diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 318923e3d..5d051377d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -67,8 +67,7 @@ class ApplicationController < ActionController::Base end def user_log_str(user) - return 'public' if user.nil? - "#{user.id}-#{user.class}: #{user.username}" + user.nil? ? 'public' : user.id_role_username end def comma_support_for(parent_key, key) diff --git a/app/controllers/registrar/contacts_controller.rb b/app/controllers/registrar/contacts_controller.rb index f4ce84d8c..878e29cd2 100644 --- a/app/controllers/registrar/contacts_controller.rb +++ b/app/controllers/registrar/contacts_controller.rb @@ -3,18 +3,61 @@ class Registrar::ContactsController < Registrar::DeppController # EPP controller def index authorize! :view, Depp::Contact - limit, offset = pagination_details - res = depp_current_user.repp_request('contacts', { details: true, limit: limit, offset: offset }) - if res.code == '200' - @response = res.parsed_body.with_indifferent_access - @contacts = @response ? @response[:contacts] : [] - - @paginatable_array = Kaminari.paginate_array( - [], total_count: @response[:total_number_of_records] - ).page(params[:page]).per(limit) + params[:q] ||= {} + params[:q].delete_if { |_k, v| v.blank? } + if params[:q].length == 1 && params[:q][:name_matches].present? + @contacts = Contact.find_by(name: params[:q][:name_matches]) end - flash.now[:epp_results] = [{ 'code' => res.code, 'msg' => res.message }] + + if params[:statuses_contains] + contacts = current_user.registrar.contacts.includes(:registrar).where( + "contacts.statuses @> ?::varchar[]", "{#{params[:statuses_contains].join(',')}}" + ) + else + contacts = current_user.registrar.contacts.includes(:registrar) + end + + normalize_search_parameters do + @q = contacts.search(params[:q]) + @contacts = @q.result.page(params[:page]) + end + + @contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 + end + + def download_list + authorize! :view, Depp::Contact + + params[:q] ||= {} + params[:q].delete_if { |_k, v| v.blank? } + if params[:q].length == 1 && params[:q][:name_matches].present? + @contacts = Contact.find_by(name: params[:q][:name_matches]) + end + + if params[:statuses_contains] + contacts = current_user.registrar.contacts.includes(:registrar).where( + "contacts.statuses @> ?::varchar[]", "{#{params[:statuses_contains].join(',')}}" + ) + else + contacts = current_user.registrar.contacts.includes(:registrar) + end + + normalize_search_parameters do + @q = contacts.search(params[:q]) + @contacts = @q.result.page(params[:page]) + end + + @contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i > 0 + + respond_to do |format| + format.csv { render text: @contacts.to_csv } + format.pdf do + pdf = @contacts.pdf(render_to_string('registrar/contacts/download_list', layout: false)) + send_data pdf, filename: 'contacts.pdf' + end + end + end def new @@ -75,4 +118,18 @@ class Registrar::ContactsController < Registrar::DeppController # EPP controller def init_epp_contact Depp::Contact.user = depp_current_user end + + def normalize_search_parameters + ca_cache = params[:q][:valid_to_lteq] + begin + end_time = params[:q][:valid_to_lteq].try(:to_date) + params[:q][:valid_to_lteq] = end_time.try(:end_of_day) + rescue + logger.warn('Invalid date') + end + + yield + + params[:q][:valid_to_lteq] = ca_cache + end end diff --git a/app/jobs/domain_update_confirm_job.rb b/app/jobs/domain_update_confirm_job.rb index 28294ef25..42209d205 100644 --- a/app/jobs/domain_update_confirm_job.rb +++ b/app/jobs/domain_update_confirm_job.rb @@ -4,18 +4,19 @@ class DomainUpdateConfirmJob < Que::Job ActiveRecord::Base.transaction do domain = Epp::Domain.find(domain_id) case action - when RegistrantVerification::CONFIRMED - domain.poll_message!(:poll_pending_update_confirmed_by_registrant) - domain.apply_pending_update! do |e| - e.instance_variable_set("@changed_attributes", e.changed_attributes.merge("statuses"=>[])) - end - domain.clean_pendings! - when RegistrantVerification::REJECTED - DomainMailer.pending_update_rejected_notification_for_new_registrant(domain_id).deliver - domain.poll_message!(:poll_pending_update_rejected_by_registrant) - domain.clean_pendings! - domain.instance_variable_set("@changed_attributes", domain.changed_attributes.merge("statuses"=>[])) - domain.save + when RegistrantVerification::CONFIRMED + domain.poll_message!(:poll_pending_update_confirmed_by_registrant) + domain.apply_pending_update! do |e| + e.instance_variable_set("@changed_attributes", e.changed_attributes.merge("statuses"=>[])) + end + domain.clean_pendings! + WhoisRecord.find_by(domain_id: domain.id).save! + when RegistrantVerification::REJECTED + domain.send_mail :pending_update_rejected_notification_for_new_registrant + domain.poll_message!(:poll_pending_update_rejected_by_registrant) + domain.clean_pendings! + domain.instance_variable_set("@changed_attributes", domain.changed_attributes.merge("statuses"=>[])) + domain.save end destroy # it's best to destroy the job in the same transaction end diff --git a/app/mailers/domain_mailer.rb b/app/mailers/domain_mailer.rb index 7fe92130b..66533e316 100644 --- a/app/mailers/domain_mailer.rb +++ b/app/mailers/domain_mailer.rb @@ -1,109 +1,28 @@ class DomainMailer < ApplicationMailer include Que::Mailer - def pending_update_request_for_old_registrant(domain_id, old_registrant_id, should_deliver) - @domain = Domain.find_by(id: domain_id) - @old_registrant = Registrant.find(old_registrant_id) - return unless @domain - return if delivery_off?(@domain, should_deliver) - - if @domain.registrant_verification_token.blank? - logger.warn "EMAIL NOT DELIVERED: registrant_verification_token is missing for #{@domain.name}" - return - end - - if @domain.registrant_verification_asked_at.blank? - logger.warn "EMAIL NOT DELIVERED: registrant_verification_asked_at is missing for #{@domain.name}" - return - end - - confirm_path = "#{ENV['registrant_url']}/registrant/domain_update_confirms" - @verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}" - - return if whitelist_blocked?(@old_registrant.email) - mail(to: format(@old_registrant.email), - subject: "#{I18n.t(:pending_update_request_for_old_registrant_subject, - name: @domain.name)} [#{@domain.name}]") + def pending_update_request_for_old_registrant(params) + compose_from(params) end - def pending_update_notification_for_new_registrant(domain_id, old_registrant_id, should_deliver) - @domain = Domain.find_by(id: domain_id) - @old_registrant = Registrant.find(old_registrant_id) - return unless @domain - return if delivery_off?(@domain, should_deliver) - - if @domain.registrant_verification_token.blank? - logger.warn "EMAIL NOT DELIVERED: registrant_verification_token is missing for #{@domain.name}" - return - end - - if @domain.registrant_verification_asked_at.blank? - logger.warn "EMAIL NOT DELIVERED: registrant_verification_asked_at is missing for #{@domain.name}" - return - end - - @new_registrant = @domain.registrant # NB! new registrant at this point - - return if whitelist_blocked?(@new_registrant.email) - mail(to: format(@new_registrant.email), - subject: "#{I18n.t(:pending_update_notification_for_new_registrant_subject, - name: @domain.name)} [#{@domain.name}]") + def pending_update_notification_for_new_registrant(params) + compose_from(params) end - def registrant_updated_notification_for_new_registrant(domain_id, should_deliver) - @domain = Domain.find_by(id: domain_id) - return unless @domain - return if delivery_off?(@domain, should_deliver) - - return if whitelist_blocked?(@domain.registrant_email) - mail(to: format(@domain.registrant_email), - subject: "#{I18n.t(:registrant_updated_notification_for_new_registrant_subject, - name: @domain.name)} [#{@domain.name}]") + def registrant_updated_notification_for_new_registrant(params) + compose_from(params) end - def registrant_updated_notification_for_old_registrant(domain_id, should_deliver) - domain = Domain.find_by(id: domain_id) - return unless domain - return if delivery_off?(@domain, should_deliver) - - @old_registrant_email = domain.registrant_email # Nb! before applying pending updates - - 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}]") + def registrant_updated_notification_for_old_registrant(params) + compose_from(params) end - def pending_update_rejected_notification_for_new_registrant(domain_id) - @domain = Domain.find_by(id: domain_id) - return unless @domain - # no delivery off control, driggered by que, no epp request - - @new_registrant_email = @domain.pending_json['new_registrant_email'] - @new_registrant_name = @domain.pending_json['new_registrant_name'] - - return if whitelist_blocked?(@new_registrant_email) - mail(to: format(@new_registrant_email), - subject: "#{I18n.t(:pending_update_rejected_notification_for_new_registrant_subject, - name: @domain.name)} [#{@domain.name}]") + def pending_update_rejected_notification_for_new_registrant(params) + compose_from(params) end - def pending_update_expired_notification_for_new_registrant(domain_id) - @domain = Domain.find_by(id: domain_id) - return unless @domain - # no delivery off control, driggered by cron, no epp request - - @new_registrant_email = @domain.pending_json['new_registrant_email'] - @new_registrant_name = @domain.pending_json['new_registrant_name'] - - return if whitelist_blocked?(@new_registrant_email) - if @new_registrant_email.blank? - logger.info "EMAIL NOT DELIVERED: no registrant email [pending_update_expired_notification_for_new_registrant]" - return - end - mail(to: format(@new_registrant_email), - subject: "#{I18n.t(:pending_update_expired_notification_for_new_registrant_subject, - name: @domain.name)} [#{@domain.name}]") + def pending_update_expired_notification_for_new_registrant(params) + compose_from(params) end def pending_deleted(domain_id, old_registrant_id, should_deliver) @@ -176,6 +95,16 @@ class DomainMailer < ApplicationMailer name: @domain.name)} [#{@domain.name}]") end + def expiration_reminder(domain_id) + @domain = Domain.find_by(id: domain_id) + return unless @domain + return if whitelist_blocked?(@domain.registrant.email) + mail(to: format(@domain.registrant.email), + subject: "#{I18n.t(:expiration_remind_subject, + name: @domain.name)} [#{@domain.name}]") + end + + def force_delete(domain_id, should_deliver) @domain = Domain.find_by(id: domain_id) return if delivery_off?(@domain, should_deliver) @@ -187,4 +116,18 @@ class DomainMailer < ApplicationMailer subject: "#{I18n.t(:force_delete_subject)}" ) end + + private + # app/models/DomainMailModel provides the data for mail that can be composed_from + # which ensures that values of objects are captured when they are valid, not later when this method is executed + def compose_from(params) + @params = params + return if delivery_off?(params, params[:deliver_emails]) + return if whitelist_blocked?(params[:recipient]) + params[:errors].map do |error| + logger.warn error + return + end + mail(to: params[:recipient], subject: params[:subject]) + end end diff --git a/app/models/concerns/user_events.rb b/app/models/concerns/user_events.rb index 12ff18444..25a225e8b 100644 --- a/app/models/concerns/user_events.rb +++ b/app/models/concerns/user_events.rb @@ -1,23 +1,30 @@ module UserEvents extend ActiveSupport::Concern - # TODO: remove old - # module ClassMethods - # def registrar_events(id) - # registrar = Registrar.find(id) - # return [] unless registrar - # @events = [] - # registrar.users.each { |user| @events << user_events(user.id) } - # registrar.epp_users.each { |user| @events << epp_user_events(user.id) } - # @events - # end + included do + # EPP requires a server defined creator ID, which should be registrar code if we have one + def cr_id + # try this, rebuild user for registrar before searching history? really? + registrar = self.creator.try(:registrar) + if registrar.present? # Did creator return a kind of User that has a registrar? + registrar.code + else + if self.versions.first.try(:object).nil? + changes = self.versions.first.try(:object_changes) + cr_registrar_id = changes['registrar_id'].second if changes.present? + else + # untested, expected never to execute + cr_registrar_id = self.versions.first.object['registrar_id'] + end - # def user_events(id) - # where(whodunnit: id.to_s) - # end + if cr_registrar_id.present? + Registrar.find(cr_registrar_id).code + else + # cr_id optional for domain, but required for contact; but we want something here anyway + self.creator_str # Fallback if we failed, maybe we can find a string here + end + end + end + end - # def epp_user_events(id) - # where(whodunnit: "#{id}-EppUser") - # end - # end end diff --git a/app/models/concerns/versions.rb b/app/models/concerns/versions.rb index 2cbdca838..768cf021e 100644 --- a/app/models/concerns/versions.rb +++ b/app/models/concerns/versions.rb @@ -22,32 +22,30 @@ module Versions def creator return nil if creator_str.blank? - - if creator_str =~ /^\d+-AdminUser:/ - creator = AdminUser.find_by(id: creator_str) - elsif creator_str =~ /^\d+-ApiUser:/ - creator = ApiUser.find_by(id: creator_str) - elsif creator_str =~ /^\d+-api-/ # depricated - creator = ApiUser.find_by(id: creator_str) - end - + creator = user_from_id_role_username creator_str creator.present? ? creator : creator_str end def updator return nil if updator_str.blank? - - if updator_str =~ /^\d+-AdminUser:/ - updator = AdminUser.find_by(id: updator_str) - elsif updator_str =~ /^\d+-ApiUser:/ - updator = ApiUser.find_by(id: updator_str) - elsif updator_str =~ /^\d+-api-/ # depricated - updator = ApiUser.find_by(id: updator_str) - end - + updator = user_from_id_role_username updator_str updator.present? ? updator : updator_str end + def user_from_id_role_username(str) + user = ApiUser.find_by(id: $1) if str =~ /^(\d+)-(ApiUser:|api-)/ + unless user.present? + user = AdminUser.find_by(id: $1) if str =~ /^(\d+)-AdminUser:/ + unless user.present? + # on import we copied Registrar name, which may eql code + registrar = Registrar.find_by(name: str) + # assume each registrar has only one user + user = registrar.api_users.first if registrar + end + end + user + end + # callbacks def touch_domain_version domain.try(:touch_with_version) diff --git a/app/models/contact.rb b/app/models/contact.rb index 7ebfaf684..96365d056 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -1,6 +1,7 @@ class Contact < ActiveRecord::Base include Versions # version/contact_version.rb include EppErrors + include UserEvents belongs_to :registrar has_many :domain_contacts @@ -26,7 +27,7 @@ class Contact < ActiveRecord::Base validates :ident_country_code, presence: true, if: proc { |c| %w(org priv).include? c.ident_type }, on: :create validates :code, uniqueness: { message: :epp_id_taken }, - format: { with: /\A[\w\-\:]*\Z/i, message: :invalid }, + format: { with: /\A[\w\-\:\.\_]*\z/i, message: :invalid }, length: { maximum: 100, message: :too_long_contact_code } validate :ident_valid_format? validate :uniq_statuses? @@ -48,7 +49,7 @@ class Contact < ActiveRecord::Base return nil unless deliver_emails == true emails = [] emails << [email, email_was] - emails << domains.map(&:registrant_email) if domains.present? + # emails << domains.map(&:registrant_email) if domains.present? emails = emails.flatten.uniq emails.each do |e| ContactMailer.email_updated(email_was, e, id, deliver_emails).deliver @@ -61,6 +62,8 @@ class Contact < ActiveRecord::Base manage_ok end + after_save :update_related_whois_records + # for overwrite when doing children loop attr_writer :domains_present @@ -201,6 +204,21 @@ class Contact < ActiveRecord::Base ['DeleteProhibited', SERVER_DELETE_PROHIBITED] ] end + + def to_csv + CSV.generate do |csv| + csv << column_names + all.each do |contact| + csv << contact.attributes.values_at(*column_names) + end + end + end + + def pdf(html) + kit = PDFKit.new(html) + kit.to_pdf + end + end def roid @@ -468,4 +486,9 @@ class Contact < ActiveRecord::Base PENDING_DELETE ]).present? end + + def update_related_whois_records + related_domain_descriptions.each{ |x, y| WhoisRecord.find_by(name: x).save} + end + end diff --git a/app/models/domain.rb b/app/models/domain.rb index cc35807d5..7a4aae870 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -1,5 +1,6 @@ # rubocop: disable Metrics/ClassLength class Domain < ActiveRecord::Base + include UserEvents include Versions # version/domain_version.rb include Statuses has_paper_trail class_name: "DomainVersion", meta: { children: :children_log } @@ -238,10 +239,10 @@ class Domain < ActiveRecord::Base end count += 1 if domain.pending_update? - DomainMailer.pending_update_expired_notification_for_new_registrant(domain.id).deliver + send_mail :pending_update_expired_notification_for_new_registrant end if domain.pending_delete? || domain.pending_delete_confirmation? - DomainMailer.pending_delete_expired_notification(domain.id, deliver_emails).deliver + DomainMailer.pending_delete_expired_notification(domain.id, true).deliver end domain.clean_pendings! unless Rails.env.test? @@ -263,6 +264,7 @@ class Domain < ActiveRecord::Base domains.each do |domain| next unless domain.expirable? domain.set_graceful_expired + DomainMailer.expiration_reminder(domain.id).deliver STDOUT << "#{Time.zone.now.utc} Domain.start_expire_period: ##{domain.id} (#{domain.name}) #{domain.changes}\n" unless Rails.env.test? domain.save end @@ -306,7 +308,7 @@ class Domain < ActiveRecord::Base c = 0 Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x| - Whois::Record.where('domain_id = ?', x.id).try(':destroy') + 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? @@ -314,7 +316,7 @@ class Domain < ActiveRecord::Base end Domain.where('force_delete_at <= ?', Time.zone.now).each do |x| - Whois::Record.where('domain_id = ?', x.id).try(':destroy') + WhoisRecord.where(domain_id: x.id).destroy_all destroy_with_message x STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test? c += 1 @@ -392,7 +394,7 @@ class Domain < ActiveRecord::Base end def delete_candidateable? - return false if delete_at > Time.zone.now + return false if delete_at.to_date > Date.today return false if statuses.include?(DomainStatus::DELETE_CANDIDATE) return false if statuses.include?(DomainStatus::SERVER_DELETE_PROHIBITED) true @@ -438,7 +440,6 @@ class Domain < ActiveRecord::Base end def pending_update! - old_registrant_id = registrant_id return true if pending_update? self.epp_pending_update = true # for epp @@ -450,8 +451,8 @@ class Domain < ActiveRecord::Base new_registrant_email = registrant.email new_registrant_name = registrant.name - DomainMailer.pending_update_request_for_old_registrant(id, old_registrant_id, deliver_emails).deliver - DomainMailer.pending_update_notification_for_new_registrant(id, old_registrant_id, deliver_emails).deliver + send_mail :pending_update_request_for_old_registrant + send_mail :pending_update_notification_for_new_registrant reload # revert back to original @@ -542,7 +543,7 @@ class Domain < ActiveRecord::Base ### VALIDATIONS ### def validate_nameserver_ips - nameservers.each do |ns| + nameservers.to_a.reject(&:marked_for_destruction?).each do |ns| next unless ns.hostname.end_with?(name) next if ns.ipv4.present? errors.add(:nameservers, :invalid) if errors[:nameservers].blank? @@ -647,7 +648,7 @@ class Domain < ActiveRecord::Base registrar.messages.create!( body: I18n.t('force_delete_set_on_domain', domain: name) ) - DomainMailer.force_delete(id, deliver_emails).deliver + DomainMailer.force_delete(id, true).deliver return true end false @@ -817,5 +818,10 @@ class Domain < ActiveRecord::Base status_notes[status] = notes[i] end end + + def send_mail(action) + DomainMailer.send(action, DomainMailModel.new(self).send(action)).deliver + end + end # rubocop: enable Metrics/ClassLength diff --git a/app/models/domain_mail_model.rb b/app/models/domain_mail_model.rb new file mode 100644 index 000000000..46309ad52 --- /dev/null +++ b/app/models/domain_mail_model.rb @@ -0,0 +1,180 @@ +class DomainMailModel + # Capture current values used in app/views/mailers/domain_mailer/* and app/mailers/domain_mailer will send later + + def initialize(domain) + @domain = domain + @params = {errors: [], deliver_emails: domain.deliver_emails, id: domain.id} + end + + def pending_update_request_for_old_registrant + registrant_old + subject(:pending_update_request_for_old_registrant_subject) + confirm_update + domain_info + compose + end + + def pending_update_notification_for_new_registrant + registrant # new registrant at this point + subject(:pending_update_notification_for_new_registrant_subject) + 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 + subject(:pending_update_rejected_notification_for_new_registrant_subject) + @params[:deliver_emails] = true # triggered from que + @params[:registrar_name] = @domain.registrar.name + compose + end + + def pending_update_expired_notification_for_new_registrant + registrant_pending + subject(:pending_update_expired_notification_for_new_registrant_subject) + domain_info + compose + end + + def pending_deleted + registrant + subject(:domain_pending_deleted_subject) + confirm_delete + compose + end + + def pending_delete_rejected_notification + registrant + subject(:pending_delete_rejected_notification_subject) + compose + end + + def pending_delete_expired_notification + registrant + subject(:pending_delete_expired_notification_subject) + compose + end + + def delete_confirmation + registrant + subject(:delete_confirmation_subject) + compose + end + + def force_delete + admins + subject(:force_delete_subject) + compose + end + + private + + def registrant_old + @params[:recipient] = format Registrant.find(@domain.registrant_id_was).email + end + + def registrant + @params[:recipient] = format @domain.registrant.email + end + + def registrant_pending + @params[:recipient] = format @domain.pending_json['new_registrant_email'] + @params[:new_registrant_name] = @domain.pending_json['new_registrant_name'] + @params[:old_registrant_name] = @domain.registrant.name + end + + # registrant and domain admin contacts + def admins + emails = ([@domain.registrant.email] + @domain.admin_contacts.map { |x| format(x.email) }) + @params[:recipient] = emails.uniq.map { |x| format(x) } + end + + # puny internet domain name, TODO: username + def format(email) + return warn_no_email if email.nil? + user, host = email.split('@') + host = SimpleIDN.to_ascii(host) + "#{user}@#{host}" + end + + def subject(subject) + @params[:name] = @domain.name + @params[:subject] = "#{I18n.t(subject, name: @domain.name)}, [#{@domain.name}]" + end + + def confirm_update + verification_url('domain_update_confirms') + end + + def confirm_delete + verification_url('domain_delete_confirms') + end + + def compose + @params + end + + def verification_url(path) + token = verification_token or return + @params[:verification_url] = "#{ENV['registrant_url']}/registrant/#{path}/#{@domain.id}?token=#{token}" + end + + def verification_token + return warn_missing(:registrant_verification_token) if @domain.registrant_verification_token.blank? + return warn_missing(:registrant_verification_asked_at) if @domain.registrant_verification_asked_at.blank? + @domain.registrant_verification_token + end + + def domain_info + [:name, :registrar_name, + :registrant_name, :registrant_ident, :registrant_email, + :registrant_street,:registrant_city + ].each do |attr| + @params.store attr, @domain.send(attr) + end + @params.store :registrant_country, @domain.registrant_country.name + @params.store :registrant_priv, @domain.registrant.priv? + @params.store :old_registrant_name, Registrant.find(@domain.registrant_id_was).name + @params + end + + def warn_no_email(item = 'email') + warn_missing item + nil + end + + def warn_missing(item) + warn_not_delivered "#{item.to_s} is missing for #{@domain.name}" + end + + def warn_not_delivered(reason) + message = "EMAIL NOT DELIVERED: #{reason}" + @params[:errors] << message +# Rails.logger.warn message + nil + end + +end + diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 613c57115..656d5f645 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -2,6 +2,9 @@ class Epp::Domain < Domain include EppErrors + # TODO: remove this spagetti once data in production is correct. + attr_accessor :is_renewal + before_validation :manage_permissions def manage_permissions return unless update_prohibited? || delete_prohibited? @@ -11,6 +14,8 @@ class Epp::Domain < Domain after_validation :validate_contacts def validate_contacts + return true if is_renewal + ok = true active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? } active_techs = tech_domain_contacts.select { |x| !x.marked_for_destruction? } @@ -495,18 +500,23 @@ class Epp::Domain < Domain # rubocop: enable Metrics/CyclomaticComplexity def apply_pending_update! - old_registrant_email = DomainMailer.registrant_updated_notification_for_old_registrant(id, deliver_emails) preclean_pendings user = ApiUser.find(pending_json['current_user_id']) frame = Nokogiri::XML(pending_json['frame']) + + self.deliver_emails = true # turn on email delivery + send_mail :registrant_updated_notification_for_old_registrant + statuses.delete(DomainStatus::PENDING_UPDATE) yield(self) if block_given? # need to skip statuses check here + self.save + ::PaperTrail.whodunnit = user.id_role_username # updator str should be the request originator not the approval user return unless update(frame, user, false) clean_pendings! - self.deliver_emails = true # turn on email delivery - DomainMailer.registrant_updated_notification_for_new_registrant(id, deliver_emails).deliver - old_registrant_email.deliver + + send_mail :registrant_updated_notification_for_new_registrant + update_whois_record true end @@ -564,6 +574,7 @@ class Epp::Domain < Domain ### RENEW ### def renew(cur_exp_date, period, unit = 'y') + @is_renewal = true validate_exp_dates(cur_exp_date) add_epp_error('2105', nil, nil, I18n.t('object_is_not_eligible_for_renewal')) unless renewable? diff --git a/app/models/user.rb b/app/models/user.rb index 0beb174f3..b69e0250c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,4 +3,9 @@ class User < ActiveRecord::Base devise :trackable, :timeoutable attr_accessor :phone + + def id_role_username + "#{self.id}-#{self.class}: #{self.username}" + end + end diff --git a/app/models/version/contact_version.rb b/app/models/version/contact_version.rb index 987dbc1fd..781813302 100644 --- a/app/models/version/contact_version.rb +++ b/app/models/version/contact_version.rb @@ -2,8 +2,6 @@ class ContactVersion < PaperTrail::Version include VersionSession self.table_name = :log_contacts self.sequence_name = :log_contacts_id_seq - - # include UserEvents - + # scope :deleted, -> { where(event: 'destroy') } end diff --git a/app/models/version/domain_version.rb b/app/models/version/domain_version.rb index 5bc25f1e1..2986d7811 100644 --- a/app/models/version/domain_version.rb +++ b/app/models/version/domain_version.rb @@ -4,7 +4,5 @@ class DomainVersion < PaperTrail::Version self.table_name = :log_domains self.sequence_name = :log_domains_id_seq - include UserEvents - scope :deleted, -> { where(event: 'destroy') } end diff --git a/app/models/whois_record.rb b/app/models/whois_record.rb index ac5f17c7b..55cc997da 100644 --- a/app/models/whois_record.rb +++ b/app/models/whois_record.rb @@ -44,13 +44,13 @@ class WhoisRecord < ActiveRecord::Base h[:changed] = domain.updated_at.try(:to_s, :iso8601) h[:expire] = domain.valid_to.try(:to_date).try(:to_s) h[:outzone] = domain.outzone_at.try(:to_date).try(:to_s) - h[:delete] = domain.delete_at.try(:to_date).try(:to_s) + h[:delete] = [domain.delete_at, domain.force_delete_at].compact.min.try(:to_date).try(:to_s) h[:registrant] = domain.registrant.name h[:registrant_email] = domain.registrant.email @disclosed << [:email, domain.registrant.email] - h[:changed] = domain.registrant.updated_at.try(:to_s, :iso8601) + h[:registrant_changed] = domain.registrant.updated_at.try(:to_s, :iso8601) h[:admin_contacts] = [] domain.admin_contacts.each do |ac| @@ -113,6 +113,6 @@ class WhoisRecord < ActiveRecord::Base end def destroy_whois_record - Whois::Record.where(name: name).delete_all() + Whois::Record.where(name: name).delete_all end end diff --git a/app/views/epp/contacts/info.xml.builder b/app/views/epp/contacts/info.xml.builder index 18019208a..39aa91b39 100644 --- a/app/views/epp/contacts/info.xml.builder +++ b/app/views/epp/contacts/info.xml.builder @@ -46,15 +46,15 @@ xml.epp_head do xml.tag!('contact:email', 'No access') end - xml.tag!('contact:clID', @contact.registrar.try(:name)) - if @contact.creator.try(:registrar).blank? && Rails.env.test? - xml.tag!('contact:crID', 'TEST-CREATOR') - else - xml.tag!('contact:crID', @contact.creator.try(:registrar)) - end + xml.tag!('contact:clID', @contact.registrar.try(:code)) + + xml.tag!('contact:crID', @contact.cr_id) xml.tag!('contact:crDate', @contact.created_at.try(:iso8601)) + if @contact.updated_at != @contact.created_at - xml.tag!('contact:upID', @contact.updator.try(:registrar)) + upID = @contact.updator.try(:registrar) + upID = upID.code if upID.present? # Did updator return a kind of User that has a registrar? + xml.tag!('contact:upID', upID) if upID.present? # optional upID xml.tag!('contact:upDate', @contact.updated_at.try(:iso8601)) end # xml.tag!('contact:trDate', '123') if false diff --git a/app/views/epp/domains/info.xml.builder b/app/views/epp/domains/info.xml.builder index d3ffd22d5..ec5947b13 100644 --- a/app/views/epp/domains/info.xml.builder +++ b/app/views/epp/domains/info.xml.builder @@ -36,19 +36,20 @@ xml.epp_head do ## TODO Find out what this domain:host is all about - xml.tag!('domain:clID', @domain.registrar_name) - - xml.tag!('domain:crID', @domain.creator.try(:registrar) || @domain.creator) if @domain.creator + xml.tag!('domain:clID', @domain.registrar.code) + xml.tag!('domain:crID', @domain.cr_id) xml.tag!('domain:crDate', @domain.created_at.try(:iso8601)) - xml.tag!('domain:upDate', @domain.updated_at.try(:iso8601)) if @domain.updated_at != @domain.created_at + if @domain.updated_at != @domain.created_at + upID = @domain.updator.try(:registrar) + upID = upID.code if upID.present? # Did updator return a kind of User that has a registrar? + xml.tag!('domain:upID', upID) if upID.present? # optional upID + xml.tag!('domain:upDate', @domain.updated_at.try(:iso8601)) + end xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) - # TODO Make domain stampable - #xml.tag!('domain:upID', @domain.updated_by) - # TODO Make domain transferrable #xml.tag!('domain:trDate', @domain.transferred_at) if @domain.transferred_at diff --git a/app/views/for_models/whois.erb b/app/views/for_models/whois.erb index cb6adac75..030f10d51 100644 --- a/app/views/for_models/whois.erb +++ b/app/views/for_models/whois.erb @@ -14,10 +14,10 @@ delete: <%= json['delete'].to_s.tr('T',' ').sub('+', ' +') %> Registrant: name: <%= json['registrant'] %> email: Not Disclosed - Visit www.internet.ee for webbased WHOIS -changed: <%= json['changed'].to_s.tr('T',' ').sub('+', ' +') %> +changed: <%= json['registrant_changed'].to_s.tr('T',' ').sub('+', ' +') %> <%- if json['admin_contacts'].present? -%> -Administrative contact +Administrative contact: <%- for contact in json['admin_contacts'] -%> name: <%= contact['name'] %> email: Not Disclosed - Visit www.internet.ee for webbased WHOIS @@ -57,4 +57,4 @@ changed: <%= json['dnssec_changed'].to_s.tr('T',' ').sub('+', ' +') %> <%- end -%> Estonia .ee Top Level Domain WHOIS server -More information at http://internet.ee \ No newline at end of file +More information at http://internet.ee diff --git a/app/views/mailers/domain_mailer/expiration_reminder.html.erb b/app/views/mailers/domain_mailer/expiration_reminder.html.erb new file mode 100644 index 000000000..59f02c510 --- /dev/null +++ b/app/views/mailers/domain_mailer/expiration_reminder.html.erb @@ -0,0 +1,75 @@ +Domeen <%= @domain.name %> on aegunud
+Lugupeetud .ee domeeni kasutaja
+
+Domeeninimi <%= @domain.name %> on aegunud ja ei ole alates <%= l(@domain.outzone_at, format: :short) %> internetis kättesaadav. Alates <%= l(@domain.delete_at, format: :short) %> on domeen <%= @domain.name %> avatud registreerimiseks kõigile huvilistele. +

+Domeeni registreeringu pikendamiseks pöörduge palun oma registripidaja <%= @domain.registrar.name %> poole. Registripidajate kontaktid leiate aadressilt www.internet.ee/registripidajad. +

+Domeeni <%= @domain.name %> kohta on registris järgmised andmed: +

+Registreerija: <%= @domain.registrant_name %>
+Halduskontakt: <%= @domain.admin_contacts.map(&:name).join ', ' %>
+Tehniline kontakt: <%= @domain.tech_contacts.map(&:name).join ', ' %>
+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
+

+
+

+The <%= @domain.name %> domain has expired
+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: :short) %>. From <%= l(@domain.delete_at, format: :short) %>, 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/. +

+The following data for the <%= @domain.name %> domain have been entered into the registry: +

+Registrant: <%= @domain.registrant_name %>
+Administrative contact: <%= @domain.admin_contacts.map(&:name).join ', ' %>
+Technical contact: <%= @domain.tech_contacts.map(&:name).join ', ' %>
+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
+

+
+

+Домен <%= @domain.name %> устарел
+Уважаемый пользователь домена .ee
+
+Доменное имя <%= @domain.name %> устарело и с <%= l(@domain.outzone_at, format: :short) %> недоступно в Интернете. С <%= l(@domain.delete_at, format: :short) %> домен <%= @domain.name %> доступен для регистрации всем желающим по принципу "first come, first served". +

+Для продления регистрации домена просим обратиться к своему регистратору <%= @domain.registrar.name %>. Контактные данные регистраторов можно найти по адресу http://www.internet.ee/ru/p/. +

+Относительно домена <%= @domain.name %> в реестр внесены следующие данные: +

+Регистрант: <%= @domain.registrant_name %>
+Административный контакт: <%= @domain.admin_contacts.map(&:name).join ', ' %>
+Технический контакт: <%= @domain.tech_contacts.map(&:name).join ', ' %>
+Регистратор: <%= @domain.registrar.name %>
+Серверы доменных имен: <%= @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 diff --git a/app/views/mailers/domain_mailer/expiration_reminder.text.erb b/app/views/mailers/domain_mailer/expiration_reminder.text.erb new file mode 100644 index 000000000..988ae5e10 --- /dev/null +++ b/app/views/mailers/domain_mailer/expiration_reminder.text.erb @@ -0,0 +1,75 @@ +Domeen <%= @domain.name %> on aegunud +Lugupeetud .ee domeeni kasutaja + +Domeeninimi <%= @domain.name %> on aegunud ja ei ole alates <%= l(@domain.outzone_at, format: :short) %> internetis kättesaadav. Alates <%= l(@domain.delete_at, format: :short) %> on domeen <%= @domain.name %> avatud registreerimiseks kõigile huvilistele. + +Domeeni registreeringu pikendamiseks pöörduge palun oma registripidaja <%= @domain.registrar.name %> poole. Registripidajate kontaktid leiate aadressilt www.internet.ee/registripidajad. + +Domeeni <%= @domain.name %> kohta on registris järgmised andmed: + +Registreerija: <%= @domain.registrant_name %> +Halduskontakt: <%= @domain.admin_contacts.map(&:name).join ', ' %> +Tehniline kontakt: <%= @domain.tech_contacts.map(&:name).join ', ' %> +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 + +-------------------------------------- + +The <%= @domain.name %> domain has expired +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: :short) %>. From <%= l(@domain.delete_at, format: :short) %>, 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/. + +The following data for the <%= @domain.name %> domain have been entered into the registry: + +Registrant: <%= @domain.registrant_name %> +Administrative contact: <%= @domain.admin_contacts.map(&:name).join ', ' %> +Technical contact: <%= @domain.tech_contacts.map(&:name).join ', ' %> +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 + +-------------------------------------- + +Домен <%= @domain.name %> устарел +Уважаемый пользователь домена .ee + +Доменное имя <%= @domain.name %> устарело и с <%= l(@domain.outzone_at, format: :short) %> недоступно в Интернете. С <%= l(@domain.delete_at, format: :short) %> домен <%= @domain.name %> доступен для регистрации всем желающим по принципу "first come, first served". + +Для продления регистрации домена просим обратиться к своему регистратору <%= @domain.registrar.name %>. Контактные данные регистраторов можно найти по адресу http://www.internet.ee/ru/p/. + +Относительно домена <%= @domain.name %> в реестр внесены следующие данные: + +Регистрант: <%= @domain.registrant_name %> +Административный контакт: <%= @domain.admin_contacts.map(&:name).join ', ' %> +Технический контакт: <%= @domain.tech_contacts.map(&:name).join ', ' %> +Регистратор: <%= @domain.registrar.name %> +Серверы доменных имен: <%= @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 diff --git a/app/views/mailers/domain_mailer/force_delete.html.erb b/app/views/mailers/domain_mailer/force_delete.html.erb index cfb5fb914..82bdee156 100644 --- a/app/views/mailers/domain_mailer/force_delete.html.erb +++ b/app/views/mailers/domain_mailer/force_delete.html.erb @@ -16,7 +16,7 @@ Registrikood: <%= @domain.registrant.try(:ident) %>

EIS-le 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/et/domeenid/) punktile 6.4 domeeni <%= @domain.name %> suhtes 30 päeva pikkuse kustutusmenetluse. Kustutamise käigus jääb domeen internetis kättesaadavaks.

+

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.

@@ -35,13 +35,13 @@ 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.

-

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/en/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 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.

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.

If the transfer has not been made in 30 days, the domain <%= @domain.name %> will be deleted at a randomly chosen moment within 24 hours after <%= l(@domain.force_delete_at, format: :short) %>. After deletion it is possible to reregister the domain on a "first come, first served" basis.

-

Should you have additional questions, please contact your registrar <%= @domain.registrar %>, whose contact information can be found at http://www.internet.ee/en/registrars/



+

Should you have additional questions, please contact your registrar <%= @domain.registrar %>, whose contact information can be found at http://www.internet.ee/registrars/



@@ -54,13 +54,13 @@ Registry code: <%= @domain.registrant.try(:ident) %>

EIS стало известно, что юридическое лицо с регистрационным кодом <%= @domain.registrant.try(:ident) %> удалено из коммерческого реестра.

-

Поскольку прекратившее деятельность юридическое лицо не может являться регистрантом домена, то согласно пункту 6.4 Правил домена (http://www.internet.ee/ru/11364/11400/) EIS <%= l(Time.zone.now, format: :date) %> инициировало удаление домена <%= @domain.name %> с применением 30-дневной процедуры удаления. На протяжении процесса удаления домен остается доступным в Интернете.

+

Поскольку прекратившее деятельность юридическое лицо не может являться регистрантом домена, то согласно пункту 6.4 Правил домена (http://www.internet.ee/domeny/) EIS <%= l(Time.zone.now, format: :date) %> инициировало удаление домена <%= @domain.name %> с применением 30-дневной процедуры удаления. На протяжении процесса удаления домен остается доступным в Интернете.

Согласно пункту 6.4 Правил домена регистрант, имеющий право на домен, может подать регистратору <%= @domain.registrar %> домена <%= @domain.name %> ходатайство о передаче домена в соответствии с п. 5.3.6.2 Правил домена. К ходатайству следует приложить подтверждающие приобретение домена документы, заменяющие в соответствии с пунктом 5.3.6.3 Правил домена согласие передающего доменное имя регистранта. EIS предлагает представить соответствующую документацию Регистратору при первой возможности, начиная с инициирования процедуры удаления.

Если в течение 30 дней передача не произошла, домен <%= @domain.name %> удаляется по истечении 24 часов <%= l(@domain.force_delete_at, format: :short) %> в случайный момент времени. По желанию после удаления из регистра домен можно снова зарегистрировать по принципу "кто успел, тот и съел".

-

Просим обратиться к своему регистратору <%= @domain.registrar %>. Контактные данные регистраторов можно найти по адресу http://www.internet.ee/ru/p/



+

Просим обратиться к своему регистратору <%= @domain.registrar %>. Контактные данные регистраторов можно найти по адресу http://www.internet.ee/registratory/



diff --git a/app/views/mailers/domain_mailer/force_delete.text.erb b/app/views/mailers/domain_mailer/force_delete.text.erb index fdd075647..527288686 100644 --- a/app/views/mailers/domain_mailer/force_delete.text.erb +++ b/app/views/mailers/domain_mailer/force_delete.text.erb @@ -7,13 +7,13 @@ Registrikood: <%= @domain.registrant.try(:ident) %> EIS-le 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/et/domeenid/) punktile 6.4 domeeni <%= @domain.name %> suhtes 30 päeva pikkuse kustutusmenetluse. Kustutamise käigus jääb domeen internetis kättesaadavaks. +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. Kui üleandmine ei ole 30 päeva jooksul toimunud, kustub domeen <%= @domain.name %> 24 tunni jooksul <%= l(@domain.force_delete_at, format: :short) %> 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/et/registripidajad/ +Lisaküsimuste korral võtke palun ühendust oma registripidajaga <%= @domain.registrar %>, kelle kontaktandmed leiate lingilt http://www.internet.ee/registripidajad/ @@ -26,13 +26,13 @@ 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. -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/en/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 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. 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. If the transfer has not been made in 30 days, the domain <%= @domain.name %> will be deleted at a randomly chosen moment within 24 hours after <%= l(@domain.force_delete_at, format: :short) %>. After deletion it is possible to reregister the domain on a "first come, first served" basis. -Should you have additional questions, please contact your registrar <%= @domain.registrar %>, whose contact information can be found at http://www.internet.ee/en/registrars/ +Should you have additional questions, please contact your registrar <%= @domain.registrar %>, whose contact information can be found at http://www.internet.ee/registrars/ @@ -45,13 +45,13 @@ Should you have additional questions, please contact your registrar <%= @domain. EIS стало известно, что юридическое лицо с регистрационным кодом <%= @domain.registrant.try(:ident) %> удалено из коммерческого реестра. -Поскольку прекратившее деятельность юридическое лицо не может являться регистрантом домена, то согласно пункту 6.4 Правил домена (http://www.internet.ee/ru/11364/11400/) EIS <%= l(Time.zone.now, format: :date) %> инициировало удаление домена <%= @domain.name %> с применением 30-дневной процедуры удаления. На протяжении процесса удаления домен остается доступным в Интернете. +Поскольку прекратившее деятельность юридическое лицо не может являться регистрантом домена, то согласно пункту 6.4 Правил домена (http://www.internet.ee/domeny) EIS <%= l(Time.zone.now, format: :date) %> инициировало удаление домена <%= @domain.name %> с применением 30-дневной процедуры удаления. На протяжении процесса удаления домен остается доступным в Интернете. Согласно пункту 6.4 Правил домена регистрант, имеющий право на домен, может подать регистратору <%= @domain.registrar %> домена <%= @domain.name %> ходатайство о передаче домена в соответствии с п. 5.3.6.2 Правил домена. К ходатайству следует приложить подтверждающие приобретение домена документы, заменяющие в соответствии с пунктом 5.3.6.3 Правил домена согласие передающего доменное имя регистранта. EIS предлагает представить соответствующую документацию Регистратору при первой возможности, начиная с инициирования процедуры удаления. Если в течение 30 дней передача не произошла, домен <%= @domain.name %> удаляется по истечении 24 часов <%= l(@domain.force_delete_at, format: :short) %> в случайный момент времени. По желанию после удаления из регистра домен можно снова зарегистрировать по принципу "кто успел, тот и съел". -Просим обратиться к своему регистратору <%= @domain.registrar %>. Контактные данные регистраторов можно найти по адресу http://www.internet.ee/ru/p/ +Просим обратиться к своему регистратору <%= @domain.registrar %>. Контактные данные регистраторов можно найти по адресу http://www.internet.ee/registratory 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 a8bf8723d..cfa539736 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,8 +1,8 @@ Tere,

-Domeeni <%= @domain.name %> registreerija <%= @domain.registrant_name %> ei kinnitanud tähtaegselt registreerija vahetuse taotlust. Domeeni <%= @domain.name %> registreerija vahetus on sellest tulenevalt tühistatud. +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 <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad +Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad

Lugupidamisega
Eesti Interneti SA @@ -11,9 +11,9 @@ Eesti Interneti SA

Hi,

-Domain registrant change has been expired for the domain <%= @domain.name %>. +Domain registrant change has been expired for the domain <%= @params[:name] %>.

-Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. +Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.

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 020a9da65..626583562 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,8 +1,8 @@ Tere, -Domeeni <%= @domain.name %> registreerija <%= @domain.registrant_name %> ei kinnitanud tähtaegselt registreerija vahetuse taotlust. Domeeni <%= @domain.name %> registreerija vahetus on sellest tulenevalt tühistatud. +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 <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad +Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad Lugupidamisega Eesti Interneti SA @@ -11,9 +11,9 @@ Eesti Interneti SA Hi, -Domain registrant change has been expired for the domain <%= @domain.name %>. +Domain registrant change has been expired for the domain <%= @params[:name] %>. -Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. +Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions. 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 df31c9139..07de23117 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,25 +1,25 @@ Tere,

-Registripidaja <%= @domain.registrar_name %> vahendusel on algatatud <%= @domain.name %> domeeni omanikuvahetuse protseduur. +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 <%= @domain.registrar_name %> +Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @params[:registrar_name] %>

-Uued registreerija andmed:
-Nimi: <%= @domain.registrant_name %>
-<% if @domain.registrant.priv? %> - Isikukood: <%= @domain.registrant_ident %>
+Uue registreerija andmed:
+Nimi: <%= @params[:registrant_name] %>
+<% if @params[:registrant_priv] %> + Isikukood: <%= @params[:registrant_ident] %>
<% else %> - Äriregistrikood: <%= @domain.registrant_ident %>
+ Äriregistrikood: <%= @params[:registrant_ident] %>
<% end %> -Tänav: <%= @domain.registrant_street %>
-Linn: <%= @domain.registrant_city %>
-Riik: <%= @domain.registrant_country %> +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 <%= @old_registrant.name %> omanikuvahetuse tähtaegselt kinnitab. +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.

-Juhul kui <%= @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 omanikuvahtuse 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 <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad +Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad

Lugupidamisega
Eesti Interneti SA @@ -28,20 +28,20 @@ Eesti Interneti SA

Hi,

-Registrant change process for the domain <%= @domain.name %> has been started. +Registrant change process for the domain <%= @params[:name] %> has been started.

New registrant:
-Name: <%= @domain.registrant_name %>
-<% if @domain.registrant.priv? %> -Personal code: <%= @domain.registrant_ident %>
+Name: <%= @params[:registrant_name] %>
+<% if @params[:registrant_priv] %> +Personal code: <%= @params[:registrant_ident] %>
<% else %> -Business Registry code: <%= @domain.registrant_ident %>
+Business Registry code: <%= @params[:registrant_ident] %>
<% end %> -Street: <%= @domain.registrant_street %>
-City: <%= @domain.registrant_city %>
-Country: <%= @domain.registrant_country %> +Street: <%= @params[:registrant_street] %>
+City: <%= @params[:registrant_city] %>
+Country: <%= @params[:registrant_country] %>

-Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. +Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.

Best Regards,
Estonian Internet Foundation 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 80265c05f..24005a58a 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,25 +1,25 @@ Tere, -Registripidaja <%= @domain.registrar_name %> vahendusel on algatatud <%= @domain.name %> domeeni omanikuvahetuse protseduur. +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 <%= @domain.registrar_name %> +Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @params[:registrar_name] %> -Uued registreerija andmed: -Nimi: <%= @domain.registrant_name %> -<% if @domain.registrant.priv? %> -Isikukood: <%= @domain.registrant_ident %> +Uue registreerija andmed: +Nimi: <%= @params[:registrant_name] %> +<% if @params[:registrant_priv] %> +Isikukood: <%= @params[:registrant_ident] %> <% else %> -Äriregistrikood: <%= @domain.registrant_ident %> +Äriregistrikood: <%= @params[:registrant_ident] %> <% end %> -Tänav: <%= @domain.registrant_street %> -Linn: <%= @domain.registrant_city %> -Riik: <%= @domain.registrant_country %> +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 <%= @old_registrant.name %> omanikuvahetuse tähtaegselt kinnitab. +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. -Juhul kui <%= @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 omanikuvahtuse 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 <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad +Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad Lugupidamisega Eesti Interneti SA @@ -28,20 +28,20 @@ Eesti Interneti SA Hi, -Registrant change process for the domain <%= @domain.name %> has been started. +Registrant change process for the domain <%= @params[:name] %> has been started. New registrant: -Name: <%= @domain.registrant_name %> -<% if @domain.registrant.priv? %> -Personal code: <%= @domain.registrant_ident %> +Name: <%= @params[:registrant_name] %> +<% if @params[:registrant_priv] %> +Personal code: <%= @params[:registrant_ident] %> <% else %> -Business Registry code: <%= @domain.registrant_ident %> +Business Registry code: <%= @params[:registrant_ident] %> <% end %> -Street: <%= @domain.registrant_street %> -City: <%= @domain.registrant_city %> -Country: <%= @domain.registrant_country %> +Street: <%= @params[:registrant_street] %> +City: <%= @params[:registrant_city] %> +Country: <%= @params[:registrant_country] %> -Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. +Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions. Best Regards, Estonian Internet Foundation 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 94672f176..1f9acf666 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,8 +1,8 @@ Tere,

-Domeeni <%= @domain.name %> registreerija <%= @new_registrant_name %> on domeeni registreerija vahetamise taotluse tagasi lükanud. +Domeeni <%= @params[:name] %> registreerija <%= @params[:old_registrant_name] %> on domeeni registreerija vahetamise taotluse tagasi lükanud.

-Küsimuste korral palun võtke ühendust registripidajaga <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad +Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad

Lugupidamisega,
Eesti Interneti SA @@ -11,9 +11,9 @@ Eesti Interneti SA

Hi,

-Registrant change was declined for the domain <%= @domain.name %>. +Registrant change was declined for the domain <%= @params[:name] %>.

-Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. +Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.

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 afdf06325..38a83e1b3 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,8 +1,8 @@ Tere, -Domeeni <%= @domain.name %> registreerija <%= @new_registrant_name %> on domeeni registreerija vahetamise taotluse tagasi lükanud. +Domeeni <%= @params[:name] %> registreerija <%= @params[:old_registrant_name] %> on domeeni registreerija vahetamise taotluse tagasi lükanud. -Küsimuste korral palun võtke ühendust registripidajaga <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad +Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad Lugupidamisega Eesti Interneti SA @@ -11,9 +11,9 @@ Eesti Interneti SA Hi, -Registrant change was declined for the domain <%= @domain.name %>. +Registrant change was declined for the domain <%= @params[:name] %>. -Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. +Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions. 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 c62cb5561..dc26a9c1c 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,23 +1,23 @@ Tere,

-Registrisse laekus taotlus domeeni <%= @domain.name %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @domain.registrar_name %> +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] %>

-Uued registreerija andmed:
-Nimi: <%= @domain.registrant_name %>
-<% if @domain.registrant.priv? %> -Isikukood: <%= @domain.registrant_ident %>
+Uue registreerija andmed:
+Nimi: <%= @params[:registrant_name] %>
+<% if @params[:registrant_priv] %> +Isikukood: <%= @params[:registrant_ident] %>
<% else %> -Äriregistrikood: <%= @domain.registrant_ident %>
+Äriregistrikood: <%= @params[:registrant_ident] %>
<% end %> -Tänav: <%= @domain.registrant_street %>
-Linn: <%= @domain.registrant_city %>
-Riik: <%= @domain.registrant_country %> +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:
-<%= link_to @verification_url, @verification_url %> +<%= link_to @params[:verification_url], @params[:verification_url] %>

Lugupidamisega
Eesti Interneti SA @@ -26,23 +26,23 @@ Eesti Interneti SA

Hi,

-Application for changing registrant of your domain <%= @domain.name %> has been filed. Please make sure that the update and information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @domain.registrar_name %> +Application for changing registrant of your domain <%= @params[:name] %> has been filed. Please make sure that the update and information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @params[:registrar_name] %>

New registrant:
-Name: <%= @domain.registrant_name %>
-<% if @domain.registrant.priv? %> -Personal code: <%= @domain.registrant_ident %>
+Name: <%= @params[:registrant_name] %>
+<% if @params[:registrant_priv] %> +Personal code: <%= @params[:registrant_ident] %>
<% else %> -Business Registry code: <%= @domain.registrant_ident %>
+Business Registry code: <%= @params[:registrant_ident] %>
<% end %> -Street: <%= @domain.registrant_street %>
-City: <%= @domain.registrant_city %>
-Country: <%= @domain.registrant_country %> +Street: <%= @params[:registrant_street] %>
+City: <%= @params[:registrant_city] %>
+Country: <%= @params[:registrant_country] %>

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.

To confirm the update please visit this website, once again review the data and press approve:
-<%= link_to @verification_url, @verification_url %> +<%= link_to @params[:verification_url], @params[:verification_url] %>

Best Regards,
Estonian Internet Foundation 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 04a85bf5e..142004bb6 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,21 +1,21 @@ Tere, -Registrisse laekus taotlus domeeni <%= @domain.name %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @domain.registrar_name %> +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] %> -Uued registreerija andmed: -Nimi: <%= @domain.registrant_name %> -<% if @domain.registrant.priv? %> -Isikukood: <%= @domain.registrant_ident %> +Uue registreerija andmed: +Nimi: <%= @params[:registrant_name] %> +<% if @params[:registrant_priv] %> +Isikukood: <%= @params[:registrant_ident] %> <% else %> -Äriregistrikood: <%= @domain.registrant_ident %> +Äriregistrikood: <%= @params[:registrant_ident] %> <% end %> -Tänav: <%= @domain.registrant_street %> -Linn: <%= @domain.registrant_city %> -Riik: <%= @domain.registrant_country %> +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: -<%= @verification_url %> +<%= @params[:verification_url] %> Lugupidamisega Eesti Interneti SA @@ -24,22 +24,22 @@ Eesti Interneti SA Hi, -Application for changing registrant of your domain <%= @domain.name %> has been filed. Please make sure that the update and information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @domain.registrar_name %> +Application for changing registrant of your domain <%= @params[:name] %> has been filed. Please make sure that the update and information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @params[:registrar_name] %> New registrant: -Name: <%= @domain.registrant_name %> -<% if @domain.registrant.priv? %> -Personal code: <%= @domain.registrant_ident %> +Name: <%= @params[:registrant_name] %> +<% if @params[:registrant_priv] %> +Personal code: <%= @params[:registrant_ident] %> <% else %> -Business Registry code: <%= @domain.registrant_ident %> +Business Registry code: <%= @params[:registrant_ident] %> <% end %> -Street: <%= @domain.registrant_street %> -City: <%= @domain.registrant_city %> -Country: <%= @domain.registrant_country %> +Street: <%= @params[:registrant_street] %> +City: <%= @params[:registrant_city] %> +Country: <%= @params[:registrant_country] %> 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. To confirm the update please visit this website, once again review the data and press approve: -<%= @verification_url %> +<%= @params[:verification_url] %> Best Regards, Estonian Internet Foundation 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 eb8352b8e..c7d464f43 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 <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. +Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.

-Uued registreerija andmed:
-Nimi: <%= @domain.registrant_name %>
-<% if @domain.registrant.priv? %> -Isikukood: <%= @domain.registrant_ident %>
+Uue registreerija andmed:
+Nimi: <%= @params[:registrant_name] %>
+<% if @params[:registrant_priv] %> +Isikukood: <%= @params[:registrant_ident] %>
<% else %> -Äriregistrikood: <%= @domain.registrant_ident %>
+Äriregistrikood: <%= @params[:registrant_ident] %>
<% end %> -Epost: <%= @domain.registrant_email %>
-Tänav: <%= @domain.registrant_street %>
-Linn: <%= @domain.registrant_city %>
-Riik: <%= @domain.registrant_country %> +Epost: <%= @params[:registrant_email] %>
+Tänav: <%= @params[:registrant_street] %>
+Linn: <%= @params[:registrant_city] %>
+Riik: <%= @params[:registrant_country] %>

Lugupidamisega
Eesti Interneti SA @@ -21,19 +21,19 @@ Eesti Interneti SA

Hi,

-Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated. +Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated.

New registrant:
-Name: <%= @domain.registrant_name %>
-<% if @domain.registrant.priv? %> -Personal code: <%= @domain.registrant_ident %>
+Name: <%= @params[:registrant_name] %>
+<% if @params[:registrant_priv] %> +Personal code: <%= @params[:registrant_ident] %>
<% else %> -Business Registry code: <%= @domain.registrant_ident %>
+Business Registry code: <%= @params[:registrant_ident] %>
<% end %> -E-mail: <%= @domain.registrant_email %>
-Street: <%= @domain.registrant_street %>
-City: <%= @domain.registrant_city %>
-Country: <%= @domain.registrant_country %> +E-mail: <%= @params[:registrant_email] %>
+Street: <%= @params[:registrant_street] %>
+City: <%= @params[:registrant_city] %>
+Country: <%= @params[:registrant_country] %>

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 503c111f6..115655897 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,18 @@ Tere, -Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. +Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. -Uued registreerija andmed: -Nimi: <%= @domain.registrant_name %> -<% if @domain.registrant.priv? %> -Isikukood: <%= @domain.registrant_ident %> +Uue registreerija andmed: +Nimi: <%= @params[:registrant_name] %> +<% if @params[:registrant_priv] %> +Isikukood: <%= @params[:registrant_ident] %> <% else %> -Äriregistrikood: <%= @domain.registrant_ident %> +Äriregistrikood: <%= @params[:registrant_ident] %> <% end %> -Epost: <%= @domain.registrant_email %> -Tänav: <%= @domain.registrant_street %> -Linn: <%= @domain.registrant_city %> -Riik: <%= @domain.registrant_country %> +Epost: <%= @params[:registrant_email] %> +Tänav: <%= @params[:registrant_street] %> +Linn: <%= @params[:registrant_city] %> +Riik: <%= @params[:registrant_country] %> Lugupidamisega Eesti Interneti SA @@ -21,19 +21,19 @@ Eesti Interneti SA Hi, -Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated. +Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated. New registrant: -Name: <%= @domain.registrant_name %> -<% if @domain.registrant.priv? %> -Personal code: <%= @domain.registrant_ident %> +Name: <%= @params[:registrant_name] %> +<% if @params[:registrant_priv] %> +Personal code: <%= @params[:registrant_ident] %> <% else %> -Business Registry code: <%= @domain.registrant_ident %> +Business Registry code: <%= @params[:registrant_ident] %> <% end %> -E-mail: <%= @domain.registrant_email %> -Street: <%= @domain.registrant_street %> -City: <%= @domain.registrant_city %> -Country: <%= @domain.registrant_country %> +E-mail: <%= @params[:registrant_email] %> +Street: <%= @params[:registrant_street] %> +City: <%= @params[:registrant_city] %> +Country: <%= @params[:registrant_country] %> 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 bdfda76dc..b41e1f1eb 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,9 +1,18 @@ Tere,

-Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. +Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.

-Uued registreerija:
-Nimi: <%= @domain.registrant_name %> +Uue registreerija andmed:
+Nimi: <%= @params[:new_registrant_name] %>
+<% if @params[:registrant_priv] %> +Isikukood: <%= @params[:registrant_ident] %>
+<% else %> +Äriregistrikood: <%= @params[:registrant_ident] %>
+<% end %> +Epost: <%= @params[:registrant_email] %>
+Tänav: <%= @params[:registrant_street] %>
+Linn: <%= @params[:registrant_city] %>
+Riik: <%= @params[:registrant_country] %>

Lugupidamisega
Eesti Interneti SA @@ -12,10 +21,19 @@ Eesti Interneti SA

Hi,

-Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated. +Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated.

New registrant:
-Name: <%= @domain.registrant_name %> +Name: <%= @params[:new_registrant_name] %>
+<% if @params[:registrant_priv] %> +Personal code: <%= @params[:registrant_ident] %>
+<% else %> +Business Registry code: <%= @params[:registrant_ident] %>
+<% end %> +E-mail: <%= @params[:registrant_email] %>
+Street: <%= @params[:registrant_street] %>
+City: <%= @params[:registrant_city] %>
+Country: <%= @params[:registrant_country] %>

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 08fb37fe0..c2efa5af9 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,9 +1,19 @@ Tere, -Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. +Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. -Uued registreerija: -Nimi: <%= @domain.registrant_name %> +Uue registreerija andmed: +Nimi: <%= @params[:new_registrant_name] %> + +<% if @params[:registrant_priv] %> +Isikukood: <%= @params[:registrant_ident] %> +<% else %> +Äriregistrikood: <%= @params[:registrant_ident] %> +<% end %> +Epost: <%= @params[:registrant_email] %> +Tänav: <%= @params[:registrant_street] %> +Linn: <%= @params[:registrant_city] %> +Riik: <%= @params[:registrant_country] %> Lugupidamisega Eesti Interneti SA @@ -12,10 +22,20 @@ Eesti Interneti SA Hi, -Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated. +Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated. New registrant: -Name: <%= @domain.registrant_name %> +Name: <%= @params[:new_registrant_name] %> + +<% if @params[:registrant_priv] %> +Personal code: <%= @params[:registrant_ident] %> +<% else %> +Business Registry code: <%= @params[:registrant_ident] %> +<% end %> +E-mail: <%= @params[:registrant_email] %> +Street: <%= @params[:registrant_street] %> +City: <%= @params[:registrant_city] %> +Country: <%= @params[:registrant_country] %> Best Regards, Estonian Internet Foundation diff --git a/app/views/registrar/contacts/download_list.haml b/app/views/registrar/contacts/download_list.haml new file mode 100644 index 000000000..b8944d254 --- /dev/null +++ b/app/views/registrar/contacts/download_list.haml @@ -0,0 +1,30 @@ +!!! +%html + %head + %meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"} + %title Contacts + %body + .row + .col-md-12 + .table-responsive + %table.table.table-hover.table-bordered.table-condensed + %thead + %tr + %th{class: 'col-xs-2'} + =t(:name) + %th{class: 'col-xs-2'} + =t(:id) + %th{class: 'col-xs-2'} + =t(:ident) + %th{class: 'col-xs-2'} + =t(:created_at) + %th{class: 'col-xs-2'} + =t(:registrar) + %tbody + - @contacts.each do |contact| + %tr + %td= contact + %td= contact.code + %td= ident_for(contact) + %td= l(contact.created_at, format: :short) + %td= contact.registrar diff --git a/app/views/registrar/contacts/index.haml b/app/views/registrar/contacts/index.haml index 401df706d..ae93a82fd 100644 --- a/app/views/registrar/contacts/index.haml +++ b/app/views/registrar/contacts/index.haml @@ -2,23 +2,130 @@ = link_to(t(:new), new_registrar_contact_path, class: 'btn btn-primary') = render 'shared/title', name: t(:contacts) -- if @response - .table-responsive - %table.table.table-hover.table-condensed - %thead - %tr - %th{class: 'col-xs-3'}= t(:name) - %th{class: 'col-xs-3'}= t(:id) - %th{class: 'col-xs-3'}= t(:ident) - %th{class: 'col-xs-3'}= t(:actions) - %tbody - - @contacts.each do |c| - %tr - %td= link_to(c[:name], registrar_contact_path(id: c[:code])) - %td= c[:code] - %td= ident_for(c) - %td - = link_to(t(:edit), edit_registrar_contact_path(c[:code]), class: 'btn btn-primary btn-xs') - = link_to(t(:delete), delete_registrar_contact_path(c[:code]), class: 'btn btn-default btn-xs') +.row + .col-md-12 + = search_form_for [:registrar, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f| + .row + .col-md-3 + .form-group + = f.label :name + = f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name) + .col-md-3 + .form-group + = f.label t(:id) + = f.search_field :code_eq, class: 'form-control', placeholder: t(:id) + .col-md-3 + .form-group + = f.label t(:ident) + = f.search_field :ident_matches, class: 'form-control', placeholder: t(:ident) + .col-md-3 + .form-group + = label_tag t(:ident_type) + = select_tag '[q][ident_type_eq]', options_for_select(Contact::IDENT_TYPES, params[:q][:ident_type_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' } + .row + .col-md-3 + .form-group + = f.label t(:email) + = f.search_field :email_matches, class: 'form-control', placeholder: t(:email) + .col-md-3 + .form-group + = label_tag t(:country) + = select_tag '[q][country_code_eq]', SortedCountry.all_options(params[:q][:country_code_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' } + .col-md-3 + .form-group + = f.label t(:is_registrant) + %div + = f.check_box :registrant_domains_id_not_null + .col-md-3 + .form-group + = label_tag t(:contact_type) + = select_tag '[q][domain_contacts_type_in]', options_for_select([['admin', 'AdminDomainContact'], ['tech', 'TechDomainContact']], params[:q][:domain_contacts_type_in]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' } + .row + .col-md-3 + .form-group + = f.label t(:registrar) + = f.select :registrar_id_eq, Registrar.all.map { |x| [x, x.id] }, { include_blank: true }, class: 'form-control selectize', placeholder: t(:choose) + .col-md-3 + .form-group + = f.label t(:created_at_from) + = f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control datepicker', placeholder: t(:created_at_from) + .col-md-3 + .form-group + = f.label t(:created_at_until) + = f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control datepicker', placeholder: t(:created_at_until) + .col-md-3 + .form-group + = f.label t(:updated_at) + = f.search_field :updated_at_gteq, value: params[:q][:updated_at_gteq], class: 'form-control datepicker', placeholder: t(:updated_at) + .row + .col-md-6 + .form-group + = label_tag t(:status) + = select_tag :statuses_contains, options_for_select(Contact::STATUSES, params[:statuses_contains]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' } + .col-md-3 + .form-group + = label_tag t(:results_per_page) + = text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page) + .col-md-3{style: 'padding-top: 25px;'} + %button.btn.btn-primary +   + %span.glyphicon.glyphicon-search +   + %button.btn.btn-default.js-reset-form + = t(:clear_fields) + .row + .col-md-3 + .btn-group{:role => "group"} + %button.btn.btn-default.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button"} + Download + %span.caret + %ul.dropdown-menu + %li= link_to 'PDF', download_list_registrar_contacts_path(q: params[:q], format: "pdf") + %li= link_to 'CSV', download_list_registrar_contacts_path(q: params[:q], format: "csv") + .col-md-3 + .col-md-3 + .col-md-3 - = paginate @paginatable_array +%hr +.row + .col-md-12 + .table-responsive + %table.table.table-hover.table-bordered.table-condensed + %thead + %tr + %th{class: 'col-xs-2'} + = sort_link(@q, 'name', t(:name)) + %th{class: 'col-xs-2'} + = sort_link(@q, 'code', t(:id)) + %th{class: 'col-xs-2'} + = sort_link(@q, 'ident', t(:ident)) + %th{class: 'col-xs-2'} + = sort_link(@q, 'email', t(:created_at)) + %th{class: 'col-xs-2'} + = sort_link(@q, 'registrar_name', t(:registrar)) + %th{class: 'col-xs-2'}= t(:actions) + %tbody + - @contacts.each do |contact| + %tr + %td= link_to(contact.name, registrar_contact_path(id: contact.code)) + %td= contact.code + %td= ident_for(contact) + %td= l(contact.created_at, format: :short) + %td + - if contact.registrar + = contact.registrar + %td + = link_to(t(:edit), edit_registrar_contact_path(contact.code), class: 'btn btn-primary btn-xs') + = link_to(t(:delete), delete_registrar_contact_path(contact.code), class: 'btn btn-default btn-xs') + +.row + .col-md-6 + = paginate @contacts + .col-md-6.text-right + .pagination + = t(:result_count, count: @contacts.total_count) + +:coffee + $(".js-reset-form").on "click", (e) -> + e.preventDefault(); + window.location = "#{registrar_contacts_path}" diff --git a/config/locales/en.yml b/config/locales/en.yml index 07f4ebc0a..b441f8fd3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -904,7 +904,7 @@ en: edit_zone: 'Edit zone' there_are_count_domains_in_this_zone: 'There are %{count} domains in this zone' poll_pending_update_confirmed_by_registrant: 'Registrant confirmed domain update' - poll_pending_update_rejected_by_registranti: 'Registrant rejected domain update' + poll_pending_update_rejected_by_registrant: 'Registrant rejected domain update' poll_pending_delete_rejected_by_registrant: 'Registrant rejected domain deletion' poll_pending_delete_confirmed_by_registrant: 'Registrant confirmed domain deletion' manage: Manage @@ -925,3 +925,4 @@ en: list_format_is_in_yaml: 'List format is in YAML' if_auth_info_is_left_empty_it_will_be_auto_generated: 'If auth info is left empty, it will be auto generated.' each_domain_name_must_end_with_colon_sign: 'Each domain name must end with colon (:) sign.' + expiration_remind_subject: 'The %{name} domain has expired' diff --git a/config/routes.rb b/config/routes.rb index f5b81e8b5..9dd7faf7d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -67,13 +67,14 @@ Rails.application.routes.draw do # end # end - resources :contacts do + resources :contacts, constraints: {:id => /[^\/]+(?=#{ ActionController::Renderers::RENDERERS.map{|e| "\\.#{e}\\z"}.join("|") })|[^\/]+/} do member do get 'delete' end collection do get 'check' + get 'download_list' end end diff --git a/doc/epp/contact.md b/doc/epp/contact.md index 5e45e491b..5db5ba3b4 100644 --- a/doc/epp/contact.md +++ b/doc/epp/contact.md @@ -34,7 +34,7 @@ Contact Mapping protocol short version: Attribute: "type" "org" # Business registry code "priv" # National idendtification number - "birthday" # Birthday date in format in DD-MM-YYYY + "birthday" # Birthday date in format in YYYY-MM-DD Attribute: "cc" "EE" # Country code in ISO_3166-1 aplha 2 0-1 Base64 encoded document @@ -70,7 +70,7 @@ Contact Mapping protocol short version: Attribute: "type" "org" # Business registry code "priv" # National idendtification number - "birthday" # Birthday date in format in DD-MM-YYYY + "birthday" # Birthday date in format in YYYY-MM-DD Attribute: "cc" "EE" # Country code in ISO_3166-1 aplha 2 0-1 Base64 encoded document. diff --git a/lib/tasks/convert.rake b/lib/tasks/convert.rake index 6345c9097..ba0e547dc 100644 --- a/lib/tasks/convert.rake +++ b/lib/tasks/convert.rake @@ -15,5 +15,22 @@ namespace :convert do end puts "-----> all done in #{(Time.zone.now.to_f - start).round(2)} seconds. #{count} domains changed." end + + desc 'Convert punycodes in history to unicode' + task history_punycode: :environment do + DomainVersion.find_each do |d| + if obj = d.object + obj["name"] = SimpleIDN.to_unicode(obj["name"]) + obj["name_puny"] = SimpleIDN.to_ascii(obj["name_puny"]) + d.object = obj + end + if (obj_c = d.object_changes).present? + obj_c["name"].map!{|e| e ? SimpleIDN.to_unicode(e) : e } if obj_c["name"] + obj_c["name_puny"].map!{|e| e ? SimpleIDN.to_ascii(e) : e } if obj_c["name_puny"] + d.object_changes = obj_c + end + d.save! + end + end end