From 07d6805aa60ce1c493dbfbe4e819f018ed4234c3 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 19 Jan 2016 16:51:19 +0200
Subject: [PATCH 001/180] 111864739-legal_doc_for_pt
---
app/models/domain.rb | 3 +++
app/models/epp/domain.rb | 1 +
lib/tasks/documents.rake | 41 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+)
create mode 100644 lib/tasks/documents.rake
diff --git a/app/models/domain.rb b/app/models/domain.rb
index e4882473a..8f2010a5e 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -7,6 +7,8 @@ class Domain < ActiveRecord::Base
attr_accessor :roles
+ attr_accessor :legal_document_id
+
# TODO: whois requests ip whitelist for full info for own domains and partial info for other domains
# TODO: most inputs should be trimmed before validatation, probably some global logic?
@@ -821,6 +823,7 @@ class Domain < ActiveRecord::Base
log[:admin_contacts] = admin_contact_ids
log[:tech_contacts] = tech_contact_ids
log[:nameservers] = nameserver_ids
+ log[:legal_documents]= [legal_document_id]
log[:registrant] = [registrant_id]
log[:domain_statuses] = domain_status_ids
log
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 15e16163a..6cda7712f 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -476,6 +476,7 @@ class Epp::Domain < Domain
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
+ self.legal_document_id = doc.id
end
at_add = attrs_from(frame.css('add'), current_user, 'add')
diff --git a/lib/tasks/documents.rake b/lib/tasks/documents.rake
new file mode 100644
index 000000000..51ba49108
--- /dev/null
+++ b/lib/tasks/documents.rake
@@ -0,0 +1,41 @@
+namespace :documents do
+
+
+ desc 'Generate all'
+ task all: :environment do
+ Rake::Task['documents:log'].invoke
+ end
+
+ desc 'Generate legaldoc versions'
+ task log: :environment do
+ start = Time.zone.now.to_f
+ puts '-----> Adding documets id for PaperTrail log...'
+ count = 0
+
+ LegalDocument.all.each do |x|
+
+ next if x.documentable_id.blank?
+
+ dc = DomainVersion.where(item_id: x.documentable_id)
+
+ dc.each do |y|
+
+ if x.created_at < (y.created_at + (2*60)) &&
+ x.created_at > (y.created_at - (2*60))
+
+ y.children[:legal_documents] = [x.id]
+ y.save
+ count =+1
+
+ else
+
+ y.children[:legal_documents] = []
+ y.save
+
+ end
+ end
+ end
+ puts "-----> Log changed for #{count} rows in #{(Time.zone.now.to_f - start).round(2)} seconds"
+ end
+end
+
From 556868da6f4c8a42f5d1cc9c589ddc0780495b99 Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 20 Jan 2016 12:24:13 +0200
Subject: [PATCH 002/180] 111864739-memory_optimization
---
lib/tasks/documents.rake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/tasks/documents.rake b/lib/tasks/documents.rake
index 51ba49108..d16025785 100644
--- a/lib/tasks/documents.rake
+++ b/lib/tasks/documents.rake
@@ -12,7 +12,7 @@ namespace :documents do
puts '-----> Adding documets id for PaperTrail log...'
count = 0
- LegalDocument.all.each do |x|
+ LegalDocument.where(documentable_type: Domain).find_each do |x|
next if x.documentable_id.blank?
From 2430bfebf2f5ed3471e88f0b8ed2597b603c96e6 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 26 Jan 2016 17:17:36 +0200
Subject: [PATCH 003/180] 111864739-contact_type_added
---
lib/tasks/documents.rake | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lib/tasks/documents.rake b/lib/tasks/documents.rake
index d16025785..5ae8fb4df 100644
--- a/lib/tasks/documents.rake
+++ b/lib/tasks/documents.rake
@@ -1,6 +1,5 @@
namespace :documents do
-
desc 'Generate all'
task all: :environment do
Rake::Task['documents:log'].invoke
@@ -12,11 +11,16 @@ namespace :documents do
puts '-----> Adding documets id for PaperTrail log...'
count = 0
- LegalDocument.where(documentable_type: Domain).find_each do |x|
+ LegalDocument.find_each do |x|
next if x.documentable_id.blank?
- dc = DomainVersion.where(item_id: x.documentable_id)
+ document_type = case x.documentable_type
+ when 'Domain' then DomainVersion
+ when 'Contact'then ContactVersion
+ end
+
+ dc = document_type.where(item_id: x.documentable_id)
dc.each do |y|
From 7f9e1e0c9c689e7ddad7ac7366d15304859841c4 Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 1 Feb 2016 17:47:58 +0200
Subject: [PATCH 004/180] 111864739-catcher_for_all_domain_methods
---
app/models/epp/domain.rb | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 6cda7712f..667b566ca 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -194,7 +194,10 @@ class Epp::Domain < Domain
end
at[:dnskeys_attributes] = dnskeys_attrs(dnskey_frame, action)
- at[:legal_documents_attributes] = legal_document_from(frame)
+
+ doc = legal_document_from(frame)
+ self.legal_document_id = doc.id if doc.id
+ at[:legal_documents_attributes] = doc
at
end
# rubocop: enable Metrics/PerceivedComplexity
@@ -476,7 +479,7 @@ class Epp::Domain < Domain
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
- self.legal_document_id = doc.id
+ self.legal_document_id = doc.id if doc.id
end
at_add = attrs_from(frame.css('add'), current_user, 'add')
@@ -546,6 +549,7 @@ class Epp::Domain < Domain
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
+ self.legal_document_id = doc.id if doc.id
end
if Setting.request_confirmation_on_domain_deletion_enabled &&
@@ -698,7 +702,8 @@ class Epp::Domain < Domain
self.registrar = current_user.registrar
end
- attach_legal_document(self.class.parse_legal_document_from_frame(frame))
+ doc = attach_legal_document(self.class.parse_legal_document_from_frame(frame))
+ self.legal_document_id = doc.id if doc.id
save!(validate: false)
return dt
@@ -726,7 +731,8 @@ class Epp::Domain < Domain
generate_auth_info
self.registrar = pt.transfer_to
- attach_legal_document(self.class.parse_legal_document_from_frame(frame))
+ doc = attach_legal_document(self.class.parse_legal_document_from_frame(frame))
+ self.legal_document_id = doc.id if doc.id
save!(validate: false)
end
@@ -747,7 +753,8 @@ class Epp::Domain < Domain
status: DomainTransfer::CLIENT_REJECTED
)
- attach_legal_document(self.class.parse_legal_document_from_frame(frame))
+ doc = attach_legal_document(self.class.parse_legal_document_from_frame(frame))
+ self.legal_document_id = doc.id if doc.id
save!(validate: false)
end
From f087a00bef9ee78fccbac6d926d022f89b1aebc5 Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 1 Feb 2016 18:08:44 +0200
Subject: [PATCH 005/180] 111864739-legaldocs_for_contacts
---
app/models/contact.rb | 11 ++++++++++-
app/models/epp/contact.rb | 4 +++-
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index ccc44851d..558e930d9 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -2,6 +2,7 @@ class Contact < ActiveRecord::Base
include Versions # version/contact_version.rb
include EppErrors
include UserEvents
+ has_paper_trail class_name: "ContactVersion", meta: { children: :children_log }
belongs_to :registrar
has_many :domain_contacts
@@ -9,6 +10,8 @@ class Contact < ActiveRecord::Base
has_many :legal_documents, as: :documentable
has_many :registrant_domains, class_name: 'Domain', foreign_key: 'registrant_id' # when contant is registrant
+ attr_accessor :legal_document_id
+
# TODO: remove later
has_many :depricated_statuses, class_name: 'DepricatedContactStatus', dependent: :destroy
@@ -499,6 +502,12 @@ class Contact < ActiveRecord::Base
def update_related_whois_records
related_domain_descriptions.each{ |x, y| WhoisRecord.find_by(name: x).try(:save) }
- end
+ end
+
+ def children_log
+ log = HashWithIndifferentAccess.new
+ log[:legal_documents]= [legal_document_id]
+ log
+ end
end
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index f4773f732..6df2e7b4d 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -38,7 +38,9 @@ class Epp::Contact < Contact
legal_frame = f.css('legalDocument').first
if legal_frame.present?
- at[:legal_documents_attributes] = legal_document_attrs(legal_frame)
+ doc = legal_document_attrs(legal_frame)
+ self.legal_document_id = doc.id if doc.id
+ at[:legal_documents_attributes] = doc
end
at.merge!(ident_attrs(f.css('ident').first)) if new_record
at
From feb93b4093ab67b30b4d2d66178457f3d6ed3cfb Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 1 Feb 2016 18:39:06 +0200
Subject: [PATCH 006/180] 111864739-method_fix
---
app/models/epp/domain.rb | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 667b566ca..0e53ba264 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -194,10 +194,7 @@ class Epp::Domain < Domain
end
at[:dnskeys_attributes] = dnskeys_attrs(dnskey_frame, action)
-
- doc = legal_document_from(frame)
- self.legal_document_id = doc.id if doc.id
- at[:legal_documents_attributes] = doc
+ at[:legal_documents_attributes] = legal_document_from(frame)
at
end
# rubocop: enable Metrics/PerceivedComplexity
From 0141026408f6e4ea1e90c976c5e48c96ab218c45 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 2 Feb 2016 16:38:16 +0200
Subject: [PATCH 007/180] 111864739-nested_id_catch
---
app/models/contact.rb | 11 +++++++++++
app/models/epp/contact.rb | 4 +---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index 558e930d9..2400ea33a 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -17,6 +17,8 @@ class Contact < ActiveRecord::Base
accepts_nested_attributes_for :legal_documents
+ before_save :catch_legal_doc_id
+
validates :name, :phone, :email, :ident, :ident_type,
:street, :city, :zip, :country_code, :registrar, presence: true
@@ -510,4 +512,13 @@ class Contact < ActiveRecord::Base
log
end
+ def catch_legal_doc_id
+
+ if !legal_document_id && doc = self.legal_documents.last.new_record?
+
+ legal_document_id = doc.id
+
+ end
+end
+
end
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index 6df2e7b4d..f4773f732 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -38,9 +38,7 @@ class Epp::Contact < Contact
legal_frame = f.css('legalDocument').first
if legal_frame.present?
- doc = legal_document_attrs(legal_frame)
- self.legal_document_id = doc.id if doc.id
- at[:legal_documents_attributes] = doc
+ at[:legal_documents_attributes] = legal_document_attrs(legal_frame)
end
at.merge!(ident_attrs(f.css('ident').first)) if new_record
at
From 59f7f364ad3fc2c1734deeaa19ba9bc9e1a7f8ec Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 4 Feb 2016 16:32:30 +0200
Subject: [PATCH 008/180]
11186739-revert_to_2430bfebf2f5ed3471e88f0b8ed2597b603c96e6
---
app/models/contact.rb | 20 --------------------
app/models/epp/domain.rb | 12 ++++--------
2 files changed, 4 insertions(+), 28 deletions(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index 2400ea33a..fdb114673 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -2,7 +2,6 @@ class Contact < ActiveRecord::Base
include Versions # version/contact_version.rb
include EppErrors
include UserEvents
- has_paper_trail class_name: "ContactVersion", meta: { children: :children_log }
belongs_to :registrar
has_many :domain_contacts
@@ -10,15 +9,11 @@ class Contact < ActiveRecord::Base
has_many :legal_documents, as: :documentable
has_many :registrant_domains, class_name: 'Domain', foreign_key: 'registrant_id' # when contant is registrant
- attr_accessor :legal_document_id
-
# TODO: remove later
has_many :depricated_statuses, class_name: 'DepricatedContactStatus', dependent: :destroy
accepts_nested_attributes_for :legal_documents
- before_save :catch_legal_doc_id
-
validates :name, :phone, :email, :ident, :ident_type,
:street, :city, :zip, :country_code, :registrar, presence: true
@@ -506,19 +501,4 @@ class Contact < ActiveRecord::Base
related_domain_descriptions.each{ |x, y| WhoisRecord.find_by(name: x).try(:save) }
end
- def children_log
- log = HashWithIndifferentAccess.new
- log[:legal_documents]= [legal_document_id]
- log
- end
-
- def catch_legal_doc_id
-
- if !legal_document_id && doc = self.legal_documents.last.new_record?
-
- legal_document_id = doc.id
-
- end
-end
-
end
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 0e53ba264..6cda7712f 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -476,7 +476,7 @@ class Epp::Domain < Domain
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
- self.legal_document_id = doc.id if doc.id
+ self.legal_document_id = doc.id
end
at_add = attrs_from(frame.css('add'), current_user, 'add')
@@ -546,7 +546,6 @@ class Epp::Domain < Domain
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
- self.legal_document_id = doc.id if doc.id
end
if Setting.request_confirmation_on_domain_deletion_enabled &&
@@ -699,8 +698,7 @@ class Epp::Domain < Domain
self.registrar = current_user.registrar
end
- doc = attach_legal_document(self.class.parse_legal_document_from_frame(frame))
- self.legal_document_id = doc.id if doc.id
+ attach_legal_document(self.class.parse_legal_document_from_frame(frame))
save!(validate: false)
return dt
@@ -728,8 +726,7 @@ class Epp::Domain < Domain
generate_auth_info
self.registrar = pt.transfer_to
- doc = attach_legal_document(self.class.parse_legal_document_from_frame(frame))
- self.legal_document_id = doc.id if doc.id
+ attach_legal_document(self.class.parse_legal_document_from_frame(frame))
save!(validate: false)
end
@@ -750,8 +747,7 @@ class Epp::Domain < Domain
status: DomainTransfer::CLIENT_REJECTED
)
- doc = attach_legal_document(self.class.parse_legal_document_from_frame(frame))
- self.legal_document_id = doc.id if doc.id
+ attach_legal_document(self.class.parse_legal_document_from_frame(frame))
save!(validate: false)
end
From 185e1d5c93927e1686bc257dc5873ddab451c609 Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 10 Feb 2016 10:38:47 +0200
Subject: [PATCH 009/180] 110687814-update_function
---
app/models/epp/domain.rb | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 3f32ce6d5..62c6ee7ac 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -3,9 +3,11 @@ class Epp::Domain < Domain
include EppErrors
# TODO: remove this spagetti once data in production is correct.
- attr_accessor :is_renewal, :is_transfer
+ attr_accessor :is_renewal, :is_transfer, :current_user
before_validation :manage_permissions
+ before_update :write_update_values
+
def manage_permissions
return if is_admin # this bad hack for 109086524, refactor later
return true if is_transfer || is_renewal
@@ -14,6 +16,11 @@ class Epp::Domain < Domain
false
end
+ def write_update_values
+ self.updator_str = current_user.identity_code if current_user
+ self.updated_at = Time.zone.now
+ end
+
after_validation :validate_contacts
def validate_contacts
return true if is_renewal || is_transfer
@@ -488,6 +495,8 @@ class Epp::Domain < Domain
# at[:statuses] += at_add[:domain_statuses_attributes]
+ @current_user = current_user
+
if errors.empty? && verify &&
Setting.request_confrimation_on_registrant_change_enabled &&
frame.css('registrant').present? &&
From e2cb9e99c49166b1fa8366297434f4ef7bdacec8 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 10 Feb 2016 14:31:48 +0200
Subject: [PATCH 010/180] Story#105855968 - Shorter code on pricelist type
calculation
---
app/models/domain.rb | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 9da57e27a..9004661f7 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -549,13 +549,7 @@ class Domain < ActiveRecord::Base
p = period_i / 12 if unit == 'm'
p = period_i if unit == 'y'
- if p > 1
- p = "#{p}years"
- else
- p = "#{p}year"
- end
-
- Pricelist.pricelist_for(zone, operation, p)
+ Pricelist.pricelist_for(zone, operation, "#{p}year".pluralize(p))
end
### VALIDATIONS ###
From 6ebcaf69d08ae960933c1c6cabfd701131c475c6 Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 15 Feb 2016 17:52:30 +0200
Subject: [PATCH 011/180] 111864739-contact_and_domain_create
---
app/controllers/epp/contacts_controller.rb | 2 ++
app/controllers/epp/domains_controller.rb | 2 ++
app/models/contact.rb | 16 +++++++--
app/models/epp/contact.rb | 41 +++++++++++++++++++---
app/models/epp/domain.rb | 23 ++++++------
5 files changed, 67 insertions(+), 17 deletions(-)
diff --git a/app/controllers/epp/contacts_controller.rb b/app/controllers/epp/contacts_controller.rb
index 5b0a39bbf..14c6de7b6 100644
--- a/app/controllers/epp/contacts_controller.rb
+++ b/app/controllers/epp/contacts_controller.rb
@@ -19,6 +19,8 @@ class Epp::ContactsController < EppController
authorize! :create, Epp::Contact
@contact = Epp::Contact.new(params[:parsed_frame], current_user.registrar)
+ @contact.add_legal_file_to_new(params[:parsed_frame])
+
if @contact.save
render_epp_response '/epp/contacts/create'
else
diff --git a/app/controllers/epp/domains_controller.rb b/app/controllers/epp/domains_controller.rb
index 91ddeb93d..fb3441580 100644
--- a/app/controllers/epp/domains_controller.rb
+++ b/app/controllers/epp/domains_controller.rb
@@ -30,6 +30,8 @@ class Epp::DomainsController < EppController
handle_errors and return unless balance_ok?('create') # loads pricelist in this method
ActiveRecord::Base.transaction do
+ @domain.add_legal_file_to_new(params[:parsed_frame])
+
if @domain.save # TODO: Maybe use validate: false here because we have already validated the domain?
current_user.registrar.debit!({
sum: @domain_pricelist.price.amount,
diff --git a/app/models/contact.rb b/app/models/contact.rb
index fdb114673..5ec9c0a46 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -12,6 +12,10 @@ class Contact < ActiveRecord::Base
# TODO: remove later
has_many :depricated_statuses, class_name: 'DepricatedContactStatus', dependent: :destroy
+ has_paper_trail class_name: "ContactVersion", meta: { children: :children_log }
+
+ attr_accessor :legal_document_id
+
accepts_nested_attributes_for :legal_documents
validates :name, :phone, :email, :ident, :ident_type,
@@ -497,8 +501,14 @@ class Contact < ActiveRecord::Base
]).present?
end
- def update_related_whois_records
- related_domain_descriptions.each{ |x, y| WhoisRecord.find_by(name: x).try(:save) }
- end
+ def update_related_whois_records
+ related_domain_descriptions.each{ |x, y| WhoisRecord.find_by(name: x).try(:save) }
+ end
+
+ def children_log
+ log = HashWithIndifferentAccess.new
+ log[:legal_documents]= [legal_document_id]
+ log
+ end
end
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index f4773f732..a3180a534 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -36,10 +36,7 @@ class Epp::Contact < Contact
at[:country_code] = f.css('postalInfo addr cc').text if f.css('postalInfo addr cc').present?
at[:auth_info] = f.css('authInfo pw').text if f.css('authInfo pw').present?
- legal_frame = f.css('legalDocument').first
- if legal_frame.present?
- at[:legal_documents_attributes] = legal_document_attrs(legal_frame)
- end
+
at.merge!(ident_attrs(f.css('ident').first)) if new_record
at
end
@@ -152,6 +149,12 @@ class Epp::Contact < Contact
legal_frame = frame.css('legalDocument').first
at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
+
+ if doc = attach_legal_document(parse_legal_document_from_frame(frame))
+ frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
+ self.legal_document_id = doc.id
+ end
+
self.deliver_emails = true # turn on email delivery for epp
@@ -213,4 +216,34 @@ class Epp::Contact < Contact
status_list
end
+
+ def attach_legal_document(legal_document_data)
+ return unless legal_document_data
+
+ legal_documents.create(
+ document_type: legal_document_data[:type],
+ body: legal_document_data[:body]
+ )
+ end
+
+ def add_legal_file_to_new frame
+ if doc = attach_legal_document(parse_legal_document_from_frame(frame))
+ raise ActiveRecord::Rollback if doc && doc.id.nil?
+
+ frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
+ self.legal_document_id = doc.id
+ end
+ end
+
+ def parse_legal_document_from_frame frame
+ ld = frame.css('legalDocument').first
+ return nil unless ld
+ return nil if ld.text.starts_with?(ENV['legal_documents_dir'])
+
+ {
+ body: ld.text,
+ type: ld['type']
+ }
+ end
+
end
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 6cda7712f..d0f83fd9f 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -194,9 +194,21 @@ class Epp::Domain < Domain
end
at[:dnskeys_attributes] = dnskeys_attrs(dnskey_frame, action)
- at[:legal_documents_attributes] = legal_document_from(frame)
+
at
end
+
+
+ # Adding legal doc to domain and
+ # if something goes wrong - raise Rollback error
+ def add_legal_file_to_new frame
+ if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
+ raise ActiveRecord::Rollback if doc && doc.id.nil?
+
+ frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
+ self.legal_document_id = doc.id
+ end
+ end
# rubocop: enable Metrics/PerceivedComplexity
# rubocop: enable Metrics/CyclomaticComplexity
# rubocop: enable Metrics/MethodLength
@@ -456,15 +468,6 @@ class Epp::Domain < Domain
status_list
end
- def legal_document_from(frame)
- ld = frame.css('legalDocument').first
- return [] unless ld
-
- [{
- body: ld.text,
- document_type: ld['type']
- }]
- end
# rubocop: disable Metrics/AbcSize
# rubocop: disable Metrics/CyclomaticComplexity
From e8bf3f7e647a91a67fa67b108942246f9e72494a Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 10 Feb 2016 14:31:48 +0200
Subject: [PATCH 012/180] Story#105855968 - Shorter code on pricelist type
calculation
---
app/models/domain.rb | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 3e0ff3e23..1b7121c1a 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -458,13 +458,7 @@ class Domain < ActiveRecord::Base
p = period_i / 12 if unit == 'm'
p = period_i if unit == 'y'
- if p > 1
- p = "#{p}years"
- else
- p = "#{p}year"
- end
-
- Pricelist.pricelist_for(zone, operation, p)
+ Pricelist.pricelist_for(zone, operation, "#{p}year".pluralize(p))
end
### VALIDATIONS ###
From e45915b9daed6e0dab2c3f2c98cd544c71949a60 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 25 Feb 2016 13:34:52 +0200
Subject: [PATCH 013/180] Story#105855968 - 1st scratch how to send monthly
invoices
---
app/models/counter.rb | 20 +++++++++++++++
app/models/directo.rb | 58 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+)
create mode 100644 app/models/counter.rb
diff --git a/app/models/counter.rb b/app/models/counter.rb
new file mode 100644
index 000000000..01bec95e6
--- /dev/null
+++ b/app/models/counter.rb
@@ -0,0 +1,20 @@
+class Counter
+ def initialize value = 0
+ @value = value
+ end
+ attr_accessor :value
+ def method_missing *args, &blk
+ @value.send(*args, &blk)
+ end
+ def to_s
+ @value.to_s
+ end
+
+ # pre-increment ".+" when x not present
+ def next(x = 1)
+ @value += x
+ end
+ def prev(x = 1)
+ @value -= x
+ end
+end
\ No newline at end of file
diff --git a/app/models/directo.rb b/app/models/directo.rb
index 5a719d0a7..5cd480bf5 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -46,4 +46,62 @@ class Directo < ActiveRecord::Base
Rails.logger.info("[DIRECTO] Invoice #{res.attributes["docid"].value} was pushed and return is #{res.as_json.to_h.inspect}")
end
end
+
+
+ def self.send_monthly_invoices
+ product_ids = {"ee" => "01EE", "com.ee" => "02COM", "pri.ee" => "03PRI", "fie.ee"=>"04FIE", "med.ee" => "05MED"}
+ month = Time.now - 1.month
+ invoices_until = month.end_of_month
+ # pochemu registrar has_many :accounts
+
+ activity_scope = AccountActivity.where(activity_type: [CREATE, RENEW])
+ Registrar.joins(:account).find_each do |registrar|
+ next unless registrar.cash_account
+ counter = Counter.new
+ builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml|
+ activity_scope.where(account_id: registrar.cash_account)
+
+ xml.invoices{
+ xml.invoice("Number"=>"13980",
+ "InvoiceDate"=>invoices_until.strftime("%Y-%m-%d"),
+ "PaymentTerm"=>"E",
+ "CustomerCode"=>registrar.directo_handle,
+ "Language"=>"",
+ "Currency"=>"EUR",
+ "SalesAgent"=>Setting.directo_sales_agent){
+ xml.line("RN" => counter.next, "RR"=>1, "ProductName"=> "Domeenide registreerimine - Juuli 2015")
+ activity_scope.where(account_id: registrar.account_ids).each do |activity|
+ xml.line("RN"=>counter.next, "RR"=>"2", "ProductID"=>"01EE", "Quantity"=>"1911", "Unit"=>"tk", "ProductName"=>".ee registreerimine: 1 aasta", "UnitPriceWoVAT"=>"9.00")
+ end
+ }
+ }
+ end
+
+ end
+ end
end
+
+=begin
+RN - incremental
+RR - grouping of rows - is same for rows where sum is devided to more than one year eg. 7€ - 7€ - 7€ for 3 year 21€ domains
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+=end
From 577762a2bc25b534e8a06c5ff61507d94ec8fa41 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 25 Feb 2016 13:54:46 +0200
Subject: [PATCH 014/180] 110687814-migrations_and_values
---
app/controllers/epp/contacts_controller.rb | 2 +-
app/models/epp/contact.rb | 13 ++++++++++++-
app/models/epp/domain.rb | 2 +-
.../20160225113801_add_up_id_value_to_domain.rb | 5 +++++
.../20160225113812_add_up_id_value_to_contact.rb | 5 +++++
5 files changed, 24 insertions(+), 3 deletions(-)
create mode 100644 db/migrate/20160225113801_add_up_id_value_to_domain.rb
create mode 100644 db/migrate/20160225113812_add_up_id_value_to_contact.rb
diff --git a/app/controllers/epp/contacts_controller.rb b/app/controllers/epp/contacts_controller.rb
index 5b0a39bbf..22473bae7 100644
--- a/app/controllers/epp/contacts_controller.rb
+++ b/app/controllers/epp/contacts_controller.rb
@@ -29,7 +29,7 @@ class Epp::ContactsController < EppController
def update
authorize! :update, @contact, @password
- if @contact.update_attributes(params[:parsed_frame])
+ if @contact.update_attributes(params[:parsed_frame], current_user)
render_epp_response 'epp/contacts/update'
else
handle_errors(@contact)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index 54806b88d..7727666d2 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -1,16 +1,25 @@
class Epp::Contact < Contact
include EppErrors
+ attr_accessor :current_user
+
# disable STI, there is type column present
self.inheritance_column = :sti_disabled
before_validation :manage_permissions
+ before_update :write_update_values
+
def manage_permissions
return unless update_prohibited? || delete_prohibited?
add_epp_error('2304', nil, nil, I18n.t(:object_status_prohibits_operation))
false
end
+ def write_update_values
+ self.upid = current_user.identity_code if current_user
+ self.updated_at = Time.zone.now
+ end
+
class << self
# support legacy search
def find_by_epp_code(code)
@@ -142,7 +151,7 @@ class Epp::Contact < Contact
end
# rubocop:disable Metrics/AbcSize
- def update_attributes(frame)
+ def update_attributes(frame, current_user)
return super if frame.blank?
at = {}.with_indifferent_access
at.deep_merge!(self.class.attrs_from(frame.css('chg'), new_record: false))
@@ -177,6 +186,8 @@ class Epp::Contact < Contact
end
end
+ @current_user = current_user
+
super(at)
end
# rubocop:enable Metrics/AbcSize
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 62c6ee7ac..8769acc1e 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -17,7 +17,7 @@ class Epp::Domain < Domain
end
def write_update_values
- self.updator_str = current_user.identity_code if current_user
+ self.upid = current_user.identity_code if current_user
self.updated_at = Time.zone.now
end
diff --git a/db/migrate/20160225113801_add_up_id_value_to_domain.rb b/db/migrate/20160225113801_add_up_id_value_to_domain.rb
new file mode 100644
index 000000000..df3d70e6f
--- /dev/null
+++ b/db/migrate/20160225113801_add_up_id_value_to_domain.rb
@@ -0,0 +1,5 @@
+class AddUpIdValueToDomain < ActiveRecord::Migration
+ def change
+ add_column :domains, :upid, :string
+ end
+end
diff --git a/db/migrate/20160225113812_add_up_id_value_to_contact.rb b/db/migrate/20160225113812_add_up_id_value_to_contact.rb
new file mode 100644
index 000000000..927950bd2
--- /dev/null
+++ b/db/migrate/20160225113812_add_up_id_value_to_contact.rb
@@ -0,0 +1,5 @@
+class AddUpIdValueToContact < ActiveRecord::Migration
+ def change
+ add_column :contacts, :upid, :string
+ end
+end
From 7a659da6a3603e8eb7db45c8691e07d6f83cc44e Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 25 Feb 2016 14:20:19 +0200
Subject: [PATCH 015/180] Story#114471339 - change order when legal docs are
saved into DB
---
app/models/epp/contact.rb | 18 +++++++++++++-----
app/models/epp/domain.rb | 17 ++++++++++++-----
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index a3180a534..571cae45b 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -227,14 +227,22 @@ class Epp::Contact < Contact
end
def add_legal_file_to_new frame
- if doc = attach_legal_document(parse_legal_document_from_frame(frame))
- raise ActiveRecord::Rollback if doc && doc.id.nil?
+ legal_document_data = Epp::Contact.parse_legal_document_from_frame(frame)
+ return unless legal_document_data
- frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
- self.legal_document_id = doc.id
- end
+ doc = LegalDocument.create(
+ documentable_type: Contact,
+ document_type: legal_document_data[:type],
+ body: legal_document_data[:body]
+ )
+ raise ActiveRecord::Rollback if doc && doc.id.nil?
+ self.legal_documents = [doc]
+
+ frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
+ self.legal_document_id = doc.id
end
+
def parse_legal_document_from_frame frame
ld = frame.css('legalDocument').first
return nil unless ld
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index d0f83fd9f..1ee8a2d92 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -202,12 +202,19 @@ class Epp::Domain < Domain
# Adding legal doc to domain and
# if something goes wrong - raise Rollback error
def add_legal_file_to_new frame
- if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
- raise ActiveRecord::Rollback if doc && doc.id.nil?
+ legal_document_data = Epp::Domain.parse_legal_document_from_frame(frame)
+ return unless legal_document_data
- frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
- self.legal_document_id = doc.id
- end
+ doc = LegalDocument.create(
+ documentable_type: Domain,
+ document_type: legal_document_data[:type],
+ body: legal_document_data[:body]
+ )
+ raise ActiveRecord::Rollback if doc && doc.id.nil?
+ self.legal_documents = [doc]
+
+ frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
+ self.legal_document_id = doc.id
end
# rubocop: enable Metrics/PerceivedComplexity
# rubocop: enable Metrics/CyclomaticComplexity
From 30fe6bd1e66c58176aff046117c9dc89f278bd54 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 25 Feb 2016 17:01:41 +0200
Subject: [PATCH 016/180] Story#114471339 - move
parse_legal_document_from_frame to one braking point
---
app/models/epp/contact.rb | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index 571cae45b..e3b972394 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -150,7 +150,7 @@ class Epp::Contact < Contact
legal_frame = frame.css('legalDocument').first
at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
- if doc = attach_legal_document(parse_legal_document_from_frame(frame))
+ if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
self.legal_document_id = doc.id
end
@@ -227,7 +227,7 @@ class Epp::Contact < Contact
end
def add_legal_file_to_new frame
- legal_document_data = Epp::Contact.parse_legal_document_from_frame(frame)
+ legal_document_data = Epp::Domain.parse_legal_document_from_frame(frame)
return unless legal_document_data
doc = LegalDocument.create(
@@ -242,16 +242,4 @@ class Epp::Contact < Contact
self.legal_document_id = doc.id
end
-
- def parse_legal_document_from_frame frame
- ld = frame.css('legalDocument').first
- return nil unless ld
- return nil if ld.text.starts_with?(ENV['legal_documents_dir'])
-
- {
- body: ld.text,
- type: ld['type']
- }
- end
-
end
From 28fcf0eb4558dc40d763e0f8cd57ebb95b24356a Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 26 Feb 2016 13:58:38 +0200
Subject: [PATCH 017/180] 113430903-que_jobs_for_set_delete_candidate
---
app/jobs/domain_set_delete_candidate_job.rb | 8 ++++++++
app/models/domain_cron.rb | 7 +++----
2 files changed, 11 insertions(+), 4 deletions(-)
create mode 100644 app/jobs/domain_set_delete_candidate_job.rb
diff --git a/app/jobs/domain_set_delete_candidate_job.rb b/app/jobs/domain_set_delete_candidate_job.rb
new file mode 100644
index 000000000..7101c237c
--- /dev/null
+++ b/app/jobs/domain_set_delete_candidate_job.rb
@@ -0,0 +1,8 @@
+class DomainSetDeleteCandidateJob < Que::Job
+
+ def run(domain_id)
+ domain = Domain.find(domain_id)
+ domain.statuses << DomainStatus::DELETE_CANDIDATE
+ domain.save(validate: false)
+ end
+end
diff --git a/app/models/domain_cron.rb b/app/models/domain_cron.rb
index 74c09740e..90ab37044 100644
--- a/app/models/domain_cron.rb
+++ b/app/models/domain_cron.rb
@@ -74,12 +74,11 @@ class DomainCron
d.each do |domain|
next unless domain.delete_candidateable?
real += 1
- domain.statuses << DomainStatus::DELETE_CANDIDATE
- STDOUT << "#{Time.zone.now.utc} DomainCron.start_delete_period: ##{domain.id} (#{domain.name}) #{domain.changes}\n" unless Rails.env.test?
- domain.save(validate: false) and marked += 1
+ STDOUT << "#{Time.zone.now.utc} DomainCron.start_delete_period: ##{domain.id} (#{domain.name})\n" unless Rails.env.test?
+ DomainSetDeleteCandidateJob.enqueue(domain.id, run_at: rand(24*60).minutes.from_now) and marked += 1
end
ensure # the operator should see what was accomplished
- STDOUT << "#{Time.zone.now.utc} - Finished setting delete_candidate - #{marked} out of #{real} successfully set\n" unless Rails.env.test?
+ STDOUT << "#{Time.zone.now.utc} - Finished setting schedule for delete_candidate - #{marked} out of #{real} successfully added to Que schedule\n" unless Rails.env.test?
end
marked
end
From 7784a44f8de60e6518034b308392cd3ed02d2222 Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 26 Feb 2016 15:56:51 +0200
Subject: [PATCH 018/180] 110687814-migrations_code_change
---
app/models/epp/contact.rb | 9 ++-------
app/models/epp/domain.rb | 9 ++-------
db/migrate/20160225113801_add_up_id_value_to_domain.rb | 2 +-
db/migrate/20160225113812_add_up_id_value_to_contact.rb | 2 +-
db/migrate/20160226132045_add_up_date_value_to_domain.rb | 5 +++++
.../20160226132056_add_up_date_value_to_contact.rb | 5 +++++
6 files changed, 16 insertions(+), 16 deletions(-)
create mode 100644 db/migrate/20160226132045_add_up_date_value_to_domain.rb
create mode 100644 db/migrate/20160226132056_add_up_date_value_to_contact.rb
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index 7727666d2..303113f02 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -7,7 +7,6 @@ class Epp::Contact < Contact
self.inheritance_column = :sti_disabled
before_validation :manage_permissions
- before_update :write_update_values
def manage_permissions
return unless update_prohibited? || delete_prohibited?
@@ -15,11 +14,6 @@ class Epp::Contact < Contact
false
end
- def write_update_values
- self.upid = current_user.identity_code if current_user
- self.updated_at = Time.zone.now
- end
-
class << self
# support legacy search
def find_by_epp_code(code)
@@ -186,7 +180,8 @@ class Epp::Contact < Contact
end
end
- @current_user = current_user
+ self.upid = current_user.id if current_user
+ self.update = Time.zone.now
super(at)
end
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 8769acc1e..aca475cf5 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -6,7 +6,6 @@ class Epp::Domain < Domain
attr_accessor :is_renewal, :is_transfer, :current_user
before_validation :manage_permissions
- before_update :write_update_values
def manage_permissions
return if is_admin # this bad hack for 109086524, refactor later
@@ -16,11 +15,6 @@ class Epp::Domain < Domain
false
end
- def write_update_values
- self.upid = current_user.identity_code if current_user
- self.updated_at = Time.zone.now
- end
-
after_validation :validate_contacts
def validate_contacts
return true if is_renewal || is_transfer
@@ -495,7 +489,8 @@ class Epp::Domain < Domain
# at[:statuses] += at_add[:domain_statuses_attributes]
- @current_user = current_user
+ self.upid = current_user.id if current_user
+ self.update = Time.zone.now
if errors.empty? && verify &&
Setting.request_confrimation_on_registrant_change_enabled &&
diff --git a/db/migrate/20160225113801_add_up_id_value_to_domain.rb b/db/migrate/20160225113801_add_up_id_value_to_domain.rb
index df3d70e6f..9879c8555 100644
--- a/db/migrate/20160225113801_add_up_id_value_to_domain.rb
+++ b/db/migrate/20160225113801_add_up_id_value_to_domain.rb
@@ -1,5 +1,5 @@
class AddUpIdValueToDomain < ActiveRecord::Migration
def change
- add_column :domains, :upid, :string
+ add_column :domains, :upid, :integer
end
end
diff --git a/db/migrate/20160225113812_add_up_id_value_to_contact.rb b/db/migrate/20160225113812_add_up_id_value_to_contact.rb
index 927950bd2..b78478e75 100644
--- a/db/migrate/20160225113812_add_up_id_value_to_contact.rb
+++ b/db/migrate/20160225113812_add_up_id_value_to_contact.rb
@@ -1,5 +1,5 @@
class AddUpIdValueToContact < ActiveRecord::Migration
def change
- add_column :contacts, :upid, :string
+ add_column :contacts, :upid, :integer
end
end
diff --git a/db/migrate/20160226132045_add_up_date_value_to_domain.rb b/db/migrate/20160226132045_add_up_date_value_to_domain.rb
new file mode 100644
index 000000000..c3568e6dd
--- /dev/null
+++ b/db/migrate/20160226132045_add_up_date_value_to_domain.rb
@@ -0,0 +1,5 @@
+class AddUpDateValueToDomain < ActiveRecord::Migration
+ def change
+ add_column :domains, :update, :timestamp
+ end
+end
diff --git a/db/migrate/20160226132056_add_up_date_value_to_contact.rb b/db/migrate/20160226132056_add_up_date_value_to_contact.rb
new file mode 100644
index 000000000..99f90d662
--- /dev/null
+++ b/db/migrate/20160226132056_add_up_date_value_to_contact.rb
@@ -0,0 +1,5 @@
+class AddUpDateValueToContact < ActiveRecord::Migration
+ def change
+ add_column :contacts, :update, :timestamp
+ end
+end
From 003bfed538552ab64903a0d7e8423064dc200a11 Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 26 Feb 2016 16:52:08 +0200
Subject: [PATCH 019/180] 110687814-attr_accessor_removed
---
app/models/epp/contact.rb | 2 --
app/models/epp/domain.rb | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index 303113f02..725d8d2a2 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -1,8 +1,6 @@
class Epp::Contact < Contact
include EppErrors
- attr_accessor :current_user
-
# disable STI, there is type column present
self.inheritance_column = :sti_disabled
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index aca475cf5..104abeb57 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -3,7 +3,7 @@ class Epp::Domain < Domain
include EppErrors
# TODO: remove this spagetti once data in production is correct.
- attr_accessor :is_renewal, :is_transfer, :current_user
+ attr_accessor :is_renewal, :is_transfer
before_validation :manage_permissions
From 57bd1c77b6e9ae9fcdcb5cc9c1d9006fffd3c51b Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 2 Mar 2016 17:44:25 +0200
Subject: [PATCH 020/180] 113430903-new_job_added
---
app/jobs/domain_delete_job.rb | 16 ++++++++++++++++
app/jobs/domain_set_delete_candidate_job.rb | 1 +
app/models/domain_cron.rb | 15 +++------------
3 files changed, 20 insertions(+), 12 deletions(-)
create mode 100644 app/jobs/domain_delete_job.rb
diff --git a/app/jobs/domain_delete_job.rb b/app/jobs/domain_delete_job.rb
new file mode 100644
index 000000000..5336dc466
--- /dev/null
+++ b/app/jobs/domain_delete_job.rb
@@ -0,0 +1,16 @@
+class DomainDeleteJob < Que::Job
+
+ def run(domain_id)
+ domain = Domain.find(domain_id)
+
+ WhoisRecord.where(domain_id: domain.id).destroy_all
+
+ domain.destroy
+ bye_bye = domain.versions.last
+ domain.registrar.messages.create!(
+ body: "#{I18n.t(:domain_deleted)}: #{domain.name}",
+ attached_obj_id: bye_bye.id,
+ attached_obj_type: bye_bye.class.to_s
+ )
+ end
+end
diff --git a/app/jobs/domain_set_delete_candidate_job.rb b/app/jobs/domain_set_delete_candidate_job.rb
index 7101c237c..cfa55cf6e 100644
--- a/app/jobs/domain_set_delete_candidate_job.rb
+++ b/app/jobs/domain_set_delete_candidate_job.rb
@@ -4,5 +4,6 @@ class DomainSetDeleteCandidateJob < Que::Job
domain = Domain.find(domain_id)
domain.statuses << DomainStatus::DELETE_CANDIDATE
domain.save(validate: false)
+ DomainDeleteJob.enqueue(domain.id, run_at: rand(24*60).minutes.from_now)
end
end
diff --git a/app/models/domain_cron.rb b/app/models/domain_cron.rb
index 90ab37044..5fd4331f8 100644
--- a/app/models/domain_cron.rb
+++ b/app/models/domain_cron.rb
@@ -87,22 +87,13 @@ class DomainCron
STDOUT << "#{Time.zone.now.utc} - Destroying domains\n" unless Rails.env.test?
c = 0
- Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x|
- WhoisRecord.where(domain_id: x.id).destroy_all
- destroy_with_message x
- STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by deleteCandidate ##{x.id} (#{x.name})\n" unless Rails.env.test?
-
- c += 1
- end
-
Domain.where('force_delete_at <= ?', Time.zone.now).each do |x|
- WhoisRecord.where(domain_id: x.id).destroy_all
- destroy_with_message x
- STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
+ DomainDeleteJob.enqueue(x.id, run_at: rand(24*60).minutes.from_now)
+ STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: job added by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
c += 1
end
- STDOUT << "#{Time.zone.now.utc} - Successfully destroyed #{c} domains\n" unless Rails.env.test?
+ STDOUT << "#{Time.zone.now.utc} - Job destroy added for #{c} domains\n" unless Rails.env.test?
end
# rubocop: enable Metrics/AbcSize
From 5cc3e0d1dee35b23c7a3d05acf125341ec86dd04 Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 2 Mar 2016 18:34:56 +0200
Subject: [PATCH 021/180] 110687814-name_fix
---
db/migrate/20160226132045_add_up_date_value_to_domain.rb | 2 +-
db/migrate/20160226132056_add_up_date_value_to_contact.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/db/migrate/20160226132045_add_up_date_value_to_domain.rb b/db/migrate/20160226132045_add_up_date_value_to_domain.rb
index c3568e6dd..5fdc3d196 100644
--- a/db/migrate/20160226132045_add_up_date_value_to_domain.rb
+++ b/db/migrate/20160226132045_add_up_date_value_to_domain.rb
@@ -1,5 +1,5 @@
class AddUpDateValueToDomain < ActiveRecord::Migration
def change
- add_column :domains, :update, :timestamp
+ add_column :domains, :up_date, :timestamp
end
end
diff --git a/db/migrate/20160226132056_add_up_date_value_to_contact.rb b/db/migrate/20160226132056_add_up_date_value_to_contact.rb
index 99f90d662..f7ba92313 100644
--- a/db/migrate/20160226132056_add_up_date_value_to_contact.rb
+++ b/db/migrate/20160226132056_add_up_date_value_to_contact.rb
@@ -1,5 +1,5 @@
class AddUpDateValueToContact < ActiveRecord::Migration
def change
- add_column :contacts, :update, :timestamp
+ add_column :contacts, :up_date, :timestamp
end
end
From 9926a7e54c8e6da4443f1e4ea66fc0c27f71177d Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 2 Mar 2016 18:46:08 +0200
Subject: [PATCH 022/180] 110687814-variable_changes
---
app/models/epp/contact.rb | 2 +-
app/models/epp/domain.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index 725d8d2a2..6a3540888 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -179,7 +179,7 @@ class Epp::Contact < Contact
end
self.upid = current_user.id if current_user
- self.update = Time.zone.now
+ self.up_date = Time.zone.now
super(at)
end
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 104abeb57..b92a33e5a 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -490,7 +490,7 @@ class Epp::Domain < Domain
# at[:statuses] += at_add[:domain_statuses_attributes]
self.upid = current_user.id if current_user
- self.update = Time.zone.now
+ self.up_date = Time.zone.now
if errors.empty? && verify &&
Setting.request_confrimation_on_registrant_change_enabled &&
From e954c212c71f09c4fc685735ec235ff6a1f30b39 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 3 Mar 2016 15:52:42 +0200
Subject: [PATCH 023/180] Story#105855968 - Prepare xml for Directo
---
Gemfile | 1 +
Gemfile.lock | 10 +++
app/models/counter.rb | 4 ++
app/models/directo.rb | 89 +++++++++++++++++++------
app/models/domain.rb | 1 +
app/models/pricelist.rb | 10 +++
config/initializers/initial_settings.rb | 2 +-
7 files changed, 96 insertions(+), 21 deletions(-)
diff --git a/Gemfile b/Gemfile
index d29fa223b..d0218726e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -9,6 +9,7 @@ source 'https://rubygems.org'
# core
gem 'rails', '4.2.4' # when update, all initializers eis_custom files needs check/update
+gem 'rails-i18n', github: 'svenfuchs/rails-i18n', branch: 'rails-4-x'
gem 'iso8601', '0.8.6' # for dates and times
gem 'hashie-forbidden_attributes', '0.1.1'
gem 'SyslogLogger', '2.0', require: 'syslog/logger'
diff --git a/Gemfile.lock b/Gemfile.lock
index 45eb09943..c1119a9fa 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -45,6 +45,15 @@ GIT
bundler (~> 1.2)
thor (~> 0.18)
+GIT
+ remote: https://github.com/svenfuchs/rails-i18n.git
+ revision: 4913b54a5d7026066ceb12a4523476a1411e86bb
+ branch: rails-4-x
+ specs:
+ rails-i18n (4.0.8)
+ i18n (~> 0.7)
+ railties (~> 4.0)
+
GEM
remote: https://rubygems.org/
specs:
@@ -626,6 +635,7 @@ DEPENDENCIES
que_mailer!
railroady (= 1.3.0)
rails (= 4.2.4)
+ rails-i18n!
rails-settings-cached (= 0.4.1)
rake
ransack (= 1.5.1)
diff --git a/app/models/counter.rb b/app/models/counter.rb
index 01bec95e6..7d1c2b926 100644
--- a/app/models/counter.rb
+++ b/app/models/counter.rb
@@ -10,6 +10,10 @@ class Counter
@value.to_s
end
+ def now
+ @value
+ end
+
# pre-increment ".+" when x not present
def next(x = 1)
@value += x
diff --git a/app/models/directo.rb b/app/models/directo.rb
index 5cd480bf5..efd508e41 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -1,4 +1,5 @@
class Directo < ActiveRecord::Base
+ DOMAIN_TO_PRODUCT = {"ee" => "01EE", "com.ee" => "02COM", "pri.ee" => "03PRI", "fie.ee"=>"04FIE", "med.ee" => "05MED"}.freeze
belongs_to :item, polymorphic: true
def self.send_receipts
@@ -49,36 +50,84 @@ class Directo < ActiveRecord::Base
def self.send_monthly_invoices
- product_ids = {"ee" => "01EE", "com.ee" => "02COM", "pri.ee" => "03PRI", "fie.ee"=>"04FIE", "med.ee" => "05MED"}
+ I18n.locale = :et
month = Time.now - 1.month
invoices_until = month.end_of_month
- # pochemu registrar has_many :accounts
+ date_format = "%Y-%m-%d"
- activity_scope = AccountActivity.where(activity_type: [CREATE, RENEW])
- Registrar.joins(:account).find_each do |registrar|
+ Registrar.find_each do |registrar|
next unless registrar.cash_account
- counter = Counter.new
- builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml|
- activity_scope.where(account_id: registrar.cash_account)
+ counter = Counter.new(1)
+ items = {}
+ registrar_activities = AccountActivity.where(account_id: registrar.account_ids).where("created_at BETWEEN ? AND ?",month.beginning_of_month, month.end_of_month)
- xml.invoices{
- xml.invoice("Number"=>"13980",
- "InvoiceDate"=>invoices_until.strftime("%Y-%m-%d"),
- "PaymentTerm"=>"E",
- "CustomerCode"=>registrar.directo_handle,
- "Language"=>"",
- "Currency"=>"EUR",
- "SalesAgent"=>Setting.directo_sales_agent){
- xml.line("RN" => counter.next, "RR"=>1, "ProductName"=> "Domeenide registreerimine - Juuli 2015")
- activity_scope.where(account_id: registrar.account_ids).each do |activity|
- xml.line("RN"=>counter.next, "RR"=>"2", "ProductID"=>"01EE", "Quantity"=>"1911", "Unit"=>"tk", "ProductName"=>".ee registreerimine: 1 aasta", "UnitPriceWoVAT"=>"9.00")
- end
+ # adding domains items
+ registrar_activities.where(activity_type: [AccountActivity::CREATE, AccountActivity::RENEW]).each do |activity|
+ pricelist = load_activity_pricelist(activity)
+ next unless pricelist
+
+ pricelist.years_amount.times do |i|
+ year = i+1
+ hash = {
+ "ProductID" => DOMAIN_TO_PRODUCT[pricelist.category],
+ "Unit" => "tk",
+ "ProductName" => ".#{pricelist.category} registreerimine: #{pricelist.years_amount} aasta",
+ "UnitPriceWoVAT" => pricelist.price_decimal/pricelist.years_amount
}
- }
+ hash["StartDate"] = (activity.created_at + year.year).strftime(date_format) if year > 1
+ hash["EndDate"] = (activity.created_at + year.year + 1).strftime(date_format) if year > 1
+
+ if items.has_key?(hash)
+ items[hash]["Quantity"] += 1
+ else
+ items[hash] = {"RN"=>counter.next, "RR" => counter.now - i, "Quantity"=> 1}
+ end
+ end
+ end
+
+ #adding prepaiments
+ registrar_activities.where(activity_type: [AccountActivity::ADD_CREDIT]).each do |activity|
+ hash = {"ProductID" => Setting.directo_receipt_product_name, "Unit" => "tk", "ProductName" => "Domeenide ettemaks", "UnitPriceWoVAT"=>activity.sum}
+ items[hash] = {"RN"=>counter.next, "RR" => counter.now, "Quantity"=> -1}
+ end
+
+ # generating XML
+ if items.any?
+ builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml|
+ xml.invoices{
+ xml.invoice("Number" =>"13980",
+ "InvoiceDate" =>invoices_until.strftime(date_format),
+ "PaymentTerm" =>"E",
+ "CustomerCode"=>registrar.directo_handle,
+ "Language" =>"",
+ "Currency" =>registrar_activities.first.currency,
+ "SalesAgent" =>Setting.directo_sales_agent){
+ xml.line("RN" => 1, "RR"=>1, "ProductName"=> "Domeenide registreerimine - #{I18n.l(invoices_until, format: "%B %Y").titleize}")
+ items.each do |line, val|
+ xml.line(val.merge(line))
+ end
+ }
+ }
+ end
+ puts builder.to_xml
end
end
end
+
+ def self.load_activity_pricelist activity
+ @pricelists ||= {}
+ return @pricelists[activity.log_pricelist_id] if @pricelists.has_key?(activity.log_pricelist_id)
+
+ pricelist = Pricelist.find_by(id: activity.log_pricelist_id) || PricelistVersion.find_by(item_id: activity.log_pricelist_id).try(:reify)
+ unless pricelist
+ @pricelists[activity.log_pricelist_id] = nil
+ Rails.logger.info("[DIRECTO] AccountActivity #{activity.id} cannot be sent as pricelist wasn't found #{activity.log_pricelist_id}")
+ return
+ end
+
+ @pricelists[activity.log_pricelist_id] = pricelist.version_at(activity.created_at) || pricelist
+ end
end
=begin
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 1b7121c1a..1beea0840 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -452,6 +452,7 @@ class Domain < ActiveRecord::Base
period_i ||= period
unit ||= period_unit
+ # TODO: test if name.scan(/\.(.+)\z/).first.first is faster
zone = name.split('.').drop(1).join('.')
p = period_i / 365 if unit == 'd'
diff --git a/app/models/pricelist.rb b/app/models/pricelist.rb
index 17420dfa1..d38e4290d 100644
--- a/app/models/pricelist.rb
+++ b/app/models/pricelist.rb
@@ -8,6 +8,8 @@ class Pricelist < ActiveRecord::Base
)
}
+ scope :valid_at, ->(time){ where("valid_from IS NULL OR valid_from <= ?", time).where("valid_to IS NULL OR valid_to >= ?", time) }
+
monetize :price_cents
validates :price_cents, :price_currency, :price,
@@ -27,6 +29,14 @@ class Pricelist < ActiveRecord::Base
"#{operation_category} #{category}"
end
+ def years_amount
+ duration.to_i
+ end
+
+ def price_decimal
+ price_cents / BigDecimal.new('100')
+ end
+
class << self
def pricelist_for(zone, operation, period)
lists = valid.where(category: zone, operation_category: operation, duration: period)
diff --git a/config/initializers/initial_settings.rb b/config/initializers/initial_settings.rb
index 1b25ddeb3..6590d2922 100644
--- a/config/initializers/initial_settings.rb
+++ b/config/initializers/initial_settings.rb
@@ -5,7 +5,7 @@ rescue ActiveRecord::NoDatabaseError => e
Rails.logger.info "Init settings didn't find database: #{e}"
end
-if con.present? && con.table_exists?('settings')
+if false && con.present? && con.table_exists?('settings')
Setting.save_default(:admin_contacts_min_count, 1)
Setting.save_default(:admin_contacts_max_count, 10)
Setting.save_default(:tech_contacts_min_count, 1)
From 519c8908ee101862557361c7da169434ce8bc4c3 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 3 Mar 2016 20:59:28 +0200
Subject: [PATCH 024/180] 113430903-precision_for_minutes
---
app/jobs/domain_set_delete_candidate_job.rb | 2 +-
app/models/domain_cron.rb | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/jobs/domain_set_delete_candidate_job.rb b/app/jobs/domain_set_delete_candidate_job.rb
index cfa55cf6e..ffdf54277 100644
--- a/app/jobs/domain_set_delete_candidate_job.rb
+++ b/app/jobs/domain_set_delete_candidate_job.rb
@@ -4,6 +4,6 @@ class DomainSetDeleteCandidateJob < Que::Job
domain = Domain.find(domain_id)
domain.statuses << DomainStatus::DELETE_CANDIDATE
domain.save(validate: false)
- DomainDeleteJob.enqueue(domain.id, run_at: rand(24*60).minutes.from_now)
+ DomainDeleteJob.enqueue(domain.id, run_at: rand(((24*60) - (DateTime.now.hour * 60))).minutes.from_now)
end
end
diff --git a/app/models/domain_cron.rb b/app/models/domain_cron.rb
index 5fd4331f8..d4e26f10a 100644
--- a/app/models/domain_cron.rb
+++ b/app/models/domain_cron.rb
@@ -75,7 +75,7 @@ class DomainCron
next unless domain.delete_candidateable?
real += 1
STDOUT << "#{Time.zone.now.utc} DomainCron.start_delete_period: ##{domain.id} (#{domain.name})\n" unless Rails.env.test?
- DomainSetDeleteCandidateJob.enqueue(domain.id, run_at: rand(24*60).minutes.from_now) and marked += 1
+ DomainSetDeleteCandidateJob.enqueue(domain.id, run_at: rand(((24*60) - (DateTime.now.hour * 60))).minutes.from_now) and marked += 1
end
ensure # the operator should see what was accomplished
STDOUT << "#{Time.zone.now.utc} - Finished setting schedule for delete_candidate - #{marked} out of #{real} successfully added to Que schedule\n" unless Rails.env.test?
@@ -88,7 +88,7 @@ class DomainCron
c = 0
Domain.where('force_delete_at <= ?', Time.zone.now).each do |x|
- DomainDeleteJob.enqueue(x.id, run_at: rand(24*60).minutes.from_now)
+ DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60))).minutes.from_now)
STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: job added by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
c += 1
end
From aa1e08942b48c785d7cdb8313be3d2480b485afd Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 4 Mar 2016 12:47:39 +0200
Subject: [PATCH 025/180] 113430903-minutes_added_for_condition
---
app/jobs/domain_set_delete_candidate_job.rb | 2 +-
app/models/domain_cron.rb | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/jobs/domain_set_delete_candidate_job.rb b/app/jobs/domain_set_delete_candidate_job.rb
index ffdf54277..cc6f3f255 100644
--- a/app/jobs/domain_set_delete_candidate_job.rb
+++ b/app/jobs/domain_set_delete_candidate_job.rb
@@ -4,6 +4,6 @@ class DomainSetDeleteCandidateJob < Que::Job
domain = Domain.find(domain_id)
domain.statuses << DomainStatus::DELETE_CANDIDATE
domain.save(validate: false)
- DomainDeleteJob.enqueue(domain.id, run_at: rand(((24*60) - (DateTime.now.hour * 60))).minutes.from_now)
+ DomainDeleteJob.enqueue(domain.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
end
end
diff --git a/app/models/domain_cron.rb b/app/models/domain_cron.rb
index d4e26f10a..24c0aac74 100644
--- a/app/models/domain_cron.rb
+++ b/app/models/domain_cron.rb
@@ -75,7 +75,7 @@ class DomainCron
next unless domain.delete_candidateable?
real += 1
STDOUT << "#{Time.zone.now.utc} DomainCron.start_delete_period: ##{domain.id} (#{domain.name})\n" unless Rails.env.test?
- DomainSetDeleteCandidateJob.enqueue(domain.id, run_at: rand(((24*60) - (DateTime.now.hour * 60))).minutes.from_now) and marked += 1
+ DomainSetDeleteCandidateJob.enqueue(domain.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now) and marked += 1
end
ensure # the operator should see what was accomplished
STDOUT << "#{Time.zone.now.utc} - Finished setting schedule for delete_candidate - #{marked} out of #{real} successfully added to Que schedule\n" unless Rails.env.test?
@@ -88,7 +88,7 @@ class DomainCron
c = 0
Domain.where('force_delete_at <= ?', Time.zone.now).each do |x|
- DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60))).minutes.from_now)
+ DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: job added by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
c += 1
end
From 20c15e41b0cbc4686e00109c72a64a17350ae1b9 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 4 Mar 2016 14:17:04 +0200
Subject: [PATCH 026/180] Story#105855968 - set directo min and max default
settings
---
app/models/directo.rb | 24 ------------------------
config/initializers/initial_settings.rb | 2 ++
2 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/app/models/directo.rb b/app/models/directo.rb
index efd508e41..a181dde33 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -130,27 +130,3 @@ class Directo < ActiveRecord::Base
end
end
-=begin
-RN - incremental
-RR - grouping of rows - is same for rows where sum is devided to more than one year eg. 7€ - 7€ - 7€ for 3 year 21€ domains
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-=end
diff --git a/config/initializers/initial_settings.rb b/config/initializers/initial_settings.rb
index 6590d2922..d652fd8fa 100644
--- a/config/initializers/initial_settings.rb
+++ b/config/initializers/initial_settings.rb
@@ -30,6 +30,8 @@ if false && con.present? && con.table_exists?('settings')
Setting.save_default(:invoice_number_min, 131050)
Setting.save_default(:invoice_number_max, 149999)
+ Setting.save_default(:directo_monthly_number_min, 309901)
+ Setting.save_default(:directo_monthly_number_max, 309999)
Setting.save_default(:days_to_keep_invoices_active, 30)
Setting.save_default(:days_to_keep_overdue_invoices_active, 30)
Setting.save_default(:minimum_deposit, 0.0)
From ef55560d0ef0c050acb0c6d6c233a4900dd48ceb Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 4 Mar 2016 16:15:30 +0200
Subject: [PATCH 027/180] Story#105855968 - send invoices to directo
---
app/models/bank_transaction.rb | 1 -
app/models/directo.rb | 40 +-
app/views/admin/settings/index.haml | 3 +
config/initializers/initial_settings.rb | 7 +-
...304125933_add_invoice_number_to_directo.rb | 6 +
db/schema-read-only.rb | 59 ++-
db/structure.sql | 422 +++++++++---------
7 files changed, 309 insertions(+), 229 deletions(-)
create mode 100644 db/migrate/20160304125933_add_invoice_number_to_directo.rb
diff --git a/app/models/bank_transaction.rb b/app/models/bank_transaction.rb
index 1a34965bf..daf6abc29 100644
--- a/app/models/bank_transaction.rb
+++ b/app/models/bank_transaction.rb
@@ -2,7 +2,6 @@ class BankTransaction < ActiveRecord::Base
include Versions
belongs_to :bank_statement
has_one :account_activity
- has_many :directo_records, as: :item, class_name: 'Directo'# Deprecated
scope :unbinded, lambda {
where('id NOT IN (SELECT bank_transaction_id FROM account_activities where bank_transaction_id IS NOT NULL)')
diff --git a/app/models/directo.rb b/app/models/directo.rb
index 8ff0b9820..8ebf8fbf0 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -53,7 +53,7 @@ class Directo < ActiveRecord::Base
def self.dump_result_to_db mappers, xml
Nokogiri::XML(xml).css("Result").each do |res|
obj = mappers[res.attributes["docid"].value.to_i]
- obj.directo_records.create!(response: res.as_json.to_h)
+ obj.directo_records.create!(response: res.as_json.to_h, invoice_number: obj.number)
obj.update_columns(in_directo: true)
Rails.logger.info("[DIRECTO] Invoice #{res.attributes["docid"].value} was pushed and return is #{res.as_json.to_h.inspect}")
end
@@ -61,13 +61,24 @@ class Directo < ActiveRecord::Base
def self.send_monthly_invoices
- I18n.locale = :et
+ I18n.locale = :et
month = Time.now - 1.month
invoices_until = month.end_of_month
date_format = "%Y-%m-%d"
+ invoice_counter= Counter.new
+
+ min_directo = Setting.invoice_number_min.presence.try(:to_i)
+ max_directo = Setting.directo_monthly_number_max.presence.try(:to_i)
+ last_directo = [Setting.directo_monthly_number_last.presence.try(:to_i), min_directo].compact.max || 0
+ if max_directo && max_directo <= last_directo
+ raise "Directo counter is out of period"
+ end
Registrar.find_each do |registrar|
- next unless registrar.cash_account
+ unless registrar.cash_account
+ Rails.logger.info("[DIRECTO] Monthly invoice for registrar #{registrar.id} has been skipped as it doesn't has cash_account")
+ next
+ end
counter = Counter.new(1)
items = {}
registrar_activities = AccountActivity.where(account_id: registrar.account_ids).where("created_at BETWEEN ? AND ?",month.beginning_of_month, month.end_of_month)
@@ -75,7 +86,10 @@ class Directo < ActiveRecord::Base
# adding domains items
registrar_activities.where(activity_type: [AccountActivity::CREATE, AccountActivity::RENEW]).each do |activity|
pricelist = load_activity_pricelist(activity)
- next unless pricelist
+ unless pricelist
+ Rails.logger.error("[DIRECTO] Skipping activity #{activity.id} as pricelist not found")
+ next
+ end
pricelist.years_amount.times do |i|
year = i+1
@@ -104,9 +118,12 @@ class Directo < ActiveRecord::Base
# generating XML
if items.any?
+ directo_next = last_directo + 1
+ invoice_counter.next
+
builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml|
xml.invoices{
- xml.invoice("Number" =>"13980",
+ xml.invoice("Number" =>directo_next,
"InvoiceDate" =>invoices_until.strftime(date_format),
"PaymentTerm" =>"E",
"CustomerCode"=>registrar.directo_handle,
@@ -120,12 +137,23 @@ class Directo < ActiveRecord::Base
}
}
end
- puts builder.to_xml
+
+ data = builder.to_xml.gsub("\n",'')
+ response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false).to_s
+ Setting.directo_monthly_number_last = directo_next
+ Nokogiri::XML(response).css("Result").each do |res|
+ Directo.create!(response: res.as_json.to_h, invoice_number: directo_next)
+ Rails.logger.info("[DIRECTO] Invoice #{res.attributes["docid"].value} was pushed and return is #{res.as_json.to_h.inspect}")
+ end
+ else
+ Rails.logger.info("[DIRECTO] Registrar #{registrar.id} has nothing to be sent to Directo")
end
end
+ STDOUT << "#{Time.zone.now.utc} - Directo invoices sending finished. #{invoice_counter.now} are sent\n"
end
+
def self.load_activity_pricelist activity
@pricelists ||= {}
return @pricelists[activity.log_pricelist_id] if @pricelists.has_key?(activity.log_pricelist_id)
diff --git a/app/views/admin/settings/index.haml b/app/views/admin/settings/index.haml
index 863d197d0..6c7e3d74c 100644
--- a/app/views/admin/settings/index.haml
+++ b/app/views/admin/settings/index.haml
@@ -69,6 +69,9 @@
%tbody
= render 'setting_row', var: :invoice_number_min
= render 'setting_row', var: :invoice_number_max
+ = render 'setting_row', var: :directo_monthly_number_min
+ = render 'setting_row', var: :directo_monthly_number_max
+ = render 'setting_row', var: :directo_monthly_number_last
= render 'setting_row', var: :days_to_keep_invoices_active
= render 'setting_row', var: :days_to_keep_overdue_invoices_active
= render 'setting_row', var: :minimum_deposit
diff --git a/config/initializers/initial_settings.rb b/config/initializers/initial_settings.rb
index b31e7205d..b6a60c5e8 100644
--- a/config/initializers/initial_settings.rb
+++ b/config/initializers/initial_settings.rb
@@ -5,7 +5,7 @@ rescue ActiveRecord::NoDatabaseError => e
Rails.logger.info "Init settings didn't find database: #{e}"
end
-if false && con.present? && con.table_exists?('settings')
+if con.present? && con.table_exists?('settings')
Setting.save_default(:admin_contacts_min_count, 1)
Setting.save_default(:admin_contacts_max_count, 10)
Setting.save_default(:tech_contacts_min_count, 1)
@@ -32,8 +32,9 @@ if false && con.present? && con.table_exists?('settings')
Setting.save_default(:invoice_number_min, 131050)
Setting.save_default(:invoice_number_max, 149999)
- Setting.save_default(:directo_monthly_number_min, 309901)
- Setting.save_default(:directo_monthly_number_max, 309999)
+ Setting.save_default(:directo_monthly_number_min, 309901)
+ Setting.save_default(:directo_monthly_number_max, 309999)
+ Setting.save_default(:directo_monthly_number_last, 309901)
Setting.save_default(:days_to_keep_invoices_active, 30)
Setting.save_default(:days_to_keep_overdue_invoices_active, 30)
Setting.save_default(:minimum_deposit, 0.0)
diff --git a/db/migrate/20160304125933_add_invoice_number_to_directo.rb b/db/migrate/20160304125933_add_invoice_number_to_directo.rb
new file mode 100644
index 000000000..e639e8910
--- /dev/null
+++ b/db/migrate/20160304125933_add_invoice_number_to_directo.rb
@@ -0,0 +1,6 @@
+class AddInvoiceNumberToDirecto < ActiveRecord::Migration
+ def change
+ add_column :directos, :invoice_number, :string
+ execute "UPDATE directos d SET invoice_number=i.number FROM invoices i WHERE d.item_type='Invoice' AND d.item_id=i.id"
+ end
+end
diff --git a/db/schema-read-only.rb b/db/schema-read-only.rb
index 78722223a..2d410461c 100644
--- a/db/schema-read-only.rb
+++ b/db/schema-read-only.rb
@@ -11,11 +11,12 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160108135436) do
+ActiveRecord::Schema.define(version: 20160304125933) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
enable_extension "hstore"
+ enable_extension "btree_gist"
create_table "account_activities", force: :cascade do |t|
t.integer "account_id"
@@ -108,6 +109,7 @@ ActiveRecord::Schema.define(version: 20160108135436) do
t.datetime "updated_at"
t.string "creator_str"
t.string "updator_str"
+ t.boolean "in_directo", default: false
end
create_table "banklink_transactions", force: :cascade do |t|
@@ -144,6 +146,17 @@ ActiveRecord::Schema.define(version: 20160108135436) do
add_index "blocked_domains", ["name"], name: "index_blocked_domains_on_name", using: :btree
+ create_table "business_registry_caches", force: :cascade do |t|
+ t.string "ident"
+ t.string "ident_country_code"
+ t.datetime "retrieved_on"
+ t.string "associated_businesses", array: true
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ add_index "business_registry_caches", ["ident"], name: "index_business_registry_caches_on_ident", using: :btree
+
create_table "cached_nameservers", id: false, force: :cascade do |t|
t.string "hostname", limit: 255
t.string "ipv4", limit: 255
@@ -241,6 +254,17 @@ ActiveRecord::Schema.define(version: 20160108135436) do
t.datetime "created_at"
end
+ create_table "directos", force: :cascade do |t|
+ t.integer "item_id"
+ t.string "item_type"
+ t.json "response"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "invoice_number"
+ end
+
+ add_index "directos", ["item_type", "item_id"], name: "index_directos_on_item_type_and_item_id", using: :btree
+
create_table "dnskeys", force: :cascade do |t|
t.integer "domain_id"
t.integer "flags"
@@ -345,6 +369,7 @@ ActiveRecord::Schema.define(version: 20160108135436) do
add_index "domains", ["registrant_verification_asked_at"], name: "index_domains_on_registrant_verification_asked_at", using: :btree
add_index "domains", ["registrant_verification_token"], name: "index_domains_on_registrant_verification_token", using: :btree
add_index "domains", ["registrar_id"], name: "index_domains_on_registrar_id", using: :btree
+ add_index "domains", ["statuses"], name: "index_domains_on_statuses", using: :gin
create_table "epp_sessions", force: :cascade do |t|
t.string "session_id"
@@ -372,20 +397,20 @@ ActiveRecord::Schema.define(version: 20160108135436) do
add_index "invoice_items", ["invoice_id"], name: "index_invoice_items_on_invoice_id", using: :btree
create_table "invoices", force: :cascade do |t|
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
- t.string "invoice_type", null: false
- t.datetime "due_date", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "invoice_type", null: false
+ t.datetime "due_date", null: false
t.string "payment_term"
- t.string "currency", null: false
+ t.string "currency", null: false
t.string "description"
t.string "reference_no"
- t.decimal "vat_prc", precision: 10, scale: 2, null: false
+ t.decimal "vat_prc", precision: 10, scale: 2, null: false
t.datetime "paid_at"
t.integer "seller_id"
- t.string "seller_name", null: false
+ t.string "seller_name", null: false
t.string "seller_reg_no"
- t.string "seller_iban", null: false
+ t.string "seller_iban", null: false
t.string "seller_bank"
t.string "seller_swift"
t.string "seller_vat_no"
@@ -399,7 +424,7 @@ ActiveRecord::Schema.define(version: 20160108135436) do
t.string "seller_email"
t.string "seller_contact_name"
t.integer "buyer_id"
- t.string "buyer_name", null: false
+ t.string "buyer_name", null: false
t.string "buyer_reg_no"
t.string "buyer_country_code"
t.string "buyer_state"
@@ -414,6 +439,7 @@ ActiveRecord::Schema.define(version: 20160108135436) do
t.integer "number"
t.datetime "cancelled_at"
t.decimal "sum_cache", precision: 10, scale: 2
+ t.boolean "in_directo", default: false
end
add_index "invoices", ["buyer_id"], name: "index_invoices_on_buyer_id", using: :btree
@@ -592,7 +618,7 @@ ActiveRecord::Schema.define(version: 20160108135436) do
t.integer "item_id", null: false
t.string "event", null: false
t.string "whodunnit"
- t.json "object"
+ t.jsonb "object"
t.json "object_changes"
t.datetime "created_at"
t.string "session"
@@ -623,7 +649,7 @@ ActiveRecord::Schema.define(version: 20160108135436) do
t.integer "item_id", null: false
t.string "event", null: false
t.string "whodunnit"
- t.json "object"
+ t.jsonb "object"
t.json "object_changes"
t.datetime "created_at"
t.string "session"
@@ -683,7 +709,7 @@ ActiveRecord::Schema.define(version: 20160108135436) do
t.integer "item_id", null: false
t.string "event", null: false
t.string "whodunnit"
- t.json "object"
+ t.jsonb "object"
t.json "object_changes"
t.datetime "created_at"
t.text "nameserver_ids", default: [], array: true
@@ -761,7 +787,7 @@ ActiveRecord::Schema.define(version: 20160108135436) do
t.integer "item_id", null: false
t.string "event", null: false
t.string "whodunnit"
- t.json "object"
+ t.jsonb "object"
t.json "object_changes"
t.datetime "created_at"
t.string "session"
@@ -897,10 +923,10 @@ ActiveRecord::Schema.define(version: 20160108135436) do
create_table "nameservers", force: :cascade do |t|
t.string "hostname"
- t.string "ipv4", default: [], array: true
+ t.string "ipv4", array: true
t.datetime "created_at"
t.datetime "updated_at"
- t.string "ipv6", default: [], array: true
+ t.string "ipv6", array: true
t.integer "domain_id"
t.string "creator_str"
t.string "updator_str"
@@ -992,6 +1018,7 @@ ActiveRecord::Schema.define(version: 20160108135436) do
end
add_index "registrars", ["code"], name: "index_registrars_on_code", using: :btree
+ add_index "registrars", ["legacy_id"], name: "index_registrars_on_legacy_id", using: :btree
create_table "reserved_domains", force: :cascade do |t|
t.datetime "created_at"
diff --git a/db/structure.sql b/db/structure.sql
index cf413eff1..78228b693 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -23,6 +23,20 @@ CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
+--
+-- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: -
+--
+
+CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;
+
+
+--
+-- Name: EXTENSION btree_gist; Type: COMMENT; Schema: -; Owner: -
+--
+
+COMMENT ON EXTENSION btree_gist IS 'support for indexing common datatypes in GiST';
+
+
--
-- Name: hstore; Type: EXTENSION; Schema: -; Owner: -
--
@@ -39,140 +53,6 @@ COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs
SET search_path = public, pg_catalog;
---
--- Name: change_ident_country(); Type: FUNCTION; Schema: public; Owner: -
---
-
-CREATE FUNCTION change_ident_country() RETURNS boolean
- LANGUAGE plpgsql
- AS $_$
-DECLARE
- changed BOOLEAN;
- multiplier INT [];
- multiplier2 INT [];
- multiplier3 INT [];
- multiplier4 INT [];
- r RECORD;
- control TEXT;
- total INT;
- i INT;
- mod INT;
- counter INT;
-BEGIN
-
- multiplier := ARRAY [1, 2, 3, 4, 5, 6, 7, 8, 9, 1];
-
- multiplier2 := ARRAY [3, 4, 5, 6, 7, 8, 9, 1, 2, 3];
-
- multiplier3 := ARRAY [1, 2, 3, 4, 5, 6, 7];
-
- multiplier4 := ARRAY [3, 4, 5, 6, 7, 8, 9];
-
- FOR r IN SELECT id, ident FROM contacts WHERE ident_type = 'priv' /*AND ident_country_code IS NULL*/
- LOOP
- IF (length(r.ident) = 11 AND (r.ident ~ '^[0-9]+$') AND (substring(r.ident, 1, 1) = '3' OR substring(r.ident, 1, 1) = '4' OR substring(r.ident, 1, 1) = '5' OR substring(r.ident, 1, 1) = '6'))
- THEN
- total := 0;
- counter := 1;
- FOREACH i IN ARRAY multiplier
- LOOP
- total := (total + (i * to_number(substring(r.ident, counter, 1), '9')));
- counter := (counter + 1);
- END LOOP;
- mod := (total % 11);
- counter := 1;
-
- IF (mod >= 10)
- THEN
- total = 0;
- FOREACH i IN ARRAY multiplier2
- LOOP
- total := (total + (i * to_number(substring(r.ident, counter, 1), '9')));
- counter := (counter + 1);
- END LOOP;
- mod := (total % 11);
- END IF;
-
- IF (mod < 10 AND substring(r.ident, 11, 1) = to_char(mod, 'FM999MI'))
- THEN
- UPDATE contacts SET ident_country_code = 'EE' WHERE id = r.id;
- END IF;
- total = 0;
- END IF;
- END LOOP;
-
- FOR r IN SELECT id, ident FROM contacts WHERE ident_type = 'org'
- LOOP
- IF (length(r.ident) = 8 AND (r.ident ~ '^[0-9]+$') AND (substring(r.ident, 1, 1) = '1' OR substring(r.ident, 1, 1) = '8' OR substring(r.ident, 1, 1) = '9'))
- THEN
- total := 0;
- counter := 1;
- FOREACH i IN ARRAY multiplier3
- LOOP
- total := (total + (i * to_number(substring(r.ident, counter, 1), '9')));
- counter := (counter + 1);
- END LOOP;
- mod := total % 11;
- total = 0;
- counter := 1;
-
- IF (mod >= 10)
- THEN
- total = 0;
- FOREACH i IN ARRAY multiplier4
- LOOP
- total := (total + (i * to_number(substring(r.ident, counter, 1), '9')));
- counter := (counter + 1);
- END LOOP;
- mod := (total % 11);
- END IF;
-
- IF (mod < 10 AND (substring(r.ident, 8, 1) = to_char(mod, 'FM999MI')))
- THEN
- UPDATE contacts SET ident_country_code = 'EE' WHERE id = r.id;
- END IF;
- END IF;
- END LOOP;
-
-
-
- RETURN changed;
-END;
-$_$;
-
-
---
--- Name: change_ident_country(integer, text); Type: FUNCTION; Schema: public; Owner: -
---
-
-CREATE FUNCTION change_ident_country(id integer, type text) RETURNS boolean
- LANGUAGE plpgsql
- AS $_$
-DECLARE
- changed BOOLEAN;
- multiplier int[];
- multiplier2 int[];
- code int;
-BEGIN
-
- multiplier := ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 1];
-
- multiplier2 := ARRAY[3, 4, 5, 6, 7, 8, 9, 1, 2, 3];
-
- code := (SELECT code FROM contacts WHERE id = 208 AND ident_country_code = 'EE');
-
-
-
- UPDATE contacts
- SET ident = ''
- WHERE id = $1 and ident_type = $2 AND ident_country_code = 'EE'
- AND ident = '';
-
- RETURN changed;
-END;
-$_$;
-
-
--
-- Name: fill_ident_country(); Type: FUNCTION; Schema: public; Owner: -
--
@@ -222,12 +102,10 @@ CREATE FUNCTION fill_ident_country() RETURNS boolean
END LOOP;
mod := (total % 11);
END IF;
-
IF (mod = 10)
THEN
mod := 0;
END IF;
-
IF (substring(r.ident, 11, 1) = to_char(mod, 'FM999MI'))
THEN
UPDATE contacts SET ident_country_code = 'EE' WHERE id = r.id;
@@ -291,7 +169,7 @@ CREATE FUNCTION generate_zonefile(i_origin character varying) RETURNS text
ret text;
BEGIN
-- define filters
- include_filter = '%' || i_origin;
+ include_filter = '%.' || i_origin;
-- for %.%.%
IF i_origin ~ '\.' THEN
@@ -318,6 +196,10 @@ CREATE FUNCTION generate_zonefile(i_origin character varying) RETURNS text
ret = concat(tmp_var, chr(10), chr(10));
+ -- origin ns records
+ SELECT ns_records FROM zonefile_settings zf WHERE i_origin = zf.origin INTO tmp_var;
+ ret := concat(ret, '; Zone NS Records', chr(10), tmp_var, chr(10));
+
-- ns records
SELECT array_to_string(
array(
@@ -325,26 +207,17 @@ CREATE FUNCTION generate_zonefile(i_origin character varying) RETURNS text
FROM domains d
JOIN nameservers ns ON ns.domain_id = d.id
WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter
+ AND NOT ('{serverHold,clientHold}' && d.statuses)
ORDER BY d.name
),
chr(10)
) INTO tmp_var;
- ret := concat(ret, '; Zone NS Records', chr(10), tmp_var, chr(10), chr(10));
+ ret := concat(ret, tmp_var, chr(10), chr(10));
- -- a glue records for origin nameservers
- SELECT array_to_string(
- array(
- SELECT concat(ns.hostname, '. IN A ', ns.ipv4)
- FROM nameservers ns
- JOIN domains d ON d.id = ns.domain_id
- WHERE d.name = i_origin
- AND ns.hostname LIKE '%.' || d.name
- AND ns.ipv4 IS NOT NULL AND ns.ipv4 <> ''
- ), chr(10)
- ) INTO tmp_var;
-
- ret := concat(ret, '; Zone A Records', chr(10), tmp_var);
+ -- origin a glue records
+ SELECT a_records FROM zonefile_settings zf WHERE i_origin = zf.origin INTO tmp_var;
+ ret := concat(ret, '; Zone A Records', chr(10), tmp_var, chr(10));
-- a glue records for other nameservers
SELECT array_to_string(
@@ -355,44 +228,16 @@ CREATE FUNCTION generate_zonefile(i_origin character varying) RETURNS text
WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter
AND ns.hostname LIKE '%.' || d.name
AND d.name <> i_origin
- AND ns.ipv4 IS NOT NULL AND ns.ipv4 <> ''
- AND NOT EXISTS ( -- filter out glue records that already appeared in origin glue recrods
- SELECT 1 FROM nameservers nsi
- JOIN domains di ON nsi.domain_id = di.id
- WHERE di.name = i_origin
- AND nsi.hostname = ns.hostname
- )
+ AND ns.ipv4 IS NOT NULL AND ns.ipv4 <> '{}'
+ AND NOT ('{serverHold,clientHold}' && d.statuses)
), chr(10)
) INTO tmp_var;
- -- TODO This is a possible subtitition to the previous query, stress testing is needed to see which is faster
+ ret := concat(ret, tmp_var, chr(10), chr(10));
- -- SELECT ns.*
- -- FROM nameservers ns
- -- JOIN domains d ON d.id = ns.domain_id
- -- WHERE d.name LIKE '%ee' AND d.name NOT LIKE '%pri.ee'
- -- AND ns.hostname LIKE '%.' || d.name
- -- AND d.name <> 'ee'
- -- AND ns.ipv4 IS NOT NULL AND ns.ipv4 <> ''
- -- AND ns.hostname NOT IN (
- -- SELECT ns.hostname FROM domains d JOIN nameservers ns ON d.id = ns.domain_id WHERE d.name = 'ee'
- -- )
-
- ret := concat(ret, chr(10), tmp_var, chr(10), chr(10));
-
- -- aaaa glue records for origin nameservers
- SELECT array_to_string(
- array(
- SELECT concat(ns.hostname, '. IN AAAA ', ns.ipv6)
- FROM nameservers ns
- JOIN domains d ON d.id = ns.domain_id
- WHERE d.name = i_origin
- AND ns.hostname LIKE '%.' || d.name
- AND ns.ipv6 IS NOT NULL AND ns.ipv6 <> ''
- ), chr(10)
- ) INTO tmp_var;
-
- ret := concat(ret, '; Zone AAAA Records', chr(10), tmp_var);
+ -- origin aaaa glue records
+ SELECT a4_records FROM zonefile_settings zf WHERE i_origin = zf.origin INTO tmp_var;
+ ret := concat(ret, '; Zone AAAA Records', chr(10), tmp_var, chr(10));
-- aaaa glue records for other nameservers
SELECT array_to_string(
@@ -403,17 +248,12 @@ CREATE FUNCTION generate_zonefile(i_origin character varying) RETURNS text
WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter
AND ns.hostname LIKE '%.' || d.name
AND d.name <> i_origin
- AND ns.ipv6 IS NOT NULL AND ns.ipv6 <> ''
- AND NOT EXISTS ( -- filter out glue records that already appeared in origin glue recrods
- SELECT 1 FROM nameservers nsi
- JOIN domains di ON nsi.domain_id = di.id
- WHERE di.name = i_origin
- AND nsi.hostname = ns.hostname
- )
+ AND ns.ipv6 IS NOT NULL AND ns.ipv6 <> '{}'
+ AND NOT ('{serverHold,clientHold}' && d.statuses)
), chr(10)
) INTO tmp_var;
- ret := concat(ret, chr(10), tmp_var, chr(10), chr(10));
+ ret := concat(ret, tmp_var, chr(10), chr(10));
-- ds records
SELECT array_to_string(
@@ -424,7 +264,8 @@ CREATE FUNCTION generate_zonefile(i_origin character varying) RETURNS text
)
FROM domains d
JOIN dnskeys dk ON dk.domain_id = d.id
- WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter
+ WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter AND dk.flags = 257
+ AND NOT ('{serverHold,clientHold}' && d.statuses)
),
chr(10)
) INTO tmp_var;
@@ -652,7 +493,8 @@ CREATE TABLE bank_transactions (
created_at timestamp without time zone,
updated_at timestamp without time zone,
creator_str character varying,
- updator_str character varying
+ updator_str character varying,
+ in_directo boolean DEFAULT false
);
@@ -757,6 +599,40 @@ CREATE SEQUENCE blocked_domains_id_seq
ALTER SEQUENCE blocked_domains_id_seq OWNED BY blocked_domains.id;
+--
+-- Name: business_registry_caches; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE business_registry_caches (
+ id integer NOT NULL,
+ ident character varying,
+ ident_country_code character varying,
+ retrieved_on timestamp without time zone,
+ associated_businesses character varying[],
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL
+);
+
+
+--
+-- Name: business_registry_caches_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE business_registry_caches_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: business_registry_caches_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE business_registry_caches_id_seq OWNED BY business_registry_caches.id;
+
+
--
-- Name: cached_nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
@@ -1000,6 +876,40 @@ CREATE SEQUENCE depricated_versions_id_seq
ALTER SEQUENCE depricated_versions_id_seq OWNED BY depricated_versions.id;
+--
+-- Name: directos; Type: TABLE; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE TABLE directos (
+ id integer NOT NULL,
+ item_id integer,
+ item_type character varying,
+ response json,
+ created_at timestamp without time zone NOT NULL,
+ updated_at timestamp without time zone NOT NULL,
+ invoice_number character varying
+);
+
+
+--
+-- Name: directos_id_seq; Type: SEQUENCE; Schema: public; Owner: -
+--
+
+CREATE SEQUENCE directos_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+
+--
+-- Name: directos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
+--
+
+ALTER SEQUENCE directos_id_seq OWNED BY directos.id;
+
+
--
-- Name: dnskeys; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
@@ -1328,7 +1238,8 @@ CREATE TABLE invoices (
updator_str character varying,
number integer,
cancelled_at timestamp without time zone,
- sum_cache numeric(10,2)
+ sum_cache numeric(10,2),
+ in_directo boolean DEFAULT false
);
@@ -1771,7 +1682,7 @@ CREATE TABLE log_contacts (
item_id integer NOT NULL,
event character varying NOT NULL,
whodunnit character varying,
- object json,
+ object jsonb,
object_changes json,
created_at timestamp without time zone,
session character varying,
@@ -1846,7 +1757,7 @@ CREATE TABLE log_dnskeys (
item_id integer NOT NULL,
event character varying NOT NULL,
whodunnit character varying,
- object json,
+ object jsonb,
object_changes json,
created_at timestamp without time zone,
session character varying,
@@ -1994,7 +1905,7 @@ CREATE TABLE log_domains (
item_id integer NOT NULL,
event character varying NOT NULL,
whodunnit character varying,
- object json,
+ object jsonb,
object_changes json,
created_at timestamp without time zone,
nameserver_ids text[] DEFAULT '{}'::text[],
@@ -2182,7 +2093,7 @@ CREATE TABLE log_nameservers (
item_id integer NOT NULL,
event character varying NOT NULL,
whodunnit character varying,
- object json,
+ object jsonb,
object_changes json,
created_at timestamp without time zone,
session character varying,
@@ -2548,10 +2459,10 @@ ALTER SEQUENCE messages_id_seq OWNED BY messages.id;
CREATE TABLE nameservers (
id integer NOT NULL,
hostname character varying,
- ipv4 character varying[] DEFAULT '{}'::character varying[],
+ ipv4 character varying[],
created_at timestamp without time zone,
updated_at timestamp without time zone,
- ipv6 character varying[] DEFAULT '{}'::character varying[],
+ ipv6 character varying[],
domain_id integer,
creator_str character varying,
updator_str character varying,
@@ -3118,6 +3029,13 @@ ALTER TABLE ONLY banklink_transactions ALTER COLUMN id SET DEFAULT nextval('bank
ALTER TABLE ONLY blocked_domains ALTER COLUMN id SET DEFAULT nextval('blocked_domains_id_seq'::regclass);
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY business_registry_caches ALTER COLUMN id SET DEFAULT nextval('business_registry_caches_id_seq'::regclass);
+
+
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
@@ -3160,6 +3078,13 @@ ALTER TABLE ONLY delegation_signers ALTER COLUMN id SET DEFAULT nextval('delegat
ALTER TABLE ONLY depricated_versions ALTER COLUMN id SET DEFAULT nextval('depricated_versions_id_seq'::regclass);
+--
+-- Name: id; Type: DEFAULT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY directos ALTER COLUMN id SET DEFAULT nextval('directos_id_seq'::regclass);
+
+
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
@@ -3595,6 +3520,14 @@ ALTER TABLE ONLY blocked_domains
ADD CONSTRAINT blocked_domains_pkey PRIMARY KEY (id);
+--
+-- Name: business_registry_caches_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY business_registry_caches
+ ADD CONSTRAINT business_registry_caches_pkey PRIMARY KEY (id);
+
+
--
-- Name: certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
@@ -3643,6 +3576,14 @@ ALTER TABLE ONLY depricated_versions
ADD CONSTRAINT depricated_versions_pkey PRIMARY KEY (id);
+--
+-- Name: directos_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
+--
+
+ALTER TABLE ONLY directos
+ ADD CONSTRAINT directos_pkey PRIMARY KEY (id);
+
+
--
-- Name: dnskeys_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
@@ -4109,6 +4050,13 @@ CREATE INDEX index_api_users_on_registrar_id ON api_users USING btree (registrar
CREATE INDEX index_blocked_domains_on_name ON blocked_domains USING btree (name);
+--
+-- Name: index_business_registry_caches_on_ident; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_business_registry_caches_on_ident ON business_registry_caches USING btree (ident);
+
+
--
-- Name: index_cached_nameservers_on_hostname_and_ipv4_and_ipv6; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
@@ -4158,6 +4106,13 @@ CREATE INDEX index_contacts_on_registrar_id_and_ident_type ON contacts USING btr
CREATE INDEX index_delegation_signers_on_domain_id ON delegation_signers USING btree (domain_id);
+--
+-- Name: index_directos_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_directos_on_item_type_and_item_id ON directos USING btree (item_type, item_id);
+
+
--
-- Name: index_dnskeys_on_delegation_signer_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
@@ -4256,6 +4211,13 @@ CREATE INDEX index_domains_on_registrant_verification_token ON domains USING btr
CREATE INDEX index_domains_on_registrar_id ON domains USING btree (registrar_id);
+--
+-- Name: index_domains_on_statuses; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_domains_on_statuses ON domains USING gin (statuses);
+
+
--
-- Name: index_epp_sessions_on_session_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
@@ -4732,6 +4694,13 @@ CREATE INDEX index_registrant_verifications_on_domain_id ON registrant_verificat
CREATE INDEX index_registrars_on_code ON registrars USING btree (code);
+--
+-- Name: index_registrars_on_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX index_registrars_on_legacy_id ON registrars USING btree (legacy_id);
+
+
--
-- Name: index_reserved_domains_on_name; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
@@ -4774,6 +4743,41 @@ CREATE INDEX index_whois_records_on_domain_id ON whois_records USING btree (doma
CREATE INDEX index_whois_records_on_registrar_id ON whois_records USING btree (registrar_id);
+--
+-- Name: log_contacts_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX log_contacts_object_legacy_id ON log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer));
+
+
+--
+-- Name: log_contacts_object_legacy_id1; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX log_contacts_object_legacy_id1 ON log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer));
+
+
+--
+-- Name: log_dnskeys_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX log_dnskeys_object_legacy_id ON log_contacts USING btree ((((object ->> 'legacy_domain_id'::text))::integer));
+
+
+--
+-- Name: log_domains_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX log_domains_object_legacy_id ON log_contacts USING btree ((((object ->> 'legacy_id'::text))::integer));
+
+
+--
+-- Name: log_nameservers_object_legacy_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
+--
+
+CREATE INDEX log_nameservers_object_legacy_id ON log_contacts USING btree ((((object ->> 'legacy_domain_id'::text))::integer));
+
+
--
-- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
@@ -5196,7 +5200,19 @@ INSERT INTO schema_migrations (version) VALUES ('20151130175654');
INSERT INTO schema_migrations (version) VALUES ('20151202123506');
-INSERT INTO schema_migrations (version) VALUES ('20160106092052');
+INSERT INTO schema_migrations (version) VALUES ('20151209122816');
+
+INSERT INTO schema_migrations (version) VALUES ('20160106101725');
INSERT INTO schema_migrations (version) VALUES ('20160108135436');
+INSERT INTO schema_migrations (version) VALUES ('20160113143447');
+
+INSERT INTO schema_migrations (version) VALUES ('20160118092453');
+
+INSERT INTO schema_migrations (version) VALUES ('20160118092454');
+
+INSERT INTO schema_migrations (version) VALUES ('20160218102355');
+
+INSERT INTO schema_migrations (version) VALUES ('20160304125933');
+
From 65f6b4b43e2c5ad137bc1ad621111fe81751b5ce Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 8 Mar 2016 15:06:53 +0200
Subject: [PATCH 028/180] Story#114871365 - add address country_code validation
---
app/models/contact.rb | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index aa3819850..4f2e7105e 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -39,8 +39,8 @@ class Contact < ActiveRecord::Base
self.ident_updated_at = Time.zone.now if new_record? && ident_updated_at.blank?
end
- before_validation :set_ident_country_code
- before_validation :prefix_code
+ before_validation :val_upcase_country_code
+ before_validation :val_prefix_code
before_create :generate_auth_info
before_update :manage_emails
@@ -298,7 +298,7 @@ class Contact < ActiveRecord::Base
end
# rubocop:disable Metrics/CyclomaticComplexity
- def prefix_code
+ def val_prefix_code
return nil unless new_record?
return nil if registrar.blank?
code = self[:code]
@@ -338,13 +338,17 @@ class Contact < ActiveRecord::Base
destroy
end
- def set_ident_country_code
- return true unless ident_country_code_changed? && ident_country_code.present?
- code = Country.new(ident_country_code)
- if code
+ def val_upcase_country_code
+ if code = Country.new(ident_country_code)
self.ident_country_code = code.alpha2
else
errors.add(:ident, :invalid_country_code)
+ end if ident_country_code_changed? && ident_country_code.present?
+
+ if code = Country.new(country_code)
+ self.country_code = code.alpha2
+ else
+ errors.add(:country_code, :invalid_country_code)
end
end
From d18fb5e6be46feb9c01920732bff374ffc36e299 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 8 Mar 2016 15:46:48 +0200
Subject: [PATCH 029/180] Story#114871365 - add rake task to update contacts
country code
---
lib/tasks/convert.rake | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/lib/tasks/convert.rake b/lib/tasks/convert.rake
index ba0e547dc..849450c7c 100644
--- a/lib/tasks/convert.rake
+++ b/lib/tasks/convert.rake
@@ -32,5 +32,21 @@ namespace :convert do
d.save!
end
end
+
+
+ desc 'Contact Address Country Code Upcase'
+ task country_code_ucase: :environment do
+ count = 0
+ Contact.find_each do |c|
+ if c.country_code.present? && c.country_code != c.country_code.upcase
+ c.country_code = c.country_code.upcase
+ c.update_columns(country_code: c.country_code.upcase)
+ # c.send(:record_update)
+
+ count +=1
+ puts "#{count} contacts has been changed" if count % 1000 == 0
+ end
+ end
+ end
end
From 3615f4dd8bd8131cbc455e635767353b95c4fdc5 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 8 Mar 2016 15:48:26 +0200
Subject: [PATCH 030/180] Story#114871365 - add rake task to update contacts
country code (typo)
---
lib/tasks/convert.rake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/tasks/convert.rake b/lib/tasks/convert.rake
index 849450c7c..d55778ad9 100644
--- a/lib/tasks/convert.rake
+++ b/lib/tasks/convert.rake
@@ -35,7 +35,7 @@ namespace :convert do
desc 'Contact Address Country Code Upcase'
- task country_code_ucase: :environment do
+ task country_code_upcase: :environment do
count = 0
Contact.find_each do |c|
if c.country_code.present? && c.country_code != c.country_code.upcase
From 519046064d795e45a5882b41efb067bf794a4c6d Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 11 Mar 2016 11:23:11 +0200
Subject: [PATCH 031/180] Story#105855968 - Exclude registrars in directo
monthly invoices
---
app/controllers/admin/registrars_controller.rb | 2 +-
app/models/directo.rb | 2 +-
app/views/admin/registrars/_form.haml | 5 +++++
...0160311085956_add_exclude_monthly_directo_to_registrar.rb | 5 +++++
4 files changed, 12 insertions(+), 2 deletions(-)
create mode 100644 db/migrate/20160311085956_add_exclude_monthly_directo_to_registrar.rb
diff --git a/app/controllers/admin/registrars_controller.rb b/app/controllers/admin/registrars_controller.rb
index cf8c89505..eec50d064 100644
--- a/app/controllers/admin/registrars_controller.rb
+++ b/app/controllers/admin/registrars_controller.rb
@@ -57,7 +57,7 @@ class Admin::RegistrarsController < AdminController
def registrar_params
params.require(:registrar).permit(
:name, :reg_no, :vat_no, :street, :city, :state, :zip, :billing_address,
- :country_code, :email, :phone, :billing_email, :code
+ :country_code, :email, :phone, :billing_email, :code, :exclude_in_monthly_directo
)
end
end
diff --git a/app/models/directo.rb b/app/models/directo.rb
index 8ebf8fbf0..96d418ae0 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -74,7 +74,7 @@ class Directo < ActiveRecord::Base
raise "Directo counter is out of period"
end
- Registrar.find_each do |registrar|
+ Registrar.where.not(exclude_in_monthly_directo: true).find_each do |registrar|
unless registrar.cash_account
Rails.logger.info("[DIRECTO] Monthly invoice for registrar #{registrar.id} has been skipped as it doesn't has cash_account")
next
diff --git a/app/views/admin/registrars/_form.haml b/app/views/admin/registrars/_form.haml
index f00bf6a14..fbe2530d4 100644
--- a/app/views/admin/registrars/_form.haml
+++ b/app/views/admin/registrars/_form.haml
@@ -82,6 +82,11 @@
= f.label :code
.col-md-7
= f.text_field(:code, class: 'form-control', disabled: !f.object.new_record?)
+ .form-group
+ .col-md-4.control-label
+ = f.label :exclude_in_monthly_directo
+ .col-md-7
+ = f.check_box :exclude_in_monthly_directo, class: 'form-control'
%hr
.row
diff --git a/db/migrate/20160311085956_add_exclude_monthly_directo_to_registrar.rb b/db/migrate/20160311085956_add_exclude_monthly_directo_to_registrar.rb
new file mode 100644
index 000000000..c6ae4d31b
--- /dev/null
+++ b/db/migrate/20160311085956_add_exclude_monthly_directo_to_registrar.rb
@@ -0,0 +1,5 @@
+class AddExcludeMonthlyDirectoToRegistrar < ActiveRecord::Migration
+ def change
+ add_column :registrars, :exclude_in_monthly_directo, :boolean, default: false
+ end
+end
From 2af2a2ab1cc7aace3a539759541492d1fde2b253 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 11 Mar 2016 15:13:40 +0200
Subject: [PATCH 032/180] Story#114871365 - Better error messages for country
codes in contact
---
app/models/contact.rb | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index 4f2e7105e..baa51c19e 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -32,6 +32,7 @@ class Contact < ActiveRecord::Base
validate :val_ident_valid_format?
validate :uniq_statuses?
validate :validate_html
+ validate :val_country_code
after_initialize do
self.statuses = [] if statuses.nil?
@@ -39,7 +40,7 @@ class Contact < ActiveRecord::Base
self.ident_updated_at = Time.zone.now if new_record? && ident_updated_at.blank?
end
- before_validation :val_upcase_country_code
+ before_validation :to_upcase_country_code
before_validation :val_prefix_code
before_create :generate_auth_info
@@ -338,18 +339,14 @@ class Contact < ActiveRecord::Base
destroy
end
- def val_upcase_country_code
- if code = Country.new(ident_country_code)
- self.ident_country_code = code.alpha2
- else
- errors.add(:ident, :invalid_country_code)
- end if ident_country_code_changed? && ident_country_code.present?
+ def to_upcase_country_code
+ self.ident_country_code = ident_country_code.upcase if ident_country_code
+ self.country_code = country_code.upcase if country_code
+ end
- if code = Country.new(country_code)
- self.country_code = code.alpha2
- else
- errors.add(:country_code, :invalid_country_code)
- end
+ def val_country_code
+ errors.add(:ident, :invalid_country_code) unless Country.new(ident_country_code)
+ errors.add(:ident, :invalid_country_code) unless Country.new(country_code)
end
def related_domain_descriptions
From 03b58f738612f418c4263b860105029c875c1d03 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 14 Mar 2016 17:56:31 +0200
Subject: [PATCH 033/180] Story#115405945 - clean_pendings_lowlevel saves
history
---
app/models/domain.rb | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index ff51f6f08..27c061770 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -345,7 +345,8 @@ class Domain < ActiveRecord::Base
end
- # state change shouln't be
+ # state changes may be done low-level - no validation
+ # in this metod we still save PaperTrail log.
def clean_pendings_lowlevel
statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
statuses.delete(DomainStatus::PENDING_UPDATE)
@@ -354,13 +355,21 @@ class Domain < ActiveRecord::Base
status_notes[DomainStatus::PENDING_UPDATE] = ''
status_notes[DomainStatus::PENDING_DELETE] = ''
- update_columns(
+ hash = {
registrant_verification_token: nil,
registrant_verification_asked_at: nil,
pending_json: {},
status_notes: status_notes,
statuses: statuses.presence || [DomainStatus::OK]
- )
+ }
+
+ # papertrail
+ self.attributes = hash
+ record_create
+ clear_version_instance!
+ reset_transaction_id
+
+ update_columns(hash)
end
def pending_update!
From 35e7055c7ba4bde7ab5d347b48ea6ce2fc7f5000 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 15 Mar 2016 13:01:25 +0200
Subject: [PATCH 034/180] 110687814-update_point_changed
---
app/models/epp/domain.rb | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index b92a33e5a..737a434d6 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -489,14 +489,13 @@ class Epp::Domain < Domain
# at[:statuses] += at_add[:domain_statuses_attributes]
- self.upid = current_user.id if current_user
- self.up_date = Time.zone.now
-
if errors.empty? && verify &&
Setting.request_confrimation_on_registrant_change_enabled &&
frame.css('registrant').present? &&
frame.css('registrant').attr('verified').to_s.downcase != 'yes'
registrant_verification_asked!(frame.to_s, current_user.id)
+ self.upid = current_user.registrar.id if current_user.registrar
+ self.up_date = Time.zone.now
end
self.deliver_emails = true # turn on email delivery for epp
From d703cac62dae4f9c0d346416a1a26f4dc144a983 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 15 Mar 2016 15:20:08 +0200
Subject: [PATCH 035/180] Story#115405945 - on remove pending state create
update history record
---
app/models/domain.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 27c061770..28cf46041 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -365,7 +365,7 @@ class Domain < ActiveRecord::Base
# papertrail
self.attributes = hash
- record_create
+ record_update
clear_version_instance!
reset_transaction_id
From 6459e89705271823d1a72388007c8868343e7b9f Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 15 Mar 2016 16:59:46 +0200
Subject: [PATCH 036/180] Story#105855968 - counter is outside of namespace
---
app/models/directo.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/models/directo.rb b/app/models/directo.rb
index 96d418ae0..e64bf99e1 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -74,6 +74,7 @@ class Directo < ActiveRecord::Base
raise "Directo counter is out of period"
end
+ directo_next = last_directo
Registrar.where.not(exclude_in_monthly_directo: true).find_each do |registrar|
unless registrar.cash_account
Rails.logger.info("[DIRECTO] Monthly invoice for registrar #{registrar.id} has been skipped as it doesn't has cash_account")
@@ -118,7 +119,7 @@ class Directo < ActiveRecord::Base
# generating XML
if items.any?
- directo_next = last_directo + 1
+ directo_next += 1
invoice_counter.next
builder = Nokogiri::XML::Builder.new(encoding: "UTF-8") do |xml|
From 57bf11517c496999de517396f21c8357d243269c Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 15 Mar 2016 17:00:34 +0200
Subject: [PATCH 037/180] Story#115405945 - better debug message on directo
---
app/models/directo.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/directo.rb b/app/models/directo.rb
index e64bf99e1..caa721db7 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -71,7 +71,7 @@ class Directo < ActiveRecord::Base
max_directo = Setting.directo_monthly_number_max.presence.try(:to_i)
last_directo = [Setting.directo_monthly_number_last.presence.try(:to_i), min_directo].compact.max || 0
if max_directo && max_directo <= last_directo
- raise "Directo counter is out of period"
+ raise "Directo counter is out of period (max allowed number is smaller than last counter number)"
end
directo_next = last_directo
From a950e9e4a7b9e922bb3ae437a20efa69c061ed75 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 16 Mar 2016 15:52:51 +0200
Subject: [PATCH 038/180] Story#105855968 - Directo payment term on directo
monthly nvoice is also taken from directo_receipt_payment_term
---
app/models/directo.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/directo.rb b/app/models/directo.rb
index caa721db7..3fe6b8eec 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -126,7 +126,7 @@ class Directo < ActiveRecord::Base
xml.invoices{
xml.invoice("Number" =>directo_next,
"InvoiceDate" =>invoices_until.strftime(date_format),
- "PaymentTerm" =>"E",
+ "PaymentTerm" =>Setting.directo_receipt_payment_term,
"CustomerCode"=>registrar.directo_handle,
"Language" =>"",
"Currency" =>registrar_activities.first.currency,
From c957bce55301c9fa6076fb7f341a7acf8cf236d0 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 16 Mar 2016 17:48:35 +0200
Subject: [PATCH 039/180] Story#105855968 - change registrar parameter from
exclude_in_monthly_directo to test_registrar be used more widely
---
app/controllers/admin/registrars_controller.rb | 2 +-
app/models/directo.rb | 2 +-
app/views/admin/registrars/_form.haml | 4 ++--
...0160311085956_add_exclude_monthly_directo_to_registrar.rb | 5 -----
db/migrate/20160311085957_add_test_registrar_to_registrar.rb | 5 +++++
5 files changed, 9 insertions(+), 9 deletions(-)
delete mode 100644 db/migrate/20160311085956_add_exclude_monthly_directo_to_registrar.rb
create mode 100644 db/migrate/20160311085957_add_test_registrar_to_registrar.rb
diff --git a/app/controllers/admin/registrars_controller.rb b/app/controllers/admin/registrars_controller.rb
index eec50d064..be4b7d092 100644
--- a/app/controllers/admin/registrars_controller.rb
+++ b/app/controllers/admin/registrars_controller.rb
@@ -57,7 +57,7 @@ class Admin::RegistrarsController < AdminController
def registrar_params
params.require(:registrar).permit(
:name, :reg_no, :vat_no, :street, :city, :state, :zip, :billing_address,
- :country_code, :email, :phone, :billing_email, :code, :exclude_in_monthly_directo
+ :country_code, :email, :phone, :billing_email, :code, :test_registrar
)
end
end
diff --git a/app/models/directo.rb b/app/models/directo.rb
index 3fe6b8eec..0bfdd4548 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -75,7 +75,7 @@ class Directo < ActiveRecord::Base
end
directo_next = last_directo
- Registrar.where.not(exclude_in_monthly_directo: true).find_each do |registrar|
+ Registrar.where.not(test_registrar: true).find_each do |registrar|
unless registrar.cash_account
Rails.logger.info("[DIRECTO] Monthly invoice for registrar #{registrar.id} has been skipped as it doesn't has cash_account")
next
diff --git a/app/views/admin/registrars/_form.haml b/app/views/admin/registrars/_form.haml
index fbe2530d4..48cfc8066 100644
--- a/app/views/admin/registrars/_form.haml
+++ b/app/views/admin/registrars/_form.haml
@@ -84,9 +84,9 @@
= f.text_field(:code, class: 'form-control', disabled: !f.object.new_record?)
.form-group
.col-md-4.control-label
- = f.label :exclude_in_monthly_directo
+ = f.label :test_registrar
.col-md-7
- = f.check_box :exclude_in_monthly_directo, class: 'form-control'
+ = f.check_box :test_registrar, class: 'form-control'
%hr
.row
diff --git a/db/migrate/20160311085956_add_exclude_monthly_directo_to_registrar.rb b/db/migrate/20160311085956_add_exclude_monthly_directo_to_registrar.rb
deleted file mode 100644
index c6ae4d31b..000000000
--- a/db/migrate/20160311085956_add_exclude_monthly_directo_to_registrar.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-class AddExcludeMonthlyDirectoToRegistrar < ActiveRecord::Migration
- def change
- add_column :registrars, :exclude_in_monthly_directo, :boolean, default: false
- end
-end
diff --git a/db/migrate/20160311085957_add_test_registrar_to_registrar.rb b/db/migrate/20160311085957_add_test_registrar_to_registrar.rb
new file mode 100644
index 000000000..b8b05cbd7
--- /dev/null
+++ b/db/migrate/20160311085957_add_test_registrar_to_registrar.rb
@@ -0,0 +1,5 @@
+class AddTestRegistrarToRegistrar < ActiveRecord::Migration
+ def change
+ add_column :registrars, :test_registrar, :boolean, default: false
+ end
+end
From 60c9a0a766a8a299405b633251e9096579d7cfca Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 16 Mar 2016 17:50:19 +0200
Subject: [PATCH 040/180] Story#105855968 - show Registrar#test_registrar in
admin/registrars
---
app/views/admin/registrars/index.haml | 3 +++
config/locales/en.yml | 1 +
2 files changed, 4 insertions(+)
diff --git a/app/views/admin/registrars/index.haml b/app/views/admin/registrars/index.haml
index 8ba45d205..4e1c78294 100644
--- a/app/views/admin/registrars/index.haml
+++ b/app/views/admin/registrars/index.haml
@@ -14,12 +14,15 @@
= sort_link(@q, 'reg_no', t(:reg_no))
%th{class: 'col-xs-4'}
= t(:credit_balance)
+ %th{class: 'col-xs-4'}
+ = t(:test_registrar)
%tbody
- @registrars.each do |x|
%tr
%td= link_to(x, [:admin, x])
%td= x.reg_no
%td= "#{x.balance}"
+ %td= "#{x.test_registrar}"
.row
.col-md-12
= paginate @registrars
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 27495c382..16628072c 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -937,3 +937,4 @@ en:
add_blocked_domain: 'Add domain to blocked list'
edit_pw: 'Edit Pw'
optional: 'Optional'
+ test_registrar: "Test registrar?"
From 92bc47adfa9488e82f6f6aafe81e6278863607eb Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 17 Mar 2016 12:49:00 +0200
Subject: [PATCH 041/180] Story#115405945 - papertrail saves new time as record
itself
---
app/models/domain.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 28cf46041..a71a06467 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -360,10 +360,12 @@ class Domain < ActiveRecord::Base
registrant_verification_asked_at: nil,
pending_json: {},
status_notes: status_notes,
- statuses: statuses.presence || [DomainStatus::OK]
+ statuses: statuses.presence || [DomainStatus::OK],
+ # need this column in order to update PaperTrail version properly
+ updated_at: Time.now.utc
}
- # papertrail
+ # PaperTrail
self.attributes = hash
record_update
clear_version_instance!
From 431eaf54392dead044fe33c8a624818f43a7fcfc Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 17 Mar 2016 18:32:55 +0200
Subject: [PATCH 042/180] 1150040781-contact_delete_legal_doc
---
app/controllers/epp/contacts_controller.rb | 2 +-
app/models/contact.rb | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/controllers/epp/contacts_controller.rb b/app/controllers/epp/contacts_controller.rb
index 5b0a39bbf..0a8c8f634 100644
--- a/app/controllers/epp/contacts_controller.rb
+++ b/app/controllers/epp/contacts_controller.rb
@@ -39,7 +39,7 @@ class Epp::ContactsController < EppController
def delete
authorize! :delete, @contact, @password
- if @contact.destroy_and_clean
+ if @contact.destroy_and_clean(params[:parsed_frame])
render_epp_response '/epp/contacts/delete'
else
handle_errors(@contact)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index 9b4902e0b..d01bac152 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -330,11 +330,15 @@ class Contact < ActiveRecord::Base
# TODO: refactor, it should not allow to destroy with normal destroy,
# no need separate method
# should use only in transaction
- def destroy_and_clean
+ def destroy_and_clean frame
if domains_present?
errors.add(:domains, :exist)
return false
end
+ if doc = Epp::Contact.attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
+ frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
+ self.legal_document_id = doc.id
+ end
destroy
end
From 14b246d6922972d83c111a4de81526deb8d8baaa Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 18 Mar 2016 14:43:21 +0200
Subject: [PATCH 043/180] Story#111864739 - do not throw an error.
---
app/models/epp/contact.rb | 1 -
app/models/epp/domain.rb | 1 -
2 files changed, 2 deletions(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index e3b972394..145e0fd27 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -235,7 +235,6 @@ class Epp::Contact < Contact
document_type: legal_document_data[:type],
body: legal_document_data[:body]
)
- raise ActiveRecord::Rollback if doc && doc.id.nil?
self.legal_documents = [doc]
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 1ee8a2d92..ca052bfeb 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -210,7 +210,6 @@ class Epp::Domain < Domain
document_type: legal_document_data[:type],
body: legal_document_data[:body]
)
- raise ActiveRecord::Rollback if doc && doc.id.nil?
self.legal_documents = [doc]
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
From 71aae06dd14a956bec4ae6662ae0e10975314d39 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 18 Mar 2016 15:59:14 +0200
Subject: [PATCH 044/180] Story#111864739 - epp validation
---
app/models/legal_document.rb | 18 ++++++++++++++++++
config/locales/en.yml | 4 ++++
2 files changed, 22 insertions(+)
diff --git a/app/models/legal_document.rb b/app/models/legal_document.rb
index 5aef34675..32ed8e61b 100644
--- a/app/models/legal_document.rb
+++ b/app/models/legal_document.rb
@@ -1,4 +1,7 @@
class LegalDocument < ActiveRecord::Base
+ include EppErrors
+ MIN_BODY_SIZE = (1.37 * 8.kilobytes).ceil
+
if ENV['legal_document_types'].present?
TYPES = ENV['legal_document_types'].split(',').map(&:strip)
else
@@ -9,9 +12,24 @@ class LegalDocument < ActiveRecord::Base
belongs_to :documentable, polymorphic: true
+
+ validate :val_body_length, if: ->(file){ file.path.blank? && !Rails.env.staging?}
+
before_create :add_creator
before_save :save_to_filesystem
+ def epp_code_map
+ {
+ '2306' => [
+ [:body, :length]
+ ]
+ }
+ end
+
+ def val_body_length
+ errors.add(:body, :length) if body.nil? || body.size < MIN_BODY_SIZE
+ end
+
def save_to_filesystem
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 2cc8b1387..ad662277d 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -205,6 +205,10 @@ en:
blank: 'Algorithm is missing'
auth_info_pw:
blank: 'Password is missing'
+ legal_document:
+ attributes:
+ body:
+ length: 'Parameter value policy error: legalDocument size should be more than 8kB'
attributes:
From d67db2d7c87d20c49751e630ca37cbedf591c114 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 21 Mar 2016 12:18:48 +0200
Subject: [PATCH 045/180] Story#105855968 - admin/show mark if registrar is
test
---
app/views/admin/registrars/show.haml | 4 ++++
app/views/shared/_title.haml | 2 +-
config/locales/en.yml | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/views/admin/registrars/show.haml b/app/views/admin/registrars/show.haml
index 35938c0c6..c1c8ebf6c 100644
--- a/app/views/admin/registrars/show.haml
+++ b/app/views/admin/registrars/show.haml
@@ -2,6 +2,10 @@
= link_to(t(:edit), edit_admin_registrar_path(@registrar), class: 'btn btn-primary')
= link_to(t(:delete), admin_registrar_path(@registrar),
method: :delete, data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger')
+- content_for :page_name do
+ = @registrar.name
+ - if @registrar.test_registrar?
+ %span{style: "color: #c9302c;"} (test)
= render 'shared/title', name: @registrar.name
- if @registrar.errors.any?
diff --git a/app/views/shared/_title.haml b/app/views/shared/_title.haml
index 3832a7664..c6ab477fa 100644
--- a/app/views/shared/_title.haml
+++ b/app/views/shared/_title.haml
@@ -4,7 +4,7 @@
.row
.col-sm-6
%h1.text-center-xs
- = truncate(name, length: 35)
+ = content_for?(:page_name) ? yield(:page_name) : truncate(name, length: 35)
.col-sm-6
%h1.text-right.text-center-xs
= yield :actions
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 16628072c..08258b921 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -937,4 +937,4 @@ en:
add_blocked_domain: 'Add domain to blocked list'
edit_pw: 'Edit Pw'
optional: 'Optional'
- test_registrar: "Test registrar?"
+ test_registrar: "Test registrar"
From ed17431ebc89d6f6a9b99d14920343c92c23b2de Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 21 Mar 2016 15:17:00 +0200
Subject: [PATCH 046/180] 110687814-values_for_pending_apply
---
app/models/epp/domain.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 737a434d6..d687137a6 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -511,6 +511,8 @@ class Epp::Domain < Domain
self.deliver_emails = true # turn on email delivery
self.statuses.delete(DomainStatus::PENDING_UPDATE)
+ self.upid = user.registrar.id if user.registrar
+ self.up_date = Time.zone.now
::PaperTrail.whodunnit = user.id_role_username # updator str should be the request originator not the approval user
send_mail :registrant_updated_notification_for_old_registrant
From ffb76c7372af06330edabe928c90e2703b0a604e Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 21 Mar 2016 20:15:36 +0200
Subject: [PATCH 047/180] 114554395-start_date_added
---
.../admin/account_activities_controller.rb | 11 ++++++++++-
app/controllers/admin/epp_logs_controller.rb | 10 ++++++++++
app/controllers/admin/repp_logs_controller.rb | 10 ++++++++++
app/views/admin/epp_logs/index.haml | 4 ++--
app/views/admin/repp_logs/index.haml | 4 ++--
5 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/app/controllers/admin/account_activities_controller.rb b/app/controllers/admin/account_activities_controller.rb
index 1e1bf9196..82bb021fe 100644
--- a/app/controllers/admin/account_activities_controller.rb
+++ b/app/controllers/admin/account_activities_controller.rb
@@ -1,8 +1,8 @@
class Admin::AccountActivitiesController < AdminController
load_and_authorize_resource
+ before_action :set_default_dates, only: [:index]
def index # rubocop: disable Metrics/AbcSize
- params[:q] ||= {}
ca_cache = params[:q][:created_at_lteq]
begin
@@ -41,4 +41,13 @@ class Admin::AccountActivitiesController < AdminController
params[:q][:created_at_lteq] = ca_cache
end
+
+ def set_default_dates
+ params[:q] ||= {}
+
+ if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil?
+ params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
+ end
+
+ end
end
diff --git a/app/controllers/admin/epp_logs_controller.rb b/app/controllers/admin/epp_logs_controller.rb
index deb9ee8e7..3de64751d 100644
--- a/app/controllers/admin/epp_logs_controller.rb
+++ b/app/controllers/admin/epp_logs_controller.rb
@@ -1,5 +1,6 @@
class Admin::EppLogsController < AdminController
load_and_authorize_resource class: ApiLog::EppLog
+ before_action :set_default_dates, only: [:index]
def index
@q = ApiLog::EppLog.search(params[:q])
@@ -10,4 +11,13 @@ class Admin::EppLogsController < AdminController
def show
@epp_log = ApiLog::EppLog.find(params[:id])
end
+
+ def set_default_dates
+ params[:q] ||= {}
+
+ if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil?
+ params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
+ end
+
+ end
end
diff --git a/app/controllers/admin/repp_logs_controller.rb b/app/controllers/admin/repp_logs_controller.rb
index e9e35aac0..ab7942753 100644
--- a/app/controllers/admin/repp_logs_controller.rb
+++ b/app/controllers/admin/repp_logs_controller.rb
@@ -1,5 +1,6 @@
class Admin::ReppLogsController < AdminController
load_and_authorize_resource class: ApiLog::ReppLog
+ before_action :set_default_dates, only: [:index]
def index
@q = ApiLog::ReppLog.search(params[:q])
@@ -10,4 +11,13 @@ class Admin::ReppLogsController < AdminController
def show
@repp_log = ApiLog::ReppLog.find(params[:id])
end
+
+ def set_default_dates
+ params[:q] ||= {}
+
+ if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil?
+ params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
+ end
+
+ end
end
diff --git a/app/views/admin/epp_logs/index.haml b/app/views/admin/epp_logs/index.haml
index fa2e64267..550a20014 100644
--- a/app/views/admin/epp_logs/index.haml
+++ b/app/views/admin/epp_logs/index.haml
@@ -29,11 +29,11 @@
.col-md-3
.form-group
= f.label t(:created_after)
- = f.search_field :created_at_gteq, class: 'form-control', placeholder: t(:created_after), autocomplete: 'off'
+ = f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control datepicker', placeholder: t(:created_after), autocomplete: 'off'
.col-md-3
.form-group
= f.label t(:created_before)
- = f.search_field :created_at_lteq, class: 'form-control', placeholder: t(:created_before), autocomplete: 'off'
+ = f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control datepicker', placeholder: t(:created_before), autocomplete: 'off'
.col-md-3{style: 'padding-top: 25px;'}
%button.btn.btn-primary
diff --git a/app/views/admin/repp_logs/index.haml b/app/views/admin/repp_logs/index.haml
index 0d33c4a6b..49c74405b 100644
--- a/app/views/admin/repp_logs/index.haml
+++ b/app/views/admin/repp_logs/index.haml
@@ -29,11 +29,11 @@
.col-md-3
.form-group
= f.label t(:created_after)
- = f.search_field :created_at_gteq, class: 'form-control', placeholder: t(:created_after), autocomplete: 'off'
+ = f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control datepicker', placeholder: t(:created_after), autocomplete: 'off'
.col-md-3
.form-group
= f.label t(:created_before)
- = f.search_field :created_at_lteq, class: 'form-control', placeholder: t(:created_before), autocomplete: 'off'
+ = f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control datepicker', placeholder: t(:created_before), autocomplete: 'off'
.col-md-3{style: 'padding-top: 25px;'}
%button.btn.btn-primary
From adfb1381970672d37334a95ca3b5bacd4fb43b42 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 22 Mar 2016 11:47:32 +0200
Subject: [PATCH 048/180] Merge remote-tracking branch 'origin/master' into
story/105855968-directo
# Conflicts:
# Gemfile
# Gemfile.lock
---
Gemfile.lock | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index 959f7a3c0..dbc1e8e3c 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -45,15 +45,6 @@ GIT
bundler (~> 1.2)
thor (~> 0.18)
-GIT
- remote: https://github.com/svenfuchs/rails-i18n.git
- revision: 4913b54a5d7026066ceb12a4523476a1411e86bb
- branch: rails-4-x
- specs:
- rails-i18n (4.0.8)
- i18n (~> 0.7)
- railties (~> 4.0)
-
GEM
remote: https://rubygems.org/
specs:
From 9e9d0a305aac47fc0896ac9f5801f45ec688f8a7 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 22 Mar 2016 18:14:19 +0200
Subject: [PATCH 049/180] 114554395-clear_fields_modification
---
app/controllers/admin/account_activities_controller.rb | 2 +-
app/controllers/admin/epp_logs_controller.rb | 2 +-
app/controllers/admin/repp_logs_controller.rb | 2 +-
app/views/admin/account_activities/index.haml | 2 +-
app/views/admin/epp_logs/index.haml | 2 +-
app/views/admin/repp_logs/index.haml | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/controllers/admin/account_activities_controller.rb b/app/controllers/admin/account_activities_controller.rb
index 82bb021fe..9357d7067 100644
--- a/app/controllers/admin/account_activities_controller.rb
+++ b/app/controllers/admin/account_activities_controller.rb
@@ -45,7 +45,7 @@ class Admin::AccountActivitiesController < AdminController
def set_default_dates
params[:q] ||= {}
- if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil?
+ if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil? && params[:clear_fields].nil?
params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
end
diff --git a/app/controllers/admin/epp_logs_controller.rb b/app/controllers/admin/epp_logs_controller.rb
index 3de64751d..fdefb0a1d 100644
--- a/app/controllers/admin/epp_logs_controller.rb
+++ b/app/controllers/admin/epp_logs_controller.rb
@@ -15,7 +15,7 @@ class Admin::EppLogsController < AdminController
def set_default_dates
params[:q] ||= {}
- if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil?
+ if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil? && params[:clear_fields].nil?
params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
end
diff --git a/app/controllers/admin/repp_logs_controller.rb b/app/controllers/admin/repp_logs_controller.rb
index ab7942753..989db165b 100644
--- a/app/controllers/admin/repp_logs_controller.rb
+++ b/app/controllers/admin/repp_logs_controller.rb
@@ -15,7 +15,7 @@ class Admin::ReppLogsController < AdminController
def set_default_dates
params[:q] ||= {}
- if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil?
+ if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil? && params[:clear_fields].nil?
params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
end
diff --git a/app/views/admin/account_activities/index.haml b/app/views/admin/account_activities/index.haml
index e29f12f75..d79a64d5d 100644
--- a/app/views/admin/account_activities/index.haml
+++ b/app/views/admin/account_activities/index.haml
@@ -91,4 +91,4 @@
:coffee
$(".js-reset-form").on "click", (e) ->
e.preventDefault();
- window.location = "#{admin_account_activities_path}"
+ window.location = "#{admin_account_activities_path(clear_fields: true)}"
diff --git a/app/views/admin/epp_logs/index.haml b/app/views/admin/epp_logs/index.haml
index 550a20014..4e1f9501e 100644
--- a/app/views/admin/epp_logs/index.haml
+++ b/app/views/admin/epp_logs/index.haml
@@ -72,4 +72,4 @@
:coffee
$(".js-reset-form").on "click", (e) ->
e.preventDefault();
- window.location = "#{admin_epp_logs_path}"
+ window.location = "#{admin_epp_logs_path(clear_fields: true)}"
diff --git a/app/views/admin/repp_logs/index.haml b/app/views/admin/repp_logs/index.haml
index 49c74405b..00f90602b 100644
--- a/app/views/admin/repp_logs/index.haml
+++ b/app/views/admin/repp_logs/index.haml
@@ -71,4 +71,4 @@
:coffee
$(".js-reset-form").on "click", (e) ->
e.preventDefault();
- window.location = "#{admin_repp_logs_path}"
+ window.location = "#{admin_repp_logs_path(clear_fields: true)}"
From 61f08cda9a6e7cb37c8e1ad423ea7bd076e3ca27 Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 23 Mar 2016 12:15:27 +0200
Subject: [PATCH 050/180] 111864739-method_scope_changed
---
app/models/epp/contact.rb | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index 145e0fd27..c0952aadd 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -100,6 +100,16 @@ class Epp::Contact < Contact
res
end
+
+ def attach_legal_document(legal_document_data)
+ return unless legal_document_data
+
+ legal_documents.create(
+ document_type: legal_document_data[:type],
+ body: legal_document_data[:body]
+ )
+ end
+
end
delegate :ident_attr_valid?, to: :class
@@ -217,15 +227,6 @@ class Epp::Contact < Contact
status_list
end
- def attach_legal_document(legal_document_data)
- return unless legal_document_data
-
- legal_documents.create(
- document_type: legal_document_data[:type],
- body: legal_document_data[:body]
- )
- end
-
def add_legal_file_to_new frame
legal_document_data = Epp::Domain.parse_legal_document_from_frame(frame)
return unless legal_document_data
From 667ce870787578c8028d2f74dcf4320258f0ce7e Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 23 Mar 2016 18:17:05 +0200
Subject: [PATCH 051/180] 111864739-revert_scope
---
app/models/epp/contact.rb | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index c0952aadd..52e32da11 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -101,15 +101,6 @@ class Epp::Contact < Contact
res
end
- def attach_legal_document(legal_document_data)
- return unless legal_document_data
-
- legal_documents.create(
- document_type: legal_document_data[:type],
- body: legal_document_data[:body]
- )
- end
-
end
delegate :ident_attr_valid?, to: :class
@@ -227,6 +218,15 @@ class Epp::Contact < Contact
status_list
end
+ def attach_legal_document(legal_document_data)
+ return unless legal_document_data
+
+ legal_documents.create(
+ document_type: legal_document_data[:type],
+ body: legal_document_data[:body]
+ )
+ end
+
def add_legal_file_to_new frame
legal_document_data = Epp::Domain.parse_legal_document_from_frame(frame)
return unless legal_document_data
From 4ab4ba6f975a04c1bb4724a34f0cc273dc7d7445 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 23 Mar 2016 18:55:04 +0200
Subject: [PATCH 052/180] Story#114871365 - add to country_code updater
functionality to update it in log table
---
lib/tasks/convert.rake | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/lib/tasks/convert.rake b/lib/tasks/convert.rake
index d55778ad9..c3976f2a0 100644
--- a/lib/tasks/convert.rake
+++ b/lib/tasks/convert.rake
@@ -41,12 +41,36 @@ namespace :convert do
if c.country_code.present? && c.country_code != c.country_code.upcase
c.country_code = c.country_code.upcase
c.update_columns(country_code: c.country_code.upcase)
- # c.send(:record_update)
count +=1
puts "#{count} contacts has been changed" if count % 1000 == 0
end
end
+ puts "Contacts change has been finished. Starting ContactVersions"
+
+ count = 0
+ ContactVersion.find_each do |c|
+ if if_object = (c.object && c.object["country_code"].present? && c.object["country_code"] != c.object["country_code"].upcase) ||
+ if_changes = (c.object_changes && c.object_changes["country_code"].present? && c.object_changes["country_code"] != c.object_changes["country_code"].map{|e|e.try(:upcase)})
+
+ if if_object
+ h = c.object
+ h["country_code"] = h["country_code"].upcase
+ c.object = h
+ end
+
+ if if_changes
+ h = c.object_changes
+ h["country_code"] = h["country_code"].map{|e|e.try(:upcase)}
+ c.object_changes = h
+ binding.pry
+ end
+ c.update_columns(object: c.object, object_changes: c.object_changes)
+
+ count +=1
+ puts "#{count} contact histories has been changed" if count % 1000 == 0
+ end
+ end
end
end
From 4e51adb08e2f5b02d75ce992ebdbe56a341cec79 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 24 Mar 2016 12:01:10 +0200
Subject: [PATCH 053/180] 115040781-legal_doc_check_and_save
---
app/models/contact.rb | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index d01bac152..3d4ca419c 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -335,9 +335,19 @@ class Contact < ActiveRecord::Base
errors.add(:domains, :exist)
return false
end
- if doc = Epp::Contact.attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
- frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
- self.legal_document_id = doc.id
+
+ legal_document_data = Epp::Domain.parse_legal_document_from_frame(frame)
+
+ if legal_document_data
+
+ doc = LegalDocument.create(
+ documentable_type: Contact,
+ document_type: legal_document_data[:type],
+ body: legal_document_data[:body]
+ )
+ self.legal_documents = [doc]
+ self.legal_document_id = doc.id
+ self.save
end
destroy
end
From b73ef11cc31aee4dbbe63dab4caf3fa5a9586a7c Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 24 Mar 2016 14:43:21 +0200
Subject: [PATCH 054/180] 114554395-param_changes
---
.../admin/account_activities_controller.rb | 11 +++++++++--
app/controllers/admin/epp_logs_controller.rb | 10 ++++++++--
app/controllers/admin/repp_logs_controller.rb | 11 +++++++++--
app/views/admin/account_activities/index.haml | 2 +-
app/views/admin/epp_logs/index.haml | 2 +-
app/views/admin/repp_logs/index.haml | 2 +-
app/views/layouts/admin/application.haml | 6 +++---
7 files changed, 32 insertions(+), 12 deletions(-)
diff --git a/app/controllers/admin/account_activities_controller.rb b/app/controllers/admin/account_activities_controller.rb
index 9357d7067..4a4fe2307 100644
--- a/app/controllers/admin/account_activities_controller.rb
+++ b/app/controllers/admin/account_activities_controller.rb
@@ -45,8 +45,15 @@ class Admin::AccountActivitiesController < AdminController
def set_default_dates
params[:q] ||= {}
- if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil? && params[:clear_fields].nil?
- params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
+ if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil? && params[:created_after].present?
+
+ default_date = params[:created_after]
+
+ if !['today', 'tomorrow', 'yesterday'].include?(default_date)
+ default_date = 'today'
+ end
+
+ params[:q][:created_at_gteq] = Date.send(default_date).strftime("%Y-%m-%d")
end
end
diff --git a/app/controllers/admin/epp_logs_controller.rb b/app/controllers/admin/epp_logs_controller.rb
index fdefb0a1d..b14a99766 100644
--- a/app/controllers/admin/epp_logs_controller.rb
+++ b/app/controllers/admin/epp_logs_controller.rb
@@ -15,8 +15,14 @@ class Admin::EppLogsController < AdminController
def set_default_dates
params[:q] ||= {}
- if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil? && params[:clear_fields].nil?
- params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
+ if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil? && params[:created_after].present?
+ default_date = params[:created_after]
+
+ if !['today', 'tomorrow', 'yesterday'].include?(default_date)
+ default_date = 'today'
+ end
+
+ params[:q][:created_at_gteq] = Date.send(default_date).strftime("%Y-%m-%d")
end
end
diff --git a/app/controllers/admin/repp_logs_controller.rb b/app/controllers/admin/repp_logs_controller.rb
index 989db165b..8e904007a 100644
--- a/app/controllers/admin/repp_logs_controller.rb
+++ b/app/controllers/admin/repp_logs_controller.rb
@@ -15,8 +15,15 @@ class Admin::ReppLogsController < AdminController
def set_default_dates
params[:q] ||= {}
- if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil? && params[:clear_fields].nil?
- params[:q][:created_at_gteq] = Time.now.strftime("%Y-%m-%d")
+ if params[:q][:created_at_gteq].nil? && params[:q][:created_at_lteq].nil? && params[:created_after].present?
+
+ default_date = params[:created_after]
+
+ if !['today', 'tomorrow', 'yesterday'].include?(default_date)
+ default_date = 'today'
+ end
+
+ params[:q][:created_at_gteq] = Date.send(default_date).strftime("%Y-%m-%d")
end
end
diff --git a/app/views/admin/account_activities/index.haml b/app/views/admin/account_activities/index.haml
index d79a64d5d..e29f12f75 100644
--- a/app/views/admin/account_activities/index.haml
+++ b/app/views/admin/account_activities/index.haml
@@ -91,4 +91,4 @@
:coffee
$(".js-reset-form").on "click", (e) ->
e.preventDefault();
- window.location = "#{admin_account_activities_path(clear_fields: true)}"
+ window.location = "#{admin_account_activities_path}"
diff --git a/app/views/admin/epp_logs/index.haml b/app/views/admin/epp_logs/index.haml
index 4e1f9501e..550a20014 100644
--- a/app/views/admin/epp_logs/index.haml
+++ b/app/views/admin/epp_logs/index.haml
@@ -72,4 +72,4 @@
:coffee
$(".js-reset-form").on "click", (e) ->
e.preventDefault();
- window.location = "#{admin_epp_logs_path(clear_fields: true)}"
+ window.location = "#{admin_epp_logs_path}"
diff --git a/app/views/admin/repp_logs/index.haml b/app/views/admin/repp_logs/index.haml
index 00f90602b..49c74405b 100644
--- a/app/views/admin/repp_logs/index.haml
+++ b/app/views/admin/repp_logs/index.haml
@@ -71,4 +71,4 @@
:coffee
$(".js-reset-form").on "click", (e) ->
e.preventDefault();
- window.location = "#{admin_repp_logs_path(clear_fields: true)}"
+ window.location = "#{admin_repp_logs_path}"
diff --git a/app/views/layouts/admin/application.haml b/app/views/layouts/admin/application.haml
index 6e3257740..53a73520c 100644
--- a/app/views/layouts/admin/application.haml
+++ b/app/views/layouts/admin/application.haml
@@ -55,7 +55,7 @@
%li= link_to t(:pricelists), admin_pricelists_path
%li= link_to t(:bank_statements), admin_bank_statements_path
%li= link_to t(:invoices), admin_invoices_path
- %li= link_to t(:account_activities), admin_account_activities_path
+ %li= link_to t(:account_activities), admin_account_activities_path(created_after: 'today')
%li.divider
%li.dropdown-header= t(:system)
%li= link_to t(:settings), admin_settings_path
@@ -64,8 +64,8 @@
%li= link_to t(:reserved_domains), admin_reserved_domains_path
%li= link_to t(:mail_templates), admin_mail_templates_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(:repp_logs), admin_repp_logs_path
+ %li= link_to t(:epp_logs), admin_epp_logs_path(created_after: 'today')
+ %li= link_to t(:repp_logs), admin_repp_logs_path(created_after: 'today')
%li= link_to t(:que), '/admin/que'
- if signed_in?
From 2a7de9fbd6232d55a261ae4b7b6af199e335ff14 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 24 Mar 2016 15:32:44 +0200
Subject: [PATCH 055/180] Story#114871365 - fix imported old fred history
---
lib/tasks/convert.rake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/tasks/convert.rake b/lib/tasks/convert.rake
index c3976f2a0..7b5adb9a5 100644
--- a/lib/tasks/convert.rake
+++ b/lib/tasks/convert.rake
@@ -55,7 +55,7 @@ namespace :convert do
if if_object
h = c.object
- h["country_code"] = h["country_code"].upcase
+ h["country_code"] = h["country_code"].try(:upcase)
c.object = h
end
From 21e74dce217d85ffdc0171b574249e2d514e5e2f Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 24 Mar 2016 16:33:32 +0200
Subject: [PATCH 056/180] 110687814-contact_value_modification
---
app/models/epp/contact.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index 6a3540888..be4dfeaf9 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -178,7 +178,7 @@ class Epp::Contact < Contact
end
end
- self.upid = current_user.id if current_user
+ self.upid = current_user.registrar.id if current_user.registrar
self.up_date = Time.zone.now
super(at)
From 5c2033a8a81cde33ce0859f3f000baecfc6a4dd9 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 24 Mar 2016 17:31:17 +0200
Subject: [PATCH 057/180] 110687814-update_order_change
---
app/models/epp/domain.rb | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index d687137a6..d070da026 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -489,13 +489,16 @@ class Epp::Domain < Domain
# at[:statuses] += at_add[:domain_statuses_attributes]
+ if erros.empty? && verify
+ self.upid = current_user.registrar.id if current_user.registrar
+ self.up_date = Time.zone.now
+ end
+
if errors.empty? && verify &&
Setting.request_confrimation_on_registrant_change_enabled &&
frame.css('registrant').present? &&
frame.css('registrant').attr('verified').to_s.downcase != 'yes'
registrant_verification_asked!(frame.to_s, current_user.id)
- self.upid = current_user.registrar.id if current_user.registrar
- self.up_date = Time.zone.now
end
self.deliver_emails = true # turn on email delivery for epp
From b682deeb9e1ce151960f35208ba0790d93b6110f Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 28 Mar 2016 11:40:34 +0300
Subject: [PATCH 058/180] story#114871365 - revert prefix code name generation
---
app/models/contact.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index baa51c19e..f06008495 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -41,7 +41,7 @@ class Contact < ActiveRecord::Base
end
before_validation :to_upcase_country_code
- before_validation :val_prefix_code
+ before_validation :prefix_code
before_create :generate_auth_info
before_update :manage_emails
@@ -299,7 +299,7 @@ class Contact < ActiveRecord::Base
end
# rubocop:disable Metrics/CyclomaticComplexity
- def val_prefix_code
+ def prefix_code
return nil unless new_record?
return nil if registrar.blank?
code = self[:code]
From bd049968e13431131dec1f64d98321f3430b6e64 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 28 Mar 2016 20:16:27 +0300
Subject: [PATCH 059/180] story#115040421 - remove double save of legal doc on
contact update
---
app/models/epp/contact.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index c0952aadd..3a8cc83b9 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -157,8 +157,8 @@ class Epp::Contact < Contact
at[:statuses] = statuses - statuses_attrs(frame.css('rem'), 'rem') + statuses_attrs(frame.css('add'), 'add')
end
- legal_frame = frame.css('legalDocument').first
- at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
+ # legal_frame = frame.css('legalDocument').first
+ # at[:legal_documents_attributes] = self.class.legal_document_attrs(legal_frame)
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
From 9875393b63f721e3e296c68ac1f85b0eebf8f568 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 29 Mar 2016 11:57:09 +0300
Subject: [PATCH 060/180] 110687814-typo
---
app/models/epp/domain.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index d070da026..c1274c02b 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -489,7 +489,7 @@ class Epp::Domain < Domain
# at[:statuses] += at_add[:domain_statuses_attributes]
- if erros.empty? && verify
+ if errors.empty? && verify
self.upid = current_user.registrar.id if current_user.registrar
self.up_date = Time.zone.now
end
From 0e35641702c542050ef97122a960ae8677a56994 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 29 Mar 2016 12:56:23 +0300
Subject: [PATCH 061/180] 115040781-translation_added
---
config/locales/en.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 27495c382..30418d17a 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -355,6 +355,7 @@ en:
contact: 'Contact'
credit_balance: 'Credit balance'
starting_balance: 'Starting balance'
+ destroyed: 'Destroyed'
domain_transfer_requested: 'Domain transfer requested!'
domain_transfer_approved: 'Domain transfer approved!'
From de5f06fa89796e8958d7e883a2deac841ebc3602 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 29 Mar 2016 17:03:07 +0300
Subject: [PATCH 062/180] 113430903-paper_trail_log_added
---
app/jobs/domain_delete_job.rb | 1 +
app/jobs/domain_set_delete_candidate_job.rb | 1 +
2 files changed, 2 insertions(+)
diff --git a/app/jobs/domain_delete_job.rb b/app/jobs/domain_delete_job.rb
index 5336dc466..7d86e9885 100644
--- a/app/jobs/domain_delete_job.rb
+++ b/app/jobs/domain_delete_job.rb
@@ -3,6 +3,7 @@ class DomainDeleteJob < Que::Job
def run(domain_id)
domain = Domain.find(domain_id)
+ ::PaperTrail.whodunnit = "job - #{self.class.name}"
WhoisRecord.where(domain_id: domain.id).destroy_all
domain.destroy
diff --git a/app/jobs/domain_set_delete_candidate_job.rb b/app/jobs/domain_set_delete_candidate_job.rb
index cc6f3f255..f1e489694 100644
--- a/app/jobs/domain_set_delete_candidate_job.rb
+++ b/app/jobs/domain_set_delete_candidate_job.rb
@@ -3,6 +3,7 @@ class DomainSetDeleteCandidateJob < Que::Job
def run(domain_id)
domain = Domain.find(domain_id)
domain.statuses << DomainStatus::DELETE_CANDIDATE
+ ::PaperTrail.whodunnit = "job - #{self.class.name}"
domain.save(validate: false)
DomainDeleteJob.enqueue(domain.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
end
From 0f33a0fb70da1fb2aa602a6f7e02374181db6774 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 29 Mar 2016 17:44:01 +0300
Subject: [PATCH 063/180] story#114871365 - differintiate which value we're
setting in if
---
lib/tasks/convert.rake | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/tasks/convert.rake b/lib/tasks/convert.rake
index 7b5adb9a5..35e68046c 100644
--- a/lib/tasks/convert.rake
+++ b/lib/tasks/convert.rake
@@ -50,8 +50,8 @@ namespace :convert do
count = 0
ContactVersion.find_each do |c|
- if if_object = (c.object && c.object["country_code"].present? && c.object["country_code"] != c.object["country_code"].upcase) ||
- if_changes = (c.object_changes && c.object_changes["country_code"].present? && c.object_changes["country_code"] != c.object_changes["country_code"].map{|e|e.try(:upcase)})
+ if (if_object = (c.object && c.object["country_code"].present? && c.object["country_code"] != c.object["country_code"].upcase)) ||
+ (if_changes = (c.object_changes && c.object_changes["country_code"].present? && c.object_changes["country_code"] != c.object_changes["country_code"].map{|e|e.try(:upcase)}))
if if_object
h = c.object
@@ -63,7 +63,6 @@ namespace :convert do
h = c.object_changes
h["country_code"] = h["country_code"].map{|e|e.try(:upcase)}
c.object_changes = h
- binding.pry
end
c.update_columns(object: c.object, object_changes: c.object_changes)
From 8c5c1dd087d2bdfc1dd8fd93d3a77f905283e27d Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 30 Mar 2016 13:51:41 +0300
Subject: [PATCH 064/180] 113430903-delete_by_status_added
---
app/models/domain_cron.rb | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/app/models/domain_cron.rb b/app/models/domain_cron.rb
index 24c0aac74..390708e76 100644
--- a/app/models/domain_cron.rb
+++ b/app/models/domain_cron.rb
@@ -87,6 +87,14 @@ class DomainCron
STDOUT << "#{Time.zone.now.utc} - Destroying domains\n" unless Rails.env.test?
c = 0
+
+ Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x|
+ WhoisRecord.where(domain_id: x.id).destroy_all
+ DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
+ STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: job added by deleteCandidate status ##{x.id} (#{x.name})\n" unless Rails.env.test?
+ c += 1
+ end
+
Domain.where('force_delete_at <= ?', Time.zone.now).each do |x|
DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: job added by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
From a75d8c840716632a4eeba329e982a216bd788ae1 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 31 Mar 2016 17:51:40 +0300
Subject: [PATCH 065/180] 116209751-option_added
---
app/models/depp/domain.rb | 11 +++++++++++
app/views/registrar/domains/delete.haml | 5 +++++
.../registrar/domains/form_partials/_general.haml | 5 +++++
config/locales/en.yml | 2 ++
4 files changed, 23 insertions(+)
diff --git a/app/models/depp/domain.rb b/app/models/depp/domain.rb
index 7b4630008..03ee83592 100644
--- a/app/models/depp/domain.rb
+++ b/app/models/depp/domain.rb
@@ -187,6 +187,12 @@ module Depp
}
end
+ if domain_params[:verified].present?
+ custom_params[:_anonymus] << {
+ chg: { registrant_verified: 'yes' }
+ }
+ end
+
if domain_params[:reserved_pw].present?
custom_params[:_anonymus] << { reserved: { pw: { value: domain_params[:reserved_pw] } } }
end
@@ -217,6 +223,11 @@ module Depp
chg = [{ registrant: { value: domain_params[:registrant] } }]
end
+ if domain_params[:verified].present?
+ chg.push({ registrant_verified: 'yes'}) if chg.present?
+ chg = [{ registrant_verified: 'yes'}] if chg.nil?
+ end
+
add_arr = nil if add_arr.none?
rem_arr = nil if rem_arr.none?
diff --git a/app/views/registrar/domains/delete.haml b/app/views/registrar/domains/delete.haml
index 13953a6e3..5216622fb 100644
--- a/app/views/registrar/domains/delete.haml
+++ b/app/views/registrar/domains/delete.haml
@@ -7,6 +7,11 @@
= t(:legal_document)
.panel-body
.form-group
+ .col-md-3.control-label
+ = label_tag :verified, t(:verified)
+ .col-md-7
+ = check_box_tag :verified, '1', params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
+
.col-md-4.control-label
= label_tag 'domain[legal_document]', t(:legal_document), class: 'required'
%p.help-block= t(:legal_document_max_size)
diff --git a/app/views/registrar/domains/form_partials/_general.haml b/app/views/registrar/domains/form_partials/_general.haml
index e4c124803..51f855f4e 100644
--- a/app/views/registrar/domains/form_partials/_general.haml
+++ b/app/views/registrar/domains/form_partials/_general.haml
@@ -23,6 +23,11 @@
= text_field_tag 'domain[registrant]', @domain_params[:registrant], class: "hidden"
= text_field_tag 'domain[registrant_helper]', contacts.find_by(code: @domain_params[:registrant]).try(:search_name),
class: 'form-control', data: {autocomplete: search_contacts_registrar_domains_path}, required: true
+ .form-group
+ .col-md-3.control-label
+ = label_tag :verified, t(:verified)
+ .col-md-7
+ = check_box_tag :verified, '1', params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
- unless params[:domain_name]
.form-group
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 6b9a7af3c..ffa18216d 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -941,3 +941,5 @@ en:
edit_pw: 'Edit Pw'
optional: 'Optional'
test_registrar: "Test registrar"
+ verified_confirm: 'Verified status is for cases when current registrant is the one applying for the update. Legal document signed by the registrant is required. Are you sure this update is properly verified with the registrant?'
+ verified: 'Verified'
From 733d48d9328804a6b599041fa6505c83267e692f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Fri, 1 Apr 2016 11:32:23 +0300
Subject: [PATCH 066/180] updated EPP doc with supported DNSSEC algorithms
---
doc/epp/domain.md | 4 ++--
doc/epp/keyrelay.md | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/epp/domain.md b/doc/epp/domain.md
index 524deee1e..178ab629b 100644
--- a/doc/epp/domain.md
+++ b/doc/epp/domain.md
@@ -32,7 +32,7 @@ Domain name mapping protocol short version:
1-n
1 Allowed values: 0, 256, 257
1 Allowed values: 3
- 1 Allowed values: 3, 5, 6, 7, 8, 252, 253, 254, 255
+ 1 Allowed values: 3, 5, 6, 7, 8, 10, 13, 14
1 Public key
1 Attribute: xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
1 Base64 encoded document.
@@ -81,7 +81,7 @@ Domain name mapping protocol short version:
1-n
1 Allowed values: 0, 256, 257
1 Allowed values: 3
- 1 Allowed values: 3, 5, 6, 7, 8, 252, 253, 254, 255
+ 1 Allowed values: 3, 5, 6, 7, 8, 10, 13, 14
1 Public key
0-1 Attribute: xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"
0-1 Base64 encoded document. Required if registrant is changing.
diff --git a/doc/epp/keyrelay.md b/doc/epp/keyrelay.md
index f61765b2c..804fed6db 100644
--- a/doc/epp/keyrelay.md
+++ b/doc/epp/keyrelay.md
@@ -11,7 +11,7 @@ NB! Keyrelay not implemented.
1
1 Allowed values: 0, 256, 257
1 Allowed values: 3
- 1 Allowed values: 3, 5, 6, 7, 8, 252, 253, 254, 255
+ 1 Allowed values: 3, 5, 6, 7, 8, 10, 13, 14
1 Public key
1
1 Domain password. Attribute: roid="String"
From ee36333640b4f588ad1b3b68722614699b35ab02 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 4 Apr 2016 14:59:09 +0300
Subject: [PATCH 067/180] Story#115405945 - setting pending update should
update updated_at
---
app/models/domain.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index a71a06467..3c7ad14e2 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -395,6 +395,7 @@ class Domain < ActiveRecord::Base
self.registrant_verification_token = token
self.registrant_verification_asked_at = asked_at
set_pending_update
+ touch_always_version
pending_json['new_registrant_id'] = new_registrant_id
pending_json['new_registrant_email'] = new_registrant_email
pending_json['new_registrant_name'] = new_registrant_name
From accdf6b6f2dc1cbcff1361c28acc6ca7397dfb6d Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 4 Apr 2016 16:35:42 +0300
Subject: [PATCH 068/180] 113430903-start_delete_candidate_method_change
---
app/models/domain_cron.rb | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/models/domain_cron.rb b/app/models/domain_cron.rb
index 390708e76..93f904cf2 100644
--- a/app/models/domain_cron.rb
+++ b/app/models/domain_cron.rb
@@ -74,11 +74,13 @@ class DomainCron
d.each do |domain|
next unless domain.delete_candidateable?
real += 1
+ domain.statuses << DomainStatus::DELETE_CANDIDATE
STDOUT << "#{Time.zone.now.utc} DomainCron.start_delete_period: ##{domain.id} (#{domain.name})\n" unless Rails.env.test?
- DomainSetDeleteCandidateJob.enqueue(domain.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now) and marked += 1
+ ::PaperTrail.whodunnit = "cron - #{__method__}"
+ domain.save(validate: false) and marked += 1
end
ensure # the operator should see what was accomplished
- STDOUT << "#{Time.zone.now.utc} - Finished setting schedule for delete_candidate - #{marked} out of #{real} successfully added to Que schedule\n" unless Rails.env.test?
+ STDOUT << "#{Time.zone.now.utc} - Finished setting delete_candidate - #{marked} out of #{real} successfully set\n" unless Rails.env.test?
end
marked
end
@@ -96,6 +98,7 @@ class DomainCron
end
Domain.where('force_delete_at <= ?', Time.zone.now).each do |x|
+ WhoisRecord.where(domain_id: x.id).destroy_all
DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: job added by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
c += 1
From 442b2b5a714633fff08c53182b7944e687536249 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 5 Apr 2016 14:52:27 +0300
Subject: [PATCH 069/180] 116209751-css_modification
---
app/views/registrar/domains/delete.haml | 5 +++--
.../registrar/domains/form_partials/_general.haml | 12 +++++++-----
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/app/views/registrar/domains/delete.haml b/app/views/registrar/domains/delete.haml
index 5216622fb..706587629 100644
--- a/app/views/registrar/domains/delete.haml
+++ b/app/views/registrar/domains/delete.haml
@@ -7,11 +7,12 @@
= t(:legal_document)
.panel-body
.form-group
- .col-md-3.control-label
+ .col-md-4.control-label
= label_tag :verified, t(:verified)
- .col-md-7
+ .col-md-6
= check_box_tag :verified, '1', params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
+ .form-group
.col-md-4.control-label
= label_tag 'domain[legal_document]', t(:legal_document), class: 'required'
%p.help-block= t(:legal_document_max_size)
diff --git a/app/views/registrar/domains/form_partials/_general.haml b/app/views/registrar/domains/form_partials/_general.haml
index 51f855f4e..a41e6cd2b 100644
--- a/app/views/registrar/domains/form_partials/_general.haml
+++ b/app/views/registrar/domains/form_partials/_general.haml
@@ -23,11 +23,13 @@
= text_field_tag 'domain[registrant]', @domain_params[:registrant], class: "hidden"
= text_field_tag 'domain[registrant_helper]', contacts.find_by(code: @domain_params[:registrant]).try(:search_name),
class: 'form-control', data: {autocomplete: search_contacts_registrar_domains_path}, required: true
- .form-group
- .col-md-3.control-label
- = label_tag :verified, t(:verified)
- .col-md-7
- = check_box_tag :verified, '1', params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
+
+ - if params[:domain_name]
+ .form-group
+ .col-md-3.control-label
+ = label_tag :verified, t(:verified)
+ .col-md-7
+ = check_box_tag :verified, '1', params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
- unless params[:domain_name]
.form-group
From 5e2e7d3ed2b48c25bee91af9a8287734c26b7657 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 5 Apr 2016 15:38:54 +0300
Subject: [PATCH 070/180] story#116954569 - Parse id-card data in new apache
---
app/models/registrant_user.rb | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/app/models/registrant_user.rb b/app/models/registrant_user.rb
index 413ff1202..12cae0d82 100644
--- a/app/models/registrant_user.rb
+++ b/app/models/registrant_user.rb
@@ -30,10 +30,20 @@ class RegistrantUser < User
return false if issuer_organization != ACCEPTED_ISSUER
idc_data.force_encoding('UTF-8')
- identity_code = idc_data.scan(/serialNumber=(\d+)/).flatten.first
- country = idc_data.scan(/^\/C=(.{2})/).flatten.first
- first_name = idc_data.scan(%r{/GN=(.+)/serialNumber}).flatten.first
- last_name = idc_data.scan(%r{/SN=(.+)/GN}).flatten.first
+
+ # handling here new and old mode
+ if idc_data.starts_with?("/")
+ identity_code = idc_data.scan(/serialNumber=(\d+)/).flatten.first
+ country = idc_data.scan(/^\/C=(.{2})/).flatten.first
+ first_name = idc_data.scan(%r{/GN=(.+)/serialNumber}).flatten.first
+ last_name = idc_data.scan(%r{/SN=(.+)/GN}).flatten.first
+ else
+ parse_str = "," + idc_data
+ identity_code = parse_str.scan(/,serialNumber=(\d+)/).flatten.first
+ country = parse_str.scan(/,C=(.{2})/).flatten.first
+ first_name = parse_str.scan(/,GN=([^,]+)/).flatten.first
+ last_name = parse_str.scan(/,SN=([^,]+)/).flatten.first
+ end
u = where(registrant_ident: "#{country}-#{identity_code}").first_or_create
u.username = "#{first_name} #{last_name}"
From 375e6490097aaa47070fb8b1e86baf92f5cfd336 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 5 Apr 2016 16:12:33 +0300
Subject: [PATCH 071/180] story#116954455 - set parameter debug for Directo
monthly invoices
---
app/models/directo.rb | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/app/models/directo.rb b/app/models/directo.rb
index 0bfdd4548..d20874630 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -60,7 +60,8 @@ class Directo < ActiveRecord::Base
end
- def self.send_monthly_invoices
+ def self.send_monthly_invoices(debug: false)
+ @debug = debug
I18n.locale = :et
month = Time.now - 1.month
invoices_until = month.end_of_month
@@ -141,10 +142,14 @@ class Directo < ActiveRecord::Base
data = builder.to_xml.gsub("\n",'')
response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false).to_s
- Setting.directo_monthly_number_last = directo_next
- Nokogiri::XML(response).css("Result").each do |res|
- Directo.create!(response: res.as_json.to_h, invoice_number: directo_next)
- Rails.logger.info("[DIRECTO] Invoice #{res.attributes["docid"].value} was pushed and return is #{res.as_json.to_h.inspect}")
+ if @debug
+ STDOUT << "#{Time.zone.now.utc} - Directo xml had to be sent #{data}\n"
+ else
+ Setting.directo_monthly_number_last = directo_next
+ Nokogiri::XML(response).css("Result").each do |res|
+ Directo.create!(response: res.as_json.to_h, invoice_number: directo_next)
+ Rails.logger.info("[DIRECTO] Invoice #{res.attributes["docid"].value} was pushed and return is #{res.as_json.to_h.inspect}")
+ end
end
else
Rails.logger.info("[DIRECTO] Registrar #{registrar.id} has nothing to be sent to Directo")
From 56f9cb325de4c0432a7011fdefe98624fc089a1a Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 5 Apr 2016 16:15:59 +0300
Subject: [PATCH 072/180] story#116954455 - save Directo request
---
app/models/directo.rb | 2 +-
db/migrate/20160405131315_add_request_to_directo.rb | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
create mode 100644 db/migrate/20160405131315_add_request_to_directo.rb
diff --git a/app/models/directo.rb b/app/models/directo.rb
index d20874630..523a7b036 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -147,7 +147,7 @@ class Directo < ActiveRecord::Base
else
Setting.directo_monthly_number_last = directo_next
Nokogiri::XML(response).css("Result").each do |res|
- Directo.create!(response: res.as_json.to_h, invoice_number: directo_next)
+ Directo.create!(request: data, response: res.as_json.to_h, invoice_number: directo_next)
Rails.logger.info("[DIRECTO] Invoice #{res.attributes["docid"].value} was pushed and return is #{res.as_json.to_h.inspect}")
end
end
diff --git a/db/migrate/20160405131315_add_request_to_directo.rb b/db/migrate/20160405131315_add_request_to_directo.rb
new file mode 100644
index 000000000..2efb95f7d
--- /dev/null
+++ b/db/migrate/20160405131315_add_request_to_directo.rb
@@ -0,0 +1,5 @@
+class AddRequestToDirecto < ActiveRecord::Migration
+ def change
+ add_column :directos, :request, :text
+ end
+end
From fa682e178019b5fbebf735c82215f9fd703237ad Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 5 Apr 2016 16:53:18 +0300
Subject: [PATCH 073/180] story#116954455 - directo monthly invoices use
billing date, not real
---
app/models/directo.rb | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/app/models/directo.rb b/app/models/directo.rb
index 523a7b036..50153ef89 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -101,8 +101,8 @@ class Directo < ActiveRecord::Base
"ProductName" => ".#{pricelist.category} registreerimine: #{pricelist.years_amount} aasta",
"UnitPriceWoVAT" => pricelist.price_decimal/pricelist.years_amount
}
- hash["StartDate"] = (activity.created_at + year.year).strftime(date_format) if year > 1
- hash["EndDate"] = (activity.created_at + year.year + 1).strftime(date_format) if year > 1
+ hash["StartDate"] = (activity.created_at + (year-1).year).end_of_month.strftime(date_format) if year > 1
+ hash["EndDate"] = (activity.created_at + (year-1).year + 1).end_of_month.strftime(date_format) if year > 1
if items.has_key?(hash)
items[hash]["Quantity"] += 1
@@ -113,8 +113,10 @@ class Directo < ActiveRecord::Base
end
#adding prepaiments
- registrar_activities.where(activity_type: [AccountActivity::ADD_CREDIT]).each do |activity|
- hash = {"ProductID" => Setting.directo_receipt_product_name, "Unit" => "tk", "ProductName" => "Domeenide ettemaks", "UnitPriceWoVAT"=>activity.sum}
+ if items.any?
+ total = 0
+ items.each{ |key, val| total += val["Quantity"] * key["UnitPriceWoVAT"] }
+ hash = {"ProductID" => Setting.directo_receipt_product_name, "Unit" => "tk", "ProductName" => "Domeenide ettemaks", "UnitPriceWoVAT"=>total}
items[hash] = {"RN"=>counter.next, "RR" => counter.now, "Quantity"=> -1}
end
From f490d16a198225b592dd5701fe464c9d56f5b910 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 5 Apr 2016 17:15:34 +0300
Subject: [PATCH 074/180] 116207475-error_added
---
app/models/epp/domain.rb | 5 ++++-
config/locales/en.yml | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index d1da30a2f..85498422e 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -133,7 +133,8 @@ class Epp::Domain < Domain
[:base, :ds_data_not_allowed],
[:base, :key_data_not_allowed],
[:period, :not_a_number],
- [:period, :not_an_integer]
+ [:period, :not_an_integer],
+ [:registrant, :cannot_be_missing]
],
'2308' => [
[:base, :domain_name_blocked, { value: { obj: 'name', val: name_dirty } }]
@@ -166,6 +167,8 @@ class Epp::Domain < Domain
else
add_epp_error('2303', 'registrant', code, [:registrant, :not_found])
end
+ else
+ add_epp_error('2306', nil, nil, [:registrant, :cannot_be_missing])
end
at[:name] = frame.css('name').text if new_record?
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 6b9a7af3c..e687458cc 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -77,6 +77,7 @@ en:
registrant:
blank: 'Registrant is missing'
not_found: 'Registrant not found'
+ cannot_be_missing: 'Parameter value policy error: registrant cannot be missing'
domain_contacts:
invalid: 'Contacts are invalid'
not_found: 'Contact was not found'
From ebc8938b0617cc0b146c80dfcd44927b8a67e67b Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 6 Apr 2016 12:07:36 +0300
Subject: [PATCH 075/180] story#116954455 - fix directo min param
---
app/models/directo.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/directo.rb b/app/models/directo.rb
index 50153ef89..05d9da5aa 100644
--- a/app/models/directo.rb
+++ b/app/models/directo.rb
@@ -68,7 +68,7 @@ class Directo < ActiveRecord::Base
date_format = "%Y-%m-%d"
invoice_counter= Counter.new
- min_directo = Setting.invoice_number_min.presence.try(:to_i)
+ min_directo = Setting.directo_monthly_number_min.presence.try(:to_i)
max_directo = Setting.directo_monthly_number_max.presence.try(:to_i)
last_directo = [Setting.directo_monthly_number_last.presence.try(:to_i), min_directo].compact.max || 0
if max_directo && max_directo <= last_directo
From 3425deb0fac5cd65c0f73b8d33af2604c3dabc76 Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 6 Apr 2016 15:02:05 +0300
Subject: [PATCH 076/180] 113430903-method_merge
---
app/models/domain_cron.rb | 56 ++++++++++++++++++++++-----------------
1 file changed, 32 insertions(+), 24 deletions(-)
diff --git a/app/models/domain_cron.rb b/app/models/domain_cron.rb
index 93f904cf2..ba5d72f19 100644
--- a/app/models/domain_cron.rb
+++ b/app/models/domain_cron.rb
@@ -64,25 +64,27 @@ class DomainCron
marked
end
- def self.start_delete_period
- begin
- STDOUT << "#{Time.zone.now.utc} - Setting delete_candidate to domains\n" unless Rails.env.test?
+ #doing nothing, deprecated
- d = Domain.where('delete_at <= ?', Time.zone.now)
- marked = 0
- real = 0
- d.each do |domain|
- next unless domain.delete_candidateable?
- real += 1
- domain.statuses << DomainStatus::DELETE_CANDIDATE
- STDOUT << "#{Time.zone.now.utc} DomainCron.start_delete_period: ##{domain.id} (#{domain.name})\n" unless Rails.env.test?
- ::PaperTrail.whodunnit = "cron - #{__method__}"
- domain.save(validate: false) and marked += 1
- end
- ensure # the operator should see what was accomplished
- STDOUT << "#{Time.zone.now.utc} - Finished setting delete_candidate - #{marked} out of #{real} successfully set\n" unless Rails.env.test?
- end
- marked
+ def self.start_delete_period
+ # begin
+ # STDOUT << "#{Time.zone.now.utc} - Setting delete_candidate to domains\n" unless Rails.env.test?
+ #
+ # d = Domain.where('delete_at <= ?', Time.zone.now)
+ # marked = 0
+ # real = 0
+ # d.each do |domain|
+ # next unless domain.delete_candidateable?
+ # real += 1
+ # domain.statuses << DomainStatus::DELETE_CANDIDATE
+ # STDOUT << "#{Time.zone.now.utc} DomainCron.start_delete_period: ##{domain.id} (#{domain.name})\n" unless Rails.env.test?
+ # ::PaperTrail.whodunnit = "cron - #{__method__}"
+ # domain.save(validate: false) and marked += 1
+ # end
+ # ensure # the operator should see what was accomplished
+ # STDOUT << "#{Time.zone.now.utc} - Finished setting delete_candidate - #{marked} out of #{real} successfully set\n" unless Rails.env.test?
+ # end
+ # marked
end
def self.destroy_delete_candidates
@@ -90,15 +92,21 @@ class DomainCron
c = 0
- Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x|
- WhoisRecord.where(domain_id: x.id).destroy_all
- DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
- STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: job added by deleteCandidate status ##{x.id} (#{x.name})\n" unless Rails.env.test?
- c += 1
+ Domain.where('delete_at <= ?', Time.zone.now).each do |x|
+ next unless x.delete_candidateable?
+
+ x.statuses << DomainStatus::DELETE_CANDIDATE
+
+ # If domain successfully saved, add it to delete schedule
+ if x.save(validate: false)
+ ::PaperTrail.whodunnit = "cron - #{__method__}"
+ DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
+ STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: job added by deleteCandidate status ##{x.id} (#{x.name})\n" unless Rails.env.test?
+ c += 1
+ end
end
Domain.where('force_delete_at <= ?', Time.zone.now).each do |x|
- WhoisRecord.where(domain_id: x.id).destroy_all
DomainDeleteJob.enqueue(x.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: job added by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
c += 1
From 00948384a61ccdc0775cddffb18b19dd6d9eec40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Thu, 7 Apr 2016 11:40:02 +0300
Subject: [PATCH 077/180] lowered the minimum legalDocument size requirement to
3kB
---
app/assets/javascripts/registrar/application.coffee | 4 ++--
app/models/legal_document.rb | 2 +-
config/locales/en.yml | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/assets/javascripts/registrar/application.coffee b/app/assets/javascripts/registrar/application.coffee
index 943f14a23..a1a2084fe 100644
--- a/app/assets/javascripts/registrar/application.coffee
+++ b/app/assets/javascripts/registrar/application.coffee
@@ -29,13 +29,13 @@ $(document).on 'page:change', ->
$('.js-contact-form').trigger('restoreDefault')
$('[data-legal-document]').each (i, fileInput)->
- minSize = 8 * 1024 # 8kB
+ minSize = 3 * 1024 # 3kB
maxSize = 8 * 1024 * 1024; # 8 MB
$(fileInput).closest('form').submit (e) ->
if (files = fileInput.files).length
fileSize = files[0].size
if fileSize < minSize
- alert 'Document size should be more than 8kB'
+ alert 'Document size should be more than 3kB'
return false
else if fileSize > maxSize
alert 'Document size should be less than 8MB'
diff --git a/app/models/legal_document.rb b/app/models/legal_document.rb
index c3b0c66ea..b4bf3c96b 100644
--- a/app/models/legal_document.rb
+++ b/app/models/legal_document.rb
@@ -1,6 +1,6 @@
class LegalDocument < ActiveRecord::Base
include EppErrors
- MIN_BODY_SIZE = (1.37 * 8.kilobytes).ceil
+ MIN_BODY_SIZE = (1.37 * 3.kilobytes).ceil
if ENV['legal_document_types'].present?
TYPES = ENV['legal_document_types'].split(',').map(&:strip)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 0ced7eb78..2e97f6f9f 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -209,7 +209,7 @@ en:
legal_document:
attributes:
body:
- length: 'Parameter value policy error: legalDocument size should be more than 8kB'
+ length: 'Parameter value policy error: legalDocument size should be more than 3kB'
attributes:
From 3063c2f5d22bf342ca19d2dcd5757f26e26641ec Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 7 Apr 2016 11:50:34 +0300
Subject: [PATCH 078/180] 116207475-if_block_changed
---
app/models/epp/domain.rb | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 85498422e..477d8c28f 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -156,7 +156,8 @@ class Epp::Domain < Domain
def attrs_from(frame, current_user, action = nil)
at = {}.with_indifferent_access
- code = frame.css('registrant').first.try(:text)
+ registrant_frame = frame.css('registrant').first
+ code = registrant_frame.try(:text)
if code.present?
if action == 'chg' && registrant_change_prohibited?
add_epp_error('2304', nil, DomainStatus::SERVER_REGISTRANT_CHANGE_PROHIBITED, I18n.t(:object_status_prohibits_operation))
@@ -168,8 +169,9 @@ class Epp::Domain < Domain
add_epp_error('2303', 'registrant', code, [:registrant, :not_found])
end
else
- add_epp_error('2306', nil, nil, [:registrant, :cannot_be_missing])
- end
+ add_epp_error('2306', nil, nil, [:registrant, :cannot_be_missing])
+ end if registrant_frame
+
at[:name] = frame.css('name').text if new_record?
at[:registrar_id] = current_user.registrar.try(:id)
From 1d5a79f406379dc4052a6d9382e83d12f7a1d967 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 7 Apr 2016 16:45:44 +0300
Subject: [PATCH 079/180] Story#117124725 - raise an error ConfirmingRegistrant
Change job
---
app/jobs/domain_update_confirm_job.rb | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/app/jobs/domain_update_confirm_job.rb b/app/jobs/domain_update_confirm_job.rb
index 098b9853e..67007d334 100644
--- a/app/jobs/domain_update_confirm_job.rb
+++ b/app/jobs/domain_update_confirm_job.rb
@@ -7,8 +7,13 @@ class DomainUpdateConfirmJob < Que::Job
case action
when RegistrantVerification::CONFIRMED
domain.poll_message!(:poll_pending_update_confirmed_by_registrant)
+ raise_errors!(domain)
+
domain.apply_pending_update!
+ raise_errors!(domain)
+
domain.clean_pendings!
+ raise_errors!(domain)
when RegistrantVerification::REJECTED
domain.send_mail :pending_update_rejected_notification_for_new_registrant
domain.poll_message!(:poll_pending_update_rejected_by_registrant)
@@ -17,4 +22,8 @@ class DomainUpdateConfirmJob < Que::Job
destroy # it's best to destroy the job in the same transaction
end
end
+
+ def raise_errors!(domain)
+ throw "domain #{domain.name} failed with errors #{domain.errors.full_messages}" if domain.errors.any?
+ end
end
From a091c62264ba77085cfe0872b586c5e1621b072c Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 8 Apr 2016 14:58:56 +0300
Subject: [PATCH 080/180] Story#117124725 - generate emails of
apply_pending_update! only when everything is ok
---
app/mailers/domain_mailer.rb | 30 +++++++++++++--
app/models/domain_mail_model.rb | 21 ----------
app/models/epp/domain.rb | 10 +++--
...d_notification_for_new_registrant.html.erb | 36 +++++++++---------
...d_notification_for_new_registrant.text.erb | 38 ++++++++++---------
...d_notification_for_old_registrant.html.erb | 36 +++++++++---------
...d_notification_for_old_registrant.text.erb | 36 +++++++++---------
spec/mailers/domain_mailer_spec.rb | 4 +-
8 files changed, 108 insertions(+), 103 deletions(-)
diff --git a/app/mailers/domain_mailer.rb b/app/mailers/domain_mailer.rb
index 28e232a8c..fb2c0e851 100644
--- a/app/mailers/domain_mailer.rb
+++ b/app/mailers/domain_mailer.rb
@@ -9,12 +9,34 @@ class DomainMailer < ApplicationMailer
compose_from(params)
end
- def registrant_updated_notification_for_new_registrant(params)
- compose_from(params)
+
+ def registrant_updated_notification_for_new_registrant(domain_id, old_registrant_id, new_registrant_id, should_deliver)
+ @domain = Domain.find_by(id: domain_id)
+ return unless @domain
+ return if delivery_off?(@domain, should_deliver)
+
+ @old_registrant = Registrant.find(old_registrant_id)
+ @new_registrant = Registrant.find(new_registrant_id)
+
+ return if whitelist_blocked?(@new_registrant.email)
+ mail(to: format(@new_registrant.email),
+ subject: "#{I18n.t(:registrant_updated_notification_for_new_registrant_subject,
+ name: @domain.name)} [#{@domain.name}]")
end
- def registrant_updated_notification_for_old_registrant(params)
- compose_from(params)
+
+ def registrant_updated_notification_for_old_registrant(domain_id, old_registrant_id, new_registrant_id, should_deliver)
+ domain = Domain.find_by(id: domain_id)
+ return unless domain
+ return if delivery_off?(@domain, should_deliver)
+
+ @old_registrant = Registrant.find(old_registrant_id)
+ @new_registrant = Registrant.find(new_registrant_id)
+
+ return if whitelist_blocked?(@old_registrant.email)
+ mail(to: format(@old_registrant.email),
+ subject: "#{I18n.t(:registrant_updated_notification_for_old_registrant_subject,
+ name: @domain.name)} [#{@domain.name}]")
end
def pending_update_rejected_notification_for_new_registrant(params)
diff --git a/app/models/domain_mail_model.rb b/app/models/domain_mail_model.rb
index 46309ad52..d443d8783 100644
--- a/app/models/domain_mail_model.rb
+++ b/app/models/domain_mail_model.rb
@@ -20,28 +20,7 @@ class DomainMailModel
domain_info
compose
end
-
- def registrant_updated_notification_for_new_registrant
- registrant
- subject(:registrant_updated_notification_for_new_registrant_subject)
- domain_info
- compose
- end
- def registrant_updated_notification_for_old_registrant
- registrant_pending
- registrant_old
- subject(:registrant_updated_notification_for_old_registrant_subject)
- new_registrant = Registrant.find @domain.pending_json['new_registrant_id']
- @params[:registrant_name] = new_registrant.name
- @params[:registrant_ident] = new_registrant.ident
- @params[:registrant_priv] = new_registrant.priv?
- @params[:registrant_email] = new_registrant.email
- @params[:registrant_street] = new_registrant.street
- @params[:registrant_city] = new_registrant.city
- @params[:registrant_country] = new_registrant.country.name
- compose
- end
def pending_update_rejected_notification_for_new_registrant
registrant_pending
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 1f2dd2d54..2905bd968 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -525,19 +525,21 @@ class Epp::Domain < Domain
preclean_pendings
user = ApiUser.find(pending_json['current_user_id'])
frame = Nokogiri::XML(pending_json['frame'])
+ old_registrant_id = registrant_id
self.deliver_emails = true # turn on email delivery
self.statuses.delete(DomainStatus::PENDING_UPDATE)
::PaperTrail.whodunnit = user.id_role_username # updator str should be the request originator not the approval user
- send_mail :registrant_updated_notification_for_old_registrant
return unless update(frame, user, false)
clean_pendings!
- send_mail :registrant_updated_notification_for_new_registrant
- WhoisRecord.find_by(domain_id: id).save # need to reload model
-
save! # for notification if everything fails
+
+ WhoisRecord.find_by(domain_id: id).save # need to reload model
+ DomainMailer.registrant_updated_notification_for_old_registrant(id, old_registrant_id, registrant_id, should_deliver)
+ DomainMailer.registrant_updated_notification_for_new_registrant(id, old_registrant_id, registrant_id, should_deliver)
+
true
end
diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb
index c7d464f43..a654b2f80 100644
--- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb
+++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb
@@ -1,18 +1,18 @@
Tere,
-Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
+Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
Uue registreerija andmed:
-Nimi: <%= @params[:registrant_name] %>
-<% if @params[:registrant_priv] %>
-Isikukood: <%= @params[:registrant_ident] %>
+Nimi: <%= @new_registrant.name %>
+<% if @new_registrant.priv? %>
+ Isikukood: <%= @new_registrant.ident %>
<% else %>
-Äriregistrikood: <%= @params[:registrant_ident] %>
+ Äriregistrikood: <%= @new_registrant.ident %>
<% end %>
-Epost: <%= @params[:registrant_email] %>
-Tänav: <%= @params[:registrant_street] %>
-Linn: <%= @params[:registrant_city] %>
-Riik: <%= @params[:registrant_country] %>
+Epost: <%= @new_registrant.email %>
+Tänav: <%= @new_registrant.street %>
+Linn: <%= @new_registrant.city %>
+Riik: <%= @new_registrant.country.name %>
Lugupidamisega
Eesti Interneti SA
@@ -21,19 +21,19 @@ Eesti Interneti SA
Hi,
-Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated.
+Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated.
New registrant:
-Name: <%= @params[:registrant_name] %>
-<% if @params[:registrant_priv] %>
-Personal code: <%= @params[:registrant_ident] %>
+Name: <%= @new_registrant.name %>
+<% if @new_registrant.priv? %>
+ Personal code: <%= @new_registrant.ident %>
<% else %>
-Business Registry code: <%= @params[:registrant_ident] %>
+ Business Registry code: <%= @new_registrant.ident %>
<% end %>
-E-mail: <%= @params[:registrant_email] %>
-Street: <%= @params[:registrant_street] %>
-City: <%= @params[:registrant_city] %>
-Country: <%= @params[:registrant_country] %>
+E-mail: <%= @new_registrant.email %>
+Street: <%= @new_registrant.street %>
+City: <%= @new_registrant.city %>
+Country: <%= @new_registrant.country.name %>
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb
index 115655897..64db26ec7 100644
--- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb
+++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb
@@ -1,18 +1,19 @@
Tere,
-Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
+Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
Uue registreerija andmed:
-Nimi: <%= @params[:registrant_name] %>
-<% if @params[:registrant_priv] %>
-Isikukood: <%= @params[:registrant_ident] %>
+Nimi: <%= @new_registrant.name %>
+
+<% if @new_registrant.priv? %>
+ Isikukood: <%= @new_registrant.ident %>
<% else %>
-Äriregistrikood: <%= @params[:registrant_ident] %>
+ Äriregistrikood: <%= @new_registrant.ident %>
<% end %>
-Epost: <%= @params[:registrant_email] %>
-Tänav: <%= @params[:registrant_street] %>
-Linn: <%= @params[:registrant_city] %>
-Riik: <%= @params[:registrant_country] %>
+Epost: <%= @new_registrant.email %>
+Tänav: <%= @new_registrant.street %>
+Linn: <%= @new_registrant.city %>
+Riik: <%= @new_registrant.country.name %>
Lugupidamisega
Eesti Interneti SA
@@ -21,19 +22,20 @@ Eesti Interneti SA
Hi,
-Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated.
+Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated.
New registrant:
-Name: <%= @params[:registrant_name] %>
-<% if @params[:registrant_priv] %>
-Personal code: <%= @params[:registrant_ident] %>
+Name: <%= @new_registrant.name %>
+
+<% if @new_registrant.priv? %>
+ Personal code: <%= @new_registrant.ident %>
<% else %>
-Business Registry code: <%= @params[:registrant_ident] %>
+ Business Registry code: <%= @new_registrant.ident %>
<% end %>
-E-mail: <%= @params[:registrant_email] %>
-Street: <%= @params[:registrant_street] %>
-City: <%= @params[:registrant_city] %>
-Country: <%= @params[:registrant_country] %>
+E-mail: <%= @new_registrant.email %>
+Street: <%= @new_registrant.street %>
+City: <%= @new_registrant.city %>
+Country: <%= @new_registrant.country.name %>
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb
index b41e1f1eb..180988f08 100644
--- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb
+++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb
@@ -1,18 +1,18 @@
Tere,
-Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
+Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
Uue registreerija andmed:
-Nimi: <%= @params[:new_registrant_name] %>
-<% if @params[:registrant_priv] %>
-Isikukood: <%= @params[:registrant_ident] %>
+Nimi: <%= @new_registrant.name %>
+<% if @new_registrant.priv? %>
+Isikukood: <%= @new_registrant.ident %>
<% else %>
-Äriregistrikood: <%= @params[:registrant_ident] %>
+Äriregistrikood: <%= @new_registrant.ident %>
<% end %>
-Epost: <%= @params[:registrant_email] %>
-Tänav: <%= @params[:registrant_street] %>
-Linn: <%= @params[:registrant_city] %>
-Riik: <%= @params[:registrant_country] %>
+Epost: <%= @new_registrant.email %>
+Tänav: <%= @new_registrant.street %>
+Linn: <%= @new_registrant.city %>
+Riik: <%= @new_registrant.country.name %>
Lugupidamisega
Eesti Interneti SA
@@ -21,19 +21,19 @@ Eesti Interneti SA
Hi,
-Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated.
+Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated.
New registrant:
-Name: <%= @params[:new_registrant_name] %>
-<% if @params[:registrant_priv] %>
-Personal code: <%= @params[:registrant_ident] %>
+Name: <%= @new_registrant.name %>
+<% if @new_registrant.priv? %>
+Personal code: <%= @new_registrant.ident %>
<% else %>
-Business Registry code: <%= @params[:registrant_ident] %>
+Business Registry code: <%= @new_registrant.ident %>
<% end %>
-E-mail: <%= @params[:registrant_email] %>
-Street: <%= @params[:registrant_street] %>
-City: <%= @params[:registrant_city] %>
-Country: <%= @params[:registrant_country] %>
+E-mail: <%= @new_registrant.email %>
+Street: <%= @new_registrant.street %>
+City: <%= @new_registrant.city %>
+Country: <%= @new_registrant.country.name %>
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb
index c2efa5af9..1d45fb5e0 100644
--- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb
+++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb
@@ -1,19 +1,19 @@
Tere,
-Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
+Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
Uue registreerija andmed:
-Nimi: <%= @params[:new_registrant_name] %>
+Nimi: <%= @new_registrant.name %>
-<% if @params[:registrant_priv] %>
-Isikukood: <%= @params[:registrant_ident] %>
+<% if @new_registrant.priv? %>
+Isikukood: <%= @new_registrant.ident %>
<% else %>
-Äriregistrikood: <%= @params[:registrant_ident] %>
+Äriregistrikood: <%= @new_registrant.ident %>
<% end %>
-Epost: <%= @params[:registrant_email] %>
-Tänav: <%= @params[:registrant_street] %>
-Linn: <%= @params[:registrant_city] %>
-Riik: <%= @params[:registrant_country] %>
+Epost: <%= @new_registrant.email %>
+Tänav: <%= @new_registrant.street %>
+Linn: <%= @new_registrant.city %>
+Riik: <%= @new_registrant.country.name %>
Lugupidamisega
Eesti Interneti SA
@@ -22,20 +22,20 @@ Eesti Interneti SA
Hi,
-Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated.
+Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated.
New registrant:
-Name: <%= @params[:new_registrant_name] %>
+Name: <%= @new_registrant.name %>
-<% if @params[:registrant_priv] %>
-Personal code: <%= @params[:registrant_ident] %>
+<% if @new_registrant.priv? %>
+Personal code: <%= @new_registrant.ident %>
<% else %>
-Business Registry code: <%= @params[:registrant_ident] %>
+Business Registry code: <%= @new_registrant.ident %>
<% end %>
-E-mail: <%= @params[:registrant_email] %>
-Street: <%= @params[:registrant_street] %>
-City: <%= @params[:registrant_city] %>
-Country: <%= @params[:registrant_country] %>
+E-mail: <%= @new_registrant.email %>
+Street: <%= @new_registrant.street %>
+City: <%= @new_registrant.city %>
+Country: <%= @new_registrant.country.name %>
Best Regards,
Estonian Internet Foundation
diff --git a/spec/mailers/domain_mailer_spec.rb b/spec/mailers/domain_mailer_spec.rb
index 3f645f7e0..9963fdd38 100644
--- a/spec/mailers/domain_mailer_spec.rb
+++ b/spec/mailers/domain_mailer_spec.rb
@@ -153,7 +153,7 @@ describe DomainMailer do
@registrant = Fabricate(:registrant, email: 'test@example.com')
@domain = Fabricate(:domain, registrant: @registrant)
@domain.deliver_emails = true
- @mail = DomainMailer.registrant_updated_notification_for_new_registrant(@domain.id, deliver_emails)
+ @mail = DomainMailer.registrant_updated_notification_for_new_registrant(@domain.id, @registrant.id, @registrant.id, deliver_emails)
end
it 'should render email subject' do
@@ -178,7 +178,7 @@ describe DomainMailer do
@registrant = Fabricate(:registrant, email: 'test@example.com')
@domain = Fabricate(:domain, registrant: @registrant)
@domain.deliver_emails = true
- @mail = DomainMailer.registrant_updated_notification_for_old_registrant(@domain.id, deliver_emails)
+ @mail = DomainMailer.registrant_updated_notification_for_old_registrant(@domain.id, @registrant.id, @registrant.id, deliver_emails)
end
it 'should render email subject' do
From 912b820f82ab1d6e855cbd32f6a7c62673165393 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 8 Apr 2016 15:12:56 +0300
Subject: [PATCH 081/180] Story#117124725 - generate emails of
apply_pending_update! only when everything is ok
---
app/models/epp/domain.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 2905bd968..738fd1077 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -537,8 +537,8 @@ class Epp::Domain < Domain
save! # for notification if everything fails
WhoisRecord.find_by(domain_id: id).save # need to reload model
- DomainMailer.registrant_updated_notification_for_old_registrant(id, old_registrant_id, registrant_id, should_deliver)
- DomainMailer.registrant_updated_notification_for_new_registrant(id, old_registrant_id, registrant_id, should_deliver)
+ DomainMailer.registrant_updated_notification_for_old_registrant(id, old_registrant_id, registrant_id, deliver_emails)
+ DomainMailer.registrant_updated_notification_for_new_registrant(id, old_registrant_id, registrant_id, deliver_emails)
true
end
From af81adee57b98a36f63816c77c7f1514e2fed84b Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 8 Apr 2016 15:29:37 +0300
Subject: [PATCH 082/180] Story#117124725 - generate emails of
apply_pending_update! only when everything is ok
---
app/models/epp/domain.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 738fd1077..2092f4480 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -537,8 +537,8 @@ class Epp::Domain < Domain
save! # for notification if everything fails
WhoisRecord.find_by(domain_id: id).save # need to reload model
- DomainMailer.registrant_updated_notification_for_old_registrant(id, old_registrant_id, registrant_id, deliver_emails)
- DomainMailer.registrant_updated_notification_for_new_registrant(id, old_registrant_id, registrant_id, deliver_emails)
+ DomainMailer.registrant_updated_notification_for_old_registrant(id, old_registrant_id, registrant_id, true).deliver
+ DomainMailer.registrant_updated_notification_for_new_registrant(id, old_registrant_id, registrant_id, true).deliver
true
end
From 28bed16539f03724792f238cf5e8cd3c96c29fa8 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 8 Apr 2016 15:34:43 +0300
Subject: [PATCH 083/180] Story#117124725 - old mailer domain variable wasn't
global
---
app/mailers/domain_mailer.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/mailers/domain_mailer.rb b/app/mailers/domain_mailer.rb
index fb2c0e851..afdfe89fc 100644
--- a/app/mailers/domain_mailer.rb
+++ b/app/mailers/domain_mailer.rb
@@ -26,8 +26,8 @@ class DomainMailer < ApplicationMailer
def registrant_updated_notification_for_old_registrant(domain_id, old_registrant_id, new_registrant_id, should_deliver)
- domain = Domain.find_by(id: domain_id)
- return unless domain
+ @domain = Domain.find_by(id: domain_id)
+ return unless @domain
return if delivery_off?(@domain, should_deliver)
@old_registrant = Registrant.find(old_registrant_id)
From 55af3c8326e8a0eec0ead67313303f6f27cea7df Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 8 Apr 2016 15:54:46 +0300
Subject: [PATCH 084/180] 116209751-params_change
---
app/models/depp/domain.rb | 7 +------
app/views/registrar/domains/form_partials/_general.haml | 2 +-
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/app/models/depp/domain.rb b/app/models/depp/domain.rb
index 03ee83592..05fd2fef9 100644
--- a/app/models/depp/domain.rb
+++ b/app/models/depp/domain.rb
@@ -189,7 +189,7 @@ module Depp
if domain_params[:verified].present?
custom_params[:_anonymus] << {
- chg: { registrant_verified: 'yes' }
+ registrant_verified: { value: 'yes' }
}
end
@@ -223,11 +223,6 @@ module Depp
chg = [{ registrant: { value: domain_params[:registrant] } }]
end
- if domain_params[:verified].present?
- chg.push({ registrant_verified: 'yes'}) if chg.present?
- chg = [{ registrant_verified: 'yes'}] if chg.nil?
- end
-
add_arr = nil if add_arr.none?
rem_arr = nil if rem_arr.none?
diff --git a/app/views/registrar/domains/form_partials/_general.haml b/app/views/registrar/domains/form_partials/_general.haml
index a41e6cd2b..91ae7462f 100644
--- a/app/views/registrar/domains/form_partials/_general.haml
+++ b/app/views/registrar/domains/form_partials/_general.haml
@@ -29,7 +29,7 @@
.col-md-3.control-label
= label_tag :verified, t(:verified)
.col-md-7
- = check_box_tag :verified, '1', params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
+ = check_box_tag 'domain[verified]', '1', @domain_params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
- unless params[:domain_name]
.form-group
From deb3b9a1995082b70f3b375368b9c72384f93e58 Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 8 Apr 2016 17:03:40 +0300
Subject: [PATCH 085/180] 117131083-force_delete_at_calculation_changed
---
app/models/domain.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 05804d02f..dbdbe2d42 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -575,7 +575,7 @@ class Domain < ActiveRecord::Base
statuses << DomainStatus::SERVER_MANUAL_INZONE
end
- self.force_delete_at = Time.zone.now + Setting.redemption_grace_period.days unless force_delete_at
+ self.force_delete_at = (Time.zone.now + 31.days).beginning_of_day unless force_delete_at
transaction do
save!(validate: false)
registrar.messages.create!(
From ba1b4dbf25f735d610509a269f2d602d907d4816 Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 11 Apr 2016 15:56:26 +0300
Subject: [PATCH 086/180] 117131083-force_delete_at_calculation
---
app/models/domain.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index dbdbe2d42..b4cadb106 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -575,7 +575,7 @@ class Domain < ActiveRecord::Base
statuses << DomainStatus::SERVER_MANUAL_INZONE
end
- self.force_delete_at = (Time.zone.now + 31.days).beginning_of_day unless force_delete_at
+ self.force_delete_at = (Time.zone.now + Setting.redemption_grace_period.days + 1.day).beginning_of_day unless force_delete_at
transaction do
save!(validate: false)
registrar.messages.create!(
From 178818288d1ce7f43b6592102971e82d632c34eb Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 11 Apr 2016 16:02:42 +0300
Subject: [PATCH 087/180] 117131083-force_delete_at_calculation
---
app/models/domain.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index b4cadb106..125fa5c75 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -575,7 +575,7 @@ class Domain < ActiveRecord::Base
statuses << DomainStatus::SERVER_MANUAL_INZONE
end
- self.force_delete_at = (Time.zone.now + Setting.redemption_grace_period.days + 1.day).beginning_of_day unless force_delete_at
+ self.force_delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day unless force_delete_at
transaction do
save!(validate: false)
registrar.messages.create!(
From 0089ed476d7f8a3311b52f26a17fe864ead80638 Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 11 Apr 2016 16:15:08 +0300
Subject: [PATCH 088/180] 116043697-save_added
---
app/jobs/domain_delete_confirm_job.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/jobs/domain_delete_confirm_job.rb b/app/jobs/domain_delete_confirm_job.rb
index cce230234..0bd129d42 100644
--- a/app/jobs/domain_delete_confirm_job.rb
+++ b/app/jobs/domain_delete_confirm_job.rb
@@ -13,6 +13,7 @@ class DomainDeleteConfirmJob < Que::Job
domain.poll_message!(:poll_pending_delete_rejected_by_registrant)
domain.cancel_pending_delete
end
+ domain.save(validate: false)
destroy # it's best to destroy the job in the same transaction
end
end
From 00391d358200114357d4d53e1cd10bea0bff5f2a Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 11 Apr 2016 18:46:49 +0300
Subject: [PATCH 089/180] 115595167-colum_for_api_response
---
app/controllers/application_controller.rb | 4 ++++
db/migrate/20160411140719_add_matching_column.rb | 12 ++++++++++++
2 files changed, 16 insertions(+)
create mode 100644 db/migrate/20160411140719_add_matching_column.rb
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index ac26e61a3..e3a611656 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -55,6 +55,10 @@ class ApplicationController < ActionController::Base
end
end
+ def info_for_paper_trail
+ { svTRID: request.svTRID }
+ end
+
def user_for_paper_trail
user_log_str(current_user)
end
diff --git a/db/migrate/20160411140719_add_matching_column.rb b/db/migrate/20160411140719_add_matching_column.rb
new file mode 100644
index 000000000..9432c0ed2
--- /dev/null
+++ b/db/migrate/20160411140719_add_matching_column.rb
@@ -0,0 +1,12 @@
+class AddMatchingColumn < ActiveRecord::Migration
+
+ def change
+ tables = [:log_domains, :log_contacts]
+
+ tables.each do |table|
+ add_column table, :svTRID, :text
+ end
+ end
+
+
+end
From 0696700e5d8fc86cf8a22dd3c17453476a300598 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 12 Apr 2016 22:32:32 +0300
Subject: [PATCH 090/180] 116209751-modification_for_update
---
app/models/depp/domain.rb | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/app/models/depp/domain.rb b/app/models/depp/domain.rb
index 05fd2fef9..c4889b062 100644
--- a/app/models/depp/domain.rb
+++ b/app/models/depp/domain.rb
@@ -187,12 +187,6 @@ module Depp
}
end
- if domain_params[:verified].present?
- custom_params[:_anonymus] << {
- registrant_verified: { value: 'yes' }
- }
- end
-
if domain_params[:reserved_pw].present?
custom_params[:_anonymus] << { reserved: { pw: { value: domain_params[:reserved_pw] } } }
end
@@ -223,6 +217,11 @@ module Depp
chg = [{ registrant: { value: domain_params[:registrant] } }]
end
+ if domain_params[:verified].present?
+ chg.push({ registrant_verified: 'yes'}) if chg.present?
+ chg = [{ registrant_verified: 'yes'}] if chg.nil?
+ end
+
add_arr = nil if add_arr.none?
rem_arr = nil if rem_arr.none?
From acd2c148561a8959eeb742bf0be227fb21e0213e Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 13 Apr 2016 01:11:13 +0300
Subject: [PATCH 091/180] 117131083-deleted_at_force_delete_at
---
app/models/domain.rb | 6 +++---
app/models/epp/domain.rb | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 125fa5c75..d5c275f7f 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -575,7 +575,7 @@ class Domain < ActiveRecord::Base
statuses << DomainStatus::SERVER_MANUAL_INZONE
end
- self.force_delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day unless force_delete_at
+ self.force_delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day.utc unless force_delete_at
transaction do
save!(validate: false)
registrar.messages.create!(
@@ -604,7 +604,7 @@ class Domain < ActiveRecord::Base
def set_graceful_expired
self.outzone_at = valid_to + Setting.expire_warning_period.days
- self.delete_at = outzone_at + Setting.redemption_grace_period.days
+ self.delete_at = (outzone_at + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day.utc
self.statuses |= [DomainStatus::EXPIRED]
end
@@ -612,7 +612,7 @@ class Domain < ActiveRecord::Base
# TODO: currently valid_to attribute update logic is open
# self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit)
self.outzone_at = Time.zone.now + Setting.expire_warning_period.days
- self.delete_at = Time.zone.now + Setting.redemption_grace_period.days
+ self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day.utc
statuses << DomainStatus::EXPIRED
end
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 1f2dd2d54..7bf01c28a 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -586,7 +586,7 @@ class Epp::Domain < Domain
msg: I18n.t(:object_status_prohibits_operation)
} unless pending_deletable?
- self.delete_at = Time.zone.now + Setting.redemption_grace_period.days
+ self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day.utc
set_pending_delete
set_server_hold if server_holdable?
save(validate: false)
From ce124beb8f7e4985aa93eb31bea4ec2ec7f64e2b Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 13 Apr 2016 10:50:41 +0300
Subject: [PATCH 092/180] Story#117124725 - show errors if something happens
---
app/jobs/domain_delete_confirm_job.rb | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/app/jobs/domain_delete_confirm_job.rb b/app/jobs/domain_delete_confirm_job.rb
index cce230234..e147e3aa8 100644
--- a/app/jobs/domain_delete_confirm_job.rb
+++ b/app/jobs/domain_delete_confirm_job.rb
@@ -3,17 +3,30 @@ class DomainDeleteConfirmJob < Que::Job
# 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.poll_message!(:poll_pending_delete_confirmed_by_registrant)
domain.apply_pending_delete!
+ raise_errors!(domain)
+
when RegistrantVerification::REJECTED
- DomainMailer.pending_delete_rejected_notification(domain_id, true).deliver
domain.statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
domain.poll_message!(:poll_pending_delete_rejected_by_registrant)
+
domain.cancel_pending_delete
+ domain.save(validate: false)
+ raise_errors!(domain)
+
+ DomainMailer.pending_delete_rejected_notification(domain_id, true).deliver
end
+
destroy # it's best to destroy the job in the same transaction
end
end
+
+
+ def raise_errors!(domain)
+ throw "domain #{domain.name} failed with errors #{domain.errors.full_messages}" if domain.errors.any?
+ end
end
From cef53f16d887e07b71cb53733db149e102fcad50 Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 13 Apr 2016 15:14:47 +0300
Subject: [PATCH 093/180] 116209751-value_change
---
app/models/depp/domain.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/models/depp/domain.rb b/app/models/depp/domain.rb
index c4889b062..afaff73fe 100644
--- a/app/models/depp/domain.rb
+++ b/app/models/depp/domain.rb
@@ -217,9 +217,9 @@ module Depp
chg = [{ registrant: { value: domain_params[:registrant] } }]
end
- if domain_params[:verified].present?
- chg.push({ registrant_verified: 'yes'}) if chg.present?
- chg = [{ registrant_verified: 'yes'}] if chg.nil?
+ if domain_params[:registrant] != old_domain_params[:registrant]
+ chg = [{ registrant: { value: domain_params[:registrant] } }] if !domain_params[:verified].present?
+ chg = [{ registrant: { value: domain_params[:registrant], attrs: { verified: 'yes' } } }] if domain_params[:verified]
end
add_arr = nil if add_arr.none?
From 5373c76c4087b073685eb54226024ce1547ea5c0 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 14 Apr 2016 14:32:32 +0300
Subject: [PATCH 094/180] Story#116962601 - faster epp logs
---
app/controllers/admin/epp_logs_controller.rb | 6 +++++-
app/controllers/admin/repp_logs_controller.rb | 6 +++++-
db/migrate/20160414110443_add_time_indexing_to_epp_log.rb | 6 ++++++
3 files changed, 16 insertions(+), 2 deletions(-)
create mode 100644 db/migrate/20160414110443_add_time_indexing_to_epp_log.rb
diff --git a/app/controllers/admin/epp_logs_controller.rb b/app/controllers/admin/epp_logs_controller.rb
index b14a99766..e9d8542ed 100644
--- a/app/controllers/admin/epp_logs_controller.rb
+++ b/app/controllers/admin/epp_logs_controller.rb
@@ -5,7 +5,11 @@ class Admin::EppLogsController < AdminController
def index
@q = ApiLog::EppLog.search(params[:q])
@q.sorts = 'id desc' if @q.sorts.empty?
- @epp_logs = @q.result.page(params[:page])
+
+ @epp_logs = @q.result
+ @epp_logs = @epp_logs.where("extract(epoch from created_at) >= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_gteq])) if params[:q][:created_at_gteq]
+ @epp_logs = @epp_logs.where("extract(epoch from created_at) <= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_lteq])) if params[:q][:created_at_lteq]
+ @epp_logs = @epp_logs.page(params[:page])
end
def show
diff --git a/app/controllers/admin/repp_logs_controller.rb b/app/controllers/admin/repp_logs_controller.rb
index 8e904007a..2b28c7227 100644
--- a/app/controllers/admin/repp_logs_controller.rb
+++ b/app/controllers/admin/repp_logs_controller.rb
@@ -5,7 +5,11 @@ class Admin::ReppLogsController < AdminController
def index
@q = ApiLog::ReppLog.search(params[:q])
@q.sorts = 'id desc' if @q.sorts.empty?
- @repp_logs = @q.result.page(params[:page])
+
+ @repp_logs = @q.result
+ @repp_logs = @repp_logs.where("extract(epoch from created_at) >= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_gteq])) if params[:q][:created_at_gteq]
+ @repp_logs = @repp_logs.where("extract(epoch from created_at) <= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_lteq])) if params[:q][:created_at_lteq]
+ @repp_logs = @repp_logs.page(params[:page])
end
def show
diff --git a/db/migrate/20160414110443_add_time_indexing_to_epp_log.rb b/db/migrate/20160414110443_add_time_indexing_to_epp_log.rb
new file mode 100644
index 000000000..30e4d155e
--- /dev/null
+++ b/db/migrate/20160414110443_add_time_indexing_to_epp_log.rb
@@ -0,0 +1,6 @@
+class AddTimeIndexingToEppLog < ActiveRecord::Migration
+ def change
+ ApiLog::EppLog.connection.execute( "CREATE INDEX CONCURRENTLY epp_logs_created_at ON epp_logs USING btree (extract(epoch from created_at));")
+ ApiLog::ReppLog.connection.execute("CREATE INDEX CONCURRENTLY repp_logs_created_at ON repp_logs USING btree (extract(epoch from created_at));")
+ end
+end
From 57be19a41a01f330ca88e70e4c2f3bd9d69bdbf5 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 14 Apr 2016 14:50:48 +0300
Subject: [PATCH 095/180] Story#116962601 - faster epp logs (check for
presence)
---
app/controllers/admin/epp_logs_controller.rb | 4 ++--
app/controllers/admin/repp_logs_controller.rb | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/controllers/admin/epp_logs_controller.rb b/app/controllers/admin/epp_logs_controller.rb
index e9d8542ed..46740a8d9 100644
--- a/app/controllers/admin/epp_logs_controller.rb
+++ b/app/controllers/admin/epp_logs_controller.rb
@@ -7,8 +7,8 @@ class Admin::EppLogsController < AdminController
@q.sorts = 'id desc' if @q.sorts.empty?
@epp_logs = @q.result
- @epp_logs = @epp_logs.where("extract(epoch from created_at) >= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_gteq])) if params[:q][:created_at_gteq]
- @epp_logs = @epp_logs.where("extract(epoch from created_at) <= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_lteq])) if params[:q][:created_at_lteq]
+ @epp_logs = @epp_logs.where("extract(epoch from created_at) >= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_gteq])) if params[:q][:created_at_gteq].present?
+ @epp_logs = @epp_logs.where("extract(epoch from created_at) <= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_lteq])) if params[:q][:created_at_lteq].present?
@epp_logs = @epp_logs.page(params[:page])
end
diff --git a/app/controllers/admin/repp_logs_controller.rb b/app/controllers/admin/repp_logs_controller.rb
index 2b28c7227..ff306b0fc 100644
--- a/app/controllers/admin/repp_logs_controller.rb
+++ b/app/controllers/admin/repp_logs_controller.rb
@@ -7,8 +7,8 @@ class Admin::ReppLogsController < AdminController
@q.sorts = 'id desc' if @q.sorts.empty?
@repp_logs = @q.result
- @repp_logs = @repp_logs.where("extract(epoch from created_at) >= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_gteq])) if params[:q][:created_at_gteq]
- @repp_logs = @repp_logs.where("extract(epoch from created_at) <= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_lteq])) if params[:q][:created_at_lteq]
+ @repp_logs = @repp_logs.where("extract(epoch from created_at) >= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_gteq])) if params[:q][:created_at_gteq].present?
+ @repp_logs = @repp_logs.where("extract(epoch from created_at) <= extract(epoch from ?::timestamp)", Time.parse(params[:q][:created_at_lteq])) if params[:q][:created_at_lteq].present?
@repp_logs = @repp_logs.page(params[:page])
end
From f3fe706eabe538e054ee6e696d9ef2c7b9fb9b99 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 14 Apr 2016 17:19:17 +0300
Subject: [PATCH 096/180] 117131083-utc_removed
---
app/models/domain.rb | 6 +++---
app/models/epp/domain.rb | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index d5c275f7f..a2ecc5451 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -575,7 +575,7 @@ class Domain < ActiveRecord::Base
statuses << DomainStatus::SERVER_MANUAL_INZONE
end
- self.force_delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day.utc unless force_delete_at
+ self.force_delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day unless force_delete_at
transaction do
save!(validate: false)
registrar.messages.create!(
@@ -604,7 +604,7 @@ class Domain < ActiveRecord::Base
def set_graceful_expired
self.outzone_at = valid_to + Setting.expire_warning_period.days
- self.delete_at = (outzone_at + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day.utc
+ self.delete_at = (outzone_at + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day
self.statuses |= [DomainStatus::EXPIRED]
end
@@ -612,7 +612,7 @@ class Domain < ActiveRecord::Base
# TODO: currently valid_to attribute update logic is open
# self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit)
self.outzone_at = Time.zone.now + Setting.expire_warning_period.days
- self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day.utc
+ self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day
statuses << DomainStatus::EXPIRED
end
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 7bf01c28a..8d102178f 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -586,7 +586,7 @@ class Epp::Domain < Domain
msg: I18n.t(:object_status_prohibits_operation)
} unless pending_deletable?
- self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day.utc
+ self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day
set_pending_delete
set_server_hold if server_holdable?
save(validate: false)
From 9ace5aafb1294ead273dac2b03feeafbaad60784 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 14 Apr 2016 17:22:18 +0300
Subject: [PATCH 097/180] 115595167-matching_column_name_changed
---
app/controllers/application_controller.rb | 2 +-
db/migrate/20160411140719_add_matching_column.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index e3a611656..fac9d29f4 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -56,7 +56,7 @@ class ApplicationController < ActionController::Base
end
def info_for_paper_trail
- { svTRID: request.svTRID }
+ { uuid: request.uuid }
end
def user_for_paper_trail
diff --git a/db/migrate/20160411140719_add_matching_column.rb b/db/migrate/20160411140719_add_matching_column.rb
index 9432c0ed2..1f0774824 100644
--- a/db/migrate/20160411140719_add_matching_column.rb
+++ b/db/migrate/20160411140719_add_matching_column.rb
@@ -4,7 +4,7 @@ class AddMatchingColumn < ActiveRecord::Migration
tables = [:log_domains, :log_contacts]
tables.each do |table|
- add_column table, :svTRID, :text
+ add_column table, :uuid, :text
end
end
From c9c4e82989d1e9ab3bf5ac5aaf08fa27b17456be Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 14 Apr 2016 17:33:07 +0300
Subject: [PATCH 098/180] 115595167-log_table_list_changed
---
db/migrate/20160411140719_add_matching_column.rb | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/db/migrate/20160411140719_add_matching_column.rb b/db/migrate/20160411140719_add_matching_column.rb
index 1f0774824..c16aef530 100644
--- a/db/migrate/20160411140719_add_matching_column.rb
+++ b/db/migrate/20160411140719_add_matching_column.rb
@@ -1,7 +1,12 @@
class AddMatchingColumn < ActiveRecord::Migration
def change
- tables = [:log_domains, :log_contacts]
+ tables = [:log_account_activities, :log_accounts, :log_addresses, :log_api_users, :log_bank_statements,
+ :log_bank_transactions, :log_blocked_domains, :log_certificates, :log_contact_statuses, :log_contacts,
+ :log_countries, :log_dnskeys, :log_domain_contacts, :log_domain_statuses, :log_domain_transfers,
+ :log_domains, :log_invoice_items, :log_invoices, :log_keyrelays, :log_messages, :log_nameservers,
+ :log_pricelists, :log_registrars, :log_reserved_domains, :log_settings, :log_users, :log_white_ips,
+ :log_zonefile_settings]
tables.each do |table|
add_column table, :uuid, :text
From c09c039f3cac8658ee591e3b889ea151d485caae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Fri, 15 Apr 2016 10:05:57 +0300
Subject: [PATCH 099/180] changed pending update and delete rejection messages
[bug 117124725]
---
config/locales/en.yml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 6372d401d..fd864ddf3 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -827,16 +827,16 @@ en:
domain_registrant_change_confirmed_body: 'You have successfully submitted domain registrant change confirmation. You will receive email confirmation.'
registrant_domain_verification_confirmed: 'Domain registrant change has successfully received.'
registrant_domain_verification_confirmed_failed: 'Something went wrong.'
- domain_registrant_change_rejected_title: 'Domain registrant change has been rejected'
- domain_registrant_change_rejected_body: 'You have rejected domain registrant change.'
+ domain_registrant_change_rejected_title: 'Domain registrant change rejection has been received'
+ domain_registrant_change_rejected_body: 'You have rejected domain registrant change. You will receive confirmation by email.'
registrant_domain_verification_rejected: 'Domain registrant change has been rejected successfully.'
registrant_domain_verification_rejected_failed: 'Something went wrong.'
domain_delete_title: 'Please confirm or reject domain deletation'
domain_delete_body: 'There is a request to delete a domain. Before doing it we need your confirmation.'
domain_delete_confirmed_title: 'Domain deletion has been received successfully'
domain_delete_confirmed_body: 'You have successfully submitted delete confirmation. You will receive registry final confirmation to email.'
- domain_delete_rejected_title: 'Domain deletion has been rejected successfully'
- domain_delete_rejected_body: 'You have rejected domain deletion.'
+ domain_delete_rejected_title: 'Domain deletion rejection has been received successfully'
+ domain_delete_rejected_body: 'You have rejected pending domain deletion. You will receive confirmation by email.'
no_permission: 'No permission'
access_denied: 'Access denied'
common_name: 'Common name'
From 8e1ce321438345b5b5dfcfa9526b34e7bcc5e872 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Fri, 15 Apr 2016 11:10:40 +0300
Subject: [PATCH 100/180] fixed incorrect pending delete confirm page messages
[bug 117124725]
---
.../registrant/domain_delete_confirms_controller.rb | 8 ++++----
config/locales/en.yml | 6 +++++-
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/app/controllers/registrant/domain_delete_confirms_controller.rb b/app/controllers/registrant/domain_delete_confirms_controller.rb
index f6f05d628..209456808 100644
--- a/app/controllers/registrant/domain_delete_confirms_controller.rb
+++ b/app/controllers/registrant/domain_delete_confirms_controller.rb
@@ -22,18 +22,18 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController
verification_token: params[:token])
if params[:rejected]
if @registrant_verification.domain_registrant_delete_reject!
- flash[:notice] = t(:registrant_domain_verification_rejected)
+ flash[:notice] = t(:registrant_domain_delete_rejected)
redirect_to registrant_domain_delete_confirm_path(@domain.id, rejected: true)
else
- flash[:alert] = t(:registrant_domain_verification_rejected_failed)
+ flash[:alert] = t(:registrant_domain_delete_rejected_failed)
return render 'show'
end
elsif params[:confirmed]
if @registrant_verification.domain_registrant_delete_confirm!
- flash[:notice] = t(:registrant_domain_verification_confirmed)
+ flash[:notice] = t(:registrant_domain_delete_confirmed)
redirect_to registrant_domain_delete_confirm_path(@domain.id, confirmed: true)
else
- flash[:alert] = t(:registrant_domain_verification_confirmed_failed)
+ flash[:alert] = t(:registrant_domain_delete_confirmed_failed)
return render 'show'
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index fd864ddf3..de5891c77 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -831,10 +831,14 @@ en:
domain_registrant_change_rejected_body: 'You have rejected domain registrant change. You will receive confirmation by email.'
registrant_domain_verification_rejected: 'Domain registrant change has been rejected successfully.'
registrant_domain_verification_rejected_failed: 'Something went wrong.'
- domain_delete_title: 'Please confirm or reject domain deletation'
+ domain_delete_title: 'Please confirm or reject domain deletion'
domain_delete_body: 'There is a request to delete a domain. Before doing it we need your confirmation.'
+ registrant_domain_delete_confirmed: 'Setting the domain up for deletion...'
+ registrant_domain_delete_confirmed_failed: 'Something went wrong.'
domain_delete_confirmed_title: 'Domain deletion has been received successfully'
domain_delete_confirmed_body: 'You have successfully submitted delete confirmation. You will receive registry final confirmation to email.'
+ registrant_domain_delete_rejected: 'Rejecting the domain deletion...'
+ registrant_domain_delete_rejected_failed: 'Something went wrong.'
domain_delete_rejected_title: 'Domain deletion rejection has been received successfully'
domain_delete_rejected_body: 'You have rejected pending domain deletion. You will receive confirmation by email.'
no_permission: 'No permission'
From 96d5ae579ca7fa6877e9cdc267a694bd2a4a633d Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 15 Apr 2016 13:02:49 +0300
Subject: [PATCH 101/180] 115595167-logs_migration
---
app/api/repp/api.rb | 3 ++-
app/controllers/epp_controller.rb | 3 ++-
db/migrate/20160411140719_add_matching_column.rb | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/app/api/repp/api.rb b/app/api/repp/api.rb
index 7a9ecd1e8..f52770920 100644
--- a/app/api/repp/api.rb
+++ b/app/api/repp/api.rb
@@ -49,7 +49,8 @@ module Repp
response_code: status,
api_user_name: current_user.try(:username),
api_user_registrar: current_user.try(:registrar).try(:to_s),
- ip: request.ip
+ ip: request.ip,
+ uuid: request.uuid
})
end
diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb
index 49be47848..d692190eb 100644
--- a/app/controllers/epp_controller.rb
+++ b/app/controllers/epp_controller.rb
@@ -371,7 +371,8 @@ class EppController < ApplicationController
response: @response,
api_user_name: @api_user.try(:username) || current_user.try(:username) || 'api-public',
api_user_registrar: @api_user.try(:registrar).try(:to_s) || current_user.try(:registrar).try(:to_s),
- ip: request.ip
+ ip: request.ip,
+ uuid: request.uuid
})
end
# rubocop: enable Metrics/CyclomaticComplexity
diff --git a/db/migrate/20160411140719_add_matching_column.rb b/db/migrate/20160411140719_add_matching_column.rb
index c16aef530..a1b158313 100644
--- a/db/migrate/20160411140719_add_matching_column.rb
+++ b/db/migrate/20160411140719_add_matching_column.rb
@@ -9,7 +9,7 @@ class AddMatchingColumn < ActiveRecord::Migration
:log_zonefile_settings]
tables.each do |table|
- add_column table, :uuid, :text
+ add_column table, :uuid, :string
end
end
From 7770a4d77833f7cf2c650419fb64f46ed7677d73 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 15 Apr 2016 13:49:48 +0300
Subject: [PATCH 102/180] Story#117690107 - strip contact email
---
app/models/contact.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index 3e7ae4fc8..6c61ee698 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -46,6 +46,7 @@ class Contact < ActiveRecord::Base
before_validation :to_upcase_country_code
before_validation :prefix_code
+ before_validation :strip_email
before_create :generate_auth_info
before_update :manage_emails
@@ -411,6 +412,10 @@ class Contact < ActiveRecord::Base
"#{code} #{name}"
end
+ def strip_email
+ self.email = email.to_s.strip
+ end
+
# what we can do load firstly by registrant
# if total is smaller than needed, the load more
From c87907c56a0af239c4ad25040be465d650de2de4 Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 15 Apr 2016 14:29:57 +0300
Subject: [PATCH 103/180] 116209751-param_added
---
app/models/depp/domain.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/models/depp/domain.rb b/app/models/depp/domain.rb
index afaff73fe..997a6b693 100644
--- a/app/models/depp/domain.rb
+++ b/app/models/depp/domain.rb
@@ -66,8 +66,9 @@ module Depp
def delete(domain_params)
xml = epp_xml.delete({
- name: { value: domain_params[:name] }
- }, Depp::Domain.construct_custom_params_hash(domain_params))
+ name: { value: domain_params[:name] }},
+ Depp::Domain.construct_custom_params_hash(domain_params),
+ (domain_params[:verified].present? && 'yes'))
current_user.request(xml)
end
From 7043097ec0cdb5aff8f02700ffee6b1a077dcec5 Mon Sep 17 00:00:00 2001
From: Stas
Date: Sun, 17 Apr 2016 15:12:10 +0300
Subject: [PATCH 104/180] 117131083-timezone_precision
---
app/models/domain.rb | 6 +++---
app/models/epp/domain.rb | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index a2ecc5451..7d383f6c9 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -575,7 +575,7 @@ class Domain < ActiveRecord::Base
statuses << DomainStatus::SERVER_MANUAL_INZONE
end
- self.force_delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day unless force_delete_at
+ self.force_delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).utc.beginning_of_day unless force_delete_at
transaction do
save!(validate: false)
registrar.messages.create!(
@@ -604,7 +604,7 @@ class Domain < ActiveRecord::Base
def set_graceful_expired
self.outzone_at = valid_to + Setting.expire_warning_period.days
- self.delete_at = (outzone_at + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day
+ self.delete_at = (outzone_at + (Setting.redemption_grace_period.days + 1.day)).utc.beginning_of_day
self.statuses |= [DomainStatus::EXPIRED]
end
@@ -612,7 +612,7 @@ class Domain < ActiveRecord::Base
# TODO: currently valid_to attribute update logic is open
# self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit)
self.outzone_at = Time.zone.now + Setting.expire_warning_period.days
- self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day
+ self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).utc.beginning_of_day
statuses << DomainStatus::EXPIRED
end
diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb
index 8d102178f..69bb101f8 100644
--- a/app/models/epp/domain.rb
+++ b/app/models/epp/domain.rb
@@ -586,7 +586,7 @@ class Epp::Domain < Domain
msg: I18n.t(:object_status_prohibits_operation)
} unless pending_deletable?
- self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).beginning_of_day
+ self.delete_at = (Time.zone.now + (Setting.redemption_grace_period.days + 1.day)).utc.beginning_of_day
set_pending_delete
set_server_hold if server_holdable?
save(validate: false)
From 8ab42450cad35c94f508591ffb14799acd8344a6 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 18 Apr 2016 12:07:00 +0300
Subject: [PATCH 105/180] Story#117612061 - do not send email if it's contact
was removed
---
app/mailers/contact_mailer.rb | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/mailers/contact_mailer.rb b/app/mailers/contact_mailer.rb
index 08beae05d..731175d5d 100644
--- a/app/mailers/contact_mailer.rb
+++ b/app/mailers/contact_mailer.rb
@@ -4,6 +4,11 @@ class ContactMailer < ApplicationMailer
def email_updated(old_email, email, contact_id, should_deliver)
@contact = Contact.find_by(id: contact_id)
@old_email = old_email
+ unless @contact
+ Rails.logger.info "Cannot send email in #{self.class.name}.#{__method__} with contact_id #{contact_id}. It cannot be found"
+ return
+ end
+
return unless email || @contact
return if delivery_off?(@contact, should_deliver)
From 5b32ba5e5875a4c8290b41b204fc004c3d93fb66 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 18 Apr 2016 12:07:13 +0300
Subject: [PATCH 106/180] Story#117612061 - do not send email if it's contact
was removed
---
app/mailers/contact_mailer.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/mailers/contact_mailer.rb b/app/mailers/contact_mailer.rb
index 731175d5d..bbfecfca6 100644
--- a/app/mailers/contact_mailer.rb
+++ b/app/mailers/contact_mailer.rb
@@ -5,7 +5,7 @@ class ContactMailer < ApplicationMailer
@contact = Contact.find_by(id: contact_id)
@old_email = old_email
unless @contact
- Rails.logger.info "Cannot send email in #{self.class.name}.#{__method__} with contact_id #{contact_id}. It cannot be found"
+ Rails.logger.info "Cannot send email in #{self.class.name}##{__method__} with contact_id #{contact_id}. It cannot be found"
return
end
From a82f096fef5328c4fde55ae95b9d65d78d23850c Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 18 Apr 2016 15:32:14 +0300
Subject: [PATCH 107/180] 117226457-name_for_contacts
---
app/views/registrar/domains/partials/_contacts.haml | 3 ++-
app/views/registrar/domains/partials/_general.haml | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/app/views/registrar/domains/partials/_contacts.haml b/app/views/registrar/domains/partials/_contacts.haml
index 536f256b7..93058923c 100644
--- a/app/views/registrar/domains/partials/_contacts.haml
+++ b/app/views/registrar/domains/partials/_contacts.haml
@@ -9,7 +9,8 @@
%th{class: 'col-xs-8'}= t(:id)
%tbody
- @data.css('contact').each do |x|
+ - registrant = Contact.find_by_code(x.text)
%tr
%td= x['type']
%td= x.text
-
+ %td= registrant.name
\ No newline at end of file
diff --git a/app/views/registrar/domains/partials/_general.haml b/app/views/registrar/domains/partials/_general.haml
index 4eb5285e7..5381d0865 100644
--- a/app/views/registrar/domains/partials/_general.haml
+++ b/app/views/registrar/domains/partials/_general.haml
@@ -10,8 +10,9 @@
%dt= t(:registrar)
%dd= @data.css('clID').text
+ - registrant = Contact.find_by_code(@data.css('registrant').text)
%dt= t(:registrant)
- %dd= @data.css('registrant').text
+ %dd= "#{registrant.name} (#{@data.css('registrant').text})"
%dt= t(:registered)
%dd= @data.css('crDate').text
From 16641ce2c28eaf5dfdfcdbb43483b2851cb1cfd9 Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 18 Apr 2016 15:40:29 +0300
Subject: [PATCH 108/180] 117226457-css_changes
---
app/views/registrar/domains/partials/_contacts.haml | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/app/views/registrar/domains/partials/_contacts.haml b/app/views/registrar/domains/partials/_contacts.haml
index 93058923c..b94f99ee2 100644
--- a/app/views/registrar/domains/partials/_contacts.haml
+++ b/app/views/registrar/domains/partials/_contacts.haml
@@ -6,11 +6,12 @@
%thead
%tr
%th{class: 'col-xs-4'}= t(:type)
- %th{class: 'col-xs-8'}= t(:id)
+ %th{class: 'col-xs-4'}= t(:name)
+ %th{class: 'col-xs-4'}= t(:id)
%tbody
- @data.css('contact').each do |x|
- registrant = Contact.find_by_code(x.text)
%tr
%td= x['type']
- %td= x.text
- %td= registrant.name
\ No newline at end of file
+ %td= registrant.name
+ %td= x.text
\ No newline at end of file
From efbadd10c0fab5f85efc73280101a12ba15b26e5 Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 18 Apr 2016 18:09:24 +0300
Subject: [PATCH 109/180] 116209751-gemfile_modification
---
Gemfile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Gemfile b/Gemfile
index d616cb534..f6dc77b0f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -88,7 +88,9 @@ gem 'digidoc_client', '0.2.1'
# epp
gem 'epp', '1.4.2', github: 'internetee/epp'
-gem 'epp-xml', '1.0.4' # EIS EPP XMLs
+gem 'epp-xml', '1.0.4',
+ github: 'internetee/epp-xml',
+ ref: '287fe8705ca2f344ea670b922dd9f08635efc7af' # EIS EPP XMLs
gem 'uuidtools', '2.1.5' # For unique IDs (used by the epp gem)
# que
From dd0886f3075648265cd231882855040b51cb00d8 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 19 Apr 2016 11:04:07 +0300
Subject: [PATCH 110/180] 116209751-gemlock_update
---
Gemfile.lock | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Gemfile.lock b/Gemfile.lock
index dbc1e8e3c..d2a5dd926 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -16,6 +16,15 @@ GIT
data_migrate (1.3.0)
rails (>= 4.1.0)
+GIT
+ remote: https://github.com/internetee/epp-xml.git
+ revision: 287fe8705ca2f344ea670b922dd9f08635efc7af
+ ref: 287fe8705ca2f344ea670b922dd9f08635efc7af
+ specs:
+ epp-xml (1.0.4)
+ activesupport (~> 4.1)
+ builder (~> 3.2)
+
GIT
remote: https://github.com/internetee/epp.git
revision: 505c3f2739eb1da918e54111aecfb138a822739d
From 8b49c3882033636a7653419116eda27f730ee5a3 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 19 Apr 2016 11:20:04 +0300
Subject: [PATCH 111/180] 116209751-gemfile.lock
---
Gemfile.lock | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/Gemfile.lock b/Gemfile.lock
index d2a5dd926..591643057 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -200,9 +200,6 @@ GEM
docile (1.1.5)
domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
- epp-xml (1.0.4)
- activesupport (~> 4.1)
- builder (~> 3.2)
equalizer (0.0.11)
erubis (2.7.0)
execjs (2.6.0)
@@ -598,7 +595,7 @@ DEPENDENCIES
devise (= 3.5.4)
digidoc_client (= 0.2.1)
epp (= 1.4.2)!
- epp-xml (= 1.0.4)
+ epp-xml (= 1.0.4)!
fabrication (= 2.13.2)
faker (= 1.4.3)
figaro (= 1.1.1)
From b8df59d2ff8a990a0bcdb3703077765be2e757ba Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 19 Apr 2016 12:28:41 +0300
Subject: [PATCH 112/180] 117702653-csv_fix
---
app/models/account_activity.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/models/account_activity.rb b/app/models/account_activity.rb
index 3a0e7dc30..c6523be33 100644
--- a/app/models/account_activity.rb
+++ b/app/models/account_activity.rb
@@ -6,7 +6,6 @@ class AccountActivity < ActiveRecord::Base
belongs_to :bank_transaction
belongs_to :invoice
- attr_accessor :registrar
CREATE = 'create'
RENEW = 'renew'
@@ -24,14 +23,15 @@ class AccountActivity < ActiveRecord::Base
end
def to_csv
- attributes = %w(registrar description activity_type created_at sum)
+ attributes = %w(description activity_type created_at sum)
CSV.generate(headers: true) do |csv|
csv << %w(registrar description activity_type receipt_date sum)
all.each do |x| # rubocop:disable Rails/FindEach
- x.registrar = Registrar.find(x.account_id).try(:code)
- csv << attributes.map { |attr| x.send(attr) }
+ attrs = [x.account.registrar.try(:code)]
+ attrs += attributes.map { |attr| x.send(attr) }
+ csv << attrs
end
end
end
From 62d6c531802a09ff7ed6ac15396bd201bff978a1 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 19 Apr 2016 19:38:33 +0300
Subject: [PATCH 113/180] 115595167-frame_present
---
app/controllers/epp_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb
index d692190eb..de1002604 100644
--- a/app/controllers/epp_controller.rb
+++ b/app/controllers/epp_controller.rb
@@ -361,7 +361,7 @@ class EppController < ApplicationController
if request_command == 'login' && frame.present?
frame.gsub!(/pw>.+<\//, 'pw>[FILTERED]')
end
- trimmed_request = frame.gsub(/]+)>([^<])+<\/eis:legalDocument>/, "[FILTERED]")
+ trimmed_request = frame.gsub(/]+)>([^<])+<\/eis:legalDocument>/, "[FILTERED]") if frame.present?
ApiLog::EppLog.create({
request: trimmed_request,
From da1228a457b646d01a8f43ea8cd14e95e9ac8d5c Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 20 Apr 2016 13:43:35 +0300
Subject: [PATCH 114/180] 115595167-extra_columns
---
db/migrate/20160411140719_add_matching_column.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/db/migrate/20160411140719_add_matching_column.rb b/db/migrate/20160411140719_add_matching_column.rb
index a1b158313..48be2ac39 100644
--- a/db/migrate/20160411140719_add_matching_column.rb
+++ b/db/migrate/20160411140719_add_matching_column.rb
@@ -11,7 +11,9 @@ class AddMatchingColumn < ActiveRecord::Migration
tables.each do |table|
add_column table, :uuid, :string
end
+
+ ApiLog::EppLog.connection.execute("ALTER TABLE epp_logs ADD COLUMN uuid varchar;")
+ ApiLog::ReppLog.connection.execute("ALTER TABLE repp_logs ADD COLUMN uuid varchar;")
+
end
-
-
end
From 5048b9309e22bb592af187cc01bd0d01147c144f Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 20 Apr 2016 14:04:54 +0300
Subject: [PATCH 115/180] Story#117991277 - allow to update country code if
ident type is birthday
---
app/models/epp/contact.rb | 2 ++
1 file changed, 2 insertions(+)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index 52fef7143..ff119024d 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -173,6 +173,8 @@ class Epp::Contact < Contact
elsif ident_type == "birthday" && !ident[/\A\d{4}-\d{2}-\d{2}\z/] && (Date.parse(ident) rescue false)
at.merge!(ident: ident_frame.text)
at.merge!(ident_country_code: ident_frame.attr('cc')) if ident_frame.attr('cc').present?
+ elsif ident_type == "birthday" && ident_country_code.blank?
+ at.merge!(ident_country_code: ident_frame.attr('cc'))
elsif ident_type.blank? && ident_country_code.blank?
at.merge!(ident_type: ident_frame.attr('type'))
at.merge!(ident_country_code: ident_frame.attr('cc')) if ident_frame.attr('cc').present?
From 0d87f53e106b92ffeda1412af29f6aff81eb0a68 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 20 Apr 2016 14:08:58 +0300
Subject: [PATCH 116/180] Story#117991277 - making commit
---
app/models/epp/contact.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index ff119024d..df2dabf78 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -173,7 +173,7 @@ class Epp::Contact < Contact
elsif ident_type == "birthday" && !ident[/\A\d{4}-\d{2}-\d{2}\z/] && (Date.parse(ident) rescue false)
at.merge!(ident: ident_frame.text)
at.merge!(ident_country_code: ident_frame.attr('cc')) if ident_frame.attr('cc').present?
- elsif ident_type == "birthday" && ident_country_code.blank?
+ elsif ident_type == "birthday" && ident_country_code.blank?
at.merge!(ident_country_code: ident_frame.attr('cc'))
elsif ident_type.blank? && ident_country_code.blank?
at.merge!(ident_type: ident_frame.attr('type'))
From c8ccac84f355ea2d84625e754d93bf7ef067828b Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 20 Apr 2016 14:43:55 +0300
Subject: [PATCH 117/180] Story#117991277 - validate contact with birthday
cannot be Estonian
---
app/models/contact.rb | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index 3e7ae4fc8..090e64866 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -81,7 +81,7 @@ class Contact < ActiveRecord::Base
ORG = 'org'
PRIV = 'priv'
- BIRTHDAY = 'birthday'
+ BIRTHDAY = 'birthday'.freeze
PASSPORT = 'passport'
IDENT_TYPES = [
@@ -252,6 +252,8 @@ class Contact < ActiveRecord::Base
if ident.size != 8 || !(ident =~/\A[0-9]{8}\z/)
errors.add(:ident, err_msg)
end
+ when BIRTHDAY
+ errors.add(:ident, err_msg)
end
end
end
@@ -284,6 +286,10 @@ class Contact < ActiveRecord::Base
!org?
end
+ def birthday?
+ ident_type == BIRTHDAY
+ end
+
def generate_auth_info
return if @generate_auth_info_disabled
return if auth_info.present?
From 045b285b3706107a396811daa0393f7f1e92c12e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Wed, 20 Apr 2016 15:35:32 +0300
Subject: [PATCH 118/180] fixed typos in contact update e-mail messages
---
app/views/mailers/contact_mailer/email_updated.html.erb | 6 +++---
app/views/mailers/contact_mailer/email_updated.text.erb | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/views/mailers/contact_mailer/email_updated.html.erb b/app/views/mailers/contact_mailer/email_updated.html.erb
index cd5a75682..2c5a265e9 100644
--- a/app/views/mailers/contact_mailer/email_updated.html.erb
+++ b/app/views/mailers/contact_mailer/email_updated.html.erb
@@ -1,10 +1,10 @@
Tere <%= @contact.name %>
-Kontakti <%= @contact.name %> eposti aadress on muudetud
+Kontakti <%= @contact.name %> e-posti aadress on muudetud
endine aadress: <%= @old_email %>
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 %>
+E-posti aadressile saadetakse domeeni toimingutega seotud infot, seal hulgas kinnitustaotlused omanikuvahetuse ja domeeni kustutamise korral. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @contact.registrar.name %>
<% if @contact.related_domain_descriptions.present? %>
Muudatusega seotud domeenid:
@@ -16,7 +16,7 @@ Muudatusega seotud domeenid:
Kontaktandmed:
Nimi: <%= @contact.name %>
Isikukood: <%= @contact.ident %>
-Epost: <%= @contact.email %>
+E-post: <%= @contact.email %>
Tel: <%= @contact.phone %>
Tänav: <%= @contact.street %>
Linn: <%= @contact.city %>
diff --git a/app/views/mailers/contact_mailer/email_updated.text.erb b/app/views/mailers/contact_mailer/email_updated.text.erb
index a899c04c2..835ea2ad6 100644
--- a/app/views/mailers/contact_mailer/email_updated.text.erb
+++ b/app/views/mailers/contact_mailer/email_updated.text.erb
@@ -1,10 +1,10 @@
Tere <%= @contact.name %>
-Kontakti <%= @contact.name %> eposti aadress on muudetud
+Kontakti <%= @contact.name %> e-posti aadress on muudetud
endine aadress: <%= @old_email %>
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 %>
+E-posti aadressile saadetakse domeeni toimingutega seotud infot, seal hulgas kinnitustaotlused omanikuvahetuse ja domeeni kustutamise korral. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @contact.registrar.name %>
<% if @contact.related_domain_descriptions.present? %>
Muudatusega seotud domeenid:
@@ -16,7 +16,7 @@ Muudatusega seotud domeenid:
Kontaktandmed:
Nimi: <%= @contact.name %>
Isikukood: <%= @contact.ident %>
-Epost: <%= @contact.email %>
+E-post: <%= @contact.email %>
Tel: <%= @contact.phone %>
Tänav: <%= @contact.street %>
Linn: <%= @contact.city %>
From 10b7ce3eea586abd6bb132e8dac14110e47571ad Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 20 Apr 2016 16:04:29 +0300
Subject: [PATCH 119/180] Story#117612931 - contact touch is not regenerating
all whoises once and once again
---
app/models/contact.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index 090e64866..3cc42419f 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -551,6 +551,9 @@ class Contact < ActiveRecord::Base
end
def update_related_whois_records
+ # not doing anything if no real changes
+ return if changes.slice(*(self.class.column_names - ["updated_at", "created_at", "statuses", "status_notes"])).empty?
+
names = related_domain_descriptions.keys
UpdateWhoisRecordJob.enqueue(names, :domain) if names.present?
end
From 16de6bfaea157c5d9eed35c28370d85ff7d58748 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 21 Apr 2016 11:03:13 +0300
Subject: [PATCH 120/180] 115595167-new_migration
---
db/migrate/20160411140719_add_matching_column.rb | 4 ----
db/migrate/20160421074023_add_log_matching_column.rb | 9 +++++++++
2 files changed, 9 insertions(+), 4 deletions(-)
create mode 100644 db/migrate/20160421074023_add_log_matching_column.rb
diff --git a/db/migrate/20160411140719_add_matching_column.rb b/db/migrate/20160411140719_add_matching_column.rb
index 48be2ac39..bbc15d352 100644
--- a/db/migrate/20160411140719_add_matching_column.rb
+++ b/db/migrate/20160411140719_add_matching_column.rb
@@ -11,9 +11,5 @@ class AddMatchingColumn < ActiveRecord::Migration
tables.each do |table|
add_column table, :uuid, :string
end
-
- ApiLog::EppLog.connection.execute("ALTER TABLE epp_logs ADD COLUMN uuid varchar;")
- ApiLog::ReppLog.connection.execute("ALTER TABLE repp_logs ADD COLUMN uuid varchar;")
-
end
end
diff --git a/db/migrate/20160421074023_add_log_matching_column.rb b/db/migrate/20160421074023_add_log_matching_column.rb
new file mode 100644
index 000000000..6ea1931a9
--- /dev/null
+++ b/db/migrate/20160421074023_add_log_matching_column.rb
@@ -0,0 +1,9 @@
+class AddLogMatchingColumn < ActiveRecord::Migration
+
+ def change
+
+ ApiLog::EppLog.connection.execute("ALTER TABLE epp_logs ADD COLUMN uuid varchar;")
+ ApiLog::ReppLog.connection.execute("ALTER TABLE repp_logs ADD COLUMN uuid varchar;")
+
+ end
+end
From 16f0f940c8f1ad1f6459c1f9c3a50616d54b29cf Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 21 Apr 2016 12:38:15 +0300
Subject: [PATCH 121/180] Story#117991277 - switch off Contact's birthday and
cc=EE validation on update for now
---
app/models/contact.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index 090e64866..57174296a 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -253,7 +253,7 @@ class Contact < ActiveRecord::Base
errors.add(:ident, err_msg)
end
when BIRTHDAY
- errors.add(:ident, err_msg)
+ errors.add(:ident, err_msg) if id.blank? # only for create action right now. Later for all of them
end
end
end
From 6a49099b5282b8a2de5df6d7d3b2c3defba465c7 Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 22 Apr 2016 15:13:16 +0300
Subject: [PATCH 122/180] 116209751-template_fix
---
app/views/registrar/domains/delete.haml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/registrar/domains/delete.haml b/app/views/registrar/domains/delete.haml
index 706587629..f90f8ce04 100644
--- a/app/views/registrar/domains/delete.haml
+++ b/app/views/registrar/domains/delete.haml
@@ -8,9 +8,9 @@
.panel-body
.form-group
.col-md-4.control-label
- = label_tag :verified, t(:verified)
+ = label_tag 'domain[verified]', t(:verified)
.col-md-6
- = check_box_tag :verified, '1', params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
+ = check_box_tag 'domain[verified]', '1', domain[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
.form-group
.col-md-4.control-label
From 7e1ad772585f8129308167edec766ef6f6419a73 Mon Sep 17 00:00:00 2001
From: Stas
Date: Sun, 24 Apr 2016 16:26:16 +0300
Subject: [PATCH 123/180] 116209751-ref_to_another_commit
---
Gemfile | 2 +-
Gemfile.lock | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Gemfile b/Gemfile
index f6dc77b0f..d9ad7593a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -90,7 +90,7 @@ gem 'digidoc_client', '0.2.1'
gem 'epp', '1.4.2', github: 'internetee/epp'
gem 'epp-xml', '1.0.4',
github: 'internetee/epp-xml',
- ref: '287fe8705ca2f344ea670b922dd9f08635efc7af' # EIS EPP XMLs
+ ref: '009611d78a3bebab33c04f73968f4606863f4b93' # EIS EPP XMLs
gem 'uuidtools', '2.1.5' # For unique IDs (used by the epp gem)
# que
diff --git a/Gemfile.lock b/Gemfile.lock
index 591643057..c4ace1088 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -18,8 +18,8 @@ GIT
GIT
remote: https://github.com/internetee/epp-xml.git
- revision: 287fe8705ca2f344ea670b922dd9f08635efc7af
- ref: 287fe8705ca2f344ea670b922dd9f08635efc7af
+ revision: 009611d78a3bebab33c04f73968f4606863f4b93
+ ref: 009611d78a3bebab33c04f73968f4606863f4b93
specs:
epp-xml (1.0.4)
activesupport (~> 4.1)
From 5025758bc1b96954425f80c2ef1feaef42204824 Mon Sep 17 00:00:00 2001
From: Stas
Date: Sun, 24 Apr 2016 16:49:59 +0300
Subject: [PATCH 124/180] 116209751-typo
---
app/views/registrar/domains/delete.haml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/registrar/domains/delete.haml b/app/views/registrar/domains/delete.haml
index f90f8ce04..ab1bdfa31 100644
--- a/app/views/registrar/domains/delete.haml
+++ b/app/views/registrar/domains/delete.haml
@@ -10,7 +10,7 @@
.col-md-4.control-label
= label_tag 'domain[verified]', t(:verified)
.col-md-6
- = check_box_tag 'domain[verified]', '1', domain[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
+ = check_box_tag 'domain[verified]', '1', params[:verified].eql?('1'), onclick: "return (confirm('#{t(:verified_confirm)}') ? true : false);"
.form-group
.col-md-4.control-label
From f45b4978766855c0463acb58d34394970e0b01ff Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 25 Apr 2016 18:13:52 +0300
Subject: [PATCH 125/180] 117350717-sorting_fixes
---
app/controllers/admin/contacts_controller.rb | 10 +++++-----
app/controllers/admin/domains_controller.rb | 2 +-
app/views/admin/account_activities/index.haml | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/app/controllers/admin/contacts_controller.rb b/app/controllers/admin/contacts_controller.rb
index 3a05bb759..5156578db 100644
--- a/app/controllers/admin/contacts_controller.rb
+++ b/app/controllers/admin/contacts_controller.rb
@@ -10,22 +10,22 @@ class Admin::ContactsController < AdminController
search_params[:registrant_domains_id_not_null] = 1
end
- @q = Contact.includes(:registrar).search(search_params)
+ @q = Contact.includes(:registrar).joins(:registrar).select('contacts.*, registrars.name').search(search_params)
@contacts = @q.result(distinct: :true).page(params[:page])
if params[:statuses_contains]
- contacts = Contact.includes(:registrar).where(
+ contacts = Contact.includes(:registrar).joins(:registrar).select('contacts.*, registrars.name').where(
"contacts.statuses @> ?::varchar[]", "{#{params[:statuses_contains].join(',')}}"
)
else
- contacts = Contact.includes(:registrar)
+ contacts = Contact.includes(:registrar).joins(:registrar).select('contacts.*, registrars.name')
end
contacts = contacts.where("ident_country_code is null or ident_country_code=''") if params[:only_no_country_code].eql?('1')
normalize_search_parameters do
- @q = contacts.search(search_params)
- @contacts = @q.result(distinct: :true).page(params[:page])
+ @q = contacts.includes(:registrar).joins(:registrar).select('contacts.*, registrars.name').search(search_params)
+ @contacts = @q.result.uniq.page(params[:page])
end
@contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
diff --git a/app/controllers/admin/domains_controller.rb b/app/controllers/admin/domains_controller.rb
index 377912bad..e619c4da9 100644
--- a/app/controllers/admin/domains_controller.rb
+++ b/app/controllers/admin/domains_controller.rb
@@ -9,7 +9,7 @@ class Admin::DomainsController < AdminController
params[:q] ||= {}
if params[:statuses_contains]
domains = Domain.includes(:registrar, :registrant).where(
- "statuses @> ?::varchar[]", "{#{params[:statuses_contains].join(',')}}"
+ "domains.statuses @> ?::varchar[]", "{#{params[:statuses_contains].join(',')}}"
)
else
domains = Domain.includes(:registrar, :registrant)
diff --git a/app/views/admin/account_activities/index.haml b/app/views/admin/account_activities/index.haml
index e29f12f75..0a60e0809 100644
--- a/app/views/admin/account_activities/index.haml
+++ b/app/views/admin/account_activities/index.haml
@@ -56,7 +56,7 @@
%thead
%tr
%th{class: 'col-xs-2'}
- = sort_link(@q, 'registrar')
+ = sort_link(@q, 'account_registrar_code', t(:registrar))
%th{class: 'col-xs-3'}
= sort_link(@q, 'description')
%th{class: 'col-xs-2'}
From 47483f8d7576bdc1cb3b4681b8b472ce68d3c4fa Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Tue, 26 Apr 2016 11:06:49 +0300
Subject: [PATCH 126/180] Story#118300251 - remove old not needed code
---
app/controllers/admin/domain_versions_controller.rb | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/app/controllers/admin/domain_versions_controller.rb b/app/controllers/admin/domain_versions_controller.rb
index 44a2087cd..389530098 100644
--- a/app/controllers/admin/domain_versions_controller.rb
+++ b/app/controllers/admin/domain_versions_controller.rb
@@ -1,18 +1,8 @@
class Admin::DomainVersionsController < AdminController
load_and_authorize_resource
- # rubocop:disable Style/GuardClause
def index
@domain = Domain.where(id: params[:domain_id]).includes({versions: :item}).first
@versions = @domain.versions
-
- # Depricated it had to load legal document. We may do it by parsing and adding link.
- # if @domain.pending_json.present?
- # frame = Nokogiri::XML(@domain.pending_json['frame'])
- # @pending_user = User.find(@domain.pending_json['current_user_id'])
- # @pending_domain = Epp::Domain.find(@domain.id)
- # @pending_domain.update(frame, @pending_user, false)
- # end
end
- # rubocop:enable Style/GuardClause
end
From 576fa914b4112ed9f9bd9c7918d8fe88d055b059 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 28 Apr 2016 13:15:13 +0300
Subject: [PATCH 127/180] 114677695-utf8_nameservers
---
app/models/nameserver.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb
index ccedf0880..168b5129e 100644
--- a/app/models/nameserver.rb
+++ b/app/models/nameserver.rb
@@ -8,7 +8,7 @@ class Nameserver < ActiveRecord::Base
# scope :owned_by_registrar, -> (registrar) { joins(:domain).where('domains.registrar_id = ?', registrar.id) }
# rubocop: disable Metrics/LineLength
- validates :hostname, format: { with: /\A(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/ }
+ validates :hostname, domain_name: true
# validates :ipv4, format: { with: /\A(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\z/, allow_blank: true }
# validates :ipv6, format: { with: /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/, allow_blank: true }
validate :val_ipv4
From d04f558af55b4fa840e4d0c8f3425ebcf4ceca09 Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 29 Apr 2016 18:17:41 +0300
Subject: [PATCH 128/180] 114677695-converter_and_migration
---
app/models/nameserver.rb | 10 +++++
...9114732_add_puny_hostname_to_nameserver.rb | 9 ++++
lib/tasks/convert.rake | 42 +++++++++++++++++++
3 files changed, 61 insertions(+)
create mode 100644 db/migrate/20160429114732_add_puny_hostname_to_nameserver.rb
diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb
index 168b5129e..d86813908 100644
--- a/app/models/nameserver.rb
+++ b/app/models/nameserver.rb
@@ -16,6 +16,8 @@ class Nameserver < ActiveRecord::Base
# rubocop: enable Metrics/LineLength
before_validation :normalize_attributes
+ before_validation :hostname_to_utf
+ after_validation :add_hostname_puny
delegate :name, to: :domain, prefix: true
@@ -41,6 +43,14 @@ class Nameserver < ActiveRecord::Base
self.ipv6 = Array(ipv6).reject(&:blank?).map(&:strip).map(&:upcase)
end
+ def hostname_to_utf
+ self.hostname = SimpleIDN.to_unicode(hostname)
+ end
+
+ def add_hostname_puny
+ self.hostname_puny = SimpleIDN.to_ascii(hostname)
+ end
+
def to_s
hostname
end
diff --git a/db/migrate/20160429114732_add_puny_hostname_to_nameserver.rb b/db/migrate/20160429114732_add_puny_hostname_to_nameserver.rb
new file mode 100644
index 000000000..368d9f144
--- /dev/null
+++ b/db/migrate/20160429114732_add_puny_hostname_to_nameserver.rb
@@ -0,0 +1,9 @@
+class AddPunyHostnameToNameserver < ActiveRecord::Migration
+
+ def change
+
+ add_column :nameservers, :hostname_puny, :string
+ execute "UPDATE nameservers n SET hostname_puny = n.hostname"
+
+ end
+end
diff --git a/lib/tasks/convert.rake b/lib/tasks/convert.rake
index 35e68046c..47e0ec7c2 100644
--- a/lib/tasks/convert.rake
+++ b/lib/tasks/convert.rake
@@ -71,5 +71,47 @@ namespace :convert do
end
end
end
+
+ desc 'Convert nameservers hostname and hostname_puny'
+ task nameserves_hostname: :environment do
+
+ start = Time.zone.now.to_f
+ count = 0
+ puts '-----> Converting hostnames...'
+
+ Nameserver.find_each(:batch_size => 1000) do |ns|
+ ns.hostname = SimpleIDN.to_unicode(ns.hostname)
+ ns.hostname_puny = SimpleIDN.to_ascii(ns.hostname_puny)
+ ns.save validate: false
+ count += 1
+ puts "-----> Converted #{count} nameservers" if count % 1000 == 0
+ end
+ puts "-----> Converted #{count} nameservers #{(Time.zone.now.to_f - start).round(2)} seconds"
+
+ end
+
+ desc 'Convert nameservers history hostname'
+ task nameserves_history_hostname: :environment do
+
+ start = Time.zone.now.to_f
+ count = 0
+ puts '-----> Converting hostnames history...'
+
+ NameserverVersion.find_each do |ns|
+ if obj = ns.object
+ obj["hostname"] = SimpleIDN.to_unicode(obj["hostname"])
+ ns.object = obj
+ end
+
+ if (obj_c = ns.object_changes).present?
+ obj_c["name"].map!{|e| e ? SimpleIDN.to_unicode(e) : e } if obj_c["hostname"]
+ ns.object_changes = obj_c
+ end
+ count += 1
+ ns.save!
+ end
+ puts "-----> Converted #{count} history rows #{(Time.zone.now.to_f - start).round(2)} seconds"
+ end
+
end
From 00a1d70bc579327db857e17c1cc173e8d51835e4 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 3 May 2016 15:52:43 +0300
Subject: [PATCH 129/180] 111601356-ident_type_validation
---
app/models/contact.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index 57174296a..d6d5369dd 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -33,6 +33,7 @@ class Contact < ActiveRecord::Base
uniqueness: { message: :epp_id_taken },
format: { with: /\A[\w\-\:\.\_]*\z/i, message: :invalid },
length: { maximum: 100, message: :too_long_contact_code }
+ validates :ident_type, inclusion: {in: %w( org priv birthday)}
validate :val_ident_valid_format?
validate :uniq_statuses?
validate :validate_html
From a5e9dde027913dfa63b41fddc9943731b6b17e5e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Thu, 5 May 2016 09:13:23 +0300
Subject: [PATCH 130/180] Fixed typos in automatic emails sent to notify about
a pending registrant change request
---
.../pending_update_notification_for_new_registrant.html.erb | 4 ++--
.../pending_update_notification_for_new_registrant.text.erb | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb
index 07de23117..cbf450d9d 100644
--- a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb
+++ b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb
@@ -15,9 +15,9 @@ Tänav: <%= @params[:registrant_street] %>
Linn: <%= @params[:registrant_city] %>
Riik: <%= @params[:registrant_country] %>
-Juhime Teie tähelepanu asjaolule, et omanikuvahetuse protseduur viiaks lõpule vaid juhul, kui domeeni hetkel kehtiv registreerija <%= @params[:old_registrant_name] %> omanikuvahetuse tähtaegselt kinnitab.
+Juhime Teie tähelepanu asjaolule, et omanikuvahetuse protseduur viiakse lõpule vaid juhul, kui domeeni hetkel kehtiv registreerija <%= @params[:old_registrant_name] %> omanikuvahetuse tähtaegselt kinnitab.
-Juhul kui <%= @params[:old_registrant_name] %> lükkab omanikuvahtuse taotluse tagasi või ei anna kinnitust enne <%= Setting.expire_pending_confirmation %> tundi, omanikuvahetuse protseduur tühistatakse.
+Juhul kui <%= @params[:old_registrant_name] %> lükkab omanikuvahetuse taotluse tagasi või ei anna kinnitust enne <%= Setting.expire_pending_confirmation %> tundi, omanikuvahetuse protseduur tühistatakse.
Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
diff --git a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb
index 24005a58a..7db6f2f93 100644
--- a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb
+++ b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb
@@ -15,9 +15,9 @@ Tänav: <%= @params[:registrant_street] %>
Linn: <%= @params[:registrant_city] %>
Riik: <%= @params[:registrant_country] %>
-Juhime Teie tähelepanu asjaolule, et omanikuvahetuse protseduur viiaks lõpule vaid juhul, kui domeeni hetkel kehtiv registreerija <%= @params[:old_registrant_name] %> omanikuvahetuse tähtaegselt kinnitab.
+Juhime Teie tähelepanu asjaolule, et omanikuvahetuse protseduur viiakse lõpule vaid juhul, kui domeeni hetkel kehtiv registreerija <%= @params[:old_registrant_name] %> omanikuvahetuse tähtaegselt kinnitab.
-Juhul kui <%= @params[:old_registrant_name] %> lükkab omanikuvahtuse taotluse tagasi või ei anna kinnitust enne <%= Setting.expire_pending_confirmation %> tundi, omanikuvahetuse protseduur tühistatakse.
+Juhul kui <%= @params[:old_registrant_name] %> lükkab omanikuvahetuse taotluse tagasi või ei anna kinnitust enne <%= Setting.expire_pending_confirmation %> tundi, omanikuvahetuse protseduur tühistatakse.
Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
From 21da9bbc9b2c6f1976c61647b35644225b2f4873 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 5 May 2016 20:06:11 +0300
Subject: [PATCH 131/180] 117226457-uuid
---
app/api/repp/api.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/api/repp/api.rb b/app/api/repp/api.rb
index 7a9ecd1e8..27d0322b0 100644
--- a/app/api/repp/api.rb
+++ b/app/api/repp/api.rb
@@ -49,7 +49,8 @@ module Repp
response_code: status,
api_user_name: current_user.try(:username),
api_user_registrar: current_user.try(:registrar).try(:to_s),
- ip: request.ip
+ ip: request.ip,
+ uuid: request.try(:uuid)
})
end
From ce297dacd6e6fd037c73672cfad84b93fcf308a2 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 10 May 2016 15:18:20 +0300
Subject: [PATCH 132/180] 116209751-dublicate_deleted
---
app/models/depp/domain.rb | 4 ----
1 file changed, 4 deletions(-)
diff --git a/app/models/depp/domain.rb b/app/models/depp/domain.rb
index 997a6b693..f181d0000 100644
--- a/app/models/depp/domain.rb
+++ b/app/models/depp/domain.rb
@@ -214,10 +214,6 @@ module Depp
rem_arr << { ns: rem_ns } if rem_ns.any?
rem_arr << { _anonymus: rem_anon } if rem_anon.any?
- if domain_params[:registrant] != old_domain_params[:registrant]
- chg = [{ registrant: { value: domain_params[:registrant] } }]
- end
-
if domain_params[:registrant] != old_domain_params[:registrant]
chg = [{ registrant: { value: domain_params[:registrant] } }] if !domain_params[:verified].present?
chg = [{ registrant: { value: domain_params[:registrant], attrs: { verified: 'yes' } } }] if domain_params[:verified]
From 729b2f150e7dfbc1b9c4e13afffab5651a8f82f2 Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 11 May 2016 13:32:08 +0300
Subject: [PATCH 133/180] 118911315-data_type_change
---
app/models/blocked_domain.rb | 2 +-
app/models/reserved_domain.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/models/blocked_domain.rb b/app/models/blocked_domain.rb
index 2e337dce4..3708dd6e6 100644
--- a/app/models/blocked_domain.rb
+++ b/app/models/blocked_domain.rb
@@ -40,7 +40,7 @@ class BlockedDomain < ActiveRecord::Base
def generate_json
h = HashWithIndifferentAccess.new
h[:name] = self.name
- h[:status] = 'Blocked'
+ h[:status] = ['Blocked']
h
end
diff --git a/app/models/reserved_domain.rb b/app/models/reserved_domain.rb
index 9f36fcebc..e80b96c24 100644
--- a/app/models/reserved_domain.rb
+++ b/app/models/reserved_domain.rb
@@ -65,7 +65,7 @@ class ReservedDomain < ActiveRecord::Base
def generate_json
h = HashWithIndifferentAccess.new
h[:name] = self.name
- h[:status] = 'Reserved'
+ h[:status] = ['Reserved']
h
end
From 7bfbd0044fa9c81701ed93b06a7d9aa8fb1bca2b Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 12 May 2016 17:32:25 +0300
Subject: [PATCH 134/180] 114677695-validation_changes
---
app/models/nameserver.rb | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb
index d86813908..1dbb02d19 100644
--- a/app/models/nameserver.rb
+++ b/app/models/nameserver.rb
@@ -8,7 +8,7 @@ class Nameserver < ActiveRecord::Base
# scope :owned_by_registrar, -> (registrar) { joins(:domain).where('domains.registrar_id = ?', registrar.id) }
# rubocop: disable Metrics/LineLength
- validates :hostname, domain_name: true
+ validates :hostname, format: { with: /\A(([a-zA-Z0-9]|[a-zA-ZäöüõÄÖÜÕ0-9][a-zA-ZäöüõÄÖÜÕ0-9\-]*[a-zA-ZäöüõÄÖÜÕ0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/ }
# validates :ipv4, format: { with: /\A(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\z/, allow_blank: true }
# validates :ipv6, format: { with: /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/, allow_blank: true }
validate :val_ipv4
@@ -16,9 +16,7 @@ class Nameserver < ActiveRecord::Base
# rubocop: enable Metrics/LineLength
before_validation :normalize_attributes
- before_validation :hostname_to_utf
- after_validation :add_hostname_puny
-
+
delegate :name, to: :domain, prefix: true
def epp_code_map
@@ -43,18 +41,15 @@ class Nameserver < ActiveRecord::Base
self.ipv6 = Array(ipv6).reject(&:blank?).map(&:strip).map(&:upcase)
end
- def hostname_to_utf
- self.hostname = SimpleIDN.to_unicode(hostname)
- end
-
- def add_hostname_puny
- self.hostname_puny = SimpleIDN.to_ascii(hostname)
- end
-
def to_s
hostname
end
+ def hostname=(hostname)
+ self[:hostname] = SimpleIDN.to_unicode(hostname)
+ self[:hostname_puny] = SimpleIDN.to_ascii(hostname)
+ end
+
def val_ipv4
regexp = /\A(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\z/
ipv4.to_a.each do |ip|
From 59f21221f5c1d120ecfa7a74962b88860a997370 Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 16 May 2016 12:32:47 +0300
Subject: [PATCH 135/180] 117690107-request_trim
---
app/controllers/epp_controller.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb
index de1002604..3948a0645 100644
--- a/app/controllers/epp_controller.rb
+++ b/app/controllers/epp_controller.rb
@@ -362,6 +362,7 @@ class EppController < ApplicationController
frame.gsub!(/pw>.+<\//, 'pw>[FILTERED]')
end
trimmed_request = frame.gsub(/]+)>([^<])+<\/eis:legalDocument>/, "[FILTERED]") if frame.present?
+ trimmed_request.gsub(/\s+, "<").gsub(/>\s+/, ">")
ApiLog::EppLog.create({
request: trimmed_request,
From c41266ce8d8cd6e49a40c096be5c0c6d02bd4414 Mon Sep 17 00:00:00 2001
From: Stas
Date: Mon, 16 May 2016 18:07:12 +0300
Subject: [PATCH 136/180] 118827261-wrong_msg_deleted
---
app/views/epp/poll/poll_req.xml.builder | 2 --
1 file changed, 2 deletions(-)
diff --git a/app/views/epp/poll/poll_req.xml.builder b/app/views/epp/poll/poll_req.xml.builder
index 605ca496e..e8275dc95 100644
--- a/app/views/epp/poll/poll_req.xml.builder
+++ b/app/views/epp/poll/poll_req.xml.builder
@@ -13,8 +13,6 @@ xml.epp_head do
case @message.attached_obj_type
when 'DomainTransfer'
xml << render('epp/domains/partials/transfer', builder: xml, dt: @object)
- when 'DomainVersion'
- xml << render('epp/domains/partials/delete_complete', builder: xml, bye_bye: @object)
end
end if @object
From 01f8aa1e68671109ca1fe793d627cb4b38a8cdfc Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 18 May 2016 18:18:08 +0300
Subject: [PATCH 137/180] 116209751-updated_gem_ref
---
Gemfile | 4 +---
Gemfile.lock | 7 +++----
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/Gemfile b/Gemfile
index d9ad7593a..d990fa2cb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -88,9 +88,7 @@ gem 'digidoc_client', '0.2.1'
# epp
gem 'epp', '1.4.2', github: 'internetee/epp'
-gem 'epp-xml', '1.0.4',
- github: 'internetee/epp-xml',
- ref: '009611d78a3bebab33c04f73968f4606863f4b93' # EIS EPP XMLs
+gem 'epp-xml', '1.0.5', github: 'internetee/epp-xml' # EIS EPP XMLs
gem 'uuidtools', '2.1.5' # For unique IDs (used by the epp gem)
# que
diff --git a/Gemfile.lock b/Gemfile.lock
index c4ace1088..577bbbf20 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -18,10 +18,9 @@ GIT
GIT
remote: https://github.com/internetee/epp-xml.git
- revision: 009611d78a3bebab33c04f73968f4606863f4b93
- ref: 009611d78a3bebab33c04f73968f4606863f4b93
+ revision: 475f650951f2cf5015e00d48f408a2194ecc1662
specs:
- epp-xml (1.0.4)
+ epp-xml (1.0.5)
activesupport (~> 4.1)
builder (~> 3.2)
@@ -595,7 +594,7 @@ DEPENDENCIES
devise (= 3.5.4)
digidoc_client (= 0.2.1)
epp (= 1.4.2)!
- epp-xml (= 1.0.4)!
+ epp-xml (= 1.0.5)!
fabrication (= 2.13.2)
faker (= 1.4.3)
figaro (= 1.1.1)
From b18021774d690e327b32fd12c5e2f95dd6329d8f Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 19 May 2016 13:35:01 +0300
Subject: [PATCH 138/180] 114677695-reg_exp_and_length_change
---
app/models/nameserver.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb
index 1dbb02d19..729ac6cbf 100644
--- a/app/models/nameserver.rb
+++ b/app/models/nameserver.rb
@@ -8,7 +8,7 @@ class Nameserver < ActiveRecord::Base
# scope :owned_by_registrar, -> (registrar) { joins(:domain).where('domains.registrar_id = ?', registrar.id) }
# rubocop: disable Metrics/LineLength
- validates :hostname, format: { with: /\A(([a-zA-Z0-9]|[a-zA-ZäöüõÄÖÜÕ0-9][a-zA-ZäöüõÄÖÜÕ0-9\-]*[a-zA-ZäöüõÄÖÜÕ0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/ }
+ validates :hostname, length: { maximum: 63 }, format: { with: /\A(([a-zA-Z0-9]|[a-zA-ZäöüõšžÄÖÜÕŠŽ0-9][a-zA-ZäöüõšžÄÖÜÕŠŽ0-9\-]*[a-zA-ZäöüõšžÄÖÜÕŠŽ0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/ }
# validates :ipv4, format: { with: /\A(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\z/, allow_blank: true }
# validates :ipv6, format: { with: /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/, allow_blank: true }
validate :val_ipv4
From 92c7469372aa8e9b42761a6b530280d415bc7629 Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 19 May 2016 18:06:27 +0300
Subject: [PATCH 139/180] 117690170-request_trim
---
app/controllers/epp_controller.rb | 1 -
lib/epp_constraint.rb | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb
index 3948a0645..de1002604 100644
--- a/app/controllers/epp_controller.rb
+++ b/app/controllers/epp_controller.rb
@@ -362,7 +362,6 @@ class EppController < ApplicationController
frame.gsub!(/pw>.+<\//, 'pw>[FILTERED]')
end
trimmed_request = frame.gsub(/]+)>([^<])+<\/eis:legalDocument>/, "[FILTERED]") if frame.present?
- trimmed_request.gsub(/\s+, "<").gsub(/>\s+/, ">")
ApiLog::EppLog.create({
request: trimmed_request,
diff --git a/lib/epp_constraint.rb b/lib/epp_constraint.rb
index 06cf3d45a..71c0e2fb2 100644
--- a/lib/epp_constraint.rb
+++ b/lib/epp_constraint.rb
@@ -11,6 +11,7 @@ class EppConstraint
# creates parsed_frame, detects epp request object
def matches?(request)
# TODO: Maybe move this to controller to keep params clean
+ request.params[:raw_frame] = request.params[:raw_frame].gsub!(/\s<\//, "").gsub(/>\s/, ">")
request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame])
request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
From 12ada2af79eda0e811cd251e473e931d18614d6b Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 19 May 2016 18:13:22 +0300
Subject: [PATCH 140/180] 118827161-emty_block_remove
---
app/views/epp/poll/poll_req.xml.builder | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/app/views/epp/poll/poll_req.xml.builder b/app/views/epp/poll/poll_req.xml.builder
index e8275dc95..d5da707a6 100644
--- a/app/views/epp/poll/poll_req.xml.builder
+++ b/app/views/epp/poll/poll_req.xml.builder
@@ -9,13 +9,11 @@ xml.epp_head do
xml.msg @message.body
end
- xml.resData do
- case @message.attached_obj_type
- when 'DomainTransfer'
- xml << render('epp/domains/partials/transfer', builder: xml, dt: @object)
- end
- end if @object
-
+ if @message.attached_obj_type == 'DomainTransfer'
+ xml.resData do
+ xml << render('epp/domains/partials/transfer', builder: xml, dt: @object)
+ end if @object
+ end
render('epp/shared/trID', builder: xml)
end
end
From 50fe0fa462921a788027ab5258c5c434d7d2ce28 Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 20 May 2016 14:01:12 +0300
Subject: [PATCH 141/180] 117690107-trim_logic_change
---
lib/epp_constraint.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/epp_constraint.rb b/lib/epp_constraint.rb
index 71c0e2fb2..9cd68c121 100644
--- a/lib/epp_constraint.rb
+++ b/lib/epp_constraint.rb
@@ -11,7 +11,7 @@ class EppConstraint
# creates parsed_frame, detects epp request object
def matches?(request)
# TODO: Maybe move this to controller to keep params clean
- request.params[:raw_frame] = request.params[:raw_frame].gsub!(/\s<\//, "").gsub(/>\s/, ">")
+ request.params[:raw_frame] = request.params[:raw_frame].gsub!(/(?<=>)(.*?)(?=<)/) { |s| s.strip}
request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame])
request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
From 866f44815dae1ae1156baf87721d460f99211756 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Fri, 20 May 2016 15:14:19 +0300
Subject: [PATCH 142/180] Update CHANGELOG.md
---
CHANGELOG.md | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 68391b057..ce74bbb10 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,27 @@
+20.05.2016
+
+* Portal for registrars
+ * domain details view new displays contact name in addition to ID (#117226457)
+ * added an option to set veryfied = "yes" parameter to GUI for registrant change and domain delete opertions (#116209751)
+* Admin interface
+ * BUG: fixed number of sorting issues on different views (#117350717)
+ * BUG: internal error on filtered list sorting (#115043065)
+ * BUG: account activities csv export messes up registrars (#117702653)
+ * usability fixes to history view (#115762063)
+* Registry
+ * epp-xml gem reference updated to v 1.0.5 (#116209751)
+ * epp-xml gem is now taken from local repo https://github.com/internetee/epp-xml/blob/master, the version in RubyGems is not updated any more (#116209751)
+ * BUG: domains set to force delete were deleted a day ahead of time (#117131083)
+ * BUG: QUE - undefined method `code' for nil:NilClass - if contact is removed before Que gets to it (#117612061)
+ * BUG: Que - uninitialized constant RegenerateWhoisRecordJob (#117986917)
+* EPP
+ * BUG: poll message on domain delete does not validate against .ee xml schemas (#118827261)
+ * BUG: internal error on domain delete (#118159567)
+* RestWHOIS
+ * BUG: statuses not in array for not registered reserved and blocked domains (#118911315)
+
+...
+
21.09.2015
* eis-1.0.xsd schema file updated without a new version, please publish a new updated schema file to public.
From a51f536781f58df0e53a057951752f0bb0429704 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 20 May 2016 15:32:06 +0300
Subject: [PATCH 143/180] Story#118912395 - rearrange before_action for more
readability
---
app/controllers/epp_controller.rb | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb
index de1002604..57a5f34d4 100644
--- a/app/controllers/epp_controller.rb
+++ b/app/controllers/epp_controller.rb
@@ -6,8 +6,14 @@ class EppController < ApplicationController
before_action :generate_svtrid
before_action :latin_only
-
before_action :validate_against_schema
+ before_action :validate_request
+ before_action :update_epp_session
+
+ around_action :catch_epp_errors
+
+ helper_method :current_user
+
def validate_against_schema
return if ['hello', 'error', 'keyrelay'].include?(params[:action])
schema.validate(params[:nokogiri_frame]).each do |error|
@@ -20,10 +26,7 @@ class EppController < ApplicationController
handle_errors and return if epp_errors.any?
end
- before_action :validate_request
- before_action :update_epp_session
- around_action :catch_epp_errors
def catch_epp_errors
err = catch(:epp_error) do
yield
@@ -34,7 +37,6 @@ class EppController < ApplicationController
handle_errors
end
- helper_method :current_user
rescue_from StandardError do |e|
@errors ||= []
From 0a0b9c323b6550fc7c42767f12819a49a5361d67 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 20 May 2016 15:40:10 +0300
Subject: [PATCH 144/180] Story#115762063 - update which children elements
should be saved in logs
---
app/models/domain.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 7d383f6c9..5959cbb90 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -739,9 +739,10 @@ class Domain < ActiveRecord::Base
log[:admin_contacts] = admin_contact_ids
log[:tech_contacts] = tech_contact_ids
log[:nameservers] = nameserver_ids
+ log[:dnskeys] = dnskey_ids
+ log[:domain_statuses]= domain_status_ids
log[:legal_documents]= [legal_document_id]
log[:registrant] = [registrant_id]
- log[:domain_statuses] = domain_status_ids
log
end
From 36a854ab4c02d46d8c8dc5dde4ba2b6894356320 Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 20 May 2016 16:30:33 +0300
Subject: [PATCH 145/180] =?UTF-8?q?11=D1=91601356-error=5Fmap=5Fupd?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/epp/contact.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index df2dabf78..f6bf54f74 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -126,6 +126,7 @@ class Epp::Contact < Contact
[:ident, :invalid_birthday_format],
[:ident, :invalid_country_code],
[:ident_type, :missing],
+ [:ident_type, :invalid],
[:code, :invalid],
[:code, :too_long_contact_code]
],
From 714dd1473d58e4ba0239603d9e9ad0428a08b194 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 20 May 2016 16:37:38 +0300
Subject: [PATCH 146/180] Story#118912395 - EppLog saves resource
---
app/controllers/epp/keyrelays_controller.rb | 4 ++++
app/controllers/epp/polls_controller.rb | 4 ++++
app/controllers/epp/sessions_controller.rb | 5 +++++
app/controllers/epp_controller.rb | 8 +++++++-
config/routes.rb | 2 +-
5 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/app/controllers/epp/keyrelays_controller.rb b/app/controllers/epp/keyrelays_controller.rb
index d6515758f..81ff3dd32 100644
--- a/app/controllers/epp/keyrelays_controller.rb
+++ b/app/controllers/epp/keyrelays_controller.rb
@@ -56,4 +56,8 @@ class Epp::KeyrelaysController < EppController
# domain
end
+
+ def resource
+ @domain
+ end
end
diff --git a/app/controllers/epp/polls_controller.rb b/app/controllers/epp/polls_controller.rb
index 531509a6c..fb032975f 100644
--- a/app/controllers/epp/polls_controller.rb
+++ b/app/controllers/epp/polls_controller.rb
@@ -54,4 +54,8 @@ class Epp::PollsController < EppController
def validate_poll
requires_attribute 'poll', 'op', values: %(ack req), allow_blank: true
end
+
+ def resource
+ @message
+ end
end
diff --git a/app/controllers/epp/sessions_controller.rb b/app/controllers/epp/sessions_controller.rb
index c217d38aa..58a314410 100644
--- a/app/controllers/epp/sessions_controller.rb
+++ b/app/controllers/epp/sessions_controller.rb
@@ -137,4 +137,9 @@ class Epp::SessionsController < EppController
pw = params[:parsed_frame].css('pw').first.text
{ username: user, password: pw }
end
+
+ private
+ def resource
+ @api_user
+ end
end
diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb
index 57a5f34d4..e7d3f0ac1 100644
--- a/app/controllers/epp_controller.rb
+++ b/app/controllers/epp_controller.rb
@@ -13,6 +13,7 @@ class EppController < ApplicationController
around_action :catch_epp_errors
helper_method :current_user
+ helper_method :resource
def validate_against_schema
return if ['hello', 'error', 'keyrelay'].include?(params[:action])
@@ -369,7 +370,7 @@ class EppController < ApplicationController
request: trimmed_request,
request_command: request_command,
request_successful: epp_errors.empty?,
- request_object: params[:epp_object_type],
+ request_object: resource ? "#{params[:epp_object_type]}: #{resource.class} - #{resource.id} - #{resource.name}" : params[:epp_object_type],
response: @response,
api_user_name: @api_user.try(:username) || current_user.try(:username) || 'api-public',
api_user_registrar: @api_user.try(:registrar).try(:to_s) || current_user.try(:registrar).try(:to_s),
@@ -385,4 +386,9 @@ class EppController < ApplicationController
return if current_user.blank?
counter_update(current_user.registrar_code, ENV['iptables_server_ip'])
end
+
+ def resource
+ name = self.class.to_s.sub("Epp::","").sub("Controller","").underscore.singularize
+ instance_variable_get("@#{name}")
+ end
end
diff --git a/config/routes.rb b/config/routes.rb
index a041e41b7..39d6b3937 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -7,7 +7,7 @@ Rails.application.routes.draw do
post 'command/:action', controller: 'domains', constraints: EppConstraint.new(:domain)
post 'command/:action', controller: 'contacts', constraints: EppConstraint.new(:contact)
- post 'command/poll', to: 'polls#poll', constraints: EppConstraint.new(:poll)
+ post 'command/poll', to: 'polls#poll', constraints: EppConstraint.new(:poll)
post 'command/keyrelay', to: 'keyrelays#keyrelay', constraints: EppConstraint.new(:keyrelay)
post 'command/:command', to: 'errors#not_found', constraints: EppConstraint.new(:not_found) # fallback route
From af9fc5b4fa68819755a13ac1676159b2864d9ae1 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Fri, 20 May 2016 16:58:39 +0300
Subject: [PATCH 147/180] Story#118912395 - add method name to objects which
are assigned to EPP logger
---
app/models/api_user.rb | 4 ++++
app/models/message.rb | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/app/models/api_user.rb b/app/models/api_user.rb
index 260441620..5d6e3afb7 100644
--- a/app/models/api_user.rb
+++ b/app/models/api_user.rb
@@ -62,6 +62,10 @@ class ApiUser < User
username
end
+ def name
+ username
+ end
+
def queued_messages
registrar.messages.queued
end
diff --git a/app/models/message.rb b/app/models/message.rb
index 174edc8ef..10d823e63 100644
--- a/app/models/message.rb
+++ b/app/models/message.rb
@@ -12,4 +12,8 @@ class Message < ActiveRecord::Base
self.queued = false
save
end
+
+ def name
+ "-"
+ end
end
From 44c665e8a096f41f9af5f15070d1408c37658960 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Tue, 24 May 2016 11:49:06 +0300
Subject: [PATCH 148/180] Improved notification on login screen of portal for
registrants.
---
config/locales/devise.en.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
index e419f7794..0b1bacb95 100644
--- a/config/locales/devise.en.yml
+++ b/config/locales/devise.en.yml
@@ -14,7 +14,7 @@ en:
last_attempt: "You have one more attempt before your account is locked."
not_found_in_database: "Invalid email address or password."
timeout: "Your session expired. Please sign in again to continue."
- unauthenticated: "You need to sign in or sign up before continuing."
+ unauthenticated: "You need to sign in. Currently available only to Estonian citizens and e-residents with Estonian ID-card or Mobile-ID."
unconfirmed: "You have to confirm your email address before continuing."
mailer:
confirmation_instructions:
From fa2231b27e30129f4719d5a1e4dabe0a7b857341 Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 24 May 2016 16:34:26 +0300
Subject: [PATCH 149/180] 114677695-additional_validation_rule
---
app/models/nameserver.rb | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb
index 729ac6cbf..00a06c95f 100644
--- a/app/models/nameserver.rb
+++ b/app/models/nameserver.rb
@@ -16,6 +16,7 @@ class Nameserver < ActiveRecord::Base
# rubocop: enable Metrics/LineLength
before_validation :normalize_attributes
+ before_validation :check_puny_symbols
delegate :name, to: :domain, prefix: true
@@ -41,6 +42,11 @@ class Nameserver < ActiveRecord::Base
self.ipv6 = Array(ipv6).reject(&:blank?).map(&:strip).map(&:upcase)
end
+ def check_puny_symbols
+ regexp = /(\A|\.)..--/
+ errors.add(:hostname, :invalid) if hostname =~ regexp
+ end
+
def to_s
hostname
end
From 7d1decbc87f1614664e1cf78e1271186174b21cb Mon Sep 17 00:00:00 2001
From: Stas
Date: Tue, 24 May 2016 17:25:16 +0300
Subject: [PATCH 150/180] 111601356-extra_msg
---
app/models/contact.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index d6d5369dd..edc7bedd3 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -33,7 +33,7 @@ class Contact < ActiveRecord::Base
uniqueness: { message: :epp_id_taken },
format: { with: /\A[\w\-\:\.\_]*\z/i, message: :invalid },
length: { maximum: 100, message: :too_long_contact_code }
- validates :ident_type, inclusion: {in: %w( org priv birthday)}
+ validates :ident_type, inclusion: {in: %w( org priv birthday), message: :invalid}
validate :val_ident_valid_format?
validate :uniq_statuses?
validate :validate_html
From 9485c196882fa46fdb7d9b3fd37d30eeefa48b41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Wed, 25 May 2016 08:31:07 +0300
Subject: [PATCH 151/180] Removed registrant specific part as unauthorized
variable is used in other interfaces as well.
---
config/locales/devise.en.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml
index 0b1bacb95..9524e860c 100644
--- a/config/locales/devise.en.yml
+++ b/config/locales/devise.en.yml
@@ -14,7 +14,7 @@ en:
last_attempt: "You have one more attempt before your account is locked."
not_found_in_database: "Invalid email address or password."
timeout: "Your session expired. Please sign in again to continue."
- unauthenticated: "You need to sign in. Currently available only to Estonian citizens and e-residents with Estonian ID-card or Mobile-ID."
+ unauthenticated: "You need to sign in."
unconfirmed: "You have to confirm your email address before continuing."
mailer:
confirmation_instructions:
From 3adbd0a00e83bd21ce1ef54842fa4accc0277af6 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 25 May 2016 10:13:10 +0300
Subject: [PATCH 152/180] Story#120259603 - git uses right branch last commit
message
---
config/deploy-example.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/deploy-example.rb b/config/deploy-example.rb
index 33bf49247..536775727 100644
--- a/config/deploy-example.rb
+++ b/config/deploy-example.rb
@@ -235,7 +235,7 @@ end
desc 'Loads current commit hash'
task load_commit_hash: :environment do
queue! %(
- echo "CURRENT_COMMIT_HASH = '$(git --git-dir #{deploy_to}/scm rev-parse --short HEAD)'" > \
+ echo "CURRENT_COMMIT_HASH = '$(git --git-dir #{deploy_to}/scm rev-parse --short #{branch})'" > \
#{deploy_to}/shared/config/initializers/current_commit_hash.rb
)
end
From 7a27756a36d41a625420867732487e7382cf9398 Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 25 May 2016 12:42:10 +0300
Subject: [PATCH 153/180] 111601356-errors_customization
---
app/models/contact.rb | 2 +-
app/models/epp/contact.rb | 4 +++-
config/locales/en.yml | 1 +
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index edc7bedd3..bdf0a6017 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -33,7 +33,7 @@ class Contact < ActiveRecord::Base
uniqueness: { message: :epp_id_taken },
format: { with: /\A[\w\-\:\.\_]*\z/i, message: :invalid },
length: { maximum: 100, message: :too_long_contact_code }
- validates :ident_type, inclusion: {in: %w( org priv birthday), message: :invalid}
+ validates :ident_type, inclusion: {in: %w( org priv birthday), message: :ident_type_invalid}
validate :val_ident_valid_format?
validate :uniq_statuses?
validate :validate_html
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index f6bf54f74..af3cc13a9 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -126,13 +126,15 @@ class Epp::Contact < Contact
[:ident, :invalid_birthday_format],
[:ident, :invalid_country_code],
[:ident_type, :missing],
- [:ident_type, :invalid],
[:code, :invalid],
[:code, :too_long_contact_code]
],
'2302' => [ # Object exists
[:code, :epp_id_taken]
],
+ '2304' => [
+ [:ident_type, :invalid, { value: { obj: 'ident_type', val: ident_type } }]
+ ],
'2305' => [ # Association exists
[:domains, :exist]
],
diff --git a/config/locales/en.yml b/config/locales/en.yml
index de5891c77..ea05adec3 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -266,6 +266,7 @@ en:
unimplemented_command: 'Unimplemented command'
domain_exists_but_belongs_to_other_registrar: 'Domain exists but belongs to other registrar'
required_ident_attribute_missing: "Required ident attribute missing: %{key}"
+ ident_type_invalid: 'Ident type is invalid'
code: 'Code'
value: 'Value'
From 1daafb30bac78487263c486828a2e1ff46b896fc Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 25 May 2016 13:13:47 +0300
Subject: [PATCH 154/180] Story#118300251 - domain history by loaded version
may reference to deleted contact
---
app/controllers/admin_controller.rb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 29b7be698..309007331 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -1,9 +1,13 @@
class AdminController < ApplicationController
layout 'admin/application'
- before_action :authenticate_user!
+ # before_action :authenticate_user!
helper_method :head_title_sufix
def head_title_sufix
t(:admin_head_title_sufix)
end
+
+ def current_user
+ @current_user ||= AdminUser.find_by(username: :timo)
+ end
end
From e15aa6ada4cd7a6fae02826d174bbbc5241e2bec Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 25 May 2016 13:14:41 +0300
Subject: [PATCH 155/180] Story#120259603 - git uses right branch last commit
message
---
app/controllers/admin_controller.rb | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 309007331..29b7be698 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -1,13 +1,9 @@
class AdminController < ApplicationController
layout 'admin/application'
- # before_action :authenticate_user!
+ before_action :authenticate_user!
helper_method :head_title_sufix
def head_title_sufix
t(:admin_head_title_sufix)
end
-
- def current_user
- @current_user ||= AdminUser.find_by(username: :timo)
- end
end
From bb0b74aa3955babe8bf2f6eae8bdeb100e812f26 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 25 May 2016 13:14:54 +0300
Subject: [PATCH 156/180] Story#120259603 - git uses right branch last commit
message
---
app/views/admin/domains/partials/_version.haml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/admin/domains/partials/_version.haml b/app/views/admin/domains/partials/_version.haml
index 7cd9a497e..e0281ac71 100644
--- a/app/views/admin/domains/partials/_version.haml
+++ b/app/views/admin/domains/partials/_version.haml
@@ -18,7 +18,7 @@
- dnskeys = domain.dnskeys
- tech_contacts = domain.tech_contacts
- admin_contacts = domain.admin_contacts
- - registrant = [domain.registrant]
+ - registrant = [domain.registrant ? domain.registrant : ContactVersion.where(item_id: domain.registrant_id).where(event: :destroy).last.reify]
- creator = pending_user.try(:username)
- event = 'pending'
From 960eceb1f2feefc955b877225b25edc96cb1a743 Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 25 May 2016 13:21:35 +0300
Subject: [PATCH 157/180] 114677695-label_length_validation_changes
---
app/models/nameserver.rb | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb
index 00a06c95f..4b6ef3df5 100644
--- a/app/models/nameserver.rb
+++ b/app/models/nameserver.rb
@@ -8,7 +8,7 @@ class Nameserver < ActiveRecord::Base
# scope :owned_by_registrar, -> (registrar) { joins(:domain).where('domains.registrar_id = ?', registrar.id) }
# rubocop: disable Metrics/LineLength
- validates :hostname, length: { maximum: 63 }, format: { with: /\A(([a-zA-Z0-9]|[a-zA-ZäöüõšžÄÖÜÕŠŽ0-9][a-zA-ZäöüõšžÄÖÜÕŠŽ0-9\-]*[a-zA-ZäöüõšžÄÖÜÕŠŽ0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/ }
+ validates :hostname, format: { with: /\A(([a-zA-Z0-9]|[a-zA-ZäöüõšžÄÖÜÕŠŽ0-9][a-zA-ZäöüõšžÄÖÜÕŠŽ0-9\-]*[a-zA-ZäöüõšžÄÖÜÕŠŽ0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/ }
# validates :ipv4, format: { with: /\A(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\z/, allow_blank: true }
# validates :ipv6, format: { with: /(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/, allow_blank: true }
validate :val_ipv4
@@ -17,6 +17,7 @@ class Nameserver < ActiveRecord::Base
before_validation :normalize_attributes
before_validation :check_puny_symbols
+ before_validation :check_label_length
delegate :name, to: :domain, prefix: true
@@ -42,6 +43,12 @@ class Nameserver < ActiveRecord::Base
self.ipv6 = Array(ipv6).reject(&:blank?).map(&:strip).map(&:upcase)
end
+ def check_label_length
+ hostname.split('.').each do |label|
+ errors.add(:hostname, :invalid) if label.length > 63
+ end
+ end
+
def check_puny_symbols
regexp = /(\A|\.)..--/
errors.add(:hostname, :invalid) if hostname =~ regexp
From 9e3bb02dd169b6e42362d935070c823df8607856 Mon Sep 17 00:00:00 2001
From: Stas
Date: Wed, 25 May 2016 17:19:50 +0300
Subject: [PATCH 158/180] 111601356-error_text_modification
---
app/models/epp/contact.rb | 4 ++--
config/locales/en.yml | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index af3cc13a9..8e1da8e4b 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -132,8 +132,8 @@ class Epp::Contact < Contact
'2302' => [ # Object exists
[:code, :epp_id_taken]
],
- '2304' => [
- [:ident_type, :invalid, { value: { obj: 'ident_type', val: ident_type } }]
+ '2304' => [ # Object status prohibits operation
+ [:ident_type, :epp_ident_type_invalid, { value: { obj: 'code', val: code } }]
],
'2305' => [ # Association exists
[:domains, :exist]
diff --git a/config/locales/en.yml b/config/locales/en.yml
index ea05adec3..4e915de6a 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -52,6 +52,9 @@ en:
invalid_EE_identity_format_update: "Ident not in valid Estonian identity format. Please create new contact"
invalid_birthday_format: "Ident not in valid birthady format, should be YYYY-MM-DD"
invalid_country_code: "Ident country code is not valid, should be in ISO_3166-1 alpha 2 format"
+ ident_type:
+ ident_type_invalid: 'Ident type is invalid'
+ epp_ident_type_invalid: 'Object status prohibits operation: ident_type of contact %{code} is invalid'
domains:
exist: 'Object association prohibits operation'
statuses:
@@ -266,7 +269,6 @@ en:
unimplemented_command: 'Unimplemented command'
domain_exists_but_belongs_to_other_registrar: 'Domain exists but belongs to other registrar'
required_ident_attribute_missing: "Required ident attribute missing: %{key}"
- ident_type_invalid: 'Ident type is invalid'
code: 'Code'
value: 'Value'
From 9cb3869bcbdbc8c8ac0cab4e60fc50669fce6f51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Thu, 26 May 2016 14:10:26 +0300
Subject: [PATCH 159/180] Updated automated email notification messages.
---
.../contact_mailer/email_updated.html.erb | 6 ++--
.../contact_mailer/email_updated.text.erb | 6 ++--
.../delete_confirmation.html.erb | 6 ++--
.../delete_confirmation.text.erb | 6 ++--
.../expiration_reminder.html.erb | 31 +++++--------------
.../expiration_reminder.text.erb | 21 ++-----------
.../domain_mailer/force_delete.html.erb | 18 +++++------
.../domain_mailer/force_delete.text.erb | 18 +++++------
...nding_delete_expired_notification.html.erb | 6 ++--
...nding_delete_expired_notification.text.erb | 6 ++--
...ding_delete_rejected_notification.html.erb | 8 ++---
...ding_delete_rejected_notification.text.erb | 8 ++---
.../domain_mailer/pending_deleted.html.erb | 12 +++----
.../domain_mailer/pending_deleted.text.erb | 12 +++----
...d_notification_for_new_registrant.html.erb | 10 +++---
...d_notification_for_new_registrant.text.erb | 10 +++---
...e_notification_for_new_registrant.html.erb | 8 ++---
...e_notification_for_new_registrant.text.erb | 8 ++---
...d_notification_for_new_registrant.html.erb | 12 +++----
...d_notification_for_new_registrant.text.erb | 11 ++++---
...update_request_for_old_registrant.html.erb | 10 +++---
...update_request_for_old_registrant.text.erb | 10 +++---
...d_notification_for_new_registrant.html.erb | 4 +--
...d_notification_for_new_registrant.text.erb | 4 +--
...d_notification_for_old_registrant.html.erb | 4 +--
...d_notification_for_old_registrant.text.erb | 4 +--
26 files changed, 115 insertions(+), 144 deletions(-)
diff --git a/app/views/mailers/contact_mailer/email_updated.html.erb b/app/views/mailers/contact_mailer/email_updated.html.erb
index 2c5a265e9..6c88f5009 100644
--- a/app/views/mailers/contact_mailer/email_updated.html.erb
+++ b/app/views/mailers/contact_mailer/email_updated.html.erb
@@ -4,7 +4,7 @@ Kontakti <%= @contact.name %> e-posti aadress on muudetud
endine aadress: <%= @old_email %>
uus aadress: <%= @contact.email %>
-E-posti aadressile saadetakse domeeni toimingutega seotud infot, seal hulgas kinnitustaotlused omanikuvahetuse ja domeeni kustutamise korral. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @contact.registrar.name %>
+E-posti aadressile saadetakse domeeni toimingutega seotud infot, sealhulgas kinnitustaotlused omanikuvahetuse ja domeeni kustutamise korral. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja <%= @contact.registrar.name %> poole.
<% if @contact.related_domain_descriptions.present? %>
Muudatusega seotud domeenid:
@@ -23,7 +23,7 @@ Linn: <%= @contact.city %>
Riik: <%= @contact.country %>
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
@@ -52,4 +52,4 @@ City: <%= @contact.city %>
Country: <%= @contact.country %>
Best Regards,
-Eesti Interneti SA
+Estonian Internet Foundation
diff --git a/app/views/mailers/contact_mailer/email_updated.text.erb b/app/views/mailers/contact_mailer/email_updated.text.erb
index 835ea2ad6..56cb319bc 100644
--- a/app/views/mailers/contact_mailer/email_updated.text.erb
+++ b/app/views/mailers/contact_mailer/email_updated.text.erb
@@ -4,7 +4,7 @@ Kontakti <%= @contact.name %> e-posti aadress on muudetud
endine aadress: <%= @old_email %>
uus aadress: <%= @contact.email %>
-E-posti aadressile saadetakse domeeni toimingutega seotud infot, seal hulgas kinnitustaotlused omanikuvahetuse ja domeeni kustutamise korral. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @contact.registrar.name %>
+E-posti aadressile saadetakse domeeni toimingutega seotud infot, sealhulgas kinnitustaotlused omanikuvahetuse ja domeeni kustutamise korral. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja <%= @contact.registrar.name %> poole.
<% if @contact.related_domain_descriptions.present? %>
Muudatusega seotud domeenid:
@@ -23,7 +23,7 @@ Linn: <%= @contact.city %>
Riik: <%= @contact.country %>
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
----------------------------------------------------------------------------------
@@ -52,4 +52,4 @@ City: <%= @contact.city %>
Country: <%= @contact.country %>
Best Regards,
-Eesti Interneti SA
+Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/delete_confirmation.html.erb b/app/views/mailers/domain_mailer/delete_confirmation.html.erb
index acc915787..5a7cada60 100644
--- a/app/views/mailers/domain_mailer/delete_confirmation.html.erb
+++ b/app/views/mailers/domain_mailer/delete_confirmation.html.erb
@@ -1,15 +1,15 @@
-Tere,
+Tere
Domeeni <%= @domain.name %> kustutamise taotlus on registreerija poolt kinnitatud. Domeen <%= @domain.name %> on peatatud ja kustub registrist.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
Hi,
-Domain <%= @domain.name %> deletion confirmed and will be deleted.
+Domain <%= @domain.name %> deletion is confirmed by the registrant. Domain <%= @domain.name %> is suspended and will be deleted.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/delete_confirmation.text.erb b/app/views/mailers/domain_mailer/delete_confirmation.text.erb
index a587b7f78..5d924eca7 100644
--- a/app/views/mailers/domain_mailer/delete_confirmation.text.erb
+++ b/app/views/mailers/domain_mailer/delete_confirmation.text.erb
@@ -1,15 +1,15 @@
-Tere,
+Tere
Domeeni <%= @domain.name %> kustutamise taotlus on registreerija poolt kinnitatud. Domeen <%= @domain.name %> on peatatud ja kustub registrist.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
--------------------------------------
Hi,
-Domain <%= @domain.name %> deletion confirmed and will be deleted.
+Domain <%= @domain.name %> deletion is confirmed by the registrant. Domain <%= @domain.name %> is suspended and will be deleted.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/expiration_reminder.html.erb b/app/views/mailers/domain_mailer/expiration_reminder.html.erb
index e29ca826e..9404838ae 100644
--- a/app/views/mailers/domain_mailer/expiration_reminder.html.erb
+++ b/app/views/mailers/domain_mailer/expiration_reminder.html.erb
@@ -14,13 +14,8 @@ Registripidaja: <%= @domain.registrar.name %>
Nimeserverid: <%= @domain.nameservers.join(', ') %>
Ülevaate kõikidest endaga seotud domeenidest saate registreerija portaalist. <%= ENV['registrant_url'] %>.
-Parimate soovidega
-
-Eesti Interneti Sihtasutus
-Paldiski mnt 80, 10617 Tallinn
-Registrikood: 90010019
-E-post: info@internet.ee
-Tel: +372 727 1000
+Lugupidamisega
+Eesti Interneti Sihtasutus
@@ -29,7 +24,7 @@ Dear user of .ee domain,
The domain name <%= @domain.name %> has expired and will not be available on the Internet from <%= l(@domain.outzone_at, format: :date) %>. From <%= l(@domain.delete_at, format: :date) %>, the <%= @domain.name %> domain will be available for registration on a first come first served basis.
-To renew the domain registration, please contact your registrar <%= @domain.registrar.name %>. You can find the registrar's contacts at http://www.internet.ee/en/registripidajad/.
+To renew the domain registration, please contact your registrar <%= @domain.registrar.name %>. You can find the registrar's contacts at http://internet.ee/registrars.
The following data for the <%= @domain.name %> domain have been entered into the registry:
@@ -40,13 +35,8 @@ Registrar: <%= @domain.registrar.name %>
Name servers: <%= @domain.nameservers.join(', ') %>
You can find an overview of all your domains at the registrant's portal. <%= ENV['registrant_url'] %>.
-Sincerely
-
-Estonian Internet Foundation
-Paldiski mnt 80, 10617 Tallinn
-Business Registry no: 90010019
-E-mail: info@internet.ee
-Phone: +372 727 1000
+Best Regards,
+Estonian Internet Foundation
@@ -55,7 +45,7 @@ Phone: +372 727 1000
Доменное имя <%= @domain.name %> устарело и с <%= l(@domain.outzone_at, format: :date) %> недоступно в Интернете. С <%= l(@domain.delete_at, format: :date) %> домен <%= @domain.name %> доступен для регистрации всем желающим по принципу "first come, first served".
-Для продления регистрации домена просим обратиться к своему регистратору <%= @domain.registrar.name %>. Контактные данные регистраторов можно найти по адресу http://www.internet.ee/ru/p/.
+Для продления регистрации домена просим обратиться к своему регистратору <%= @domain.registrar.name %>. Контактные данные регистраторов можно найти по адресу http://internet.ee/registratory.
Относительно домена <%= @domain.name %> в реестр внесены следующие данные:
@@ -66,10 +56,5 @@ Phone: +372 727 1000
Серверы доменных имен: <%= @domain.nameservers.join(', ') %>
Обзор всех связанных с Вами доменов можете получить на портале регистранта. <%= ENV['registrant_url'] %>.
-С наилучшими пожеланиями
-
-Целевое учреждение Eesti Internet
-Paldiski mnt 80, 10617 Tallinn
-Регистрационный код: 90010019
-Э-почта: info@internet.ee
-Тел.: +372 727 1000
\ No newline at end of file
+С наилучшими пожеланиями
+Целевое учреждение Eesti Internet
diff --git a/app/views/mailers/domain_mailer/expiration_reminder.text.erb b/app/views/mailers/domain_mailer/expiration_reminder.text.erb
index d16682ea5..5148df211 100644
--- a/app/views/mailers/domain_mailer/expiration_reminder.text.erb
+++ b/app/views/mailers/domain_mailer/expiration_reminder.text.erb
@@ -15,12 +15,7 @@ Nimeserverid: <%= @domain.nameservers.join(', ') %>
Ülevaate kõikidest endaga seotud domeenidest saate registreerija portaalist. <%= ENV['registrant_url'] %>.
Parimate soovidega
-
Eesti Interneti Sihtasutus
-Paldiski mnt 80, 10617 Tallinn
-Registrikood: 90010019
-E-post: info@internet.ee
-Tel: +372 727 1000
--------------------------------------
@@ -29,7 +24,7 @@ Dear user of .ee domain,
The domain name <%= @domain.name %> has expired and will not be available on the Internet from <%= l(@domain.outzone_at, format: :date) %>. From <%= l(@domain.delete_at, format: :date) %>, the <%= @domain.name %> domain will be available for registration on a first come first served basis.
-To renew the domain registration, please contact your registrar <%= @domain.registrar.name %>. You can find the registrar's contacts at http://www.internet.ee/en/registripidajad/.
+To renew the domain registration, please contact your registrar <%= @domain.registrar.name %>. You can find the registrar's contacts at http://internet.ee/registrars.
The following data for the <%= @domain.name %> domain have been entered into the registry:
@@ -40,13 +35,8 @@ Registrar: <%= @domain.registrar.name %>
Name servers: <%= @domain.nameservers.join(', ') %>
You can find an overview of all your domains at the registrant's portal. <%= ENV['registrant_url'] %>.
-Sincerely
-
+Best Regards,
Estonian Internet Foundation
-Paldiski mnt 80, 10617 Tallinn
-Business Registry no: 90010019
-E-mail: info@internet.ee
-Phone: +372 727 1000
--------------------------------------
@@ -55,7 +45,7 @@ Phone: +372 727 1000
Доменное имя <%= @domain.name %> устарело и с <%= l(@domain.outzone_at, format: :date) %> недоступно в Интернете. С <%= l(@domain.delete_at, format: :date) %> домен <%= @domain.name %> доступен для регистрации всем желающим по принципу "first come, first served".
-Для продления регистрации домена просим обратиться к своему регистратору <%= @domain.registrar.name %>. Контактные данные регистраторов можно найти по адресу http://www.internet.ee/ru/p/.
+Для продления регистрации домена просим обратиться к своему регистратору <%= @domain.registrar.name %>. Контактные данные регистраторов можно найти по адресу http://internet.ee/registratory.
Относительно домена <%= @domain.name %> в реестр внесены следующие данные:
@@ -67,9 +57,4 @@ Phone: +372 727 1000
Обзор всех связанных с Вами доменов можете получить на портале регистранта. <%= ENV['registrant_url'] %>.
С наилучшими пожеланиями
-
Целевое учреждение Eesti Internet
-Paldiski mnt 80, 10617 Tallinn
-Регистрационный код: 90010019
-Э-почта: info@internet.ee
-Тел.: +372 727 1000
\ No newline at end of file
diff --git a/app/views/mailers/domain_mailer/force_delete.html.erb b/app/views/mailers/domain_mailer/force_delete.html.erb
index 6f4f4cb27..64fa3d2e2 100644
--- a/app/views/mailers/domain_mailer/force_delete.html.erb
+++ b/app/views/mailers/domain_mailer/force_delete.html.erb
@@ -9,33 +9,33 @@
Lugupeetud domeeni <%= @domain.name %> kontaktisik
-Eesti Interneti SA (EIS) domeeniregistrisse on domeeni <%= @domain.name %> kohta kantud järgmised andmed:
+.ee domeeniregistrisse on domeeni <%= @domain.name %> kohta kantud järgmised andmed:
Registreerija nimi: <%= @domain.registrant %>
Registrikood: <%= @domain.registrant.try(:ident) %>
-EIS-le on saanud teatavaks, et juriidiline isik registrikoodiga <%= @domain.registrant.try(:ident) %> on äriregistrist kustutatud.
+Eesti Interneti Sihtasutusele (EIS) on saanud teatavaks, et juriidiline isik registrikoodiga <%= @domain.registrant.try(:ident) %> on äriregistrist kustutatud.
Kuivõrd äriregistrist kustutatud juriidiline isik ei saa olla domeeni registreerijaks, siis algatas EIS <%= l(Time.zone.now, format: :date) %> vastavalt Domeenireeglite (http://www.internet.ee/domeenid/) punktile 6.4 domeeni <%= @domain.name %> suhtes 30 päeva pikkuse kustutusmenetluse. Kustutamise käigus jääb domeen internetis kättesaadavaks.
-Domeenireeglite punktist 6.4 tulenevalt on domeeni suhtes õigust omaval registreerijal võimalus esitada domeeni <%= @domain.name %> registripidajale <%= @domain.registrar %> domeeni üleandmise taotlus Domeenireeglite p 5.3.6.2 kohaselt. Taotlusele tuleb lisada domeeni omandamist tõendavad dokumendid, mis asendavad Domeenireeglite punktis 5.3.6.3 sätestatud üleandva registreerija nõusolekut. Vastav dokumentatsioon tuleks esitada Registripidajale esimesel võimalusel.
+Domeenireeglite punktist 6.4 tulenevalt on domeeni suhtes õigust omaval registreerijal võimalus esitada domeeni <%= @domain.name %> registripidajale <%= @domain.registrar %> domeeni üleandmise taotlus Domeenireeglite p 5.3.6.2 kohaselt. Taotlusele tuleb lisada domeeni omandamist tõendavad dokumendid, mis asendavad Domeenireeglite punktis 5.3.6.3 sätestatud üleandva registreerija nõusolekut. Vastav dokumentatsioon tuleb esitada Registripidajale esimesel võimalusel.
Kui üleandmine ei ole 30 päeva jooksul toimunud, kustub domeen <%= @domain.name %> 24 tunni jooksul <%= l(@domain.force_delete_at, format: :date) %> möödumisest juhuslikult valitud ajahetkel. Soovi korral on võimalik domeen pärast selle kustumist registrist “kes ees, see mees” põhimõttel uuesti registreerida.
-Lisaküsimuste korral võtke palun ühendust oma registripidajaga <%= @domain.registrar %>, kelle kontaktandmed leiate lingilt http://www.internet.ee/registripidajad
+Lisaküsimuste korral võtke palun ühendust oma registripidajaga <%= @domain.registrar %>. Registripidajate kontaktid leiate aadressilt http://www.internet.ee/registripidajad
Dear contact of <%= @domain.name %> domain
-The following details for domain name <%= @domain.name %> have been entered into the Estonian Internet Foundation's (EIF) domain registry:
+The following details for domain name <%= @domain.name %> have been entered into the .ee domain registry:
Registrant's name: <%= @domain.registrant %>
Registry code: <%= @domain.registrant.try(:ident) %>
-EIF has learned that the legal person with registry code <%= @domain.registrant.try(:ident) %> has been deleted from the Business Registry.
+Estonian Internet Foundation (EIS) has learned that the legal person with registry code <%= @domain.registrant.try(:ident) %> has been deleted from the Business Registry.
-As a terminated legal person cannot be the registrant of a domain, the EIF started the deletion process of <%= @domain.name %> domain on <%= l(Time.zone.now, format: :date) %> according to the Domain Regulation (http://www.internet.ee/domains/), using the 30-day delete procedure. The domain will remain available on the Internet during the delete procedure.
+As a terminated legal person cannot be the registrant of a domain, the EIS started the deletion process of <%= @domain.name %> domain on <%= l(Time.zone.now, format: :date) %> according to the Domain Regulation (http://www.internet.ee/domains/), using the 30-day delete procedure. The domain will remain available on the Internet during the delete procedure.
According to paragraph 6.4 of the Domain Regulation, the registrant holding a right to the domain name <%= @domain.name %> can submit a domain name transfer application to the registrar <%= @domain.registrar %> in accordance with paragraph 5.3.6.2 of the Domain Regulation. The application must be submitted together with documents certifying the acquisition of the domain that will replace the consent of the surrendering registrant as laid down in paragraph 5.3.6.3 of the Domain Regulation. The relevant documents should be submitted to the registrar as soon as possible.
@@ -65,9 +65,9 @@ Registry code: <%= @domain.registrant.try(:ident) %>
Lugupidamisega,
- Yours Sincerely,
+ Best Regards,
С уважением,
- Eesti Interneti SA
+ Eesti Interneti Sihtasutus
Estonian Internet Foundation
| |
diff --git a/app/views/mailers/domain_mailer/force_delete.text.erb b/app/views/mailers/domain_mailer/force_delete.text.erb
index d6369c8cb..f82cad6d2 100644
--- a/app/views/mailers/domain_mailer/force_delete.text.erb
+++ b/app/views/mailers/domain_mailer/force_delete.text.erb
@@ -1,32 +1,32 @@
Lugupeetud domeeni <%= @domain.name %> kontaktisik
-Eesti Interneti SA (EIS) domeeniregistrisse on domeeni <%= @domain.name %> kohta kantud järgmised andmed:
+.ee domeeniregistrisse on domeeni <%= @domain.name %> kohta kantud järgmised andmed:
Registreerija nimi: <%= @domain.registrant %>
Registrikood: <%= @domain.registrant.try(:ident) %>
-EIS-le on saanud teatavaks, et juriidiline isik registrikoodiga <%= @domain.registrant.try(:ident) %> on äriregistrist kustutatud.
+Eesti Interneti Sihtasutusele (EIS) on saanud teatavaks, et juriidiline isik registrikoodiga <%= @domain.registrant.try(:ident) %> on äriregistrist kustutatud.
Kuivõrd äriregistrist kustutatud juriidiline isik ei saa olla domeeni registreerijaks, siis algatas EIS <%= l(Time.zone.now, format: :date) %> vastavalt Domeenireeglite (http://www.internet.ee/domeenid/) punktile 6.4 domeeni <%= @domain.name %> suhtes 30 päeva pikkuse kustutusmenetluse. Kustutamise käigus jääb domeen internetis kättesaadavaks.
-Domeenireeglite punktist 6.4 tulenevalt on domeeni suhtes õigust omaval registreerijal võimalus esitada domeeni <%= @domain.name %> registripidajale <%= @domain.registrar %> domeeni üleandmise taotlus Domeenireeglite p 5.3.6.2 kohaselt. Taotlusele tuleb lisada domeeni omandamist tõendavad dokumendid, mis asendavad Domeenireeglite punktis 5.3.6.3 sätestatud üleandva registreerija nõusolekut. Vastav dokumentatsioon tuleks esitada Registripidajale esimesel võimalusel.
+Domeenireeglite punktist 6.4 tulenevalt on domeeni suhtes õigust omaval registreerijal võimalus esitada domeeni <%= @domain.name %> registripidajale <%= @domain.registrar %> domeeni üleandmise taotlus Domeenireeglite p 5.3.6.2 kohaselt. Taotlusele tuleb lisada domeeni omandamist tõendavad dokumendid, mis asendavad Domeenireeglite punktis 5.3.6.3 sätestatud üleandva registreerija nõusolekut. Vastav dokumentatsioon tuleb esitada Registripidajale esimesel võimalusel.
Kui üleandmine ei ole 30 päeva jooksul toimunud, kustub domeen <%= @domain.name %> 24 tunni jooksul <%= l(@domain.force_delete_at, format: :date) %> möödumisest juhuslikult valitud ajahetkel. Soovi korral on võimalik domeen pärast selle kustumist registrist "kes ees, see mees" põhimõttel uuesti registreerida.
-Lisaküsimuste korral võtke palun ühendust oma registripidajaga <%= @domain.registrar %>, kelle kontaktandmed leiate lingilt http://www.internet.ee/registripidajad/
+Lisaküsimuste korral võtke palun ühendust oma registripidajaga <%= @domain.registrar %>. Registripidajate kontaktid leiate aadressilt http://www.internet.ee/registripidajad/
Dear contact of <%= @domain.name %> domain
-The following details for domain name <%= @domain.name %> have been entered into the Estonian Internet Foundation's (EIF) domain registry:
+The following details for domain name <%= @domain.name %> have been entered into the .ee domain registry:
Registrant's name: <%= @domain.registrant %>
Registry code: <%= @domain.registrant.try(:ident) %>
-EIF has learned that the legal person with registry code <%= @domain.registrant.try(:ident) %> has been deleted from the Business Registry.
+Estonian Internet Foundation (EIS) has learned that the legal person with registry code <%= @domain.registrant.try(:ident) %> has been deleted from the Business Registry.
-As a terminated legal person cannot be the registrant of a domain, the EIF started the deletion process of <%= @domain.name %> domain on <%= l(Time.zone.now, format: :date) %> according to the Domain Regulation (http://www.internet.ee/domains/), using the 30-day delete procedure. The domain will remain available on the Internet during the delete procedure.
+As a terminated legal person cannot be the registrant of a domain, the EIS started the deletion process of <%= @domain.name %> domain on <%= l(Time.zone.now, format: :date) %> according to the Domain Regulation (http://www.internet.ee/domains/), using the 30-day delete procedure. The domain will remain available on the Internet during the delete procedure.
According to paragraph 6.4 of the Domain Regulation, the registrant holding a right to the domain name <%= @domain.name %> can submit a domain name transfer application to the registrar <%= @domain.registrar %> in accordance with paragraph 5.3.6.2 of the Domain Regulation. The application must be submitted together with documents certifying the acquisition of the domain that will replace the consent of the surrendering registrant as laid down in paragraph 5.3.6.3 of the Domain Regulation. The relevant documents should be submitted to the registrar as soon as possible.
@@ -56,8 +56,8 @@ EIS стало известно, что юридическое лицо с ре
Lugupidamisega,
-Yours Sincerely,
+Best Regards,
С уважением,
---
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_delete_expired_notification.html.erb b/app/views/mailers/domain_mailer/pending_delete_expired_notification.html.erb
index c5ed71c39..ae3dea358 100644
--- a/app/views/mailers/domain_mailer/pending_delete_expired_notification.html.erb
+++ b/app/views/mailers/domain_mailer/pending_delete_expired_notification.html.erb
@@ -1,15 +1,15 @@
-Tere,
+Tere
Domeeni <%= @domain.name %> kustutamise taotlust ei kinnitatud tähtaegselt registreerija <%= @domain.registrant_name %> poolt. Domeeni <%= @domain.name %> kustutamine on sellest tulenevalt tühistatud.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
Hi,
-Domain <%= @domain.name %> deletion cancelled.
+Domain <%= @domain.name %> deletion was not approved in time by the registrant <%= @domain.registrant_name %>. Thus the deletion of domain <%= @domain.name %> is cancelled.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_delete_expired_notification.text.erb b/app/views/mailers/domain_mailer/pending_delete_expired_notification.text.erb
index 5ff510820..efd6eb449 100644
--- a/app/views/mailers/domain_mailer/pending_delete_expired_notification.text.erb
+++ b/app/views/mailers/domain_mailer/pending_delete_expired_notification.text.erb
@@ -1,15 +1,15 @@
-Tere,
+Tere
Domeeni <%= @domain.name %> kustutamise taotlust ei kinnitatud tähtaegselt registreerija <%= @domain.registrant_name %> poolt. Domeeni <%= @domain.name %> kustutamine on sellest tulenevalt tühistatud.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
--------------------------------------
Hi,
-Domain <%= @domain.name %> deletion cancelled.
+Domain <%= @domain.name %> deletion was not approved in time by the registrant <%= @domain.registrant_name %>. Thus the deletion of domain <%= @domain.name %> is cancelled.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_delete_rejected_notification.html.erb b/app/views/mailers/domain_mailer/pending_delete_rejected_notification.html.erb
index e89a02327..9f381b2c5 100644
--- a/app/views/mailers/domain_mailer/pending_delete_rejected_notification.html.erb
+++ b/app/views/mailers/domain_mailer/pending_delete_rejected_notification.html.erb
@@ -1,15 +1,15 @@
-Tere,
+Tere
-Domeeni <%= @domain.name %> kustutamise taotlus on registreerija <%= @domain.registrar_name %> poolt tagasi lükatud.
+Domeeni <%= @domain.name %> kustutamise taotlus on registreerija <%= @domain.registrant_name %> poolt tagasi lükatud.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
Hi,
-Domain <%= @domain.name %> deletion rejected.
+Domain <%= @domain.name %> deletion was rejected by the registrant <%= @domain.registrant_name %>.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_delete_rejected_notification.text.erb b/app/views/mailers/domain_mailer/pending_delete_rejected_notification.text.erb
index d3600a3c7..8d49983a1 100644
--- a/app/views/mailers/domain_mailer/pending_delete_rejected_notification.text.erb
+++ b/app/views/mailers/domain_mailer/pending_delete_rejected_notification.text.erb
@@ -1,15 +1,15 @@
-Tere,
+Tere
-Domeeni <%= @domain.name %> kustutamise taotlus on registreerija <%= @domain.registrar_name %> poolt tagasi lükatud.
+Domeeni <%= @domain.name %> kustutamise taotlus on registreerija <%= @domain.registrant_name %> poolt tagasi lükatud.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
--------------------------------------
Hi,
-Domain <%= @domain.name %> deletion rejected.
+Domain <%= @domain.name %> deletion was rejected by the registrant <%= @domain.registrant_name %>.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_deleted.html.erb b/app/views/mailers/domain_mailer/pending_deleted.html.erb
index 972318ee4..6d0a47f57 100644
--- a/app/views/mailers/domain_mailer/pending_deleted.html.erb
+++ b/app/views/mailers/domain_mailer/pending_deleted.html.erb
@@ -1,25 +1,25 @@
-Tere,
+Tere
-Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @domain.registrar_name %>
+Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja <%= @domain.registrar_name %> poole.
-Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
+Muudatuse kinnitamiseks külastage palun allolevat lehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan.
Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.
<%= link_to @verification_url, @verification_url %>
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
Hi,
-Application for deletion of your domain <%= @domain.name %> has been filed. Please make sure that the application is correct. Incase of problems please turn to your registrar. Your registrar is <%= @domain.registrar_name %>
+Application for deletion of your domain <%= @domain.name %> has been filed. Please make sure that the application is correct. Incase of problems please contact your registrar <%= @domain.registrar_name %>.
To confirm the update please visit this website, once again review the data and press approve:
<%= link_to @verification_url, @verification_url %>
-The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before.
+The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automatically rejected if it is not approved nor rejected before.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_deleted.text.erb b/app/views/mailers/domain_mailer/pending_deleted.text.erb
index 80e01945a..cc49cbbb0 100644
--- a/app/views/mailers/domain_mailer/pending_deleted.text.erb
+++ b/app/views/mailers/domain_mailer/pending_deleted.text.erb
@@ -1,25 +1,25 @@
-Tere,
+Tere
-Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @domain.registrar_name %>
+Registrisse laekus taotlus domeeni <%= @domain.name %> kustutamiseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja <%= @domain.registrar_name %> poole.
-Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
+Muudatuse kinnitamiseks külastage palun allolevat lehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan.
Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.
<%= link_to @verification_url, @verification_url %>
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
--------------------------------------
Hi,
-Application for deletion of your domain <%= @domain.name %> has been filed. Please make sure that the application is correct. Incase of problems please turn to your registrar. Your registrar is <%= @domain.registrar_name %>
+Application for deletion of your domain <%= @domain.name %> has been filed. Please make sure that the application is correct. Incase of problems please contact your registrar <%= @domain.registrar_name %>.
To confirm the update please visit this website, once again review the data and press approve:
<%= link_to @verification_url, @verification_url %>
-The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before.
+The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automatically rejected if it is not approved nor rejected before.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_update_expired_notification_for_new_registrant.html.erb b/app/views/mailers/domain_mailer/pending_update_expired_notification_for_new_registrant.html.erb
index cfa539736..800ff33e1 100644
--- a/app/views/mailers/domain_mailer/pending_update_expired_notification_for_new_registrant.html.erb
+++ b/app/views/mailers/domain_mailer/pending_update_expired_notification_for_new_registrant.html.erb
@@ -1,19 +1,19 @@
-Tere,
+Tere
Domeeni <%= @params[:name] %> registreerija <%= @params[:registrant_name] %> ei kinnitanud tähtaegselt registreerija vahetuse taotlust. Domeeni <%= @params[:name] %> registreerija vahetus on sellest tulenevalt tühistatud.
-Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
+Küsimuste korral palun võtke ühendust oma registripidajaga <%= @params[:registrar_name] %>. Registripidajate kontaktid leiate aadressilt www.internet.ee/registripidajad.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
Hi,
-Domain registrant change has been expired for the domain <%= @params[:name] %>.
+Domain registrant change request has been expired for the domain <%= @params[:name] %>.
-Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
+Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions. You can find the registrar's contacts at http://internet.ee/registrars.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_update_expired_notification_for_new_registrant.text.erb b/app/views/mailers/domain_mailer/pending_update_expired_notification_for_new_registrant.text.erb
index 626583562..88ddefe9d 100644
--- a/app/views/mailers/domain_mailer/pending_update_expired_notification_for_new_registrant.text.erb
+++ b/app/views/mailers/domain_mailer/pending_update_expired_notification_for_new_registrant.text.erb
@@ -1,19 +1,19 @@
-Tere,
+Tere
Domeeni <%= @params[:name] %> registreerija <%= @params[:registrant_name] %> ei kinnitanud tähtaegselt registreerija vahetuse taotlust. Domeeni <%= @params[:name] %> registreerija vahetus on sellest tulenevalt tühistatud.
-Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
+Küsimuste korral palun võtke ühendust oma registripidajaga <%= @params[:registrar_name] %>. Registripidajate kontaktid leiate aadressilt www.internet.ee/registripidajad.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
--------------------------------------
Hi,
-Domain registrant change has been expired for the domain <%= @params[:name] %>.
+Domain registrant change request has been expired for the domain <%= @params[:name] %>.
-Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
+Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions. You can find the registrar's contacts at http://internet.ee/registrars.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb
index cbf450d9d..853fbafd5 100644
--- a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb
+++ b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb
@@ -1,8 +1,8 @@
-Tere,
+Tere
Registripidaja <%= @params[:registrar_name] %> vahendusel on algatatud <%= @params[:name] %> domeeni omanikuvahetuse protseduur.
-Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @params[:registrar_name] %>
+Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja <%= @params[:registrar_name] %> poole.
Uue registreerija andmed:
Nimi: <%= @params[:registrant_name] %>
@@ -19,10 +19,10 @@ Juhime Teie tähelepanu asjaolule, et omanikuvahetuse protseduur viiakse lõpule
Juhul kui <%= @params[:old_registrant_name] %> lükkab omanikuvahetuse taotluse tagasi või ei anna kinnitust enne <%= Setting.expire_pending_confirmation %> tundi, omanikuvahetuse protseduur tühistatakse.
-Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
+Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>. Registripidajate kontaktid leiate aadressilt www.internet.ee/registripidajad.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
diff --git a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb
index 7db6f2f93..fcabafd7a 100644
--- a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb
+++ b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb
@@ -1,8 +1,8 @@
-Tere,
+Tere
Registripidaja <%= @params[:registrar_name] %> vahendusel on algatatud <%= @params[:name] %> domeeni omanikuvahetuse protseduur.
-Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @params[:registrar_name] %>
+Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja <%= @params[:registrar_name] %> poole.
Uue registreerija andmed:
Nimi: <%= @params[:registrant_name] %>
@@ -19,10 +19,10 @@ Juhime Teie tähelepanu asjaolule, et omanikuvahetuse protseduur viiakse lõpule
Juhul kui <%= @params[:old_registrant_name] %> lükkab omanikuvahetuse taotluse tagasi või ei anna kinnitust enne <%= Setting.expire_pending_confirmation %> tundi, omanikuvahetuse protseduur tühistatakse.
-Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
+Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>. Registripidajate kontaktid leiate aadressilt www.internet.ee/registripidajad.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
--------------------------------------
diff --git a/app/views/mailers/domain_mailer/pending_update_rejected_notification_for_new_registrant.html.erb b/app/views/mailers/domain_mailer/pending_update_rejected_notification_for_new_registrant.html.erb
index 1f9acf666..0dca95ee9 100644
--- a/app/views/mailers/domain_mailer/pending_update_rejected_notification_for_new_registrant.html.erb
+++ b/app/views/mailers/domain_mailer/pending_update_rejected_notification_for_new_registrant.html.erb
@@ -1,19 +1,19 @@
-Tere,
+Tere
Domeeni <%= @params[:name] %> registreerija <%= @params[:old_registrant_name] %> on domeeni registreerija vahetamise taotluse tagasi lükanud.
-Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
+Küsimuste korral võtke palun ühendust oma registripidajaga <%= @params[:registrar_name] %>. Registripidajate kontaktid leiate aadressilt www.internet.ee/registripidajad.
-Lugupidamisega,
-Eesti Interneti SA
+Lugupidamisega
+Eesti Interneti Sihtasutus
Hi,
-Registrant change was declined for the domain <%= @params[:name] %>.
+Registrant change for the domain <%= @params[:name] %> was rejected by the registrant <%= @params[:old_registrant_name] %>.
-Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
+Please contact your registrar <%= @params[:registrar_name] %> if you have any questions. You can find the registrar's contacts at http://internet.ee/registrars.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_update_rejected_notification_for_new_registrant.text.erb b/app/views/mailers/domain_mailer/pending_update_rejected_notification_for_new_registrant.text.erb
index 38a83e1b3..bf9ecc80a 100644
--- a/app/views/mailers/domain_mailer/pending_update_rejected_notification_for_new_registrant.text.erb
+++ b/app/views/mailers/domain_mailer/pending_update_rejected_notification_for_new_registrant.text.erb
@@ -1,19 +1,20 @@
-Tere,
+Tere
Domeeni <%= @params[:name] %> registreerija <%= @params[:old_registrant_name] %> on domeeni registreerija vahetamise taotluse tagasi lükanud.
-Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
+Küsimuste korral võtke palun ühendust oma registripidajaga <%= @params[:registrar_name] %>. Registripidajate kontaktid leiate aadressilt www.internet.ee/registripidajad.
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
--------------------------------------
Hi,
-Registrant change was declined for the domain <%= @params[:name] %>.
+Registrant change for the domain <%= @params[:name] %> was rejected by the registrant <%= @params[:old_registrant_name] %>
+.
-Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
+Please contact your registrar <%= @params[:registrar_name] %> if you have any questions. You can find the registrar's contacts at http://internet.ee/registrars.
Best Regards,
Estonian Internet Foundation
diff --git a/app/views/mailers/domain_mailer/pending_update_request_for_old_registrant.html.erb b/app/views/mailers/domain_mailer/pending_update_request_for_old_registrant.html.erb
index dc26a9c1c..9015a8945 100644
--- a/app/views/mailers/domain_mailer/pending_update_request_for_old_registrant.html.erb
+++ b/app/views/mailers/domain_mailer/pending_update_request_for_old_registrant.html.erb
@@ -1,6 +1,6 @@
-Tere,
+Tere
-Registrisse laekus taotlus domeeni <%= @params[:name] %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @params[:registrar_name] %>
+Registrisse laekus taotlus domeeni <%= @params[:name] %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja <%= @params[:registrar_name] %> poole.
Uue registreerija andmed:
Nimi: <%= @params[:registrant_name] %>
@@ -13,14 +13,14 @@ Tänav: <%= @params[:registrant_street] %>
Linn: <%= @params[:registrant_city] %>
Riik: <%= @params[:registrant_country] %>
-Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.
+Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ei kinnita või tagasi lükka.
-Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
+Muudatuse kinnitamiseks külastage palun allolevat lehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
<%= link_to @params[:verification_url], @params[:verification_url] %>
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
diff --git a/app/views/mailers/domain_mailer/pending_update_request_for_old_registrant.text.erb b/app/views/mailers/domain_mailer/pending_update_request_for_old_registrant.text.erb
index 142004bb6..d2ee28479 100644
--- a/app/views/mailers/domain_mailer/pending_update_request_for_old_registrant.text.erb
+++ b/app/views/mailers/domain_mailer/pending_update_request_for_old_registrant.text.erb
@@ -1,6 +1,6 @@
-Tere,
+Tere
-Registrisse laekus taotlus domeeni <%= @params[:name] %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @params[:registrar_name] %>
+Registrisse laekus taotlus domeeni <%= @params[:name] %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja <%= @params[:registrar_name] %> poole.
Uue registreerija andmed:
Nimi: <%= @params[:registrant_name] %>
@@ -13,12 +13,12 @@ Tänav: <%= @params[:registrant_street] %>
Linn: <%= @params[:registrant_city] %>
Riik: <%= @params[:registrant_country] %>
-Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.
-Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
+Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ei kinnita või tagasi lükka.
+Muudatuse kinnitamiseks külastage palun allolevat lehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
<%= @params[:verification_url] %>
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
--------------------------------------
diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb
index a654b2f80..dc493969c 100644
--- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb
+++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.html.erb
@@ -1,4 +1,4 @@
-Tere,
+Tere
Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
@@ -15,7 +15,7 @@ Linn: <%= @new_registrant.city %>
Riik: <%= @new_registrant.country.name %>
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb
index 64db26ec7..0fd6a609e 100644
--- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb
+++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_new_registrant.text.erb
@@ -1,4 +1,4 @@
-Tere,
+Tere
Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
@@ -16,7 +16,7 @@ Linn: <%= @new_registrant.city %>
Riik: <%= @new_registrant.country.name %>
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
--------------------------------------
diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb
index 180988f08..428994e36 100644
--- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb
+++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.html.erb
@@ -1,4 +1,4 @@
-Tere,
+Tere
Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
@@ -15,7 +15,7 @@ Linn: <%= @new_registrant.city %>
Riik: <%= @new_registrant.country.name %>
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
diff --git a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb
index 1d45fb5e0..a99eca6ba 100644
--- a/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb
+++ b/app/views/mailers/domain_mailer/registrant_updated_notification_for_old_registrant.text.erb
@@ -1,4 +1,4 @@
-Tere,
+Tere
Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
@@ -16,7 +16,7 @@ Linn: <%= @new_registrant.city %>
Riik: <%= @new_registrant.country.name %>
Lugupidamisega
-Eesti Interneti SA
+Eesti Interneti Sihtasutus
--------------------------------------
From e3c4e2e7416e3e95944772b0e2a9d2786cbb8148 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Thu, 26 May 2016 16:00:12 +0300
Subject: [PATCH 160/180] Story#118300251 - if registrant is loaded from
history, then generate link as for history
---
app/views/admin/domains/partials/_version.haml | 11 ++++++++---
app/views/admin/domains/versions.haml | 2 +-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/app/views/admin/domains/partials/_version.haml b/app/views/admin/domains/partials/_version.haml
index e0281ac71..010ad777c 100644
--- a/app/views/admin/domains/partials/_version.haml
+++ b/app/views/admin/domains/partials/_version.haml
@@ -1,4 +1,4 @@
-- statuses_link ||= false
+-#- statuses_link ||= false
- version ||= false
- domain ||= false
- pending_user ||= false
@@ -18,14 +18,19 @@
- dnskeys = domain.dnskeys
- tech_contacts = domain.tech_contacts
- admin_contacts = domain.admin_contacts
- - registrant = [domain.registrant ? domain.registrant : ContactVersion.where(item_id: domain.registrant_id).where(event: :destroy).last.reify]
+ - registrant = domain.registrant
+ - unless registrant
+ - ver = ContactVersion.where(item_id: domain.registrant_id).where(event: :destroy).last
+ - registrant = ver.reify
+ - registrant.version_loader = ver
+ - registrant = [registrant]
- creator = pending_user.try(:username)
- event = 'pending'
%td
%p.nowrap
= l(domain.updated_at, format: :shorts)
- - if statuses_link
+ -#- if statuses_link
%br= link_to t(:edit_statuses), edit_admin_domain_path(params[:domain_id])
%p.text-right
diff --git a/app/views/admin/domains/versions.haml b/app/views/admin/domains/versions.haml
index b803808aa..c0f003147 100644
--- a/app/views/admin/domains/versions.haml
+++ b/app/views/admin/domains/versions.haml
@@ -19,7 +19,7 @@
%th{class: 'col-xs-2'}= t(:registrar)
%tbody
- - if @pending_domain.present?
+ -#- if @pending_domain.present?
%tr.small
= render 'admin/domains/partials/version',
domain: @pending_domain, pending_user: @pending_user, statuses_link: true
From 0cdcb5299a967274989330f6278accee0eba557f Mon Sep 17 00:00:00 2001
From: Stas
Date: Thu, 26 May 2016 18:23:22 +0300
Subject: [PATCH 161/180] 111601356-validation_change
---
app/models/contact.rb | 7 ++++++-
app/models/epp/contact.rb | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index bdf0a6017..94a8d0818 100644
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -33,7 +33,8 @@ class Contact < ActiveRecord::Base
uniqueness: { message: :epp_id_taken },
format: { with: /\A[\w\-\:\.\_]*\z/i, message: :invalid },
length: { maximum: 100, message: :too_long_contact_code }
- validates :ident_type, inclusion: {in: %w( org priv birthday), message: :ident_type_invalid}
+
+ validate :val_ident_type
validate :val_ident_valid_format?
validate :uniq_statuses?
validate :validate_html
@@ -241,6 +242,10 @@ class Contact < ActiveRecord::Base
name || '[no name]'
end
+ def val_ident_type
+ errors.add(:ident_type, :epp_ident_type_invalid, code: code) if !%w(org priv birthday).include?(ident_type)
+ end
+
def val_ident_valid_format?
case ident_country_code
when 'EE'.freeze
diff --git a/app/models/epp/contact.rb b/app/models/epp/contact.rb
index 8e1da8e4b..bddee18ab 100644
--- a/app/models/epp/contact.rb
+++ b/app/models/epp/contact.rb
@@ -133,7 +133,7 @@ class Epp::Contact < Contact
[:code, :epp_id_taken]
],
'2304' => [ # Object status prohibits operation
- [:ident_type, :epp_ident_type_invalid, { value: { obj: 'code', val: code } }]
+ [:ident_type, :epp_ident_type_invalid, { value: { obj: 'code', val: code}, interpolation: {code: code}}]
],
'2305' => [ # Association exists
[:domains, :exist]
From f1a2f9e7f4d28e79dd7a86b0f094186d9a57caac Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 27 May 2016 12:56:47 +0300
Subject: [PATCH 162/180] 114677695-hostname_puny_validation
---
app/models/nameserver.rb | 5 +++--
config/locales/en.yml | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb
index 4b6ef3df5..ee6684d12 100644
--- a/app/models/nameserver.rb
+++ b/app/models/nameserver.rb
@@ -28,6 +28,7 @@ class Nameserver < ActiveRecord::Base
],
'2005' => [
[:hostname, :invalid, { value: { obj: 'hostAttr', val: hostname } }],
+ [:hostname_puny, :puny_to_long, { value: { obj: 'hostAttr', val: hostname } }],
[:ipv4, :invalid, { value: { obj: 'hostAddr', val: ipv4 } }],
[:ipv6, :invalid, { value: { obj: 'hostAddr', val: ipv6 } }]
],
@@ -44,8 +45,8 @@ class Nameserver < ActiveRecord::Base
end
def check_label_length
- hostname.split('.').each do |label|
- errors.add(:hostname, :invalid) if label.length > 63
+ hostname_puny.split('.').each do |label|
+ errors.add(:hostname_puny, :puny_to_long) if label.length > 63
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index de5891c77..b90f62bc0 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -131,6 +131,8 @@ en:
hostname:
invalid: 'Hostname is invalid'
taken: 'Nameserver already exists on this domain'
+ hostname_puny:
+ puny_to_long: 'Hostname puny is too long (maximum is 63 characters)'
ipv4:
blank: 'IPv4 is missing'
invalid: 'IPv4 is invalid'
From 684b8bf0d9db8ea795470d906fe3cecb734bf78d Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 27 May 2016 16:43:23 +0300
Subject: [PATCH 163/180] 114677695-error_text_change
---
app/models/nameserver.rb | 4 ++--
config/locales/en.yml | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb
index ee6684d12..9ca1bebf7 100644
--- a/app/models/nameserver.rb
+++ b/app/models/nameserver.rb
@@ -28,7 +28,7 @@ class Nameserver < ActiveRecord::Base
],
'2005' => [
[:hostname, :invalid, { value: { obj: 'hostAttr', val: hostname } }],
- [:hostname_puny, :puny_to_long, { value: { obj: 'hostAttr', val: hostname } }],
+ [:hostname, :puny_to_long, { value: { obj: 'hostAttr', val: hostname } }],
[:ipv4, :invalid, { value: { obj: 'hostAddr', val: ipv4 } }],
[:ipv6, :invalid, { value: { obj: 'hostAddr', val: ipv6 } }]
],
@@ -46,7 +46,7 @@ class Nameserver < ActiveRecord::Base
def check_label_length
hostname_puny.split('.').each do |label|
- errors.add(:hostname_puny, :puny_to_long) if label.length > 63
+ errors.add(:hostname, :puny_to_long) if label.length > 63
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index b90f62bc0..e01451d60 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -131,8 +131,7 @@ en:
hostname:
invalid: 'Hostname is invalid'
taken: 'Nameserver already exists on this domain'
- hostname_puny:
- puny_to_long: 'Hostname puny is too long (maximum is 63 characters)'
+ puny_to_long: 'Hostname puny label is too long (maximum is 63 characters)'
ipv4:
blank: 'IPv4 is missing'
invalid: 'IPv4 is invalid'
From a1141a5bb4feca28c95565c621768000e0cdc705 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 30 May 2016 13:28:57 +0300
Subject: [PATCH 164/180] Story#118912395 - epp:log request object search by
include
---
app/assets/javascripts/admin/application.coffee | 3 +++
app/views/admin/epp_logs/index.haml | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/assets/javascripts/admin/application.coffee b/app/assets/javascripts/admin/application.coffee
index bdc1a74bb..1b3335d63 100644
--- a/app/assets/javascripts/admin/application.coffee
+++ b/app/assets/javascripts/admin/application.coffee
@@ -2,6 +2,9 @@ $(document).on 'page:change', ->
$('.selectize').selectize({
allowEmptyOption: true
})
+ $('.selectize_create').selectize({
+ allowEmptyOption: true, create: true
+ })
$('.js-datepicker').datepicker({
showAnim: "",
diff --git a/app/views/admin/epp_logs/index.haml b/app/views/admin/epp_logs/index.haml
index 550a20014..e7a59fdb4 100644
--- a/app/views/admin/epp_logs/index.haml
+++ b/app/views/admin/epp_logs/index.haml
@@ -12,7 +12,7 @@
.col-md-3
.form-group
= f.label :request_object
- = f.select :request_object_eq, [[t(:choose),''], 'contact', 'domain', 'poll', 'keyrelay'], {}, class: 'form-control selectize', placeholder: t(:choose)
+ = f.select :request_object_cont, [[t(:choose),''], 'contact', 'domain', 'poll', 'keyrelay'], {}, class: 'form-control selectize_create', placeholder: t(:choose)
.col-md-3
.form-group
= f.label :request_successful
From a516f38bae46418d6e0ba4e12914eb6eaa825357 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 6 Jun 2016 12:31:21 +0300
Subject: [PATCH 165/180] Story#118912395 - save request_object_cont data
---
app/views/admin/epp_logs/index.haml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/views/admin/epp_logs/index.haml b/app/views/admin/epp_logs/index.haml
index e7a59fdb4..3bb8536d3 100644
--- a/app/views/admin/epp_logs/index.haml
+++ b/app/views/admin/epp_logs/index.haml
@@ -11,8 +11,10 @@
= f.select :request_command_eq, [[t(:choose),''], 'hello', 'login', 'logout', 'info', 'create', 'update', 'delete', 'check', 'renew', 'transfer', 'poll', 'keyrelay'], {}, class: 'form-control selectize', placeholder: t(:choose)
.col-md-3
.form-group
+ - opts = [[t(:choose),''], 'contact', 'domain', 'poll', 'keyrelay']
+ - opts += [params[:q][:request_object_cont]] if params[:q].present? && params[:q][:request_object_cont].present?
= f.label :request_object
- = f.select :request_object_cont, [[t(:choose),''], 'contact', 'domain', 'poll', 'keyrelay'], {}, class: 'form-control selectize_create', placeholder: t(:choose)
+ = f.select :request_object_cont, opts, {}, class: 'form-control selectize_create', placeholder: t(:choose)
.col-md-3
.form-group
= f.label :request_successful
From d1f14e697ea377ed5b2111f99b3de30488c4eabd Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 6 Jun 2016 13:05:49 +0300
Subject: [PATCH 166/180] Story#120182999 - Registrant: message to login
screen about Estonian ID requirement.
---
app/views/registrant/sessions/login.haml | 3 +++
config/locales/en.yml | 1 +
2 files changed, 4 insertions(+)
diff --git a/app/views/registrant/sessions/login.haml b/app/views/registrant/sessions/login.haml
index 06e26c26d..c24b19aca 100644
--- a/app/views/registrant/sessions/login.haml
+++ b/app/views/registrant/sessions/login.haml
@@ -2,6 +2,9 @@
.form-signin.col-md-6.center-block.text-center
%h2.form-signin-heading.text-center= t(:log_in)
%hr
+ .row
+ =t "only_estonian_residets_can_signin"
+ %br
= link_to '/registrant/login/mid' do
= image_tag 'mid.gif'
= link_to '/registrant/id', method: :post do
diff --git a/config/locales/en.yml b/config/locales/en.yml
index a28390ae9..3a365a35b 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -954,3 +954,4 @@ en:
test_registrar: "Test registrar"
verified_confirm: 'Verified status is for cases when current registrant is the one applying for the update. Legal document signed by the registrant is required. Are you sure this update is properly verified with the registrant?'
verified: 'Verified'
+ only_estonian_residets_can_signin: "Access currently available only to Estonian citizens and e-residents with Estonian ID-card or Mobile-ID."
From 798db4d1d5237a031a847faa62ea43ba12505911 Mon Sep 17 00:00:00 2001
From: Georg Kahest
Date: Fri, 10 Jun 2016 14:29:23 +0300
Subject: [PATCH 167/180] nokogiri security update
---
Gemfile | 2 +-
Gemfile.lock | 10 ++++++----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Gemfile b/Gemfile
index d990fa2cb..06b82dce2 100644
--- a/Gemfile
+++ b/Gemfile
@@ -31,7 +31,7 @@ gem 'rails-settings-cached', '0.4.1' # for settings
# html-xml
gem 'haml-rails', '0.9.0' # haml for views
-gem 'nokogiri', '1.6.7.2' # For XML parsing
+gem 'nokogiri', '1.6.8' # For XML parsing
# style
gem 'sass-rails', '5.0.3' # sass style
diff --git a/Gemfile.lock b/Gemfile.lock
index 577bbbf20..d779fe3ff 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -316,7 +316,7 @@ GEM
mina (0.3.1)
open4 (~> 1.3.4)
rake
- mini_portile2 (2.0.0)
+ mini_portile2 (2.1.0)
minitest (5.8.4)
monetize (1.1.0)
money (~> 6.5.0)
@@ -332,8 +332,9 @@ GEM
nenv (0.2.0)
netrc (0.11.0)
newrelic_rpm (3.12.0.288)
- nokogiri (1.6.7.2)
- mini_portile2 (~> 2.0.0.rc2)
+ nokogiri (1.6.8)
+ mini_portile2 (~> 2.1.0)
+ pkg-config (~> 1.1.7)
nori (2.6.0)
notiffany (0.0.7)
nenv (~> 0.1)
@@ -348,6 +349,7 @@ GEM
phantomjs (1.9.8.0)
phantomjs-binaries (1.9.2.4)
sys-uname (= 0.9.0)
+ pkg-config (1.1.7)
poltergeist (1.6.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
@@ -619,7 +621,7 @@ DEPENDENCIES
mina (= 0.3.1)
money-rails (= 1.4.1)
newrelic_rpm (= 3.12.0.288)
- nokogiri (= 1.6.7.2)
+ nokogiri (= 1.6.8)
nprogress-rails (= 0.1.6.7)
paper_trail!
pdfkit (= 0.6.2)
From 999c161c8ec052272dc64c3d11dcda6fdaaa2585 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Mon, 13 Jun 2016 13:17:01 +0300
Subject: [PATCH 168/180] Story#120095555 - glue nameserver may have IPv4 or
IPv6
---
app/models/domain.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 5959cbb90..76cb23ff0 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -478,9 +478,11 @@ class Domain < ActiveRecord::Base
def validate_nameserver_ips
nameservers.to_a.reject(&:marked_for_destruction?).each do |ns|
next unless ns.hostname.end_with?(".#{name}")
- next if ns.ipv4.present?
+ next if ns.ipv4.present? || ns.ipv6.present?
+
errors.add(:nameservers, :invalid) if errors[:nameservers].blank?
ns.errors.add(:ipv4, :blank)
+ ns.errors.add(:ipv6, :blank)
end
end
From a3f903b717c006b0255aa03512b42c36b1e32ae3 Mon Sep 17 00:00:00 2001
From: Stas
Date: Fri, 3 Jun 2016 14:25:10 +0300
Subject: [PATCH 169/180] 120828283-fix_for_empty_hello (cherry picked from
commit e6710e5)
---
lib/epp_constraint.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/epp_constraint.rb b/lib/epp_constraint.rb
index 9cd68c121..992b5e37c 100644
--- a/lib/epp_constraint.rb
+++ b/lib/epp_constraint.rb
@@ -11,7 +11,7 @@ class EppConstraint
# creates parsed_frame, detects epp request object
def matches?(request)
# TODO: Maybe move this to controller to keep params clean
- request.params[:raw_frame] = request.params[:raw_frame].gsub!(/(?<=>)(.*?)(?=<)/) { |s| s.strip}
+ request.params[:raw_frame] = request.params[:raw_frame].gsub!(/(?<=>)(.*?)(?=<)/) { |s| s.strip} if request.params[:raw_frame]
request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame])
request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
From 002fbf5107eb359cf58c1fe39831b1975763416c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Tue, 14 Jun 2016 15:31:26 +0300
Subject: [PATCH 170/180] Update CHANGELOG.md
changes deployed to production on 14.06.2016
---
CHANGELOG.md | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ce74bbb10..367baec10 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
-20.05.2016
+14.06.2016
+* Portal for registrants
+ * Notice on login screen on limited access to Estonian electronic IDs (#120182999)
+* Admin interface:
+ * epp log view has now reference to the object name for better usability (#118912395)
+ * BUG: dnssec data missing from domain history view (#115762063)
+ * BUG: internal error in doamin history view in case some contact has been deleted (#118300251)
+* Registry:
+ * all values sent over epp are now trimmed of beginning and trailing spaces (#117690107)
+ * typo and form fixes for automated e-mail messages sent to domain contacts
+* EPP:
+ * BUG: error 2005 on adding IDN nameservers (#114677695)
+ * BUG: nameserver lable maximum 63 char length validation handled inproperly (#114677695) - support currently limited to Estonian IDN characters.
+ * BUG: validation passes out of range ident_type values - now limited to org, priv and birthday (#111601356)
+ * BUG: internal error on hello (#120828283)
+* Deploy:
+ * BUG: incorrect version in commit message on deploy - config/deploy-example.rb (#120259603)
+20.05.2016
* Portal for registrars
* domain details view new displays contact name in addition to ID (#117226457)
* added an option to set veryfied = "yes" parameter to GUI for registrant change and domain delete opertions (#116209751)
From 37952d22edb5c5c3ddcb14915cced1baf0410c0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Wed, 15 Jun 2016 10:44:41 +0300
Subject: [PATCH 171/180] Update CHANGELOG.md
---
CHANGELOG.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 367baec10..bd5256897 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-14.06.2016
+15.06.2016
* Portal for registrants
* Notice on login screen on limited access to Estonian electronic IDs (#120182999)
* Admin interface:
From 67e32f3a3648168ffb3451dd551bc3d73e1fe08e Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 15 Jun 2016 11:36:57 +0300
Subject: [PATCH 172/180] better error on validating glue IP address
---
app/models/domain.rb | 1 -
app/models/nameserver.rb | 2 +-
config/locales/en.yml | 2 +-
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/app/models/domain.rb b/app/models/domain.rb
index 76cb23ff0..3751da5b6 100644
--- a/app/models/domain.rb
+++ b/app/models/domain.rb
@@ -482,7 +482,6 @@ class Domain < ActiveRecord::Base
errors.add(:nameservers, :invalid) if errors[:nameservers].blank?
ns.errors.add(:ipv4, :blank)
- ns.errors.add(:ipv6, :blank)
end
end
diff --git a/app/models/nameserver.rb b/app/models/nameserver.rb
index 9ca1bebf7..86cd7e002 100644
--- a/app/models/nameserver.rb
+++ b/app/models/nameserver.rb
@@ -32,7 +32,7 @@ class Nameserver < ActiveRecord::Base
[:ipv4, :invalid, { value: { obj: 'hostAddr', val: ipv4 } }],
[:ipv6, :invalid, { value: { obj: 'hostAddr', val: ipv6 } }]
],
- '2306' => [
+ '2003' => [
[:ipv4, :blank]
]
}
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 400985d16..f2f4d061f 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -136,7 +136,7 @@ en:
taken: 'Nameserver already exists on this domain'
puny_to_long: 'Hostname puny label is too long (maximum is 63 characters)'
ipv4:
- blank: 'IPv4 is missing'
+ blank: 'IP is missing'
invalid: 'IPv4 is invalid'
ipv6:
invalid: 'IPv6 is invalid'
From 371ec46f420a769b4d3d9357e31b6a62e5fc8908 Mon Sep 17 00:00:00 2001
From: Vladimir Krylov
Date: Wed, 15 Jun 2016 17:28:49 +0300
Subject: [PATCH 173/180] Story#121580929 fix when incoming frame is empty
---
CHANGELOG.md | 1 +
lib/epp_constraint.rb | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bd5256897..f3537fd1a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@
* BUG: nameserver lable maximum 63 char length validation handled inproperly (#114677695) - support currently limited to Estonian IDN characters.
* BUG: validation passes out of range ident_type values - now limited to org, priv and birthday (#111601356)
* BUG: internal error on hello (#120828283)
+ * BUG: internal error broken incoming frame (#121580929)
* Deploy:
* BUG: incorrect version in commit message on deploy - config/deploy-example.rb (#120259603)
diff --git a/lib/epp_constraint.rb b/lib/epp_constraint.rb
index 992b5e37c..4463a7a04 100644
--- a/lib/epp_constraint.rb
+++ b/lib/epp_constraint.rb
@@ -12,8 +12,8 @@ class EppConstraint
def matches?(request)
# TODO: Maybe move this to controller to keep params clean
request.params[:raw_frame] = request.params[:raw_frame].gsub!(/(?<=>)(.*?)(?=<)/) { |s| s.strip} if request.params[:raw_frame]
- request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame])
- request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
+ request.params[:nokogiri_frame] ||= Nokogiri::XML(request.params[:raw_frame] || request.params[:frame])
+ request.params[:parsed_frame] ||= request.params[:nokogiri_frame].dup.remove_namespaces!
unless [:keyrelay, :poll, :session, :not_found].include?(@type)
element = "//#{@type}:#{request.params[:action]}"
From d6e490d40211a568290780d58cd1c240e5251ccf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Thu, 16 Jun 2016 11:12:34 +0300
Subject: [PATCH 174/180] Update CHANGELOG.md
---
CHANGELOG.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f3537fd1a..99534b676 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+16.06.2016
+* EPP
+ * BUG: XML syntax error for poll and logout if optional clTRID is missing (#121580929)
+ * support for glue records with ipv6 addresses only (#120095555)
+
15.06.2016
* Portal for registrants
* Notice on login screen on limited access to Estonian electronic IDs (#120182999)
From 9e9c979d36b34ae5690461e17745f3de0ec5ebff Mon Sep 17 00:00:00 2001
From: Georg Kahest
Date: Fri, 1 Jul 2016 15:11:08 +0300
Subject: [PATCH 175/180] help fixes
---
config/locales/en.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index f2f4d061f..9fc6ed60d 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -738,13 +738,13 @@ en:
no_invoices_were_binded: 'No invoices were binded'
domain_general_help:
The Administrative Contact
- is an Estonian citizen or a citizen of another country in the European Union, European Economic Area or the Swiss Confederation with a registered place of residence in Estonia and an Estonian personal identification code who has the right to represent the registering entity in accordance with the current legislation of the Republic of Estonia (member of the management board) or on the basis of the written authorisation issued by a member of the management board. The Administrative Contact has the right to sign and submit in the name of the registering entity any applications connected with the domain name and also to receive and forward any information concerning the domain name(s). The Administrative Contact is responsible for the correctness and authenticity of the data and documents submitted about itself and the registering entity.
+ is s a natural person who is a legal representative of the Registrant or whom the Registrant has authorised in writing (authorised representative). The Administrative Contact does not have the right to delegate the authorisation. The Administrative Contact has the right to sign and submit Domain Name-related applications on behalf of the Registrant and to receive and forward any information pertaining to the Domain Name(s). The Administrative Contact is responsible for the correctness and genuiness of the data and documents submitted by him/her about the Registrant and about himself/herself. Registrant is obliged to guarantee that the person appointed as the Administrative Contact agrees to fulfil the duties of and Administrative Contact. There may be more than one person in this role (the registry system allows of up to 10 Administrative Contacts)
domain_admin_contact_help:
The Technical Contact
- is a person who has the right to modify only such domain name server data that is connected with it. If the domain registering entity is using a website hosting service, it is recommended to register as the Technical Contact a representative of the corresponding provider company. If the domain registering entity manages its own servers, it can register itself as the Technical Contact.
+ is a natural or legal person who, in the name of the Registrant, adds, changes or removes entries of the authoritative Name Servers for that particular domain and its DNSSEC records. The Technical Contact does not have the right to represent the Registrant in other registration services. The Registrant is obliged to guarantee that the person appointed as the Technical Contact agrees to fulfil the duties of and Technical Contact. There may be more than one person in this role (the registry system allows of up to 10 Technical Contacts)
domain_tech_contact_help:
The domain name server
- is a computer that saves and forwards via a general-access data communications network such data that is connected with the domain name and corresponding IP addresses. Your IT helpdesk or Internet service provider will have the necessary information about the domain name servers.
+ refers to the computer that saves and forwards notices related to the Domain Names and their corresponding IP addresses in the Internet.
account_activity: 'Account activity'
account_activities: 'Account activities'
receipt_date: 'Receipt date'
From 039f6cf0eed28c39c8ea43532874392aca1f726f Mon Sep 17 00:00:00 2001
From: Georg Kahest
Date: Fri, 1 Jul 2016 15:14:31 +0300
Subject: [PATCH 176/180] typofix
---
config/locales/en.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 9fc6ed60d..2b24f8083 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -738,7 +738,7 @@ en:
no_invoices_were_binded: 'No invoices were binded'
domain_general_help:
The Administrative Contact
- is s a natural person who is a legal representative of the Registrant or whom the Registrant has authorised in writing (authorised representative). The Administrative Contact does not have the right to delegate the authorisation. The Administrative Contact has the right to sign and submit Domain Name-related applications on behalf of the Registrant and to receive and forward any information pertaining to the Domain Name(s). The Administrative Contact is responsible for the correctness and genuiness of the data and documents submitted by him/her about the Registrant and about himself/herself. Registrant is obliged to guarantee that the person appointed as the Administrative Contact agrees to fulfil the duties of and Administrative Contact. There may be more than one person in this role (the registry system allows of up to 10 Administrative Contacts)
+ is a natural person who is a legal representative of the Registrant or whom the Registrant has authorised in writing (authorised representative). The Administrative Contact does not have the right to delegate the authorisation. The Administrative Contact has the right to sign and submit Domain Name-related applications on behalf of the Registrant and to receive and forward any information pertaining to the Domain Name(s). The Administrative Contact is responsible for the correctness and genuiness of the data and documents submitted by him/her about the Registrant and about himself/herself. Registrant is obliged to guarantee that the person appointed as the Administrative Contact agrees to fulfil the duties of and Administrative Contact. There may be more than one person in this role (the registry system allows of up to 10 Administrative Contacts)
domain_admin_contact_help:
The Technical Contact
is a natural or legal person who, in the name of the Registrant, adds, changes or removes entries of the authoritative Name Servers for that particular domain and its DNSSEC records. The Technical Contact does not have the right to represent the Registrant in other registration services. The Registrant is obliged to guarantee that the person appointed as the Technical Contact agrees to fulfil the duties of and Technical Contact. There may be more than one person in this role (the registry system allows of up to 10 Technical Contacts)
From a20f9a1a7db057daf48ec6c463952ddd43c4f9d4 Mon Sep 17 00:00:00 2001
From: Georg Kahest
Date: Fri, 1 Jul 2016 15:21:05 +0300
Subject: [PATCH 177/180] fix indention fail
---
config/locales/en.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 2b24f8083..1807b3d21 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -741,10 +741,10 @@ en:
is a natural person who is a legal representative of the Registrant or whom the Registrant has authorised in writing (authorised representative). The Administrative Contact does not have the right to delegate the authorisation. The Administrative Contact has the right to sign and submit Domain Name-related applications on behalf of the Registrant and to receive and forward any information pertaining to the Domain Name(s). The Administrative Contact is responsible for the correctness and genuiness of the data and documents submitted by him/her about the Registrant and about himself/herself. Registrant is obliged to guarantee that the person appointed as the Administrative Contact agrees to fulfil the duties of and Administrative Contact. There may be more than one person in this role (the registry system allows of up to 10 Administrative Contacts)
domain_admin_contact_help:
The Technical Contact
- is a natural or legal person who, in the name of the Registrant, adds, changes or removes entries of the authoritative Name Servers for that particular domain and its DNSSEC records. The Technical Contact does not have the right to represent the Registrant in other registration services. The Registrant is obliged to guarantee that the person appointed as the Technical Contact agrees to fulfil the duties of and Technical Contact. There may be more than one person in this role (the registry system allows of up to 10 Technical Contacts)
+ is a natural or legal person who, in the name of the Registrant, adds, changes or removes entries of the authoritative Name Servers for that particular domain and its DNSSEC records. The Technical Contact does not have the right to represent the Registrant in other registration services. The Registrant is obliged to guarantee that the person appointed as the Technical Contact agrees to fulfil the duties of and Technical Contact. There may be more than one person in this role (the registry system allows of up to 10 Technical Contacts)
domain_tech_contact_help:
The domain name server
- refers to the computer that saves and forwards notices related to the Domain Names and their corresponding IP addresses in the Internet.
+ refers to the computer that saves and forwards notices related to the Domain Names and their corresponding IP addresses in the Internet.
account_activity: 'Account activity'
account_activities: 'Account activities'
receipt_date: 'Receipt date'
From edafad5a5c365511cd5dbcaba1a20ae782274153 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Tue, 5 Jul 2016 16:28:04 +0300
Subject: [PATCH 178/180] Update
pending_update_notification_for_new_registrant.html.erb
fix for english translation
---
...ending_update_notification_for_new_registrant.html.erb | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb
index 853fbafd5..a58aaef12 100644
--- a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb
+++ b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb
@@ -30,6 +30,8 @@ Hi,
Registrant change process for the domain <%= @params[:name] %> has been started.
+Please verify the details of the following change request. In case of problems contact your registrar <%= @params[:registrar_name] %>
+
New registrant:
Name: <%= @params[:registrant_name] %>
<% if @params[:registrant_priv] %>
@@ -41,7 +43,11 @@ Street: <%= @params[:registrant_street] %>
City: <%= @params[:registrant_city] %>
Country: <%= @params[:registrant_country] %>
-Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
+The registrant change procedure will be completed only after the current registrant <%= @params[:old_registrant_name] %> has approved it.
+
+Change request will be cancelled in case <%= @params[:old_registrant_name] %> rejects or does not approve it in <%= Setting.expire_pending_confirmation %> hours.
+
+Please contact registrar <%= @params[:registrar_name] %> in case of questions. You can find the registrar's contacts at http://internet.ee/registrars.
Best Regards,
Estonian Internet Foundation
From 9680ad146a2e76e43c90157a7ac3c2a3854f6b75 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20V=C3=B5hmar?=
Date: Tue, 5 Jul 2016 16:31:22 +0300
Subject: [PATCH 179/180] Update
pending_update_notification_for_new_registrant.text.erb
English translation fix
---
...ending_update_notification_for_new_registrant.text.erb | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb
index fcabafd7a..9c1a6aebe 100644
--- a/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb
+++ b/app/views/mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb
@@ -30,6 +30,8 @@ Hi,
Registrant change process for the domain <%= @params[:name] %> has been started.
+Please verify the details of the following change request. In case of problems contact your registrar <%= @params[:registrar_name] %>
+
New registrant:
Name: <%= @params[:registrant_name] %>
<% if @params[:registrant_priv] %>
@@ -41,7 +43,11 @@ Street: <%= @params[:registrant_street] %>
City: <%= @params[:registrant_city] %>
Country: <%= @params[:registrant_country] %>
-Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
+The registrant change procedure will be completed only after the current registrant <%= @params[:old_registrant_name] %> has approved it.
+
+Change request will be cancelled in case <%= @params[:old_registrant_name] %> rejects or does not approve it in <%= Setting.expire_pending_confirmation %> hours.
+
+Please contact registrar <%= @params[:registrar_name] %> in case of questions. You can find the registrar's contacts at http://internet.ee/registrars.
Best Regards,
Estonian Internet Foundation
From cfd7f600c105750cdf4e4e208557d14ceec65bf6 Mon Sep 17 00:00:00 2001
From: teadur
Date: Thu, 14 Jul 2016 13:11:54 +0300
Subject: [PATCH 180/180] update to changelog
---
CHANGELOG.md | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 99534b676..1d0aaac56 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+14.07.2016
+* Registry:
+ * whois records generation fix in contact.rb model (#117612931)
+ * english translation fix for pending_update_notification_for_new_registrant automated registrant message
+
16.06.2016
* EPP
* BUG: XML syntax error for poll and logout if optional clTRID is missing (#121580929)