Merge branch 'alpha' into staging

This commit is contained in:
Priit Tark 2015-06-19 14:45:56 +03:00
commit 1cd0767191
345 changed files with 19170 additions and 3258 deletions

View file

@ -8,6 +8,7 @@ AllCops:
- 'db/whois_schema.rb' - 'db/whois_schema.rb'
- 'db/api_log_schema.rb' - 'db/api_log_schema.rb'
- 'db/migrate/*' - 'db/migrate/*'
- 'db/data/*'
# epp support files until 'complexity issues' will be solved # epp support files until 'complexity issues' will be solved
- 'spec/support/epp.rb' - 'spec/support/epp.rb'
- 'spec/support/epp_contact_xml_builder.rb' - 'spec/support/epp_contact_xml_builder.rb'

View file

@ -1,3 +1,20 @@
16.06.2015
* Application time_zone should be defined at application.yml, updated application-exaple.yml
15.06.2015
* Apache config update: now only TLSv1.2 allowed with whitelisted chipers, please review all SSL config parameters
08.06.2015
* Add sk service name to application.yml
* Renew zonefile procedure
02.06.2015
* Added possibility to overwrite legal document types at application.yml level.
01.06.2015 01.06.2015
* Added separate data update, all data migration locate at db/data, more info 'rake -T data' * Added separate data update, all data migration locate at db/data, more info 'rake -T data'
@ -8,6 +25,11 @@
26.05.2015 26.05.2015
* Added separate data update, all data migration locate at db/data, more info 'rake -T data'
29.05.2015
* Removed old 'iptables_counter_update_command' and added 'iptables_counter_enabled'
* Updated deploy script, now staging comes from staging branch * Updated deploy script, now staging comes from staging branch
25.05.2015 25.05.2015

12
Gemfile
View file

@ -38,6 +38,7 @@ gem 'nprogress-rails', '~> 0.1.6.7' # visual loader
gem 'html5_validators', '~> 1.2.0' # model requements now automatically on html form gem 'html5_validators', '~> 1.2.0' # model requements now automatically on html form
gem 'coderay', '~> 1.1.0' # xml console visualize gem 'coderay', '~> 1.1.0' # xml console visualize
gem 'select2-rails', '~> 3.5.9.3' # for autocomplete gem 'select2-rails', '~> 3.5.9.3' # for autocomplete
gem 'bootstrap-datepicker-rails', '~> 1.3.1.1' # datepicker
# rights # rights
gem 'devise', '~> 3.4.1' # authenitcation gem 'devise', '~> 3.4.1' # authenitcation
@ -50,10 +51,11 @@ gem 'jbuilder', '~> 2.2.6' # json api
# registry specfic # registry specfic
gem 'simpleidn', '~> 0.0.5' # For punycode gem 'simpleidn', '~> 0.0.5' # For punycode
gem 'isikukood' # for EE-id validation gem 'isikukood' # for EE-id validation
gem 'money-rails', '~> 1.4.1'
# deploy # deploy
gem 'whenever', '~> 0.9.4', require: false gem 'whenever', '~> 0.9.4', require: false
gem 'data_migrate', gem 'data_migrate',
github: 'gitlabeu/data_migrate', github: 'gitlabeu/data_migrate',
ref: '35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81' ref: '35d22b09ff37a4e9d61ab326ad5d8eb0edf1fc81'
@ -70,10 +72,14 @@ gem 'deep_cloneable', '~> 2.1.1'
gem 'digidoc_client', '~> 0.2.1' gem 'digidoc_client', '~> 0.2.1'
# epp # epp
gem 'epp', '~> 1.4.2', github: 'gitlabeu/epp' gem 'epp', '~> 1.4.2', github: 'internetee/epp'
gem 'epp-xml', '~> 0.10.4' # EPP XMLs gem 'epp-xml', '~> 1.0.3' # EIS EPP XMLs
gem 'uuidtools', '~> 2.1.4' # For unique IDs (used by the epp gem) gem 'uuidtools', '~> 2.1.4' # For unique IDs (used by the epp gem)
# que
gem 'que', '~> 0.10.0'
gem 'que-web', '~> 0.4.0'
# for importing legacy db # for importing legacy db
gem 'activerecord-import', '~> 0.7.0' # for inserting dummy data gem 'activerecord-import', '~> 0.7.0' # for inserting dummy data

View file

@ -16,14 +16,6 @@ GIT
data_migrate (1.3.0) data_migrate (1.3.0)
rails (>= 4.1.0) rails (>= 4.1.0)
GIT
remote: git://github.com/gitlabeu/epp.git
revision: 505c3f2739eb1da918e54111aecfb138a822739d
specs:
epp (1.4.2)
hpricot
libxml-ruby
GIT GIT
remote: git://github.com/haml/html2haml.git remote: git://github.com/haml/html2haml.git
revision: 6984f50bdbbd6291535027726a5697f28778ee8d revision: 6984f50bdbbd6291535027726a5697f28778ee8d
@ -35,6 +27,14 @@ GIT
nokogiri (~> 1.6.0) nokogiri (~> 1.6.0)
ruby_parser (~> 3.5) ruby_parser (~> 3.5)
GIT
remote: git://github.com/internetee/epp.git
revision: 505c3f2739eb1da918e54111aecfb138a822739d
specs:
epp (1.4.2)
hpricot
libxml-ruby
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
@ -76,18 +76,18 @@ GEM
thread_safe (~> 0.3, >= 0.3.4) thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.3.8) addressable (2.3.8)
akami (1.3.0) akami (1.3.1)
gyoku (>= 0.4.0) gyoku (>= 0.4.0)
nokogiri nokogiri
arel (6.0.0) arel (6.0.0)
ast (2.0.0) ast (2.0.0)
astrolabe (1.3.0) astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0) parser (>= 2.2.0.pre.3, < 3.0)
autodoc (0.4.4) autodoc (0.5.0)
actionpack actionpack
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
rspec rspec
autoprefixer-rails (5.1.11) autoprefixer-rails (5.2.0.1)
execjs execjs
json json
axiom-types (0.1.1) axiom-types (0.1.1)
@ -101,6 +101,8 @@ GEM
rack (>= 0.9.0) rack (>= 0.9.0)
binding_of_caller (0.7.2) binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
bootstrap-datepicker-rails (1.3.1.1)
railties (>= 3.0)
bootstrap-sass (3.3.4.1) bootstrap-sass (3.3.4.1)
autoprefixer-rails (>= 5.0.0.1) autoprefixer-rails (>= 5.0.0.1)
sass (>= 3.2.19) sass (>= 3.2.19)
@ -116,9 +118,9 @@ GEM
slim (>= 1.3.6, < 3.0) slim (>= 1.3.6, < 3.0)
terminal-table (~> 1.4) terminal-table (~> 1.4)
builder (3.2.2) builder (3.2.2)
bullet (4.14.4) bullet (4.14.7)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
uniform_notifier (>= 1.6.0) uniform_notifier (~> 1.9.0)
bundler-audit (0.3.1) bundler-audit (0.3.1)
bundler (~> 1.2) bundler (~> 1.2)
thor (~> 0.18) thor (~> 0.18)
@ -142,7 +144,7 @@ GEM
coffee-script (2.4.1) coffee-script (2.4.1)
coffee-script-source coffee-script-source
execjs execjs
coffee-script-source (1.9.1) coffee-script-source (1.9.1.1)
countries (0.10.0) countries (0.10.0)
currencies (~> 0.4.2) currencies (~> 0.4.2)
crack (0.4.2) crack (0.4.2)
@ -169,18 +171,18 @@ GEM
nokogiri (>= 1.4.0) nokogiri (>= 1.4.0)
savon (>= 2.4.0) savon (>= 2.4.0)
docile (1.1.5) docile (1.1.5)
epp-xml (0.10.4) epp-xml (1.0.3)
activesupport (~> 4.1) activesupport (~> 4.1)
builder (~> 3.2) builder (~> 3.2)
equalizer (0.0.11) equalizer (0.0.11)
erubis (2.7.0) erubis (2.7.0)
execjs (2.5.0) execjs (2.5.2)
fabrication (2.12.2) fabrication (2.12.2)
faker (1.3.0) faker (1.3.0)
i18n (~> 0.5) i18n (~> 0.5)
fastercsv (1.5.5) fastercsv (1.5.5)
ffi (1.9.8) ffi (1.9.8)
figaro (1.1.0) figaro (1.1.1)
thor (~> 0.14) thor (~> 0.14)
flay (2.4.0) flay (2.4.0)
ruby_parser (~> 3.0) ruby_parser (~> 3.0)
@ -189,7 +191,7 @@ GEM
ruby_parser (~> 3.1, > 3.1.0) ruby_parser (~> 3.1, > 3.1.0)
sexp_processor (~> 4.4) sexp_processor (~> 4.4)
formatador (0.2.5) formatador (0.2.5)
globalid (0.3.3) globalid (0.3.5)
activesupport (>= 4.1.0) activesupport (>= 4.1.0)
grape (0.10.1) grape (0.10.1)
activesupport activesupport
@ -225,34 +227,33 @@ GEM
haml (>= 4.0.6, < 5.0) haml (>= 4.0.6, < 5.0)
html2haml (>= 1.0.1) html2haml (>= 1.0.1)
railties (>= 4.0.1) railties (>= 4.0.1)
hashie (3.4.1) hashie (3.4.2)
hashie-forbidden_attributes (0.1.1) hashie-forbidden_attributes (0.1.1)
hashie (>= 3.0) hashie (>= 3.0)
highline (1.6.21) highline (1.6.21)
hike (1.2.3)
hitimes (1.2.2) hitimes (1.2.2)
hpricot (0.8.6) hpricot (0.8.6)
html5_validators (1.2.0) html5_validators (1.2.0)
httpclient (2.6.0.1) httpclient (2.6.0.1)
httpi (2.4.0) httpi (2.4.1)
rack rack
i18n (0.7.0) i18n (0.7.0)
ice_nine (0.11.1) ice_nine (0.11.1)
isikukood (0.1.2) isikukood (0.1.2)
iso8601 (0.8.5) iso8601 (0.8.6)
jbuilder (2.2.12) jbuilder (2.2.16)
activesupport (>= 3.0.0, < 5) activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2) multi_json (~> 1.2)
jquery-rails (4.0.3) jquery-rails (4.0.4)
rails-dom-testing (~> 1.0) rails-dom-testing (~> 1.0)
railties (>= 4.2.0) railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.3) jquery-ui-rails (5.0.5)
railties (>= 3.2.16) railties (>= 3.2.16)
jquery-validation-rails (1.13.1) jquery-validation-rails (1.13.1)
railties (>= 3.2, < 5.0) railties (>= 3.2, < 5.0)
thor (~> 0.14) thor (~> 0.14)
json (1.8.2) json (1.8.3)
kaminari (0.16.3) kaminari (0.16.3)
actionpack (>= 3.0.0) actionpack (>= 3.0.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
@ -261,37 +262,44 @@ GEM
addressable (~> 2.3) addressable (~> 2.3)
libv8 (3.16.14.7) libv8 (3.16.14.7)
libxml-ruby (2.8.0) libxml-ruby (2.8.0)
listen (2.10.0) listen (2.10.1)
celluloid (~> 0.16.0) celluloid (~> 0.16.0)
rb-fsevent (>= 0.9.3) rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9) rb-inotify (>= 0.9)
loofah (2.0.1) loofah (2.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
lumberjack (1.0.9) lumberjack (1.0.9)
macaddr (1.7.1)
systemu (~> 2.6.2)
mail (2.6.3) mail (2.6.3)
mime-types (>= 1.16, < 3) mime-types (>= 1.16, < 3)
method_source (0.8.2) method_source (0.8.2)
mime-types (2.4.3) mime-types (2.6.1)
mina (0.3.4) mina (0.3.4)
open4 (~> 1.3.4) open4 (~> 1.3.4)
rake rake
mini_portile (0.6.2) mini_portile (0.6.2)
minitest (5.5.1) minitest (5.7.0)
multi_json (1.11.0) monetize (1.1.0)
money (~> 6.5.0)
money (6.5.1)
i18n (>= 0.6.4, <= 0.7.0)
money-rails (1.4.1)
activesupport (>= 3.0)
monetize (~> 1.1.0)
money (~> 6.5.0)
railties (>= 3.0)
multi_json (1.11.1)
multi_xml (0.5.5) multi_xml (0.5.5)
newrelic_rpm (3.9.9.275) newrelic_rpm (3.9.9.275)
nokogiri (1.6.6.2) nokogiri (1.6.6.2)
mini_portile (~> 0.6.0) mini_portile (~> 0.6.0)
nori (2.5.0) nori (2.6.0)
nprogress-rails (0.1.6.7) nprogress-rails (0.1.6.7)
open4 (1.3.4) open4 (1.3.4)
orm_adapter (0.5.0) orm_adapter (0.5.0)
parser (2.2.0.3) parser (2.3.0.pre.2)
ast (>= 1.1, < 3.0) ast (>= 1.1, < 3.0)
pdfkit (0.6.2) pdfkit (0.6.2)
pg (0.18.1) pg (0.18.2)
phantomjs (1.9.7.1) phantomjs (1.9.7.1)
phantomjs-binaries (1.9.2.4) phantomjs-binaries (1.9.2.4)
sys-uname (= 0.9.0) sys-uname (= 0.9.0)
@ -307,11 +315,18 @@ GEM
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.8.1) method_source (~> 0.8.1)
slop (~> 3.4) slop (~> 3.4)
rack (1.6.0) que (0.10.0)
que-web (0.4.0)
erubis
que (~> 0.8)
sinatra
rack (1.6.4)
rack-accept (0.4.5) rack-accept (0.4.5)
rack (>= 0.4) rack (>= 0.4)
rack-mount (0.8.3) rack-mount (0.8.3)
rack (>= 1.0.0) rack (>= 1.0.0)
rack-protection (1.5.3)
rack
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
railroady (1.3.0) railroady (1.3.0)
@ -350,7 +365,7 @@ GEM
activesupport (>= 3.0) activesupport (>= 3.0)
i18n i18n
polyamorous (~> 1.1) polyamorous (~> 1.1)
rb-fsevent (0.9.4) rb-fsevent (0.9.5)
rb-inotify (0.9.5) rb-inotify (0.9.5)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rdoc (4.2.0) rdoc (4.2.0)
@ -390,7 +405,7 @@ GEM
rainbow (>= 1.99.1, < 3.0) rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4) ruby-progressbar (~> 1.4)
ruby-progressbar (1.7.5) ruby-progressbar (1.7.5)
ruby2ruby (2.1.3) ruby2ruby (2.1.4)
ruby_parser (~> 3.1) ruby_parser (~> 3.1)
sexp_processor (~> 4.0) sexp_processor (~> 4.0)
ruby_parser (3.5.0) ruby_parser (3.5.0)
@ -403,21 +418,20 @@ GEM
ruby2ruby (>= 2.1.1, < 3.0) ruby2ruby (>= 2.1.1, < 3.0)
virtus (~> 1.0) virtus (~> 1.0)
safe_yaml (1.0.4) safe_yaml (1.0.4)
sass (3.4.13) sass (3.4.14)
sass-rails (5.0.3) sass-rails (5.0.3)
railties (>= 4.0.0, < 5.0) railties (>= 4.0.0, < 5.0)
sass (~> 3.1) sass (~> 3.1)
sprockets (>= 2.8, < 4.0) sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0) sprockets-rails (>= 2.0, < 4.0)
tilt (~> 1.1) tilt (~> 1.1)
savon (2.11.0) savon (2.11.1)
akami (~> 1.2) akami (~> 1.2)
builder (>= 2.1.2) builder (>= 2.1.2)
gyoku (~> 1.2) gyoku (~> 1.2)
httpi (~> 2.3) httpi (~> 2.3)
nokogiri (>= 1.4.0) nokogiri (>= 1.4.0)
nori (~> 2.4) nori (~> 2.4)
uuid (~> 2.3.7)
wasabi (~> 3.4) wasabi (~> 3.4)
sdoc (0.4.1) sdoc (0.4.1)
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
@ -425,7 +439,7 @@ GEM
select2-rails (3.5.9.3) select2-rails (3.5.9.3)
thor (~> 0.14) thor (~> 0.14)
selectize-rails (0.12.1) selectize-rails (0.12.1)
sexp_processor (4.5.0) sexp_processor (4.6.0)
shoulda-matchers (2.6.2) shoulda-matchers (2.6.2)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
simplecov (0.9.2) simplecov (0.9.2)
@ -434,25 +448,25 @@ GEM
simplecov-html (~> 0.9.0) simplecov-html (~> 0.9.0)
simplecov-html (0.9.0) simplecov-html (0.9.0)
simpleidn (0.0.5) simpleidn (0.0.5)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
slim (2.1.0) slim (2.1.0)
temple (~> 0.6.9) temple (~> 0.6.9)
tilt (>= 1.3.3, < 2.1) tilt (>= 1.3.3, < 2.1)
slop (3.6.0) slop (3.6.0)
spring (1.3.4) spring (1.3.6)
spring-commands-rspec (1.0.4) spring-commands-rspec (1.0.4)
spring (>= 0.9.1) spring (>= 0.9.1)
sprockets (2.12.3) sprockets (3.2.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) sprockets-rails (2.3.1)
sprockets-rails (2.2.4)
actionpack (>= 3.0) actionpack (>= 3.0)
activesupport (>= 3.0) activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0) sprockets (>= 2.8, < 4.0)
sys-uname (0.9.0) sys-uname (0.9.0)
ffi (>= 1.0.0) ffi (>= 1.0.0)
systemu (2.6.5)
temple (0.6.10) temple (0.6.10)
terminal-table (1.4.5) terminal-table (1.4.5)
therubyracer (0.12.2) therubyracer (0.12.2)
@ -472,13 +486,11 @@ GEM
uglifier (2.7.1) uglifier (2.7.1)
execjs (>= 0.3.0) execjs (>= 0.3.0)
json (>= 1.8.0) json (>= 1.8.0)
unicorn (4.8.3) unicorn (4.9.0)
kgio (~> 2.6) kgio (~> 2.6)
rack rack
raindrops (~> 0.7) raindrops (~> 0.7)
uniform_notifier (1.8.0) uniform_notifier (1.9.0)
uuid (2.3.7)
macaddr (~> 1.0)
uuidtools (2.1.5) uuidtools (2.1.5)
virtus (1.0.5) virtus (1.0.5)
axiom-types (~> 0.1) axiom-types (~> 0.1)
@ -506,6 +518,7 @@ DEPENDENCIES
autodoc autodoc
better_errors (~> 2.0.0) better_errors (~> 2.0.0)
binding_of_caller (~> 0.7.2) binding_of_caller (~> 0.7.2)
bootstrap-datepicker-rails (~> 1.3.1.1)
bootstrap-sass (~> 3.3.4.1) bootstrap-sass (~> 3.3.4.1)
brakeman (~> 2.6.2) brakeman (~> 2.6.2)
bullet (~> 4.14.4) bullet (~> 4.14.4)
@ -521,7 +534,7 @@ DEPENDENCIES
devise (~> 3.4.1) devise (~> 3.4.1)
digidoc_client (~> 0.2.1) digidoc_client (~> 0.2.1)
epp (~> 1.4.2)! epp (~> 1.4.2)!
epp-xml (~> 0.10.4) epp-xml (~> 1.0.3)
fabrication (~> 2.12.2) fabrication (~> 2.12.2)
faker (~> 1.3.0) faker (~> 1.3.0)
figaro (~> 1.1.0) figaro (~> 1.1.0)
@ -543,6 +556,7 @@ DEPENDENCIES
kaminari (~> 0.16.3) kaminari (~> 0.16.3)
launchy (~> 2.4.3) launchy (~> 2.4.3)
mina (~> 0.3.1) mina (~> 0.3.1)
money-rails (~> 1.4.1)
newrelic_rpm (~> 3.9.9.275) newrelic_rpm (~> 3.9.9.275)
nokogiri (~> 1.6.6.2) nokogiri (~> 1.6.6.2)
nprogress-rails (~> 0.1.6.7) nprogress-rails (~> 0.1.6.7)
@ -553,6 +567,8 @@ DEPENDENCIES
phantomjs-binaries (~> 1.9.2.4) phantomjs-binaries (~> 1.9.2.4)
poltergeist (~> 1.5.1) poltergeist (~> 1.5.1)
pry (~> 0.10.1) pry (~> 0.10.1)
que (~> 0.10.0)
que-web (~> 0.4.0)
railroady (~> 1.3.0) railroady (~> 1.3.0)
rails (= 4.2.1) rails (= 4.2.1)
rails-settings-cached (~> 0.4.1) rails-settings-cached (~> 0.4.1)

View file

@ -97,9 +97,10 @@ For Apache, registry admin goes to port 443 in production, /etc/apache2/sites-en
SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem
SSLCACertificateFile /etc/ssl/certs/ca.pem SSLCACertificateFile /etc/ssl/certs/ca.pem
SSLProtocol TLSv1 SSLProtocol -all +TLSv1.2
SSLHonorCipherOrder On SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH SSLCompression off
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
RewriteEnginriteEngine on RewriteEnginriteEngine on
RedirectMatch ^/$ /admin RedirectMatch ^/$ /admin
@ -157,9 +158,10 @@ Registrar configuration (/etc/apache2/sites-enabled/registrar.conf) is as follow
SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem
SSLCACertificateFile /etc/ssl/certs/ca.pem SSLCACertificateFile /etc/ssl/certs/ca.pem
SSLProtocol TLSv1 SSLProtocol -all +TLSv1.2
SSLHonorCipherOrder On SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH SSLCompression off
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
RewriteEngine on RewriteEngine on
RedirectMatch ^/$ /registrar RedirectMatch ^/$ /registrar
@ -240,9 +242,10 @@ Registrant configuration (/etc/apache2/sites-enabled/registrant.conf) is as foll
SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem SSLCertificateChainFile /etc/ssl/certs/your-chain-fail.pem
SSLCACertificateFile /etc/ssl/certs/ca.pem SSLCACertificateFile /etc/ssl/certs/ca.pem
SSLProtocol TLSv1 SSLProtocol -all +TLSv1.2
SSLHonorCipherOrder On SSLHonorCipherOrder On
SSLCipherSuite RC4-SHA:HIGH:!ADH SSLCompression off
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
RewriteEngine on RewriteEngine on
RedirectMatch ^/$ /registrant RedirectMatch ^/$ /registrant

View file

@ -2,8 +2,6 @@
#= require jquery_ujs #= require jquery_ujs
#= require turbolinks #= require turbolinks
#= require bootstrap-sprockets #= require bootstrap-sprockets
#= require nprogress
#= require nprogress-turbolinks
#= require typeahead.bundle.min #= require typeahead.bundle.min
#= require admin/autocomplete #= require admin/autocomplete
#= require jquery.nested_attributes #= require jquery.nested_attributes
@ -12,6 +10,3 @@
#= require jquery-ui/datepicker #= require jquery-ui/datepicker
#= require shared/general #= require shared/general
#= require admin/application #= require admin/application
NProgress.configure
showSpinner: false

View file

@ -1,12 +1,16 @@
ready = -> $(document).on 'page:change', ->
$('.selectize').selectize({ $('.selectize').selectize({
allowEmptyOption: true allowEmptyOption: true
}); })
$('.js-datepicker').datepicker({
showAnim: "",
autoclose: true,
dateFormat: "dd.mm.yy",
changeMonth: true,
changeYear: true
})
# client side validate all forms # client side validate all forms
$('form').each -> $('form').each ->
$(this).validate() $(this).validate()
$(document).ready(ready)
$(document).on('page:load', ready)

View file

@ -1,4 +1,4 @@
$(document).on 'ready page:load', -> $(document).on 'page:change', ->
# client side validate all forms # client side validate all forms
$('form').each -> $('form').each ->
$(this).validate() $(this).validate()

View file

@ -1,3 +1,9 @@
#= require nprogress
#= require nprogress-turbolinks
NProgress.configure
showSpinner: false
@flash_notice = (msg) -> @flash_notice = (msg) ->
$('#flash').find('div').removeClass('bg-danger') $('#flash').find('div').removeClass('bg-danger')
$('#flash').find('div').addClass('bg-success') $('#flash').find('div').addClass('bg-success')
@ -10,7 +16,7 @@
$('#flash').find('div').html(msg) $('#flash').find('div').html(msg)
$('#flash').show() $('#flash').show()
$(document).on 'ready page:load', -> $(document).on 'page:change', ->
today = new Date() today = new Date()
tomorrow = new Date(today) tomorrow = new Date(today)
tomorrow.setDate(today.getDate() + 1) tomorrow.setDate(today.getDate() + 1)
@ -20,7 +26,8 @@ $(document).on 'ready page:load', ->
maxDate: tomorrow maxDate: tomorrow
) )
$('.js-combobox').select2 if $('.js-combobox').length
width: "100%" $('.js-combobox').select2
selectOnBlur: true width: "100%"
dropdownAutoWidth: if self==top then true else false selectOnBlur: true
dropdownAutoWidth: if self==top then true else false

View file

@ -1,5 +1,6 @@
//= require 'shared/general-manifest' //= require 'shared/general-manifest'
//= require 'admin/admin-bootstrap' //= require 'admin/admin-bootstrap'
//= require 'jquery-ui/datepicker'
@import shared/fonts @import shared/fonts
@import shared/general @import shared/general
@import nprogress @import nprogress
@ -7,4 +8,5 @@
@import typeaheadjs @import typeaheadjs
@import selectize @import selectize
@import selectize.bootstrap3 @import selectize.bootstrap3
// @import bootstrap-datepicker3
@import admin/admin @import admin/admin

View file

@ -65,3 +65,6 @@
.required:after .required:after
content: "*" content: "*"
margin: 0 0 0 1px margin: 0 0 0 1px
.not-required:after
content: ''

View file

@ -57,3 +57,8 @@ body > .container
.text-grey .text-grey
color: grey color: grey
.partially-hidden
border: 1px solid #dddddd
padding-left: 4px
padding-right: 4px

View file

@ -11,6 +11,10 @@ class Admin::AdminUsersController < AdminController
@admin_user = AdminUser.new @admin_user = AdminUser.new
end end
def show; end
def edit; end
def create def create
@admin_user = AdminUser.new(admin_user_params) @admin_user = AdminUser.new(admin_user_params)
@ -23,12 +27,11 @@ class Admin::AdminUsersController < AdminController
end end
end end
def show; end
def edit; end
def update def update
if @admin_user.update(admin_user_params) params[:admin_user].delete(:password) if params[:admin_user][:password].blank?
params[:admin_user].delete(:password_confirmation) if params[:admin_user][:password_confirmation].blank?
if @admin_user.update_attributes(admin_user_params)
flash[:notice] = I18n.t('record_updated') flash[:notice] = I18n.t('record_updated')
redirect_to [:admin, @admin_user] redirect_to [:admin, @admin_user]
else else
@ -54,6 +57,7 @@ class Admin::AdminUsersController < AdminController
end end
def admin_user_params def admin_user_params
params.require(:admin_user).permit(:username, :password, :identity_code, :email, :country_code, { roles: [] }) params.require(:admin_user).permit(:username,
:password, :password_confirmation, :identity_code, :email, :country_code, { roles: [] })
end end
end end

View file

@ -29,6 +29,7 @@ class Admin::ApiUsersController < AdminController
def edit; end def edit; end
def update def update
params[:api_user].delete(:password) if params[:api_user][:password].blank?
if @api_user.update(api_user_params) if @api_user.update(api_user_params)
flash[:notice] = I18n.t('record_updated') flash[:notice] = I18n.t('record_updated')
redirect_to [:admin, @api_user] redirect_to [:admin, @api_user]

View file

@ -16,18 +16,36 @@ class Admin::DomainsController < AdminController
end end
def update def update
add_prefix_to_statuses dp = ignore_empty_statuses
if @domain.update(domain_params) if @domain.update(dp)
flash[:notice] = I18n.t('domain_updated') flash[:notice] = I18n.t('domain_updated')
redirect_to [:admin, @domain] redirect_to [:admin, @domain]
else else
@domain.domain_statuses.build if @domain.domain_statuses.empty? build_associations
flash.now[:alert] = I18n.t('failed_to_update_domain') flash.now[:alert] = I18n.t('failed_to_update_domain')
render 'edit' render 'edit'
end end
end end
def set_force_delete
if @domain.set_force_delete
flash[:notice] = I18n.t('domain_updated')
else
flash.now[:alert] = I18n.t('failed_to_update_domain')
end
redirect_to [:admin, @domain]
end
def unset_force_delete
if @domain.unset_force_delete
flash[:notice] = I18n.t('domain_updated')
else
flash.now[:alert] = I18n.t('failed_to_update_domain')
end
redirect_to [:admin, @domain]
end
private private
def set_domain def set_domain
@ -35,21 +53,23 @@ class Admin::DomainsController < AdminController
end end
def domain_params def domain_params
params.require(:domain).permit( if params[:domain]
domain_statuses_attributes: [:id, :value, :description, :_destroy] params.require(:domain).permit({ statuses: [] })
) else
{ statuses: [] }
end
end end
def build_associations def build_associations
@domain.domain_statuses.build if @domain.domain_statuses.empty? @server_statuses = @domain.statuses.select { |x| DomainStatus::SERVER_STATUSES.include?(x) }
@server_statuses = @domain.domain_statuses.select(&:server_status?) @server_statuses = [nil] if @server_statuses.empty?
@server_statuses << @domain.domain_statuses.build if @server_statuses.empty? @other_statuses = @domain.statuses.select { |x| !DomainStatus::SERVER_STATUSES.include?(x) }
end end
def add_prefix_to_statuses def ignore_empty_statuses
domain_params[:domain_statuses_attributes].each do |_k, hash| dp = domain_params
hash[:value] = hash[:value].prepend('server') if hash[:value].present? dp[:statuses].reject!(&:blank?)
end dp
end end
end end

View file

@ -0,0 +1,45 @@
class Admin::PricelistsController < AdminController
load_and_authorize_resource
before_action :set_pricelist, only: [:show, :edit, :update]
def index
@q = Pricelist.search(params[:q])
@pricelists = @q.result.page(params[:page])
end
def new
@pricelist = Pricelist.new
end
def edit
end
def create
@pricelist = Pricelist.new(pricelist_params)
if @pricelist.save
redirect_to admin_pricelists_url
else
render 'new'
end
end
def update
if @pricelist.update_attributes(pricelist_params)
redirect_to admin_pricelists_url
else
render 'edit'
end
end
private
def set_pricelist
@pricelist = Pricelist.find(params[:id])
end
def pricelist_params
params.require(:pricelist).permit(:operation_category, :category, :price_category,
:duration, :price, :valid_from, :valid_to)
end
end

View file

@ -118,6 +118,9 @@ class Epp::ContactsController < EppController
contact_org_disabled contact_org_disabled
fax_disabled fax_disabled
status_editing_disabled status_editing_disabled
if params[:parsed_frame].css('ident').present?
epp_errors << { code: '2306', msg: "#{I18n.t(:ident_update_error)} [ident]" }
end
requires 'id' requires 'id'
@prefix = nil @prefix = nil
end end

View file

@ -56,7 +56,7 @@ class Epp::DomainsController < EppController
@domain.attach_legal_document(Epp::Domain.parse_legal_document_from_frame(params[:parsed_frame])) @domain.attach_legal_document(Epp::Domain.parse_legal_document_from_frame(params[:parsed_frame]))
@domain.save(validate: false) @domain.save(validate: false)
if @domain.epp_destroy(params[:parsed_frame]) if @domain.epp_destroy(params[:parsed_frame], current_user.id)
if @domain.epp_pending_delete.present? if @domain.epp_pending_delete.present?
render_epp_response '/epp/domains/success_pending' render_epp_response '/epp/domains/success_pending'
else else
@ -77,7 +77,7 @@ class Epp::DomainsController < EppController
end end
def renew def renew
authorize! :renew, Epp::Domain authorize! :renew, @domain
handle_errors(@domain) and return unless @domain.renew( handle_errors(@domain) and return unless @domain.renew(
params[:parsed_frame].css('curExpDate').text, params[:parsed_frame].css('curExpDate').text,

View file

@ -1,9 +1,11 @@
class EppController < ApplicationController class EppController < ApplicationController
include Iptable
layout false layout false
protect_from_forgery with: :null_session protect_from_forgery with: :null_session
skip_before_action :verify_authenticity_token skip_before_action :verify_authenticity_token
before_action :generate_svtrid before_action :generate_svtrid
before_action :latin_only
before_action :validate_request before_action :validate_request
before_action :update_epp_session before_action :update_epp_session
helper_method :current_user helper_method :current_user
@ -92,6 +94,10 @@ class EppController < ApplicationController
@errors.uniq! @errors.uniq!
# Requested by client, ticket #2688
# Known issues: error request is exactly 1 second slower and server can handle less load
sleep 1 if !Rails.env.test? || !Rails.env.development?
render_epp_response '/epp/error' render_epp_response '/epp/error'
end end
@ -101,6 +107,14 @@ class EppController < ApplicationController
write_to_epp_log write_to_epp_log
end end
# VALIDATION
def latin_only
return true if params['frame'].blank?
return true if params['frame'].match(/\A[\p{Latin}\p{Z}\p{P}\p{S}\p{Cc}\p{Cf}\w_\'\+\-\.\(\)\/]*\Z/i)
render_epp_response '/epp/latin_error'
false
end
# VALIDATION # VALIDATION
def validate_request def validate_request
validation_method = "validate_#{params[:action]}" validation_method = "validate_#{params[:action]}"
@ -285,6 +299,8 @@ class EppController < ApplicationController
# rubocop: enable Metrics/CyclomaticComplexity # rubocop: enable Metrics/CyclomaticComplexity
def iptables_counter_update def iptables_counter_update
`ENV['iptables_counter_update_command']` if ENV['iptables_counter_update_command'].present? return if ENV['iptables_counter_enabled'].blank? && ENV['iptables_counter_enabled'] != 'true'
return if current_user.blank?
counter_update(current_user.registrar_code, request.remote_ip)
end end
end end

View file

@ -1,12 +1,43 @@
class Registrant::DomainDeleteConfirmsController < RegistrantController class Registrant::DomainDeleteConfirmsController < RegistrantController
skip_before_action :authenticate_user!, only: [:show, :create] skip_before_action :authenticate_user!, only: [:show, :update]
skip_authorization_check only: [:show, :create] skip_authorization_check only: [:show, :update]
def show def show
return if params[:confirmed] || params[:rejected]
@domain = Domain.find(params[:id]) @domain = Domain.find(params[:id])
@domain = nil unless @domain.registrant_delete_confirmable?(params[:token]) @domain = nil unless @domain.registrant_delete_confirmable?(params[:token])
end end
def create # # rubocop: disable Metrics/PerceivedComplexity
# # rubocop: disable Metrics/CyclomaticComplexity
def update
@domain = Domain.find(params[:id])
unless @domain.registrant_delete_confirmable?(params[:token])
flash[:alert] = t(:registrant_domain_verification_failed)
return render 'show'
end
@registrant_verification = RegistrantVerification.new(domain_id: @domain.id,
domain_name: @domain.name,
verification_token: params[:token])
if params[:rejected]
if @registrant_verification.domain_registrant_delete_reject!
flash[:notice] = t(:registrant_domain_verification_rejected)
redirect_to registrant_domain_delete_confirm_path(@domain.id, rejected: true)
else
flash[:alert] = t(:registrant_domain_verification_rejected_failed)
return render 'show'
end
elsif params[:confirmed]
if @registrant_verification.domain_registrant_delete_confirm!
flash[:notice] = t(:registrant_domain_verification_confirmed)
redirect_to registrant_domain_delete_confirm_path(@domain.id, confirmed: true)
else
flash[:alert] = t(:registrant_domain_verification_confirmed_failed)
return render 'show'
end
end
end end
# rubocop: enable Metrics/PerceivedComplexity
# rubocop: enable Metrics/CyclomaticComplexity
end end

View file

@ -20,7 +20,6 @@ class Registrant::DomainUpdateConfirmsController < RegistrantController
@registrant_verification = RegistrantVerification.new(domain_id: @domain.id, @registrant_verification = RegistrantVerification.new(domain_id: @domain.id,
domain_name: @domain.name, domain_name: @domain.name,
verification_token: params[:token]) verification_token: params[:token])
if params[:rejected] if params[:rejected]
if @registrant_verification.domain_registrant_change_reject! if @registrant_verification.domain_registrant_change_reject!
flash[:notice] = t(:registrant_domain_verification_rejected) flash[:notice] = t(:registrant_domain_verification_rejected)

View file

@ -27,9 +27,10 @@ class Registrant::SessionsController < Devise::SessionsController
@user = User.new @user = User.new
end end
def mid def mid # rubocop: disable Metrics/MethodLength
phone = params[:user][:phone] phone = params[:user][:phone]
client = Digidoc::Client.new endpoint = "#{ENV['sk_digi_doc_service_endpoint']}"
client = Digidoc::Client.new(endpoint)
if Rails.env.test? && phone == "123" if Rails.env.test? && phone == "123"
@user = ApiUser.find_by(identity_code: "14212128025") @user = ApiUser.find_by(identity_code: "14212128025")

View file

@ -6,6 +6,8 @@ class Registrar::InvoicesController < RegistrarController
def index def index
params[:q] ||= {} params[:q] ||= {}
invoices = current_user.registrar.invoices.includes(:invoice_items, :account_activity) invoices = current_user.registrar.invoices.includes(:invoice_items, :account_activity)
params[:q][:sum_cache_gteq].gsub!(',', '.')
params[:q][:sum_cache_lteq].gsub!(',', '.')
@q = invoices.search(params[:q]) @q = invoices.search(params[:q])
@q.sorts = 'id desc' if @q.sorts.empty? @q.sorts = 'id desc' if @q.sorts.empty?
@invoices = @q.result.page(params[:page]) @invoices = @q.result.page(params[:page])

View file

@ -0,0 +1,16 @@
class DomainDeleteConfirmJob < Que::Job
def run(domain_id, action)
# it's recommended to keep transaction against job table as short as possible.
ActiveRecord::Base.transaction do
domain = Epp::Domain.find(domain_id)
case action
when RegistrantVerification::CONFIRMED
domain.apply_pending_delete!
domain.clean_pendings!
when RegistrantVerification::REJECTED
domain.clean_pendings!
end
destroy # it's best to destroy the job in the same transaction
end
end
end

View file

@ -0,0 +1,16 @@
class DomainUpdateConfirmJob < Que::Job
def run(domain_id, action)
# it's recommended to keep transaction against job table as short as possible.
ActiveRecord::Base.transaction do
domain = Epp::Domain.find(domain_id)
case action
when RegistrantVerification::CONFIRMED
domain.apply_pending_update!
domain.clean_pendings!
when RegistrantVerification::REJECTED
domain.clean_pendings!
end
destroy # it's best to destroy the job in the same transaction
end
end
end

View file

@ -1,4 +1,5 @@
class ContactMailer < ApplicationMailer class ContactMailer < ApplicationMailer
# rubocop: disable Metrics/CyclomaticComplexity
def email_updated(contact) def email_updated(contact)
unless Rails.env.production? unless Rails.env.production?
return unless TEST_EMAILS.include?(contact.email) || TEST_EMAILS.include?(contact.email_was) return unless TEST_EMAILS.include?(contact.email) || TEST_EMAILS.include?(contact.email_was)
@ -8,7 +9,15 @@ class ContactMailer < ApplicationMailer
return if contact.deliver_emails != true return if contact.deliver_emails != true
@contact = contact @contact = contact
mail(to: [@contact.email, @contact.email_was],
subject: "#{I18n.t(:contact_email_update_subject)} [#{@contact.code}]") emails = []
emails << [@contact.email, @contact.email_was] if @contact.registrant_domains.present?
emails << @contact.domains.map(&:email) if @contact.domains.present?
emails = emails.uniq
emails.each do |email|
mail(to: email, subject: "#{I18n.t(:contact_email_update_subject)} [#{@contact.code}]")
end
end end
# rubocop: enable Metrics/CyclomaticComplexity
end end

View file

@ -28,7 +28,7 @@ class Ability
can(:info, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || pw.blank? ? true : d.auth_info == pw } can(:info, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || pw.blank? ? true : d.auth_info == pw }
can(:check, Epp::Domain) can(:check, Epp::Domain)
can(:create, Epp::Domain) can(:create, Epp::Domain)
can(:renew, Epp::Domain) can(:renew, Epp::Domain) { |d| d.registrar_id == @user.registrar_id }
can(:update, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.auth_info == pw } can(:update, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.auth_info == pw }
can(:transfer, Epp::Domain) { |d, pw| d.auth_info == pw } can(:transfer, Epp::Domain) { |d, pw| d.auth_info == pw }
can(:view_password, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.auth_info == pw } can(:view_password, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.auth_info == pw }
@ -107,6 +107,7 @@ class Ability
can :manage, Setting can :manage, Setting
can :manage, ZonefileSetting can :manage, ZonefileSetting
can :manage, DomainVersion can :manage, DomainVersion
can :manage, Pricelist
can :manage, User can :manage, User
can :manage, ApiUser can :manage, ApiUser
can :manage, AdminUser can :manage, AdminUser

View file

@ -1,9 +1,10 @@
class AdminUser < User class AdminUser < User
validates :username, :password, :country_code, :roles, presence: true validates :username, :country_code, :roles, presence: true
validates :identity_code, uniqueness: true, allow_blank: true validates :identity_code, uniqueness: true, allow_blank: true
validates :identity_code, presence: true, if: -> { country_code == 'EE' } validates :identity_code, presence: true, if: -> { country_code == 'EE' }
validates :email, presence: true validates :email, presence: true
validates :password, :password_confirmation, presence: true, if: :new_record?
validates :password_confirmation, presence: true, if: :encrypted_password_changed?
validate :validate_identity_code, if: -> { country_code == 'EE' } validate :validate_identity_code, if: -> { country_code == 'EE' }
ROLES = %w(user customer_service admin) # should not match to api_users roles ROLES = %w(user customer_service admin) # should not match to api_users roles

View file

@ -11,13 +11,16 @@ class ApiUser < User
} }
end end
# TODO: should have max request limit per day # TODO: should have max request limit per day?
belongs_to :registrar belongs_to :registrar
has_many :certificates has_many :certificates
validates :username, :password, :registrar, :roles, presence: true validates :username, :password, :registrar, :roles, presence: true
validates :username, uniqueness: true validates :username, uniqueness: true
# TODO: probably cache, because it's requested on every EPP
delegate :code, to: :registrar, prefix: true
attr_accessor :registrar_typeahead attr_accessor :registrar_typeahead
ROLES = %w(super epp billing) # should not match to admin roles ROLES = %w(super epp billing) # should not match to admin roles

View file

@ -75,7 +75,7 @@ class BankTransaction < ActiveRecord::Base
create_account_activity( create_account_activity(
account: registrar.cash_account, account: registrar.cash_account,
invoice: invoice, invoice: invoice,
sum: sum, sum: invoice.sum_without_vat,
currency: currency, currency: currency,
description: description description: description
) )

View file

@ -7,6 +7,7 @@ class Contact < ActiveRecord::Base
has_many :domains, through: :domain_contacts has_many :domains, through: :domain_contacts
has_many :statuses, class_name: 'ContactStatus', dependent: :destroy has_many :statuses, class_name: 'ContactStatus', dependent: :destroy
has_many :legal_documents, as: :documentable has_many :legal_documents, as: :documentable
has_many :registrant_domains, class_name: 'Domain', foreign_key: 'registrant_id' # when contant is registrant
accepts_nested_attributes_for :legal_documents accepts_nested_attributes_for :legal_documents
@ -84,6 +85,10 @@ class Contact < ActiveRecord::Base
end end
end end
def roid
"EIS-#{id}"
end
def to_s def to_s
name || '[no name]' name || '[no name]'
end end
@ -132,7 +137,7 @@ class Contact < ActiveRecord::Base
# custom code from client # custom code from client
# add prefix when needed # add prefix when needed
if code.present? if code.present?
prefix, *custom_code = code.split(':') prefix, *custom_code = code.split(':')
code = custom_code.join(':') if prefix == registrar.code code = custom_code.join(':') if prefix == registrar.code
end end
@ -143,10 +148,10 @@ class Contact < ActiveRecord::Base
end end
# rubocop:enable Metrics/CyclomaticComplexity # rubocop:enable Metrics/CyclomaticComplexity
# used only for contact trasphere # used only for contact transfer
def generate_new_code! def generate_new_code!
return nil if registrar.blank? return nil if registrar.blank?
registrar.reload # for contact transfere registrar.reload # for contact transfer
self[:code] = "#{registrar.code}:#{SecureRandom.hex(4)}".upcase self[:code] = "#{registrar.code}:#{SecureRandom.hex(4)}".upcase
end end
@ -181,7 +186,24 @@ class Contact < ActiveRecord::Base
if code if code
self.ident_country_code = code.alpha2 self.ident_country_code = code.alpha2
else else
errors.add(:ident_country_code, 'is not following ISO_3166-1 alpha 2 format') errors.add(:ident, :invalid_country_code)
end end
end end
def related_domain_descriptions
@desc = {}
registrant_domains.each do |dom|
@desc[dom.name] ||= []
@desc[dom.name] << :registrant
end
domain_contacts.each do |dc|
@desc[dc.domain.name] ||= []
@desc[dc.domain.name] << dc.name.downcase.to_sym
@desc[dc.domain.name] = @desc[dc.domain.name].compact
end
@desc
end
end end

View file

@ -229,7 +229,12 @@ module Depp
end end
def extension_xml def extension_xml
ident_xml.merge(legal_document_xml) xml = { _anonymus: [] }
ident = ident_xml[:_anonymus].try(:first) unless persisted?
legal = legal_document_xml[:_anonymus].try(:first)
xml[:_anonymus] << ident if ident.present?
xml[:_anonymus] << legal if legal.present?
xml
end end
def ident_xml def ident_xml

View file

@ -192,10 +192,10 @@ module Depp
end end
def construct_edit_hash(domain_params, old_domain_params) def construct_edit_hash(domain_params, old_domain_params)
contacts = create_contacts_hash(domain_params) - create_contacts_hash(old_domain_params) contacts = array_difference(create_contacts_hash(domain_params), create_contacts_hash(old_domain_params))
add_anon = contacts add_anon = contacts
contacts = create_contacts_hash(old_domain_params) - create_contacts_hash(domain_params) contacts = array_difference(create_contacts_hash(old_domain_params), create_contacts_hash(domain_params))
rem_anon = contacts rem_anon = contacts
if domain_params[:registrant] != old_domain_params[:registrant] if domain_params[:registrant] != old_domain_params[:registrant]
@ -284,6 +284,15 @@ module Depp
pubKey: { value: key_data_params['public_key'] } pubKey: { value: key_data_params['public_key'] }
} }
end end
def array_difference(x, y)
ret = x.dup
y.each do |element|
index = ret.index(element)
ret.delete_at(index) if index
end
ret
end
end end
end end
end end

View file

@ -1,3 +1,4 @@
# rubocop: disable Metrics/ClassLength
class Domain < ActiveRecord::Base class Domain < ActiveRecord::Base
include Versions # version/domain_version.rb include Versions # version/domain_version.rb
has_paper_trail class_name: "DomainVersion", meta: { children: :children_log } has_paper_trail class_name: "DomainVersion", meta: { children: :children_log }
@ -53,6 +54,11 @@ class Domain < ActiveRecord::Base
delegate :name, to: :registrar, prefix: true delegate :name, to: :registrar, prefix: true
delegate :street, to: :registrar, prefix: true delegate :street, to: :registrar, prefix: true
after_initialize :init_default_values
def init_default_values
self.pending_json = {} if pending_json.blank?
end
before_create :generate_auth_info before_create :generate_auth_info
before_create :set_validity_dates before_create :set_validity_dates
before_update :manage_statuses before_update :manage_statuses
@ -62,14 +68,18 @@ class Domain < ActiveRecord::Base
true true
end end
before_save :manage_automatic_statuses
before_save :touch_always_version before_save :touch_always_version
def touch_always_version def touch_always_version
self.updated_at = Time.zone.now self.updated_at = Time.zone.now
end end
after_save :manage_automatic_statuses
after_save :update_whois_record after_save :update_whois_record
after_initialize -> { self.statuses = [] if statuses.nil? }
validates :name_dirty, domain_name: true, uniqueness: true validates :name_dirty, domain_name: true, uniqueness: true
validates :puny_label, length: { maximum: 63 }
validates :period, numericality: { only_integer: true } validates :period, numericality: { only_integer: true }
validates :registrant, :registrar, presence: true validates :registrant, :registrar, presence: true
@ -117,7 +127,13 @@ class Domain < ActiveRecord::Base
validate :validate_nameserver_ips validate :validate_nameserver_ips
attr_accessor :registrant_typeahead, :update_me, :deliver_emails, validate :statuses_uniqueness
def statuses_uniqueness
return if statuses.uniq == statuses
errors.add(:statuses, :taken)
end
attr_accessor :registrant_typeahead, :update_me, :deliver_emails,
:epp_pending_update, :epp_pending_delete :epp_pending_update, :epp_pending_delete
def subordinate_nameservers def subordinate_nameservers
@ -145,6 +161,68 @@ class Domain < ActiveRecord::Base
{ admin_contacts: :registrar } { admin_contacts: :registrar }
) )
end end
def start_expire_period
STDOUT << "#{Time.zone.now.utc} - Expiring domains\n" unless Rails.env.test?
d = Domain.where('valid_to <= ?', Time.zone.now)
d.each do |x|
next unless x.expirable?
x.statuses << DomainStatus::EXPIRED
# TODO: This should be managed by automatic_statuses
x.statuses.delete(DomainStatus::OK)
x.save(validate: false)
end
STDOUT << "#{Time.zone.now.utc} - Successfully expired #{d.count} domains\n" unless Rails.env.test?
end
def start_redemption_grace_period
STDOUT << "#{Time.zone.now.utc} - Setting server_hold to domains\n" unless Rails.env.test?
d = Domain.where('outzone_at <= ?', Time.zone.now)
d.each do |x|
next unless x.server_holdable?
x.statuses << DomainStatus::SERVER_HOLD
# TODO: This should be managed by automatic_statuses
x.statuses.delete(DomainStatus::OK)
x.save
end
STDOUT << "#{Time.zone.now.utc} - Successfully set server_hold to #{d.count} domains\n" unless Rails.env.test?
end
def start_delete_period
STDOUT << "#{Time.zone.now.utc} - Setting delete_candidate to domains\n" unless Rails.env.test?
d = Domain.where('delete_at <= ?', Time.zone.now)
d.each do |x|
x.statuses << DomainStatus::DELETE_CANDIDATE if x.delete_candidateable?
# TODO: This should be managed by automatic_statuses
x.statuses.delete(DomainStatus::OK)
x.save
end
return if Rails.env.test?
STDOUT << "#{Time.zone.now.utc} - Successfully set delete_candidate to #{d.count} domains\n"
end
def destroy_delete_candidates
STDOUT << "#{Time.zone.now.utc} - Destroying domains\n" unless Rails.env.test?
c = 0
Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x|
x.destroy
c += 1
end
Domain.where('force_delete_at <= ?', Time.zone.now).each do |x|
x.destroy
c += 1
end
STDOUT << "#{Time.zone.now.utc} - Successfully destroyed #{c} domains\n" unless Rails.env.test?
end
end end
def name=(value) def name=(value)
@ -155,6 +233,14 @@ class Domain < ActiveRecord::Base
self[:name_dirty] = value self[:name_dirty] = value
end end
def roid
"EIS-#{id}"
end
def puny_label
name_puny.to_s.split('.').first
end
def registrant_typeahead def registrant_typeahead
@registrant_typeahead || registrant.try(:name) || nil @registrant_typeahead || registrant.try(:name) || nil
end end
@ -163,16 +249,52 @@ class Domain < ActiveRecord::Base
domain_transfers.find_by(status: DomainTransfer::PENDING) domain_transfers.find_by(status: DomainTransfer::PENDING)
end end
def can_be_deleted? def expirable?
(domain_statuses.pluck(:value) & %W( return false if valid_to > Time.zone.now
#{DomainStatus::SERVER_DELETE_PROHIBITED} !statuses.include?(DomainStatus::EXPIRED)
)).empty? end
def server_holdable?
return false if outzone_at > Time.zone.now
return false if statuses.include?(DomainStatus::SERVER_HOLD)
return false if statuses.include?(DomainStatus::SERVER_MANUAL_INZONE)
true
end
def delete_candidateable?
return false if delete_at > Time.zone.now
return false if statuses.include?(DomainStatus::DELETE_CANDIDATE)
return false if statuses.include?(DomainStatus::SERVER_DELETE_PROHIBITED)
true
end
def renewable?
if Setting.days_to_renew_domain_before_expire != 0
if ((valid_to - Time.zone.now.beginning_of_day).to_i / 1.day) + 1 > Setting.days_to_renew_domain_before_expire
return false
end
end
return false if statuses.include?(DomainStatus::DELETE_CANDIDATE)
true
end
def preclean_pendings
self.registrant_verification_token = nil
self.registrant_verification_asked_at = nil
end
def clean_pendings!
preclean_pendings
self.pending_json = {}
statuses.delete(DomainStatus::PENDING_UPDATE)
statuses.delete(DomainStatus::PENDING_DELETE)
save
end end
def pending_update? def pending_update?
(domain_statuses.pluck(:value) & %W( statuses.include?(DomainStatus::PENDING_UPDATE)
#{DomainStatus::PENDING_UPDATE}
)).present?
end end
def pending_update! def pending_update!
@ -180,9 +302,10 @@ class Domain < ActiveRecord::Base
self.epp_pending_update = true # for epp self.epp_pending_update = true # for epp
return true unless registrant_verification_asked? return true unless registrant_verification_asked?
pending_json_cache = all_changes pending_json_cache = pending_json
token = registrant_verification_token token = registrant_verification_token
asked_at = registrant_verification_asked_at asked_at = registrant_verification_asked_at
changes_cache = changes
DomainMailer.registrant_pending_updated(self).deliver_now DomainMailer.registrant_pending_updated(self).deliver_now
@ -191,10 +314,13 @@ class Domain < ActiveRecord::Base
self.pending_json = pending_json_cache self.pending_json = pending_json_cache
self.registrant_verification_token = token self.registrant_verification_token = token
self.registrant_verification_asked_at = asked_at self.registrant_verification_asked_at = asked_at
domain_statuses.create(value: DomainStatus::PENDING_UPDATE) self.statuses = [DomainStatus::PENDING_UPDATE]
pending_json[:domain] = changes_cache
end end
# rubocop: disable Metrics/CyclomaticComplexity
def registrant_update_confirmable?(token) def registrant_update_confirmable?(token)
return true if Rails.env.development?
return false unless pending_update? return false unless pending_update?
return false if registrant_verification_token.blank? return false if registrant_verification_token.blank?
return false if registrant_verification_asked_at.blank? return false if registrant_verification_asked_at.blank?
@ -204,6 +330,7 @@ class Domain < ActiveRecord::Base
end end
def registrant_delete_confirmable?(token) def registrant_delete_confirmable?(token)
return true if Rails.env.development?
return false unless pending_delete? return false unless pending_delete?
return false if registrant_verification_token.blank? return false if registrant_verification_token.blank?
return false if registrant_verification_asked_at.blank? return false if registrant_verification_asked_at.blank?
@ -211,20 +338,25 @@ class Domain < ActiveRecord::Base
return false if registrant_verification_token != token return false if registrant_verification_token != token
true true
end end
# rubocop: enable Metrics/CyclomaticComplexity
def force_deletable?
!statuses.include?(DomainStatus::FORCE_DELETE)
end
def registrant_verification_asked? def registrant_verification_asked?
registrant_verification_asked_at.present? && registrant_verification_token.present? registrant_verification_asked_at.present? && registrant_verification_token.present?
end end
def registrant_verification_asked! def registrant_verification_asked!(frame_str, current_user_id)
pending_json['frame'] = frame_str
pending_json['current_user_id'] = current_user_id
self.registrant_verification_asked_at = Time.zone.now self.registrant_verification_asked_at = Time.zone.now
self.registrant_verification_token = SecureRandom.hex(42) self.registrant_verification_token = SecureRandom.hex(42)
end end
def pending_delete? def pending_delete?
(domain_statuses.pluck(:value) & %W( statuses.include?(DomainStatus::PENDING_DELETE)
#{DomainStatus::PENDING_DELETE}
)).present?
end end
def pending_delete! def pending_delete!
@ -232,7 +364,9 @@ class Domain < ActiveRecord::Base
self.epp_pending_delete = true # for epp self.epp_pending_delete = true # for epp
return true unless registrant_verification_asked? return true unless registrant_verification_asked?
domain_statuses.create(value: DomainStatus::PENDING_DELETE) self.statuses = [DomainStatus::PENDING_DELETE]
save(validate: false) # should check if this did succeed
DomainMailer.pending_deleted(self).deliver_now DomainMailer.pending_deleted(self).deliver_now
end end
@ -250,7 +384,7 @@ class Domain < ActiveRecord::Base
def validate_period def validate_period
return unless period.present? return unless period.present?
if period_unit == 'd' if period_unit == 'd'
valid_values = %w(365 366 710 712 1065 1068) valid_values = %w(365 730 1095)
elsif period_unit == 'm' elsif period_unit == 'm'
valid_values = %w(12 24 36) valid_values = %w(12 24 36)
else else
@ -289,12 +423,10 @@ class Domain < ActiveRecord::Base
name name
end end
def pending_registrant_name def pending_registrant
return '' if pending_json.blank? return '' if pending_json.blank?
return '' if pending_json['domain'].blank?
return '' if pending_json['domain']['registrant_id'].blank? return '' if pending_json['domain']['registrant_id'].blank?
registrant = Registrant.find_by(id: pending_json['domain']['registrant_id'].last) Registrant.find_by(id: pending_json['domain']['registrant_id'].last)
registrant.try(:name)
end end
# rubocop:disable Lint/Loop # rubocop:disable Lint/Loop
@ -307,19 +439,45 @@ class Domain < ActiveRecord::Base
def set_validity_dates def set_validity_dates
self.registered_at = Time.zone.now self.registered_at = Time.zone.now
self.valid_from = Time.zone.now.to_date self.valid_from = Time.zone.now
self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit) self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit)
self.outzone_at = valid_to + Setting.expire_warning_period.days
self.delete_at = outzone_at + Setting.redemption_grace_period.days
end
def set_force_delete
statuses << DomainStatus::FORCE_DELETE
statuses << DomainStatus::SERVER_RENEW_PROHIBITED
statuses << DomainStatus::SERVER_TRANSFER_PROHIBITED
statuses << DomainStatus::SERVER_UPDATE_PROHIBITED
statuses << DomainStatus::SERVER_MANUAL_INZONE
statuses << DomainStatus::PENDING_DELETE
statuses.delete(DomainStatus::CLIENT_DELETE_PROHIBITED)
statuses.delete(DomainStatus::SERVER_DELETE_PROHIBITED)
self.force_delete_at = Time.zone.now + Setting.redemption_grace_period.days unless force_delete_at
save(validate: false)
end
def unset_force_delete
statuses.delete(DomainStatus::FORCE_DELETE)
statuses.delete(DomainStatus::SERVER_RENEW_PROHIBITED)
statuses.delete(DomainStatus::SERVER_TRANSFER_PROHIBITED)
statuses.delete(DomainStatus::SERVER_UPDATE_PROHIBITED)
statuses.delete(DomainStatus::SERVER_MANUAL_INZONE)
statuses.delete(DomainStatus::PENDING_DELETE)
self.force_delete_at = nil
save(validate: false)
end end
def manage_automatic_statuses def manage_automatic_statuses
if domain_statuses.empty? && valid? # domain_statuses.create(value: DomainStatus::DELETE_CANDIDATE) if delete_candidateable?
domain_statuses.create(value: DomainStatus::OK) if statuses.empty? && valid?
elsif domain_statuses.length > 1 || !valid? statuses << DomainStatus::OK
domain_statuses.find_by(value: DomainStatus::OK).try(:destroy) elsif statuses.length > 1 || !valid?
statuses.delete(DomainStatus::OK)
end end
# otherwise domain_statuses are in old state for domain object
domain_statuses.reload
end end
def children_log def children_log
@ -332,18 +490,8 @@ class Domain < ActiveRecord::Base
log log
end end
def all_changes
all_changes = HashWithIndifferentAccess.new
all_changes[:domain] = changes
all_changes[:admin_contacts] = admin_contacts.map(&:changes)
all_changes[:tech_contacts] = tech_contacts.map(&:changes)
all_changes[:nameservers] = nameservers.map(&:changes)
all_changes[:registrant] = registrant.try(:changes)
all_changes[:domain_statuses] = domain_statuses.map(&:changes)
all_changes
end
def update_whois_record def update_whois_record
whois_record.blank? ? create_whois_record : whois_record.save whois_record.blank? ? create_whois_record : whois_record.save
end end
end end
# rubocop: enable Metrics/ClassLength

View file

@ -73,23 +73,23 @@ class DomainStatus < ActiveRecord::Base
EXPIRED = 'expired' EXPIRED = 'expired'
STATUSES = [ STATUSES = [
CLIENT_DELETE_PROHIBITED, SERVER_DELETE_PROHIBITED, CLIENT_HOLD, SERVER_HOLD, CLIENT_DELETE_PROHIBITED, SERVER_DELETE_PROHIBITED, CLIENT_HOLD, SERVER_HOLD,
CLIENT_RENEW_PROHIBITED, SERVER_RENEW_PROHIBITED, CLIENT_TRANSFER_PROHIBITED, CLIENT_RENEW_PROHIBITED, SERVER_RENEW_PROHIBITED, CLIENT_TRANSFER_PROHIBITED,
SERVER_TRANSFER_PROHIBITED, CLIENT_UPDATE_PROHIBITED, SERVER_UPDATE_PROHIBITED, SERVER_TRANSFER_PROHIBITED, CLIENT_UPDATE_PROHIBITED, SERVER_UPDATE_PROHIBITED,
INACTIVE, OK, PENDING_CREATE, PENDING_DELETE, PENDING_RENEW, PENDING_TRANSFER, INACTIVE, OK, PENDING_CREATE, PENDING_DELETE, PENDING_RENEW, PENDING_TRANSFER,
PENDING_UPDATE, SERVER_MANUAL_INZONE, SERVER_REGISTRANT_CHANGE_PROHIBITED, PENDING_UPDATE, SERVER_MANUAL_INZONE, SERVER_REGISTRANT_CHANGE_PROHIBITED,
SERVER_ADMIN_CHANGE_PROHIBITED, SERVER_TECH_CHANGE_PROHIBITED, FORCE_DELETE, SERVER_ADMIN_CHANGE_PROHIBITED, SERVER_TECH_CHANGE_PROHIBITED, FORCE_DELETE,
DELETE_CANDIDATE, EXPIRED DELETE_CANDIDATE, EXPIRED
] ]
CLIENT_STATUSES = [ CLIENT_STATUSES = [
CLIENT_DELETE_PROHIBITED, CLIENT_HOLD, CLIENT_RENEW_PROHIBITED, CLIENT_TRANSFER_PROHIBITED, CLIENT_DELETE_PROHIBITED, CLIENT_HOLD, CLIENT_RENEW_PROHIBITED, CLIENT_TRANSFER_PROHIBITED,
CLIENT_UPDATE_PROHIBITED CLIENT_UPDATE_PROHIBITED
] ]
SERVER_STATUSES = [ SERVER_STATUSES = [
SERVER_DELETE_PROHIBITED, SERVER_HOLD, SERVER_RENEW_PROHIBITED, SERVER_TRANSFER_PROHIBITED, SERVER_DELETE_PROHIBITED, SERVER_HOLD, SERVER_RENEW_PROHIBITED, SERVER_TRANSFER_PROHIBITED,
SERVER_UPDATE_PROHIBITED, SERVER_MANUAL_INZONE, SERVER_REGISTRANT_CHANGE_PROHIBITED, SERVER_UPDATE_PROHIBITED, SERVER_MANUAL_INZONE, SERVER_REGISTRANT_CHANGE_PROHIBITED,
SERVER_ADMIN_CHANGE_PROHIBITED, SERVER_TECH_CHANGE_PROHIBITED SERVER_ADMIN_CHANGE_PROHIBITED, SERVER_TECH_CHANGE_PROHIBITED
] ]
@ -113,7 +113,7 @@ class DomainStatus < ActiveRecord::Base
case value case value
when 'ok' when 'ok'
'ok (paid and in zone)' 'ok (paid and in zone)'
else else
value value
end end
end end
@ -124,7 +124,7 @@ class DomainStatus < ActiveRecord::Base
end end
def statuses_for_admin def statuses_for_admin
SERVER_STATUSES.map { |x| x.sub('server', '') } SERVER_STATUSES.map { |x| [x.sub('server', ''), x] }
end end
end end
end end

View file

@ -51,9 +51,9 @@ class DomainTransfer < ActiveRecord::Base
end end
end end
def notify_losing_registrar def notify_losing_registrar(contacts, registrant)
transfer_from.messages.create!( transfer_from.messages.create!(
body: I18n.t('domain_transfer_was_approved', contacts: domain.contacts.pluck(:code).sort), body: I18n.t('domain_transfer_was_approved', contacts: contacts, registrant: registrant),
attached_obj_id: id, attached_obj_id: id,
attached_obj_type: self.class.to_s attached_obj_type: self.class.to_s
) )

View file

@ -123,7 +123,8 @@ class Epp::Contact < Contact
[:email, :invalid], [:email, :invalid],
[:ident, :invalid], [:ident, :invalid],
[:ident, :invalid_EE_identity_format], [:ident, :invalid_EE_identity_format],
[:ident, :invalid_birthday_format] [:ident, :invalid_birthday_format],
[:ident, :invalid_country_code]
], ],
'2302' => [ # Object exists '2302' => [ # Object exists
[:code, :epp_id_taken] [:code, :epp_id_taken]
@ -142,7 +143,6 @@ class Epp::Contact < Contact
at.deep_merge!(self.class.attrs_from(frame.css('rem'), 'rem')) at.deep_merge!(self.class.attrs_from(frame.css('rem'), 'rem'))
at.deep_merge!(self.class.attrs_from(frame.css('add'))) at.deep_merge!(self.class.attrs_from(frame.css('add')))
at.deep_merge!(self.class.attrs_from(frame.css('chg'))) at.deep_merge!(self.class.attrs_from(frame.css('chg')))
at.merge!(self.class.ident_attrs(frame.css('ident').first))
legal_frame = frame.css('legalDocument').first legal_frame = frame.css('legalDocument').first
at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame) at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
self.deliver_emails = true # turn on email delivery for epp self.deliver_emails = true # turn on email delivery for epp

View file

@ -34,7 +34,6 @@ class Epp::Domain < Domain
max: Setting.ns_max_count max: Setting.ns_max_count
} }
], ],
[:period, :out_of_range, { value: { obj: 'period', val: period } }],
[:dnskeys, :out_of_range, [:dnskeys, :out_of_range,
{ {
min: Setting.dnskeys_min_count, min: Setting.dnskeys_min_count,
@ -55,7 +54,8 @@ class Epp::Domain < Domain
] ]
], ],
'2005' => [ # Parameter value syntax error '2005' => [ # Parameter value syntax error
[:name_dirty, :invalid, { obj: 'name', val: name_dirty }] [:name_dirty, :invalid, { obj: 'name', val: name_dirty }],
[:puny_label, :too_long, { obj: 'name', val: name_puny }]
], ],
'2201' => [ # Authorisation error '2201' => [ # Authorisation error
[:auth_info, :wrong_pw] [:auth_info, :wrong_pw]
@ -68,6 +68,7 @@ class Epp::Domain < Domain
[:base, :domain_status_prohibits_operation] [:base, :domain_status_prohibits_operation]
], ],
'2306' => [ # Parameter policy error '2306' => [ # Parameter policy error
[:period, :out_of_range, { value: { obj: 'period', val: period } }],
[:base, :ds_data_with_key_not_allowed], [:base, :ds_data_with_key_not_allowed],
[:base, :ds_data_not_allowed], [:base, :ds_data_not_allowed],
[:base, :key_data_not_allowed], [:base, :key_data_not_allowed],
@ -109,10 +110,12 @@ class Epp::Domain < Domain
at[:period_unit] = Epp::Domain.parse_period_unit_from_frame(frame) || 'y' at[:period_unit] = Epp::Domain.parse_period_unit_from_frame(frame) || 'y'
# at[:statuses] = domain_statuses_attrs(frame, action)
# binding.pry
at[:nameservers_attributes] = nameservers_attrs(frame, action) at[:nameservers_attributes] = nameservers_attrs(frame, action)
at[:admin_domain_contacts_attributes] = admin_domain_contacts_attrs(frame, action) at[:admin_domain_contacts_attributes] = admin_domain_contacts_attrs(frame, action)
at[:tech_domain_contacts_attributes] = tech_domain_contacts_attrs(frame, action) at[:tech_domain_contacts_attributes] = tech_domain_contacts_attrs(frame, action)
at[:domain_statuses_attributes] = domain_statuses_attrs(frame, action) # at[:domain_statuses_attributes] = domain_statuses_attrs(frame, action)
if new_record? if new_record?
dnskey_frame = frame.css('extension create') dnskey_frame = frame.css('extension create')
@ -234,24 +237,6 @@ class Epp::Domain < Domain
attrs attrs
end end
def domain_status_list_from(frame)
status_list = []
frame.css('status').each do |x|
unless DomainStatus::CLIENT_STATUSES.include?(x['s'])
add_epp_error('2303', 'status', x['s'], [:domain_statuses, :not_found])
next
end
status_list << {
value: x['s'],
description: x.text
}
end
status_list
end
# rubocop: disable Metrics/PerceivedComplexity # rubocop: disable Metrics/PerceivedComplexity
# rubocop: disable Metrics/CyclomaticComplexity # rubocop: disable Metrics/CyclomaticComplexity
def dnskeys_attrs(frame, action) def dnskeys_attrs(frame, action)
@ -335,14 +320,10 @@ class Epp::Domain < Domain
if action == 'rem' if action == 'rem'
to_destroy = [] to_destroy = []
status_list.each do |x| status_list.each do |x|
status = domain_statuses.find_by(value: x[:value]) if statuses.include?(x)
if status.blank? to_destroy << x
add_epp_error('2303', 'status', x[:value], [:domain_statuses, :not_found])
else else
to_destroy << { add_epp_error('2303', 'status', x, [:domain_statuses, :not_found])
id: status.id,
_destroy: 1
}
end end
end end
@ -361,10 +342,7 @@ class Epp::Domain < Domain
next next
end end
status_list << { status_list << x['s']
value: x['s'],
description: x.text
}
end end
status_list status_list
@ -380,7 +358,7 @@ class Epp::Domain < Domain
}] }]
end end
def update(frame, current_user) def update(frame, current_user, verify = true)
return super if frame.blank? return super if frame.blank?
at = {}.with_indifferent_access at = {}.with_indifferent_access
at.deep_merge!(attrs_from(frame.css('chg'), current_user)) at.deep_merge!(attrs_from(frame.css('chg'), current_user))
@ -391,16 +369,36 @@ class Epp::Domain < Domain
at[:admin_domain_contacts_attributes] += at_add[:admin_domain_contacts_attributes] at[:admin_domain_contacts_attributes] += at_add[:admin_domain_contacts_attributes]
at[:tech_domain_contacts_attributes] += at_add[:tech_domain_contacts_attributes] at[:tech_domain_contacts_attributes] += at_add[:tech_domain_contacts_attributes]
at[:dnskeys_attributes] += at_add[:dnskeys_attributes] at[:dnskeys_attributes] += at_add[:dnskeys_attributes]
at[:domain_statuses_attributes] += at_add[:domain_statuses_attributes] at[:statuses] =
statuses - domain_statuses_attrs(frame.css('rem'), 'rem') + domain_statuses_attrs(frame.css('add'), 'add')
if frame.css('registrant').present? && frame.css('registrant').attr('verified').to_s.downcase != 'yes' # at[:statuses] += at_add[:domain_statuses_attributes]
registrant_verification_asked!
if verify && frame.css('registrant').present? && frame.css('registrant').attr('verified').to_s.downcase != 'yes'
registrant_verification_asked!(frame.to_s, current_user.id)
end end
self.deliver_emails = true # turn on email delivery for epp self.deliver_emails = true # turn on email delivery for epp
errors.empty? && super(at) errors.empty? && super(at)
end end
def apply_pending_update!
preclean_pendings
user = ApiUser.find(pending_json['current_user_id'])
frame = Nokogiri::XML(pending_json['frame'])
statuses.delete(DomainStatus::PENDING_UPDATE)
clean_pendings! if update(frame, user, false)
end
def apply_pending_delete!
preclean_pendings
user = ApiUser.find(pending_json['current_user_id'])
frame = Nokogiri::XML(pending_json['frame'])
statuses.delete(DomainStatus::PENDING_DELETE)
clean_pendings! if epp_destroy(frame, user, false)
end
def attach_legal_document(legal_document_data) def attach_legal_document(legal_document_data)
return unless legal_document_data return unless legal_document_data
@ -410,11 +408,12 @@ class Epp::Domain < Domain
) )
end end
def epp_destroy(frame) def epp_destroy(frame, user_id, verify=true)
return false unless valid? return false unless valid?
if frame.css('delete').attr('verified').to_s.downcase != 'yes' if verify && frame.css('delete').attr('verified').to_s.downcase != 'yes'
registrant_verification_asked! registrant_verification_asked!(frame.to_s, user_id)
self.deliver_emails = true # turn on email delivery for epp
pending_delete! pending_delete!
manage_automatic_statuses manage_automatic_statuses
true # aka 1001 pending_delete true # aka 1001 pending_delete
@ -426,14 +425,21 @@ class Epp::Domain < Domain
### RENEW ### ### RENEW ###
def renew(cur_exp_date, period, unit = 'y') def renew(cur_exp_date, period, unit = 'y')
# TODO: Check how much time before domain exp date can it be renewed
validate_exp_dates(cur_exp_date) validate_exp_dates(cur_exp_date)
add_epp_error('2105', nil, nil, I18n.t('object_is_not_eligible_for_renewal')) unless renewable?
return false if errors.any? return false if errors.any?
p = self.class.convert_period_to_time(period, unit) p = self.class.convert_period_to_time(period, unit)
self.valid_to = valid_to + p self.valid_to = valid_to + p
self.outzone_at = outzone_at + p
self.delete_at = delete_at + p
self.period = period self.period = period
self.period_unit = unit self.period_unit = unit
statuses.delete(DomainStatus::SERVER_HOLD)
statuses.delete(DomainStatus::EXPIRED)
save save
end end
@ -466,7 +472,8 @@ class Epp::Domain < Domain
oc = c.deep_clone include: [:statuses] oc = c.deep_clone include: [:statuses]
oc.code = nil oc.code = nil
oc.registrar_id = registrar_id oc.registrar_id = registrar_id
oc.save! oc.prefix_code
oc.save!(validate: false)
oc oc
end end
@ -474,7 +481,7 @@ class Epp::Domain < Domain
oc = Contact.find(contact_id) # n+1 workaround oc = Contact.find(contact_id) # n+1 workaround
oc.registrar_id = registrar_id oc.registrar_id = registrar_id
oc.generate_new_code! oc.generate_new_code!
oc.save! oc.save!(validate: false)
oc oc
end end
@ -520,6 +527,9 @@ class Epp::Domain < Domain
def query_transfer(frame, current_user) def query_transfer(frame, current_user)
return false unless can_be_transferred_to?(current_user.registrar) return false unless can_be_transferred_to?(current_user.registrar)
old_contact_codes = contacts.pluck(:code).sort.uniq
old_registrant_code = registrant.code
transaction do transaction do
begin begin
dt = domain_transfers.create!( dt = domain_transfers.create!(
@ -538,7 +548,7 @@ class Epp::Domain < Domain
if dt.approved? if dt.approved?
transfer_contacts(current_user.registrar_id) transfer_contacts(current_user.registrar_id)
dt.notify_losing_registrar dt.notify_losing_registrar(old_contact_codes, old_registrant_code)
generate_auth_info generate_auth_info
self.registrar = current_user.registrar self.registrar = current_user.registrar
end end
@ -547,8 +557,10 @@ class Epp::Domain < Domain
save!(validate: false) save!(validate: false)
return dt return dt
rescue => _e rescue => e
add_epp_error('2306', nil, nil, I18n.t('action_failed_due_to_server_error')) add_epp_error('2306', nil, nil, I18n.t('action_failed_due_to_server_error'))
logger.error('DOMAIN TRANSFER FAILED')
logger.error(e)
raise ActiveRecord::Rollback raise ActiveRecord::Rollback
end end
end end
@ -671,9 +683,7 @@ class Epp::Domain < Domain
begin begin
errors.add(:base, :domain_status_prohibits_operation) errors.add(:base, :domain_status_prohibits_operation)
return false return false
end if (domain_statuses.pluck(:value) & %W( end if statuses.include?(DomainStatus::CLIENT_DELETE_PROHIBITED)
#{DomainStatus::CLIENT_DELETE_PROHIBITED}
)).any?
true true
end end

View file

@ -0,0 +1,5 @@
module Legacy
class Invoice < Db
self.table_name = :invoice
end
end

View file

@ -1,5 +1,11 @@
module Legacy module Legacy
class Registrar < Db class Registrar < Db
self.table_name = :registrar self.table_name = :registrar
has_many :invoices, foreign_key: :registrarid
def account_balance
invoices.sum(:credit)
end
end end
end end

View file

@ -2,7 +2,11 @@ class LegalDocument < ActiveRecord::Base
include Versions # version/legal_document_version.rb include Versions # version/legal_document_version.rb
belongs_to :documentable, polymorphic: true belongs_to :documentable, polymorphic: true
TYPES = %w(pdf bdoc ddoc zip rar gz tar 7z) if ENV['legal_document_types'].present?
TYPES = ENV['legal_document_types'].split(',').map(&:strip)
else
TYPES = %w(pdf bdoc ddoc zip rar gz tar 7z odt doc docx)
end
attr_accessor :body attr_accessor :body

22
app/models/pricelist.rb Normal file
View file

@ -0,0 +1,22 @@
class Pricelist < ActiveRecord::Base
include Versions # version/pricelist_version.rb
monetize :price_cents
validates :price_cents, :price_currency, :price,
:valid_from, :category, :operation_category, :duration, presence: true
CATEGORIES = %w(ee pri.ee fie.ee med.ee com.ee)
OPERATION_CATEGORIES = %w(create renew)
DURATIONS = %w(1year 2years 3years)
after_initialize :init_values
def init_values
return unless new_record?
self.valid_from = Time.zone.now.beginning_of_year
end
def name
"#{operation_category} #{category}"
end
end

View file

@ -17,12 +17,24 @@ class RegistrantVerification < ActiveRecord::Base
def domain_registrant_change_confirm! def domain_registrant_change_confirm!
self.action_type = DOMAIN_REGISTRANT_CHANGE self.action_type = DOMAIN_REGISTRANT_CHANGE
self.action = CONFIRMED self.action = CONFIRMED
save DomainUpdateConfirmJob.enqueue domain.id, CONFIRMED if save
end end
def domain_registrant_change_reject! def domain_registrant_change_reject!
self.action_type = DOMAIN_REGISTRANT_CHANGE self.action_type = DOMAIN_REGISTRANT_CHANGE
self.action = REJECTED self.action = REJECTED
save DomainUpdateConfirmJob.enqueue domain.id, REJECTED if save
end
def domain_registrant_delete_confirm!
self.action_type = DOMAIN_DELETE
self.action = CONFIRMED
DomainDeleteConfirmJob.enqueue domain.id, CONFIRMED if save
end
def domain_registrant_delete_reject!
self.action_type = DOMAIN_DELETE
self.action = REJECTED
DomainDeleteConfirmJob.enqueue domain.id, REJECTED if save
end end
end end

View file

@ -0,0 +1,4 @@
class PricelistVersion < PaperTrail::Version
self.table_name = :log_pricelists
self.sequence_name = :log_pricelists_id_seq
end

View file

@ -20,11 +20,11 @@ class WhoisRecord < ActiveRecord::Base
includes( includes(
domain: [ domain: [
:registrant, :registrant,
:registrar, :registrar,
:nameservers, :nameservers,
{ tech_contacts: :registrar }, { tech_contacts: :registrar },
{ admin_contacts: :registrar } { admin_contacts: :registrar }
] ]
) )
end end
end end
@ -34,19 +34,23 @@ class WhoisRecord < ActiveRecord::Base
h = HashWithIndifferentAccess.new h = HashWithIndifferentAccess.new
return h if domain.blank? return h if domain.blank?
status_map = {
'ok' => 'ok (paid and in zone)'
}
@disclosed = [] @disclosed = []
h[:name] = domain.name h[:name] = domain.name
h[:registrant] = domain.registrant.name h[:registrant] = domain.registrant.name
h[:status] = domain.domain_statuses.map(&:human_value).join(', ') h[:status] = domain.statuses.map { |x| status_map[x] || x }.join(', ')
h[:registered] = domain.registered_at.try(:to_s, :iso8601) h[:registered] = domain.registered_at.try(:to_s, :iso8601)
h[:updated_at] = domain.updated_at.try(:to_s, :iso8601) h[:updated_at] = domain.updated_at.try(:to_s, :iso8601)
h[:valid_to] = domain.valid_to.try(:to_s, :iso8601) h[:valid_to] = domain.valid_to.try(:to_s, :iso8601)
# update registar triggers when adding new attributes # update registar triggers when adding new attributes
h[:registrar] = domain.registrar.name h[:registrar] = domain.registrar.name
h[:registrar_phone] = domain.registrar.phone h[:registrar_phone] = domain.registrar.phone
h[:registrar_address] = domain.registrar.address h[:registrar_address] = domain.registrar.address
h[:registrar_update_at] = domain.registrar.updated_at.try(:to_s, :iso8601) h[:registrar_update_at] = domain.registrar.updated_at.try(:to_s, :iso8601)
h[:admin_contacts] = [] h[:admin_contacts] = []
domain.admin_contacts.each do |ac| domain.admin_contacts.each do |ac|

View file

@ -1,11 +1,4 @@
class DomainNameValidator < ActiveModel::EachValidator class DomainNameValidator < ActiveModel::EachValidator
# TODO
# validates lenght of 2-63
# validates/honours Estonian additional letters zäõüö
# honours punicode and all interfces honors utf8
# validates lower level domains (.pri.ee, edu.ee etc)
# lower level domains are fixed for .ee and can add statically into settings
def validate_each(record, attribute, value) def validate_each(record, attribute, value)
if !self.class.validate_format(value) if !self.class.validate_format(value)
record.errors[attribute] << (options[:message] || record.errors.generate_message(attribute, :invalid)) record.errors[attribute] << (options[:message] || record.errors.generate_message(attribute, :invalid))
@ -31,9 +24,8 @@ class DomainNameValidator < ActiveModel::EachValidator
# rubocop: disable Metrics/LineLength # rubocop: disable Metrics/LineLength
unicode_chars = /\u00E4\u00F5\u00F6\u00FC\u0161\u017E/ # äõöüšž unicode_chars = /\u00E4\u00F5\u00F6\u00FC\u0161\u017E/ # äõöüšž
regexp = /\A[a-zA-Z0-9#{unicode_chars}][a-zA-Z0-9#{unicode_chars}-]{0,61}[a-zA-Z0-9#{unicode_chars}]#{general_domains}\z/ regexp = /\A[a-zA-Z0-9#{unicode_chars.source}][a-zA-Z0-9#{unicode_chars.source}-]{0,61}[a-zA-Z0-9#{unicode_chars.source}]#{general_domains.source}\z/
# rubocop: enable Metrics/LineLength # rubocop: enable Metrics/LineLength
# rubocop: disable Style/DoubleNegation # rubocop: disable Style/DoubleNegation
!!(value =~ regexp) !!(value =~ regexp)
# rubocop: enable Style/DoubleNegation # rubocop: enable Style/DoubleNegation

View file

@ -11,14 +11,15 @@
- if @admin_user.new_record? || can?(:update, AdminUser) - if @admin_user.new_record? || can?(:update, AdminUser)
.form-group .form-group
.col-md-4.control-label .col-md-4.control-label
= f.label :password - not_required = @admin_user.new_record? ? '' : 'not-required'
= f.label :password, class: not_required
.col-md-8 .col-md-8
= f.text_field(:password, class: 'form-control') = f.password_field(:password, class: 'form-control')
.form-group .form-group
.col-md-4.control-label .col-md-4.control-label
= f.label :password_confirmation = f.label :password_confirmation, class: not_required
.col-md-8 .col-md-8
= f.text_field(:password_confirmation, class: 'form-control') = f.password_field(:password_confirmation, class: 'form-control')
%hr %hr
.form-group .form-group
@ -48,3 +49,8 @@
.row .row
.col-md-8.text-right .col-md-8.text-right
= button_tag(t(:save), class: 'btn btn-primary') = button_tag(t(:save), class: 'btn btn-primary')
:coffee
$("#admin_user_password").removeAttr('required')
$("#admin_user_password_confirmation").removeAttr('required')

View file

@ -1,4 +1,5 @@
= form_for([:admin, @api_user], multipart: true, html: {class: 'form-horizontal'}) do |f| = form_for([:admin, @api_user], multipart: true,
html: {class: 'form-horizontal', autocomplete: 'off'}) do |f|
= render 'shared/full_errors', object: @api_user = render 'shared/full_errors', object: @api_user
.row .row
@ -10,9 +11,11 @@
= f.text_field(:username, class: 'form-control') = f.text_field(:username, class: 'form-control')
.form-group .form-group
.col-md-4.control-label .col-md-4.control-label
= f.label :password - not_required = @api_user.new_record? ? '' : 'not-required'
= f.label :password, class: not_required
.col-md-7 .col-md-7
= f.text_field(:password, class: 'form-control') = f.text_field :password, class: 'form-control', autocomplete: 'off'
.form-group .form-group
.col-md-4.control-label .col-md-4.control-label
= f.label :identity_code = f.label :identity_code
@ -48,4 +51,5 @@
= button_tag(t(:save), class: 'btn btn-primary') = button_tag(t(:save), class: 'btn btn-primary')
:coffee :coffee
Autocomplete.bindAdminRegistrarSearch(); Autocomplete.bindAdminRegistrarSearch()
$("#api_user_password").removeAttr('required')

View file

@ -12,6 +12,8 @@
= f.label :th6_file = f.label :th6_file
.col-md-8 .col-md-8
= f.file_field :th6_file = f.file_field :th6_file
.col-md-4
%p= t(:bank_statement_desc).html_safe
%hr %hr
.row .row
.col-md-8.text-right .col-md-8.text-right

View file

@ -7,7 +7,8 @@
%dd= @contact.code %dd= @contact.code
%dt= t(:password) %dt= t(:password)
%dd= @contact.auth_info %dd
= text_field_tag :auth_info, @contact.auth_info, readonly: true, class: 'partially-hidden'
%br %br

View file

@ -1,26 +1,29 @@
#domain-statuses #domain-statuses
= f.fields_for :domain_statuses, @server_statuses do |status_fields| - @server_statuses.each do |x|
.panel.panel-default .panel.panel-default
.panel-heading.clearfix .panel-heading.clearfix
.pull-left= t(:status) .pull-left= t(:status)
.pull-right .pull-right
= link_to(t(:add_another), '#', class: 'btn btn-primary btn-xs add-domain-status') = link_to(t(:add_another), '#', class: 'btn btn-primary btn-xs add-domain-status')
= link_to(t(:delete), '#', class: 'btn btn-danger btn-xs destroy') = link_to(t(:delete), '#', class: 'btn btn-danger btn-xs destroy-status')
.panel-body .panel-body
.errors
= render 'shared/errors', object: status_fields.object
- if status_fields.object.errors.any?
%hr
.form-group .form-group
= status_fields.label :value, class: 'col-md-2 control-label' = f.label 'status', class: 'col-md-2 control-label'
.col-md-10 .col-md-10
= status_fields.select :value, options_for_select(DomainStatus.statuses_for_admin, status_fields.object.value.try(:sub, 'server', '')), {include_blank: true}, {class: 'form-control'} = select_tag 'domain[statuses][]', options_for_select(DomainStatus.statuses_for_admin, x), include_blank: true, class: 'form-control'
.form-group .form-group
= status_fields.label :description, class: 'col-md-2 control-label' = label_tag t(:description), nil, class: 'col-md-2 control-label'
.col-md-10 .col-md-10
= status_fields.text_field :description, class: 'form-control', autocomplete: 'off' = text_field_tag :description, nil, class: 'form-control', autocomplete: 'off'
- @other_statuses.each do |x|
= hidden_field_tag 'domain[statuses][]', x, readonly: true
:coffee :coffee
$("#domain-statuses").nestedAttributes $("#domain-statuses").nestedAttributes
bindAddTo: $(".add-domain-status") bindAddTo: $(".add-domain-status")
afterAdd: (item) ->
item.find(".errors").html "" $('.destroy-status').on 'click', (e) ->
e.preventDefault()
if $('.panel').length > 1
$(this).parents('.panel').remove()
else
$(this).parents('.panel').find('select').val('')

View file

@ -13,7 +13,8 @@
%dd= link_to(@domain.registrar, root_path) %dd= link_to(@domain.registrar, root_path)
%dt= t(:password) %dt= t(:password)
%dd= @domain.auth_info %dd
= text_field_tag :password, @domain.auth_info, readonly: true, class: 'partially-hidden'
%dt= t(:valid_from) %dt= t(:valid_from)
%dd= l(@domain.valid_from) %dd= l(@domain.valid_from)

View file

@ -1,5 +1,4 @@
- panel_class = @domain.errors.messages[:domain_statuses] ? 'panel-danger' : 'panel-default' #domain_statuses.panel.panel-default
#domain_statuses.panel{class: panel_class}
.panel-heading.clearfix .panel-heading.clearfix
= t(:statuses) = t(:statuses)
.table-responsive .table-responsive
@ -9,12 +8,7 @@
%th{class: 'col-xs-6'}= t(:status) %th{class: 'col-xs-6'}= t(:status)
%th{class: 'col-xs-6'}= t(:description) %th{class: 'col-xs-6'}= t(:description)
%tbody %tbody
- @domain.domain_statuses.each do |x| - @domain.statuses.each do |x|
%tr %tr
%td= x.value %td= x
%td= x.description %td
- if @domain.errors.messages[:domain_statuses]
%tfoot
- @domain.errors.messages[:domain_statuses].each do |x|
%tr
%td{colspan: 4}= x

View file

@ -1,6 +1,11 @@
- content_for :actions do - content_for :actions do
= link_to(t(:edit_statuses), edit_admin_domain_path(@domain), class: 'btn btn-primary') = link_to(t(:edit_statuses), edit_admin_domain_path(@domain), class: 'btn btn-primary')
= link_to(t(:history), admin_domain_domain_versions_path(@domain.id), method: :get, class: 'btn btn-primary') = link_to(t(:history), admin_domain_domain_versions_path(@domain.id), method: :get, class: 'btn btn-primary')
- if @domain.force_deletable?
= link_to(t(:set_force_delete), set_force_delete_admin_domain_path(@domain), method: :post, data: { confirm: t(:are_you_sure) }, class: 'btn btn-warning')
- else
= link_to(t(:unset_force_delete), unset_force_delete_admin_domain_path(@domain), method: :post, data: { confirm: t(:are_you_sure) }, class: 'btn btn-warning')
= render 'shared/title', name: @domain.name = render 'shared/title', name: @domain.name
.row .row

View file

@ -0,0 +1,33 @@
= form_for([:admin, @pricelist], multipart: true) do |f|
= render 'shared/errors', object: f.object
.row
.col-md-6
.form-group
= f.label :operation_category
= f.select(:operation_category, Pricelist::OPERATION_CATEGORIES, {}, { class: 'form-control' })
.form-group
= f.label :category, t(:category)
= f.select(:category, Pricelist::CATEGORIES, {}, { class: 'form-control' })
.form-group
= f.label :duration
= f.select(:duration, Pricelist::DURATIONS, {}, { class: 'form-control' })
.form-group
= f.label :price
.input-group
= f.text_field(:price, class: 'form-control')
%span.input-group-addon= Money.default_currency
.form-group.input-daterange
= f.label :valid_from, t(:valid)
.input-group
= f.text_field(:valid_from, value: f.object.valid_from.try(:to_s, :dshort),
class: 'form-control js-datepicker')
%span.input-group-addon -
= f.text_field(:valid_to, value: f.object.valid_to.try(:to_s, :dshort),
class: 'form-control js-datepicker')
%hr
.row
.col-md-12.text-right
= button_tag(t(:save), class: 'btn btn-primary')

View file

@ -0,0 +1,6 @@
.row
.col-sm-6
%h2.text-center-xs= "#{t(:edit)}: #{@pricelist.name}"
%hr
= render 'form'

View file

@ -0,0 +1,43 @@
.row
.col-sm-6
%h2.text-center-xs= t(:pricelists)
.col-sm-6
%h2.text-right.text-center-xs
= link_to(t(:new), new_admin_pricelist_path, class: 'btn btn-primary')
%hr
.row
.col-md-12
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-2'}
= sort_link(@q, 'category', t(:category))
%th{class: 'col-xs-2'}
= sort_link(@q, 'operation_category', t(:operation))
%th{class: 'col-xs-2'}
= sort_link(@q, 'duration', t(:duration))
%th{class: 'col-xs-2'}
= sort_link(@q, 'price', t(:price))
%th{class: 'col-xs-2'}
= sort_link(@q, 'valid_from', t(:valid_from))
%th{class: 'col-xs-2'}
= sort_link(@q, 'valid_to', t(:valid_to))
%th{class: 'col-xs-2'}
= t(:action)
%tbody
- @pricelists.each do |pricelist|
%tr
%td= pricelist.category
%td= pricelist.operation_category
%td= pricelist.duration
%td= pricelist.price
%td= l(pricelist.valid_from, format: :ydate)
%td= l(pricelist.valid_to, format: :ydate)
%td= link_to(t(:edit), edit_admin_pricelist_path(pricelist), class: 'btn btn-xs btn-primary')
.row
.col-md-12
= paginate @pricelists

View file

@ -0,0 +1,3 @@
%h2= t(:new_price)
%hr
= render 'form'

View file

@ -0,0 +1,9 @@
- value = Setting.send(var)
%tr
%td= t(var)
- if [TrueClass, FalseClass].include?(value.class)
%td
= hidden_field_tag("[settings][#{var}]", '')
= check_box_tag("[settings][#{var}]", true, value)
- else
%td= text_field_tag("[settings][#{var}]", value)

View file

@ -1,27 +1,72 @@
= render 'shared/title', name: t(:settings) = render 'shared/title', name: t(:settings)
= form_tag [:admin, :settings] do = form_tag [:admin, :settings] do
.panel.panel-default
.panel-heading.clearfix
= t(:domain_validation_rules)
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-6'}= t(:setting)
%th{class: 'col-xs-6'}= t(:value)
%tbody
= render 'setting_row', var: :admin_contacts_min_count
= render 'setting_row', var: :admin_contacts_max_count
= render 'setting_row', var: :tech_contacts_min_count
= render 'setting_row', var: :tech_contacts_max_count
= render 'setting_row', var: :ds_data_allowed
= render 'setting_row', var: :key_data_allowed
= render 'setting_row', var: :dnskeys_min_count
= render 'setting_row', var: :dnskeys_max_count
= render 'setting_row', var: :ns_min_count
= render 'setting_row', var: :ns_max_count
.panel.panel-default
.panel-heading.clearfix
= t(:domain_expiring)
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-6'}= t(:setting)
%th{class: 'col-xs-6'}= t(:value)
%tbody
= render 'setting_row', var: :days_to_renew_domain_before_expire
= render 'setting_row', var: :expire_warning_period
= render 'setting_row', var: :redemption_grace_period
.panel.panel-default
.panel-heading.clearfix
= t(:billing)
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-6'}= t(:setting)
%th{class: 'col-xs-6'}= t(:value)
%tbody
= render 'setting_row', var: :eis_iban
= render 'setting_row', var: :eis_bank
= render 'setting_row', var: :eis_swift
= render 'setting_row', var: :eis_invoice_contact
= render 'setting_row', var: :invoice_number_min
= render 'setting_row', var: :invoice_number_max
= render 'setting_row', var: :days_to_keep_overdue_invoices_active
.panel.panel-default
.panel-heading.clearfix
= t(:other)
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-6'}= t(:setting)
%th{class: 'col-xs-6'}= t(:value)
%tbody
= render 'setting_row', var: :transfer_wait_time
= render 'setting_row', var: :ds_algorithm
= render 'setting_row', var: :client_side_status_editing_enabled
.row .row
.col-md-8 .col-md-12.text-right
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-4'}
= t(:setting)
%th{class: 'col-xs-2'}
= t(:value)
%tbody
- @settings.each do |x|
%tr
%td= t("#{x.var}")
- if [TrueClass, FalseClass].include?(x.value.class)
%td
= hidden_field_tag("[settings][#{x.var}]", '')
= check_box_tag("[settings][#{x.var}]", true, x.value)
- else
%td= text_field_tag("[settings][#{x.var}]", x.value)
%hr
.row
.col-md-8.text-right
%button.btn.btn-primary=t(:save) %button.btn.btn-primary=t(:save)

View file

@ -6,10 +6,10 @@ uus aadress: <%= @contact.email %>
<br><br> <br><br>
Eposti aadressile saadetakse domeenidega seotud infot seal hulgas kinnitustaotluseid omaniku vahetuse ja domeeni kustutamise korral. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduga oma registripidaja poole. Teie registripidaja on <%= @contact.registrar.name %> Eposti aadressile saadetakse domeenidega seotud infot seal hulgas kinnitustaotluseid omaniku vahetuse ja domeeni kustutamise korral. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduga oma registripidaja poole. Teie registripidaja on <%= @contact.registrar.name %>
<br><br> <br><br>
<% if @contact.domain_contacts.present? %> <% if @contact.related_domain_descriptions.present? %>
Muudatusega seotud domeenid:<br> Muudatusega seotud domeenid:<br>
<% @contact.domain_contacts.each do |dc| %> <% @contact.related_domain_descriptions.each do |domain, desc| %>
<%= dc.domain.name %> (<%= dc.name %>)<br> <%= domain %> (<%= desc.map { |d| t(d, locale: :et) }.join(', ') %>)<br>
<% end %> <% end %>
<% end %> <% end %>
<br> <br>
@ -35,9 +35,11 @@ new address: <% @contact.email %>
<br><br> <br><br>
E-mail addresses are used to send important information regarding your registered domains including applications for approval of registrant change and domain deletion. Please make sure that the update and contact information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @contact.registrar.name %> E-mail addresses are used to send important information regarding your registered domains including applications for approval of registrant change and domain deletion. Please make sure that the update and contact information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @contact.registrar.name %>
<br><br> <br><br>
<% if @contact.related_domain_descriptions.present? %>
Domains affected by this update:<br> Domains affected by this update:<br>
<% @contact.domain_contacts.each do |dc| %> <% @contact.related_domain_descriptions.each do |domain, desc| %>
<%= dc.domain.name %> (<%= dc.name %>)<br> <%= domain %> (<%= desc.map { |d| t(d, locale: :en) }.join(', ') %>)<br>
<% end %>
<% end %> <% end %>
<br> <br>
Contact information:<br> Contact information:<br>

View file

@ -6,11 +6,11 @@ uus aadress: <%= @contact.email %>
Eposti aadressile saadetakse domeenidega seotud infot seal hulgas kinnitustaotluseid omaniku vahetuse ja domeeni kustutamise korral. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduga oma registripidaja poole. Teie registripidaja on <%= @contact.registrar.name %> Eposti aadressile saadetakse domeenidega seotud infot seal hulgas kinnitustaotluseid omaniku vahetuse ja domeeni kustutamise korral. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduga oma registripidaja poole. Teie registripidaja on <%= @contact.registrar.name %>
<% if @contact.domain_contacts.present? %> <% if @contact.related_domain_descriptions.present? %>
Muudatusega seotud domeenid: Muudatusega seotud domeenid:
<% @contact.domain_contacts.each do |dc| %> <% @contact.related_domain_descriptions.each do |domain, desc| %>
<%= dc.domain.name %> (<%= dc.name %>) <%= domain %> (<%= desc.map { |d| t(d, locale: :et) }.join(', ') %>)
<% end %> <% end %>
<% end %> <% end %>
Kontaktandmed: Kontaktandmed:
@ -35,9 +35,11 @@ new address: <% @contact.email %>
E-mail addresses are used to send important information regarding your registered domains including applications for approval of registrant change and domain deletion. Please make sure that the update and contact information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @contact.registrar.name %> E-mail addresses are used to send important information regarding your registered domains including applications for approval of registrant change and domain deletion. Please make sure that the update and contact information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @contact.registrar.name %>
<% if @contact.related_domain_descriptions.present? %>
Domains affected by this update: Domains affected by this update:
<% @contact.domain_contacts.each do |dc| %> <% @contact.related_domain_descriptions.each do |domain, desc| %>
<%= dc.domain.name %> (<%= dc.name %>) <%= domain %> (<%= desc.map { |d| t(d, locale: :en) }.join(', ') %>)
<% end %>
<% end %> <% end %>
Contact information: Contact information:

View file

@ -9,8 +9,6 @@ Isikukood: <%= @domain.registrant_ident %><br>
<% else %> <% else %>
Äriregistrikood: <%= @domain.registrant_ident %><br> Äriregistrikood: <%= @domain.registrant_ident %><br>
<% end %> <% end %>
Epost: <%= @domain.registrant_email %><br>
Tel: <%= @domain.registrant_phone %><br>
Tänav: <%= @domain.registrant_street %><br> Tänav: <%= @domain.registrant_street %><br>
Linn: <%= @domain.registrant_city %><br> Linn: <%= @domain.registrant_city %><br>
Riik: <%= @domain.registrant_country %> Riik: <%= @domain.registrant_country %>
@ -34,8 +32,6 @@ Personal code: <%= @domain.registrant_ident %><br>
<% else %> <% else %>
Business Registry code: <%= @domain.registrant_ident %><br> Business Registry code: <%= @domain.registrant_ident %><br>
<% end %> <% end %>
E-mail: <%= @domain.registrant_email %><br>
Tel: <%= @domain.registrant_phone %><br>
Street: <%= @domain.registrant_street %><br> Street: <%= @domain.registrant_street %><br>
City: <%= @domain.registrant_city %><br> City: <%= @domain.registrant_city %><br>
Country: <%= @domain.registrant_country %> Country: <%= @domain.registrant_country %>

View file

@ -9,8 +9,6 @@ Isikukood: <%= @domain.registrant_ident %>
<% else %> <% else %>
Äriregistrikood: <%= @domain.registrant_ident %> Äriregistrikood: <%= @domain.registrant_ident %>
<% end %> <% end %>
Epost: <%= @domain.registrant_email %>
Tel: <%= @domain.registrant_phone %>
Tänav: <%= @domain.registrant_street %> Tänav: <%= @domain.registrant_street %>
Linn: <%= @domain.registrant_city %> Linn: <%= @domain.registrant_city %>
Riik: <%= @domain.registrant_country %> Riik: <%= @domain.registrant_country %>
@ -34,8 +32,6 @@ Personal code: <%= @domain.registrant_ident %>
<% else %> <% else %>
Business Registry code: <%= @domain.registrant_ident %> Business Registry code: <%= @domain.registrant_ident %>
<% end %> <% end %>
E-mail: <%= @domain.registrant_email %>
Tel: <%= @domain.registrant_phone %>
Street: <%= @domain.registrant_street %> Street: <%= @domain.registrant_street %>
City: <%= @domain.registrant_city %> City: <%= @domain.registrant_city %>
Country: <%= @domain.registrant_country %> Country: <%= @domain.registrant_country %>

View file

@ -5,7 +5,7 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('contact:chkData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do xml.tag!('contact:chkData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
@results.each do |result| @results.each do |result|
xml.tag!('contact:cd') do xml.tag!('contact:cd') do
xml.tag! "contact:id", result[:code], avail: result[:avail] xml.tag! "contact:id", result[:code], avail: result[:avail]
@ -15,6 +15,6 @@ xml.epp_head do
end end
end end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -5,12 +5,12 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('contact:creData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do xml.tag!('contact:creData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
xml.tag!('contact:id', @contact.code) xml.tag!('contact:id', @contact.code)
xml.tag!('contact:crDate', @contact.created_at) xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
end end
end end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -4,6 +4,6 @@ xml.epp_head do
xml.msg 'Command completed successfully' xml.msg 'Command completed successfully'
end end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -5,12 +5,12 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('contact:infData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do xml.tag!('contact:infData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
xml.tag!('contact:id', @contact.code) xml.tag!('contact:id', @contact.code)
if can? :view_full_info, @contact, @password xml.tag!('contact:roid', @contact.roid)
xml.tag!('contact:voice', @contact.phone)
xml.tag!('contact:email', @contact.email) @contact.statuses.each do |status|
xml.tag!('contact:fax', @contact.fax) if @contact.fax.present? xml.tag!('contact:status', s: status.value)
end end
xml.tag!('contact:postalInfo', type: 'int') do xml.tag!('contact:postalInfo', type: 'int') do
@ -20,19 +20,29 @@ xml.epp_head do
xml.tag!('contact:addr') do xml.tag!('contact:addr') do
xml.tag!('contact:street', @contact.street) xml.tag!('contact:street', @contact.street)
xml.tag!('contact:city', @contact.city) xml.tag!('contact:city', @contact.city)
xml.tag!('contact:pc', @contact.zip)
xml.tag!('contact:sp', @contact.state) xml.tag!('contact:sp', @contact.state)
xml.tag!('contact:pc', @contact.zip)
xml.tag!('contact:cc', @contact.country_code) xml.tag!('contact:cc', @contact.country_code)
end end
end end
end end
if can? :view_full_info, @contact, @password
xml.tag!('contact:voice', @contact.phone)
xml.tag!('contact:fax', @contact.fax) if @contact.fax.present?
xml.tag!('contact:email', @contact.email)
end
xml.tag!('contact:clID', @contact.registrar.try(:name)) xml.tag!('contact:clID', @contact.registrar.try(:name))
xml.tag!('contact:crID', @contact.creator.try(:registrar)) if @contact.creator.try(:registrar).blank? && Rails.env.test?
xml.tag!('contact:crDate', @contact.created_at) xml.tag!('contact:crID', 'TEST-CREATOR')
else
xml.tag!('contact:crID', @contact.creator.try(:registrar))
end
xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
if @contact.updated_at != @contact.created_at if @contact.updated_at != @contact.created_at
xml.tag!('contact:upID', @contact.updator.try(:registrar)) xml.tag!('contact:upID', @contact.updator.try(:registrar))
xml.tag!('contact:upDate', @contact.updated_at) xml.tag!('contact:upDate', @contact.updated_at.try(:iso8601))
end end
# xml.tag!('contact:trDate', '123') if false # xml.tag!('contact:trDate', '123') if false
if can? :view_password, @contact, @password if can? :view_password, @contact, @password
@ -40,21 +50,18 @@ xml.epp_head do
xml.tag!('contact:pw', @contact.auth_info) xml.tag!('contact:pw', @contact.auth_info)
end end
end end
@contact.statuses.each do |status|
xml.tag!('contact:status', s: status.value)
end
# xml << render('/epp/contacts/disclosure_policy') # xml << render('/epp/contacts/disclosure_policy')
end end
end end
if can? :view_full_info, @contact, @password if can? :view_full_info, @contact, @password
xml.tag!('extension') do xml.tag!('extension') do
xml.tag!('eis:extdata', 'xmlns:eis' => 'urn:ee:eis:xml:epp:eis-1.0') do xml.tag!('eis:extdata', 'xmlns:eis' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd') do
xml.tag!('eis:ident', @contact.ident, xml.tag!('eis:ident', @contact.ident,
type: @contact.ident_type, cc: @contact.ident_country_code) type: @contact.ident_type, cc: @contact.ident_country_code)
end end
end end
end end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -5,12 +5,12 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('contact:creData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do xml.tag!('contact:creData', 'xmlns:contact' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd') do
xml.tag!('contact:id', @contact.code) xml.tag!('contact:id', @contact.code)
xml.tag!('contact:crDate', @contact.created_at) xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
end end
end end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -5,7 +5,7 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('domain:chkData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do xml.tag!('domain:chkData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
@domains.each do |x| @domains.each do |x|
xml.tag!('domain:cd') do xml.tag!('domain:cd') do
xml.tag!('domain:name', x[:name], 'avail' => x[:avail]) xml.tag!('domain:name', x[:name], 'avail' => x[:avail])
@ -15,6 +15,6 @@ xml.epp_head do
end end
end end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -5,13 +5,13 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('domain:creData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do xml.tag!('domain:creData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
xml.tag!('domain:name', @domain.name) xml.tag!('domain:name', @domain.name)
xml.tag!('domain:crDate', @domain.created_at) xml.tag!('domain:crDate', @domain.created_at.try(:iso8601))
xml.tag!('domain:exDate', @domain.valid_to) xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601))
end end
end end
end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end
end end

View file

@ -5,11 +5,11 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('domain:infData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do xml.tag!('domain:infData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
xml.tag!('domain:name', @domain.name) xml.tag!('domain:name', @domain.name)
@domain.domain_statuses.each do |ds| xml.tag!('domain:roid', @domain.roid)
xml.tag!('domain:status', ds.description, 's' => ds.value) unless ds.description.blank? @domain.statuses.each do |s|
xml.tag!('domain:status', 's' => ds.value) if ds.description.blank? xml.tag!('domain:status', 's' => s)
end end
xml.tag!('domain:registrant', @domain.registrant_code) xml.tag!('domain:registrant', @domain.registrant_code)
@ -38,17 +38,17 @@ xml.epp_head do
xml.tag!('domain:clID', @domain.registrar_name) xml.tag!('domain:clID', @domain.registrar_name)
xml.tag!('domain:crID', @domain.creator.try(:registrar)) xml.tag!('domain:crID', @domain.creator.try(:registrar)) if @domain.creator
xml.tag!('domain:crDate', @domain.created_at) xml.tag!('domain:crDate', @domain.created_at.try(:iso8601))
xml.tag!('domain:exDate', @domain.valid_to) xml.tag!('domain:upDate', @domain.updated_at.try(:iso8601)) if @domain.updated_at != @domain.created_at
xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601))
# TODO Make domain stampable # TODO Make domain stampable
#xml.tag!('domain:upID', @domain.updated_by) #xml.tag!('domain:upID', @domain.updated_by)
xml.tag!('domain:upDate', @domain.updated_at) if @domain.updated_at != @domain.created_at
# TODO Make domain transferrable # TODO Make domain transferrable
#xml.tag!('domain:trDate', @domain.transferred_at) if @domain.transferred_at #xml.tag!('domain:trDate', @domain.transferred_at) if @domain.transferred_at
@ -59,26 +59,26 @@ xml.epp_head do
end end
end end
end end
end
xml.extension do xml.extension do
xml.tag!('secDNS:infData', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1') do xml.tag!('secDNS:infData', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1') do
@domain.dnskeys.sort.each do |key| @domain.dnskeys.sort.each do |key|
xml.tag!('secDNS:dsData') do xml.tag!('secDNS:dsData') do
xml.tag!('secDNS:keyTag', key.ds_key_tag) xml.tag!('secDNS:keyTag', key.ds_key_tag)
xml.tag!('secDNS:alg', key.ds_alg) xml.tag!('secDNS:alg', key.ds_alg)
xml.tag!('secDNS:digestType', key.ds_digest_type) xml.tag!('secDNS:digestType', key.ds_digest_type)
xml.tag!('secDNS:digest', key.ds_digest) xml.tag!('secDNS:digest', key.ds_digest)
xml.tag!('secDNS:keyData') do xml.tag!('secDNS:keyData') do
xml.tag!('secDNS:flags', key.flags) xml.tag!('secDNS:flags', key.flags)
xml.tag!('secDNS:protocol', key.protocol) xml.tag!('secDNS:protocol', key.protocol)
xml.tag!('secDNS:alg', key.alg) xml.tag!('secDNS:alg', key.alg)
xml.tag!('secDNS:pubKey', key.public_key) xml.tag!('secDNS:pubKey', key.public_key)
end
end end
end end
end end
end end if @domain.dnskeys.any?
end if @domain.dnskeys.any?
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end
end end

View file

@ -1,9 +1,9 @@
builder.tag!('domain:trnData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do builder.tag!('domain:trnData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
builder.tag!('domain:name', dt.domain_name) builder.tag!('domain:name', dt.domain_name)
builder.tag!('domain:trStatus', dt.status) builder.tag!('domain:trStatus', dt.status)
builder.tag!('domain:reID', dt.transfer_to.code) builder.tag!('domain:reID', dt.transfer_to.code)
builder.tag!('domain:reDate', dt.transfer_requested_at) builder.tag!('domain:reDate', dt.transfer_requested_at.try(:iso8601))
builder.tag!('domain:acID', dt.transfer_from.code) builder.tag!('domain:acID', dt.transfer_from.code)
builder.tag!('domain:acDate', dt.transferred_at || dt.wait_until) builder.tag!('domain:acDate', dt.transferred_at.try(:iso8601) || dt.wait_until.try(:iso8601))
builder.tag!('domain:exDate', dt.domain_valid_to) builder.tag!('domain:exDate', dt.domain_valid_to.try(:iso8601))
end end

View file

@ -5,12 +5,12 @@ xml.epp_head do
end end
xml.resData do xml.resData do
xml.tag!('domain:renData', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do xml.tag!('domain:renData', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd') do
xml.tag!('domain:name', @domain[:name]) xml.tag!('domain:name', @domain[:name])
xml.tag!('domain:exDate', @domain.valid_to) xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601))
end end
end end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -3,7 +3,7 @@ xml.epp_head do
xml.result('code' => '1000') do xml.result('code' => '1000') do
xml.msg 'Command completed successfully' xml.msg 'Command completed successfully'
end end
end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end
end end

View file

@ -3,7 +3,6 @@ xml.epp_head do
xml.result('code' => '1001') do xml.result('code' => '1001') do
xml.msg 'Command completed successfully; action pending' xml.msg 'Command completed successfully; action pending'
end end
render('epp/shared/trID', builder: xml)
end end
xml << render('/epp/shared/trID')
end end

View file

@ -7,7 +7,7 @@ xml.epp_head do
xml.resData do xml.resData do
xml << render('epp/domains/partials/transfer', builder: xml, dt: @domain_transfer) xml << render('epp/domains/partials/transfer', builder: xml, dt: @domain_transfer)
end end
end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end
end end

View file

@ -20,7 +20,6 @@ xml.epp_head do
end end
end end
render('epp/shared/trID', builder: xml)
end end
xml << render('/epp/shared/trID')
end end

View file

@ -0,0 +1,8 @@
xml.epp_head do
xml.response do
xml.result('code' => '2306') do
xml.msg('Parameter value policy error. Allowed only Latin characters.', 'lang' => 'en')
end
render('epp/shared/trID', builder: xml)
end
end

View file

@ -6,6 +6,6 @@ xml.epp_head do
xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id) xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id)
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -2,7 +2,7 @@ xml.instruct!(:xml, standalone: 'no')
xml.epp( xml.epp(
'xmlns' => 'urn:ietf:params:xml:ns:epp-1.0', 'xmlns' => 'urn:ietf:params:xml:ns:epp-1.0',
'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1', 'xmlns:secDNS' => 'urn:ietf:params:xml:ns:secDNS-1.1',
'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0', 'xmlns:domain' => 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd',
'xmlns:keyrelay' => 'urn:ietf:params:xml:ns:keyrelay-1.0' 'xmlns:keyrelay' => 'urn:ietf:params:xml:ns:keyrelay-1.0'
) do ) do
xml.response do xml.response do
@ -11,7 +11,7 @@ xml.epp(
end end
xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id) do xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id) do
xml.qDate @message.created_at xml.qDate @message.created_at.try(:iso8601)
xml.msg @message.body xml.msg @message.body
end end
@ -19,7 +19,7 @@ xml.epp(
xml.tag!('keyrelay:response') do xml.tag!('keyrelay:response') do
xml.tag!('keyrelay:panData') do xml.tag!('keyrelay:panData') do
xml.tag!('keyrelay:name', @object.domain_name) xml.tag!('keyrelay:name', @object.domain_name)
xml.tag!('keyrelay:paDate', @object.pa_date) xml.tag!('keyrelay:paDate', @object.pa_date.try(:iso8601))
xml.tag!('keyrelay:keyData') do xml.tag!('keyrelay:keyData') do
xml.tag!('secDNS:flags', @object.key_data_flags) xml.tag!('secDNS:flags', @object.key_data_flags)
@ -44,6 +44,6 @@ xml.epp(
end end
end end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -4,6 +4,6 @@ xml.epp_head do
xml.msg 'Command completed successfully; no messages' xml.msg 'Command completed successfully; no messages'
end end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -5,7 +5,7 @@ xml.epp_head do
end end
xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id) do xml.tag!('msgQ', 'count' => current_user.queued_messages.count, 'id' => @message.id) do
xml.qDate @message.created_at xml.qDate @message.created_at.try(:iso8601)
xml.msg @message.body xml.msg @message.body
end end
@ -15,6 +15,6 @@ xml.epp_head do
end end
end if @object end if @object
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -5,13 +5,13 @@ xml.epp_head do
xml.svcMenu do xml.svcMenu do
xml.version '1.0' xml.version '1.0'
xml.lang 'en' xml.lang 'en'
xml.objURI 'urn:ietf:params:xml:ns:domain-1.0' xml.objURI 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/domain-eis-1.0.xsd'
xml.objURI 'urn:ietf:params:xml:ns:contact-1.0' xml.objURI 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd'
xml.objURI 'urn:ietf:params:xml:ns:host-1.0' xml.objURI 'urn:ietf:params:xml:ns:host-1.0'
xml.objURI 'urn:ietf:params:xml:ns:keyrelay-1.0' xml.objURI 'urn:ietf:params:xml:ns:keyrelay-1.0'
xml.svcExtension do xml.svcExtension do
xml.extURI 'urn:ietf:params:xml:ns:secDNS-1.1' xml.extURI 'urn:ietf:params:xml:ns:secDNS-1.1'
xml.extURI 'urn:ee:eis:xml:epp:eis-1.0' xml.extURI 'https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd'
end end
end end

View file

@ -3,7 +3,7 @@ xml.epp_head do
xml.result('code' => '2501') do xml.result('code' => '2501') do
xml.msg(@msg || 'Authentication error; server closing connection') xml.msg(@msg || 'Authentication error; server closing connection')
end end
end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end
end end

View file

@ -4,6 +4,6 @@ xml.epp_head do
xml.msg 'Command completed successfully' xml.msg 'Command completed successfully'
end end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end end
end end

View file

@ -3,7 +3,7 @@ xml.epp_head do
xml.result('code' => '1500') do xml.result('code' => '1500') do
xml.msg 'Command completed successfully; ending session' xml.msg 'Command completed successfully; ending session'
end end
end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end
end end

View file

@ -1,4 +1,5 @@
xml.trID do # builder ||= xml
xml.clTRID params[:clTRID] builder.trID do
xml.svTRID @svTRID builder.clTRID params[:clTRID] if params[:clTRID].present?
builder.svTRID @svTRID
end end

View file

@ -3,7 +3,7 @@ xml.epp_head do
xml.result('code' => '1000') do xml.result('code' => '1000') do
xml.msg 'Command completed successfully' xml.msg 'Command completed successfully'
end end
end
xml << render('/epp/shared/trID') render('epp/shared/trID', builder: xml)
end
end end

View file

@ -51,16 +51,21 @@
%li= link_to t(:admin_users), admin_admin_users_path %li= link_to t(:admin_users), admin_admin_users_path
%li.divider %li.divider
%li.dropdown-header= t(:billing) %li.dropdown-header= t(:billing)
- if can? :view, Pricelist
%li= link_to t(:pricelists), admin_pricelists_path
%li= link_to t(:bank_statements), admin_bank_statements_path %li= link_to t(:bank_statements), admin_bank_statements_path
%li= link_to t(:invoices), admin_invoices_path %li= link_to t(:invoices), admin_invoices_path
%li.divider %li.divider
%li.dropdown-header= t(:system) %li.dropdown-header= t(:system)
%li= link_to t(:settings), admin_settings_path %li= link_to t(:settings), admin_settings_path
%li= link_to t(:zonefile), admin_zonefile_settings_path %li= link_to t(:zonefile), admin_zonefile_settings_path
%li.dropdown-header= t(:system)
%li= link_to t(:settings), admin_settings_path
%li= link_to t(:zonefile), admin_zonefile_settings_path
-# %li= link_to t(:domains_history), admin_domain_versions_path -# %li= link_to t(:domains_history), admin_domain_versions_path
%li= link_to t(:epp_logs), admin_epp_logs_path %li= link_to t(:epp_logs), admin_epp_logs_path
%li= link_to t(:repp_logs), admin_repp_logs_path %li= link_to t(:repp_logs), admin_repp_logs_path
-# %li= link_to t(:background_jobs), admin_delayed_jobs_path %li= link_to t(:que), '/admin/que'
- if signed_in? - if signed_in?
%ul.nav.navbar-nav.navbar-right %ul.nav.navbar-nav.navbar-right

View file

@ -1,4 +1,44 @@
- if @domain.present? - if params[:confirmed].present?
.row
.col-md-12
%h1= t(:domain_delete_confirmed_title)
.row
.col-md-12
%p= t(:domain_delete_confirmed_body)
- elsif params[:rejected].present?
.row
.col-md-12
%h1= t(:domain_delete_rejected_title)
.row
.col-md-12
%p= t(:domain_delete_rejected_body)
- else - else
%h1= t(:not_valid_domain_verification_title).html_safe - if @domain.present?
%p= t(:not_valid_domain_verification_body).html_safe .row
.col-md-12
%h1= t(:domain_delete_title)
.row
.col-md-12
%p= t(:domain_delete_body)
%hr
.row
.col-md-12.text-center.confirmation
.column-keys
%p= t(:domain_name) + ':'
%p= t(:registrant) + ':'
.column-values
%p= @domain.name
%p= "#{@domain.registrant_name} (#{@domain.registrant.ident})"
.row
.col-md-12.text-center
.confirmation
= form_for registrant_domain_delete_confirm_path(@domain.id), method: :patch do |f|
= hidden_field_tag :token, params[:token]
= f.button t(:confirm_domain_delete), name: 'confirmed', class: 'btn btn-primary'
= f.button t(:reject_domain_delete), name: 'rejected', class: 'btn btn-warning'
%hr
- else
%h1= t(:not_valid_domain_verification_title).html_safe
%p= t(:not_valid_domain_verification_body).html_safe

View file

@ -25,13 +25,13 @@
.row .row
.col-md-12.text-center.confirmation .col-md-12.text-center.confirmation
.column-keys .column-keys
%p= t(:domain_name) + ':' %p= t(:domain_name) + ':'
%p= t(:current_registrant) + ':' %p= t(:current_registrant) + ':'
%p= t(:new_pending_registrant) + ':' %p= t(:new_pending_registrant) + ':'
.column-values .column-values
%p= @domain.name %p= @domain.name
%p= @domain.registrant_name %p= "#{@domain.registrant_name} (#{@domain.registrant.ident})"
%p= @domain.pending_registrant_name %p= "#{@domain.pending_registrant.try(:name)} (#{@domain.pending_registrant.try(:ident)})"
.row .row
.col-md-12.text-center .col-md-12.text-center

View file

@ -7,20 +7,20 @@
= f.label :ident_country_code, t(:country) + '*' = f.label :ident_country_code, t(:country) + '*'
.col-md-7 .col-md-7
= f.select(:ident_country_code, SortedCountry.all_options(f.object.ident_country_code), {}, = f.select(:ident_country_code, SortedCountry.all_options(f.object.ident_country_code), {},
class: 'js-ident-country-code', required: true) class: 'js-ident-country-code', required: true, disabled: @contact.persisted?)
.form-group .form-group
.col-md-3.control-label .col-md-3.control-label
= f.label :ident_type, t(:type) + '*' = f.label :ident_type, t(:type) + '*'
.col-md-7 .col-md-7
= f.select(:ident_type, Depp::Contact::SELECTION_TYPES, { selected: f.object.ident_type }, = f.select(:ident_type, Depp::Contact::SELECTION_TYPES, { selected: f.object.ident_type },
class: 'js-ident-type', required: true) class: 'js-ident-type', required: true, disabled: @contact.persisted?)
.form-group .form-group
.col-md-3.control-label .col-md-3.control-label
= f.label :ident, t(:ident) + '*' = f.label :ident, t(:ident) + '*'
.col-md-7 .col-md-7
= f.text_field :ident, class: 'form-control', required: true = f.text_field :ident, class: 'form-control', required: true, disabled: @contact.persisted?
- tip_visibility = f.object.ident_type == 'birthday' ? '' : 'display: none' - tip_visibility = f.object.ident_type == 'birthday' ? '' : 'display: none'
.js-ident-tip{ style: tip_visibility } .js-ident-tip{ style: tip_visibility }
= t(:birthday_format) = t(:birthday_format)

View file

@ -7,7 +7,9 @@
%dd= @contact.id %dd= @contact.id
%dt= t(:password) %dt= t(:password)
%dd= @contact.password %dd
= text_field_tag :password, @contact.password, readonly: true, class: 'partially-hidden'
%br %br

View file

@ -1,10 +1,11 @@
- content_for :actions do - content_for :actions do
= link_to(t(:edit), edit_registrar_domains_path(domain_name: params[:domain_name]), - if @data.css('pw').text.present?
class: 'btn btn-default') = link_to(t(:edit), edit_registrar_domains_path(domain_name: params[:domain_name]),
= link_to(t(:renew), renew_registrar_domains_path(domain_name: params[:domain_name]), class: 'btn btn-default')
class: 'btn btn-default') = link_to(t(:renew), renew_registrar_domains_path(domain_name: params[:domain_name]),
= link_to(t(:delete), delete_registrar_domains_path(domain_name: params[:domain_name]), class: 'btn btn-default')
class: 'btn btn-default') = link_to(t(:delete), delete_registrar_domains_path(domain_name: params[:domain_name]),
class: 'btn btn-default')
= render 'shared/title', name: truncate(@data.css('name').text) = render 'shared/title', name: truncate(@data.css('name').text)
.row .row

View file

@ -17,11 +17,11 @@
class: 'form-control', autocomplete: 'off', required: true class: 'form-control', autocomplete: 'off', required: true
.form-group .form-group
.col-md-3.control-label .col-md-3.control-label
= label_tag 'legal_document', t(:legal_document), class: 'required' = label_tag 'legal_document', t(:legal_document)
.col-md-7 .col-md-7
= file_field_tag 'legal_document', required: true = file_field_tag 'legal_document'
.form-group .form-group
.col-md-10.text-right .col-md-10.text-right
%button.btn.btn-warning{ name: 'query' }= t(:query) %button.btn.btn-warning{ name: 'query' }= t(:transfer)
%button.btn.btn-warning{ name: 'approve' }= t(:approve) /%button.btn.btn-warning{ name: 'approve' }= t(:approve)
%button.btn.btn-warning{ name: 'reject' }= t(:reject) /%button.btn.btn-warning{ name: 'reject' }= t(:reject)

View file

@ -3,7 +3,7 @@
<command> <command>
<check> <check>
<contact:check <contact:check
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>sh8013</contact:id> <contact:id>sh8013</contact:id>
</contact:check> </contact:check>
</check> </check>

View file

@ -3,7 +3,7 @@
<command> <command>
<check> <check>
<contact:check <contact:check
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>sh8013</contact:id> <contact:id>sh8013</contact:id>
<contact:id>sh13</contact:id> <contact:id>sh13</contact:id>
<contact:id>vsdfvq</contact:id> <contact:id>vsdfvq</contact:id>

View file

@ -2,7 +2,7 @@
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<command> <command>
<create> <create>
<contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> <contact:create xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:postalInfo> <contact:postalInfo>
<contact:name>Sillius Soddus</contact:name> <contact:name>Sillius Soddus</contact:name>
<contact:addr> <contact:addr>
@ -20,7 +20,7 @@
</contact:create> </contact:create>
</create> </create>
<extension> <extension>
<eis:extdata xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"> <eis:extdata xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd">
<eis:ident type="bic" cc="EE">123</eis:ident> <eis:ident type="bic" cc="EE">123</eis:ident>
<eis:legalDocument type="pdf"> <eis:legalDocument type="pdf">
JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==

View file

@ -3,7 +3,7 @@
<command> <command>
<delete> <delete>
<contact:delete <contact:delete
xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> xmlns:contact="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/contact-eis-1.0.xsd">
<contact:id>sh8013</contact:id> <contact:id>sh8013</contact:id>
<contact:authInfo> <contact:authInfo>
<contact:pw>wrong-one</contact:pw> <contact:pw>wrong-one</contact:pw>
@ -11,7 +11,7 @@
</contact:delete> </contact:delete>
</delete> </delete>
<extension> <extension>
<eis:extdata xmlns:eis="urn:ee:eis:xml:epp:eis-1.0"> <eis:extdata xmlns:eis="https://raw.githubusercontent.com/internetee/registry/alpha/doc/schemas/eis-1.0.xsd">
<eis:legalDocument type="pdf"> <eis:legalDocument type="pdf">
JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp== JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==
</eis:legalDocument> </eis:legalDocument>

Some files were not shown because too many files have changed in this diff Show more