mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Merge branch 'master' into alpha
This commit is contained in:
commit
8e42fa87f6
50 changed files with 1259 additions and 45 deletions
1
Gemfile
1
Gemfile
|
@ -51,6 +51,7 @@ gem 'html5_validators', '~> 1.2.0' # model requements now automatically on htm
|
||||||
gem 'coderay', '~> 1.1.0' # xml console visualize
|
gem 'coderay', '~> 1.1.0' # xml console visualize
|
||||||
gem 'select2-rails', '~> 3.5.9.3' # for autocomplete
|
gem 'select2-rails', '~> 3.5.9.3' # for autocomplete
|
||||||
gem 'bootstrap-datepicker-rails', '~> 1.3.1.1' # datepicker
|
gem 'bootstrap-datepicker-rails', '~> 1.3.1.1' # datepicker
|
||||||
|
gem 'liquid', '~> 3.0.6' # for email templates
|
||||||
|
|
||||||
# rights
|
# rights
|
||||||
gem 'devise', '~> 3.5.1' # authenitcation
|
gem 'devise', '~> 3.5.1' # authenitcation
|
||||||
|
|
|
@ -278,6 +278,7 @@ GEM
|
||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
libv8 (3.16.14.11)
|
libv8 (3.16.14.11)
|
||||||
libxml-ruby (2.8.0)
|
libxml-ruby (2.8.0)
|
||||||
|
liquid (3.0.6)
|
||||||
listen (3.0.3)
|
listen (3.0.3)
|
||||||
rb-fsevent (>= 0.9.3)
|
rb-fsevent (>= 0.9.3)
|
||||||
rb-inotify (>= 0.9)
|
rb-inotify (>= 0.9)
|
||||||
|
@ -583,6 +584,7 @@ DEPENDENCIES
|
||||||
jquery-validation-rails (~> 1.13.1)
|
jquery-validation-rails (~> 1.13.1)
|
||||||
kaminari (~> 0.16.3)
|
kaminari (~> 0.16.3)
|
||||||
launchy (~> 2.4.3)
|
launchy (~> 2.4.3)
|
||||||
|
liquid (~> 3.0.6)
|
||||||
mina (~> 0.3.1)
|
mina (~> 0.3.1)
|
||||||
money-rails (~> 1.4.1)
|
money-rails (~> 1.4.1)
|
||||||
newrelic_rpm (~> 3.12.0.288)
|
newrelic_rpm (~> 3.12.0.288)
|
||||||
|
@ -622,3 +624,6 @@ DEPENDENCIES
|
||||||
uuidtools (~> 2.1.4)
|
uuidtools (~> 2.1.4)
|
||||||
validates_email_format_of (~> 1.6.3)
|
validates_email_format_of (~> 1.6.3)
|
||||||
whenever (~> 0.9.4)
|
whenever (~> 0.9.4)
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.10.6
|
||||||
|
|
|
@ -3,8 +3,24 @@ class Admin::ContactsController < AdminController
|
||||||
before_action :set_contact, only: [:show]
|
before_action :set_contact, only: [:show]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
params[:q] ||= {}
|
||||||
@q = Contact.includes(:registrar).search(params[:q])
|
@q = Contact.includes(:registrar).search(params[:q])
|
||||||
@contacts = @q.result.page(params[:page])
|
@contacts = @q.result.page(params[:page])
|
||||||
|
|
||||||
|
if params[:statuses_contains]
|
||||||
|
contacts = Contact.includes(:registrar).where(
|
||||||
|
"contacts.statuses @> ?::varchar[]", "{#{params[:statuses_contains].join(',')}}"
|
||||||
|
)
|
||||||
|
else
|
||||||
|
contacts = Contact.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
|
end
|
||||||
|
|
||||||
def search
|
def search
|
||||||
|
@ -45,4 +61,21 @@ class Admin::ContactsController < AdminController
|
||||||
dp[:statuses].reject!(&:blank?)
|
dp[:statuses].reject!(&:blank?)
|
||||||
dp
|
dp
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def normalize_search_parameters
|
||||||
|
ca_cache = params[:q][:created_at_lteq]
|
||||||
|
begin
|
||||||
|
end_time = params[:q][:created_at_lteq].try(:to_date)
|
||||||
|
params[:q][:created_at_lteq] = end_time.try(:end_of_day)
|
||||||
|
# updated at
|
||||||
|
end_time = params[:q][:updated_at_gteq].try(:to_date)
|
||||||
|
params[:q][:updated_at_lteq] = end_time.try(:end_of_day)
|
||||||
|
rescue
|
||||||
|
logger.warn('Invalid date')
|
||||||
|
end
|
||||||
|
|
||||||
|
yield
|
||||||
|
|
||||||
|
params[:q][:created_at_lteq] = ca_cache
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
61
app/controllers/admin/mail_templates_controller.rb
Normal file
61
app/controllers/admin/mail_templates_controller.rb
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
class Admin::MailTemplatesController < AdminController
|
||||||
|
load_and_authorize_resource
|
||||||
|
|
||||||
|
def index
|
||||||
|
@q = MailTemplate.search(params[:q])
|
||||||
|
@mail_templates = @q.result.page(params[:page])
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@mail_tempalte = MailTemplate.new
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@mail_template = MailTemplate.find(params[:id])
|
||||||
|
@subject = Liquid::Template.parse(@mail_template.subject).render.html_safe
|
||||||
|
@html_body = Liquid::Template.parse(@mail_template.body).render.html_safe
|
||||||
|
@text_body = Liquid::Template.parse(@mail_template.text_body).render.html_safe
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@mail_template = MailTemplate.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@mail_template = MailTemplate.new(mail_template_params)
|
||||||
|
|
||||||
|
if @mail_template.save
|
||||||
|
redirect_to [:admin, @mail_template]
|
||||||
|
else
|
||||||
|
flash.now[:alert] = I18n.t(:failure)
|
||||||
|
render 'new'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
@mail_template = MailTemplate.find(params[:id])
|
||||||
|
|
||||||
|
if @mail_template.update_attributes(mail_template_params)
|
||||||
|
redirect_to [:admin, @mail_template]
|
||||||
|
else
|
||||||
|
flash.now[:alert] = I18n.t(:failure)
|
||||||
|
render 'edit'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@mail_template = MailTemplate.find(params[:id])
|
||||||
|
if @mail_template.destroy
|
||||||
|
redirect_to admin_mail_templates_path, notise: t(:deleted)
|
||||||
|
else
|
||||||
|
flash.now[:alert] = I18n.t(:failure)
|
||||||
|
render 'show'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def mail_template_params
|
||||||
|
params.require(:mail_template).permit(:name, :subject, :from, :bcc, :cc, :body, :text_body)
|
||||||
|
end
|
||||||
|
end
|
|
@ -29,7 +29,6 @@ class Epp::DomainsController < EppController
|
||||||
handle_errors(@domain) and return if @domain.errors.any?
|
handle_errors(@domain) and return if @domain.errors.any?
|
||||||
|
|
||||||
handle_errors and return unless balance_ok?('create')
|
handle_errors and return unless balance_ok?('create')
|
||||||
|
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
if @domain.save # TODO: Maybe use validate: false here because we have already validated the domain?
|
if @domain.save # TODO: Maybe use validate: false here because we have already validated the domain?
|
||||||
current_user.registrar.debit!({
|
current_user.registrar.debit!({
|
||||||
|
|
|
@ -96,6 +96,7 @@ class Ability
|
||||||
can :manage, LegalDocument
|
can :manage, LegalDocument
|
||||||
can :manage, BankStatement
|
can :manage, BankStatement
|
||||||
can :manage, BankTransaction
|
can :manage, BankTransaction
|
||||||
|
can :manage, MailTemplate
|
||||||
can :manage, Invoice
|
can :manage, Invoice
|
||||||
can :manage, WhiteIp
|
can :manage, WhiteIp
|
||||||
can :read, ApiLog::EppLog
|
can :read, ApiLog::EppLog
|
||||||
|
|
|
@ -550,6 +550,7 @@ class Domain < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop:disable Metrics/AbcSize
|
# rubocop:disable Metrics/AbcSize
|
||||||
|
# rubocop:disable Metrics/MethodLength
|
||||||
def set_force_delete
|
def set_force_delete
|
||||||
self.statuses_backup = statuses
|
self.statuses_backup = statuses
|
||||||
statuses.delete(DomainStatus::CLIENT_DELETE_PROHIBITED)
|
statuses.delete(DomainStatus::CLIENT_DELETE_PROHIBITED)
|
||||||
|
@ -570,12 +571,23 @@ class Domain < ActiveRecord::Base
|
||||||
statuses << DomainStatus::SERVER_RENEW_PROHIBITED
|
statuses << DomainStatus::SERVER_RENEW_PROHIBITED
|
||||||
statuses << DomainStatus::SERVER_TRANSFER_PROHIBITED
|
statuses << DomainStatus::SERVER_TRANSFER_PROHIBITED
|
||||||
statuses << DomainStatus::SERVER_UPDATE_PROHIBITED
|
statuses << DomainStatus::SERVER_UPDATE_PROHIBITED
|
||||||
statuses << DomainStatus::SERVER_MANUAL_INZONE
|
|
||||||
statuses << DomainStatus::PENDING_DELETE
|
statuses << DomainStatus::PENDING_DELETE
|
||||||
|
|
||||||
|
if (statuses & [DomainStatus::SERVER_HOLD, DomainStatus::CLIENT_HOLD]).empty?
|
||||||
|
statuses << DomainStatus::SERVER_MANUAL_INZONE
|
||||||
|
end
|
||||||
|
|
||||||
self.force_delete_at = Time.zone.now + Setting.redemption_grace_period.days unless force_delete_at
|
self.force_delete_at = Time.zone.now + Setting.redemption_grace_period.days unless force_delete_at
|
||||||
save(validate: false)
|
transaction do
|
||||||
|
save!(validate: false)
|
||||||
|
registrar.messages.create!(
|
||||||
|
body: I18n.t('force_delete_set_on_domain', domain: name)
|
||||||
|
)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
false
|
||||||
end
|
end
|
||||||
|
# rubocop: enable Metrics/MethodLength
|
||||||
# rubocop:enable Metrics/AbcSize
|
# rubocop:enable Metrics/AbcSize
|
||||||
|
|
||||||
def unset_force_delete
|
def unset_force_delete
|
||||||
|
|
3
app/models/mail_template.rb
Normal file
3
app/models/mail_template.rb
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
class MailTemplate < ActiveRecord::Base
|
||||||
|
validates :name, :subject, :from, :body, :text_body, presence: true
|
||||||
|
end
|
|
@ -9,22 +9,27 @@ class DomainNameValidator < ActiveModel::EachValidator
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def validate_format(value)
|
def validate_format(value)
|
||||||
return true if value == 'ee'
|
|
||||||
return true unless value
|
return true unless value
|
||||||
value = value.mb_chars.downcase.strip
|
value = value.mb_chars.downcase.strip
|
||||||
|
|
||||||
general_domains = /(.pri.ee|.com.ee|.fie.ee|.med.ee|.ee)/
|
origins = ZonefileSetting.pluck(:origin)
|
||||||
|
# if someone tries to register an origin domain, let this validation pass
|
||||||
|
# the error will be catched in blocked domains validator
|
||||||
|
return true if origins.include?(value)
|
||||||
|
|
||||||
|
general_domains = /(#{origins.join('|')})/
|
||||||
|
# general_domains = /(.pri.ee|.com.ee|.fie.ee|.med.ee|.ee)/
|
||||||
|
|
||||||
# it's punycode
|
# it's punycode
|
||||||
if value[2] == '-' && value[3] == '-'
|
if value[2] == '-' && value[3] == '-'
|
||||||
regexp = /\Axn--[a-zA-Z0-9-]{0,59}#{general_domains}\z/
|
regexp = /\Axn--[a-zA-Z0-9-]{0,59}\.#{general_domains}\z/
|
||||||
return false unless value =~ regexp
|
return false unless value =~ regexp
|
||||||
value = SimpleIDN.to_unicode(value).mb_chars.downcase.strip
|
value = SimpleIDN.to_unicode(value).mb_chars.downcase.strip
|
||||||
end
|
end
|
||||||
|
|
||||||
# rubocop: disable Metrics/LineLength
|
# rubocop: disable Metrics/LineLength
|
||||||
unicode_chars = /\u00E4\u00F5\u00F6\u00FC\u0161\u017E/ # äõöüšž
|
unicode_chars = /\u00E4\u00F5\u00F6\u00FC\u0161\u017E/ # äõöüšž
|
||||||
regexp = /\A[a-zA-Z0-9#{unicode_chars.source}][a-zA-Z0-9#{unicode_chars.source}-]{0,61}[a-zA-Z0-9#{unicode_chars.source}]#{general_domains.source}\z/
|
regexp = /\A[a-zA-Z0-9#{unicode_chars.source}][a-zA-Z0-9#{unicode_chars.source}-]{0,61}[a-zA-Z0-9#{unicode_chars.source}]\.#{general_domains.source}\z/
|
||||||
# rubocop: enable Metrics/LineLength
|
# rubocop: enable Metrics/LineLength
|
||||||
# rubocop: disable Style/DoubleNegation
|
# rubocop: disable Style/DoubleNegation
|
||||||
!!(value =~ regexp)
|
!!(value =~ regexp)
|
||||||
|
|
|
@ -2,16 +2,75 @@
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= search_form_for [:admin, @q], html: { class: 'form-horizontal' } do |f|
|
= search_form_for [:admin, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
|
||||||
.col-md-11
|
.row
|
||||||
.form-group
|
.col-md-3
|
||||||
= f.search_field :name_cont, class: 'form-control'
|
.form-group
|
||||||
.col-md-1.text-right.text-center-xs
|
= f.label :name
|
||||||
.form-group
|
= 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
|
%button.btn.btn-primary
|
||||||
|
|
||||||
%span.glyphicon.glyphicon-search
|
%span.glyphicon.glyphicon-search
|
||||||
|
|
||||||
|
%button.btn.btn-default.js-reset-form
|
||||||
|
= t(:clear_fields)
|
||||||
%hr
|
%hr
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
|
@ -26,7 +85,7 @@
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= sort_link(@q, 'ident', t(:ident))
|
= sort_link(@q, 'ident', t(:ident))
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= sort_link(@q, 'email', t(:email))
|
= sort_link(@q, 'email', t(:created_at))
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= sort_link(@q, 'registrar_name', t(:registrar))
|
= sort_link(@q, 'registrar_name', t(:registrar))
|
||||||
%tbody
|
%tbody
|
||||||
|
@ -35,11 +94,19 @@
|
||||||
%td= link_to(contact, admin_contact_path(contact))
|
%td= link_to(contact, admin_contact_path(contact))
|
||||||
%td= contact.code
|
%td= contact.code
|
||||||
%td= ident_for(contact)
|
%td= ident_for(contact)
|
||||||
%td= contact.email
|
%td= l(contact.created_at, format: :short)
|
||||||
%td
|
%td
|
||||||
- if contact.registrar
|
- if contact.registrar
|
||||||
= link_to(contact.registrar, admin_registrar_path(contact.registrar))
|
= link_to(contact.registrar, admin_registrar_path(contact.registrar))
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-6
|
||||||
= paginate @contacts
|
= 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 = "#{admin_contacts_path}"
|
||||||
|
|
54
app/views/admin/mail_templates/_form.haml
Normal file
54
app/views/admin/mail_templates/_form.haml
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
= form_for([:admin, mail_template], html: {class: 'form-horizontal'}) do |f|
|
||||||
|
= render 'shared/full_errors', object: mail_template
|
||||||
|
|
||||||
|
|
||||||
|
- liquid_help = link_to 'Liquid info', 'https://github.com/Shopify/liquid/wiki/Liquid-for-Designers'
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-body
|
||||||
|
.form-group
|
||||||
|
.col-md-4.control-label
|
||||||
|
= f.label :name
|
||||||
|
.col-md-7
|
||||||
|
= f.text_field(:name, class: 'form-control')
|
||||||
|
.form-group
|
||||||
|
.col-md-4.control-label
|
||||||
|
= f.label :subject
|
||||||
|
%br
|
||||||
|
= liquid_help
|
||||||
|
.col-md-7
|
||||||
|
= f.text_field(:subject, class: 'form-control')
|
||||||
|
.form-group
|
||||||
|
.col-md-4.control-label
|
||||||
|
= f.label :from
|
||||||
|
.col-md-7
|
||||||
|
= f.text_field(:from, class: 'form-control', lax_email: true)
|
||||||
|
.form-group
|
||||||
|
.col-md-4.control-label
|
||||||
|
= f.label :cc
|
||||||
|
.col-md-7
|
||||||
|
= f.text_field(:cc, class: 'form-control', lax_email: true)
|
||||||
|
.form-group
|
||||||
|
.col-md-4.control-label
|
||||||
|
= f.label :bcc
|
||||||
|
.col-md-7
|
||||||
|
= f.text_field(:bcc, class: 'form-control', lax_email: true)
|
||||||
|
.form-group
|
||||||
|
.col-md-12
|
||||||
|
= f.label :body, t(:html_body)
|
||||||
|
= liquid_help
|
||||||
|
.col-md-12
|
||||||
|
= f.text_area(:body, class: 'form-control', size: '15x15')
|
||||||
|
.form-group
|
||||||
|
.col-md-12
|
||||||
|
= f.label :text_body
|
||||||
|
= liquid_help
|
||||||
|
.col-md-12
|
||||||
|
= f.text_area(:text_body, class: 'form-control', size: '15x15')
|
||||||
|
|
||||||
|
%hr
|
||||||
|
.row
|
||||||
|
.col-md-12.text-right
|
||||||
|
= button_tag(t(:save), class: 'btn btn-primary')
|
3
app/views/admin/mail_templates/edit.haml
Normal file
3
app/views/admin/mail_templates/edit.haml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
= render 'shared/title', name: "#{t(:edit)}: #{@mail_template.name}"
|
||||||
|
|
||||||
|
= render 'form', mail_template: @mail_template
|
26
app/views/admin/mail_templates/index.haml
Normal file
26
app/views/admin/mail_templates/index.haml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
- content_for :actions do
|
||||||
|
= link_to(t(:new), new_admin_mail_template_path, class: 'btn btn-primary')
|
||||||
|
= render 'shared/title', name: t(:mail_templates)
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-3'}= sort_link(@q, 'name', t(:name))
|
||||||
|
%th{class: 'col-xs-3'}= sort_link(@q, 'subject')
|
||||||
|
%th{class: 'col-xs-3'}= sort_link(@q, 'updated_at')
|
||||||
|
%th{class: 'col-xs-3'}= t(:actions)
|
||||||
|
%tbody
|
||||||
|
- @mail_templates.each do |mt|
|
||||||
|
%tr
|
||||||
|
%td= link_to(truncate(mt.name), admin_mail_template_path(mt))
|
||||||
|
%td= truncate(mt.subject)
|
||||||
|
%td= l(mt.updated_at)
|
||||||
|
%td
|
||||||
|
= link_to(t(:edit), edit_admin_mail_template_path(mt), class: 'btn btn-primary btn-xs')
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= paginate @mail_templates
|
3
app/views/admin/mail_templates/new.haml
Normal file
3
app/views/admin/mail_templates/new.haml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
= render 'shared/title', name: t(:new_mail_template)
|
||||||
|
|
||||||
|
= render 'form', mail_template: @mail_template
|
41
app/views/admin/mail_templates/show.haml
Normal file
41
app/views/admin/mail_templates/show.haml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
- content_for :actions do
|
||||||
|
= link_to(t(:edit), edit_admin_mail_template_path(@mail_template.id), class: 'btn btn-primary')
|
||||||
|
= link_to(t(:delete), admin_mail_template_path(@mail_template.id),
|
||||||
|
method: :delete, data: { confirm: t(:are_you_sure) }, class: 'btn btn-danger')
|
||||||
|
= link_to(t(:email_templates), admin_mail_templates_path, class: 'btn btn-default')
|
||||||
|
= render 'shared/title', name: @mail_template.name
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title= t(:general)
|
||||||
|
.panel-body
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dt= t(:subject)
|
||||||
|
%dd= @mail_template.subject
|
||||||
|
|
||||||
|
%dt= t(:from)
|
||||||
|
%dd= @mail_template.from
|
||||||
|
|
||||||
|
- if @mail_template.cc.present?
|
||||||
|
%dt= t(:cc)
|
||||||
|
%dd= @mail_template.cc
|
||||||
|
|
||||||
|
- if @mail_template.bcc.present?
|
||||||
|
%dt= t(:bcc)
|
||||||
|
%dd= @mail_template.bcc
|
||||||
|
|
||||||
|
.col-md-12
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title= t(:html_body)
|
||||||
|
.panel-body
|
||||||
|
= @html_body
|
||||||
|
|
||||||
|
.col-md-12
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title= t(:text_body)
|
||||||
|
.panel-body
|
||||||
|
= @text_body
|
|
@ -61,6 +61,7 @@
|
||||||
%li= link_to t(:zonefile), admin_zonefile_settings_path
|
%li= link_to t(:zonefile), admin_zonefile_settings_path
|
||||||
%li= link_to t(:blocked_domains), admin_blocked_domains_path
|
%li= link_to t(:blocked_domains), admin_blocked_domains_path
|
||||||
%li= link_to t(:reserved_domains), admin_reserved_domains_path
|
%li= link_to t(:reserved_domains), admin_reserved_domains_path
|
||||||
|
%li= link_to t(:mail_templates), admin_mail_templates_path
|
||||||
-# %li= link_to t(:domains_history), admin_domain_versions_path
|
-# %li= link_to t(:domains_history), admin_domain_versions_path
|
||||||
%li= link_to t(:epp_logs), admin_epp_logs_path
|
%li= link_to t(:epp_logs), admin_epp_logs_path
|
||||||
%li= link_to t(:repp_logs), admin_repp_logs_path
|
%li= link_to t(:repp_logs), admin_repp_logs_path
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||||
|
<command>
|
||||||
|
<poll op="req"/>
|
||||||
|
<clTRID>ABC-12345</clTRID>
|
||||||
|
</command>
|
||||||
|
</epp>
|
|
@ -30,9 +30,9 @@
|
||||||
%a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'domain', epp_action: 'delete'}}
|
%a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'domain', epp_action: 'delete'}}
|
||||||
Delete
|
Delete
|
||||||
|
|
||||||
%h4 Keyrelay
|
%h4 Poll
|
||||||
%a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'keyrelay', epp_action: 'keyrelay'}}
|
%a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'poll', epp_action: 'poll'}}
|
||||||
Keyrelay
|
Poll
|
||||||
|
|
||||||
%h4 Contact
|
%h4 Contact
|
||||||
%a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'contact', epp_action: 'create'}}
|
%a.js-load-xml{href: 'javascript:void(0)', data: {obj: 'contact', epp_action: 'create'}}
|
||||||
|
|
|
@ -22,9 +22,13 @@ smtp_enable_starttls_auto: 'true' # 'false'
|
||||||
# If your mail server requires authentication, please change.
|
# If your mail server requires authentication, please change.
|
||||||
smtp_authentication: 'plain' # 'plain', 'login', 'cram_md5'
|
smtp_authentication: 'plain' # 'plain', 'login', 'cram_md5'
|
||||||
registrant_url: 'https:/registrant.example.com' # for valid email body registrant links
|
registrant_url: 'https:/registrant.example.com' # for valid email body registrant links
|
||||||
|
# Staging env does not send any emails unless they are whitelisted
|
||||||
whitelist_emails_for_staging: >
|
whitelist_emails_for_staging: >
|
||||||
test@example.org, old@example.org,
|
test@example.org,
|
||||||
new@example.org, old@example.com, new@example.com
|
old@example.org,
|
||||||
|
new@example.org,
|
||||||
|
old@example.com,
|
||||||
|
new@example.com
|
||||||
|
|
||||||
#
|
#
|
||||||
# ADMIN server
|
# ADMIN server
|
||||||
|
|
|
@ -10,5 +10,5 @@ TEST_EMAILS =
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
ENV['whitelist_emails_for_staging'] ||= ''
|
ENV['whitelist_emails_for_staging'] ||= ''
|
||||||
ENV['whitelist_emails_for_staging'].split(',').map(&:strip)
|
ENV['whitelist_emails_for_staging'].to_s.split(',').map(&:strip)
|
||||||
end
|
end
|
||||||
|
|
|
@ -641,7 +641,6 @@ en:
|
||||||
value: 'Value'
|
value: 'Value'
|
||||||
phone: 'Phone'
|
phone: 'Phone'
|
||||||
org_name: Org name
|
org_name: Org name
|
||||||
ident_type: Ident code
|
|
||||||
country: Country
|
country: Country
|
||||||
period: Period
|
period: Period
|
||||||
birthday_format: 'Insert birthday in format: YYYY-MM-DD'
|
birthday_format: 'Insert birthday in format: YYYY-MM-DD'
|
||||||
|
@ -911,3 +910,10 @@ en:
|
||||||
pending_epp: Pending epp
|
pending_epp: Pending epp
|
||||||
id: ID
|
id: ID
|
||||||
hidden: '[hidden]'
|
hidden: '[hidden]'
|
||||||
|
created_at_from: 'Created at from'
|
||||||
|
created_at_until: 'Created at until'
|
||||||
|
is_registrant: 'Is registrant'
|
||||||
|
force_delete_set_on_domain: 'Force delete set on domain %{domain}'
|
||||||
|
mail_templates: Mail Templates
|
||||||
|
new_mail_template: New mail template
|
||||||
|
failure: "It was not saved"
|
||||||
|
|
|
@ -160,6 +160,7 @@ Rails.application.routes.draw do
|
||||||
resources :legal_documents
|
resources :legal_documents
|
||||||
resources :keyrelays
|
resources :keyrelays
|
||||||
resources :pricelists
|
resources :pricelists
|
||||||
|
resources :mail_templates
|
||||||
|
|
||||||
resources :bank_statements do
|
resources :bank_statements do
|
||||||
resources :bank_transactions
|
resources :bank_transactions
|
||||||
|
|
19
db/migrate/20150825125118_create_email_templates.rb
Normal file
19
db/migrate/20150825125118_create_email_templates.rb
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
class CreateEmailTemplates < ActiveRecord::Migration
|
||||||
|
def self.up
|
||||||
|
create_table :mail_templates do |t|
|
||||||
|
t.string :name, null: false
|
||||||
|
t.string :subject
|
||||||
|
t.string :from
|
||||||
|
t.string :bcc
|
||||||
|
t.string :cc
|
||||||
|
t.text :body, null: false
|
||||||
|
t.text :text_body, null: false
|
||||||
|
t.timestamps null: false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
drop_table :mail_templates
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20150810114746) do
|
ActiveRecord::Schema.define(version: 20150825125118) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -878,6 +878,18 @@ ActiveRecord::Schema.define(version: 20150810114746) do
|
||||||
add_index "log_zonefile_settings", ["item_type", "item_id"], name: "index_log_zonefile_settings_on_item_type_and_item_id", using: :btree
|
add_index "log_zonefile_settings", ["item_type", "item_id"], name: "index_log_zonefile_settings_on_item_type_and_item_id", using: :btree
|
||||||
add_index "log_zonefile_settings", ["whodunnit"], name: "index_log_zonefile_settings_on_whodunnit", using: :btree
|
add_index "log_zonefile_settings", ["whodunnit"], name: "index_log_zonefile_settings_on_whodunnit", using: :btree
|
||||||
|
|
||||||
|
create_table "mail_templates", force: :cascade do |t|
|
||||||
|
t.string "name", null: false
|
||||||
|
t.string "subject"
|
||||||
|
t.string "from"
|
||||||
|
t.string "bcc"
|
||||||
|
t.string "cc"
|
||||||
|
t.text "body", null: false
|
||||||
|
t.text "text_body", null: false
|
||||||
|
t.datetime "created_at", null: false
|
||||||
|
t.datetime "updated_at", null: false
|
||||||
|
end
|
||||||
|
|
||||||
create_table "messages", force: :cascade do |t|
|
create_table "messages", force: :cascade do |t|
|
||||||
t.integer "registrar_id"
|
t.integer "registrar_id"
|
||||||
t.string "body"
|
t.string "body"
|
||||||
|
|
|
@ -2228,6 +2228,43 @@ CREATE SEQUENCE log_zonefile_settings_id_seq
|
||||||
ALTER SEQUENCE log_zonefile_settings_id_seq OWNED BY log_zonefile_settings.id;
|
ALTER SEQUENCE log_zonefile_settings_id_seq OWNED BY log_zonefile_settings.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: mail_templates; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE mail_templates (
|
||||||
|
id integer NOT NULL,
|
||||||
|
name character varying NOT NULL,
|
||||||
|
subject character varying,
|
||||||
|
"from" character varying,
|
||||||
|
bcc character varying,
|
||||||
|
cc character varying,
|
||||||
|
body text NOT NULL,
|
||||||
|
text_body text NOT NULL,
|
||||||
|
created_at timestamp without time zone NOT NULL,
|
||||||
|
updated_at timestamp without time zone NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: mail_templates_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE mail_templates_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: mail_templates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE mail_templates_id_seq OWNED BY mail_templates.id;
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: messages; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
-- Name: messages; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||||
--
|
--
|
||||||
|
@ -3154,6 +3191,13 @@ ALTER TABLE ONLY log_white_ips ALTER COLUMN id SET DEFAULT nextval('log_white_ip
|
||||||
ALTER TABLE ONLY log_zonefile_settings ALTER COLUMN id SET DEFAULT nextval('log_zonefile_settings_id_seq'::regclass);
|
ALTER TABLE ONLY log_zonefile_settings ALTER COLUMN id SET DEFAULT nextval('log_zonefile_settings_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY mail_templates ALTER COLUMN id SET DEFAULT nextval('mail_templates_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
|
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
|
@ -3676,6 +3720,14 @@ ALTER TABLE ONLY log_zonefile_settings
|
||||||
ADD CONSTRAINT log_zonefile_settings_pkey PRIMARY KEY (id);
|
ADD CONSTRAINT log_zonefile_settings_pkey PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: mail_templates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY mail_templates
|
||||||
|
ADD CONSTRAINT mail_templates_pkey PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
-- Name: messages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||||
--
|
--
|
||||||
|
@ -4874,3 +4926,5 @@ INSERT INTO schema_migrations (version) VALUES ('20150803080914');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20150810114746');
|
INSERT INTO schema_migrations (version) VALUES ('20150810114746');
|
||||||
|
|
||||||
|
INSERT INTO schema_migrations (version) VALUES ('20150825125118');
|
||||||
|
|
||||||
|
|
|
@ -127,3 +127,10 @@ Crontab can be setup after deploy. Jobs can be viewed [here](/config/schedule.rb
|
||||||
Zonefile procedure must be set up in server after deploy. The same command must be run whenever procedure is updated (see changelog).
|
Zonefile procedure must be set up in server after deploy. The same command must be run whenever procedure is updated (see changelog).
|
||||||
|
|
||||||
bundle exec rake zonefile:replace_procedure
|
bundle exec rake zonefile:replace_procedure
|
||||||
|
|
||||||
|
|
||||||
|
### Application settings
|
||||||
|
|
||||||
|
Application settings locate at [config/application-example.yml](/config/application-example.yml)
|
||||||
|
|
||||||
|
|
||||||
|
|
625
lib/tasks/statuses.rake
Normal file
625
lib/tasks/statuses.rake
Normal file
|
@ -0,0 +1,625 @@
|
||||||
|
desc 'Schema load for all databases: registry, api_log and whois'
|
||||||
|
task statuses: [:environment] do
|
||||||
|
statuses = {
|
||||||
|
'ok': [
|
||||||
|
],
|
||||||
|
'inactive': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired'
|
||||||
|
],
|
||||||
|
'clientDeleteProhibited': [
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'serverDeleteProhibited': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'clientHold': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'serverHold': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'clientRenewProhibited': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingTransfer',
|
||||||
|
'pendingUpdate',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'serverRenewProhibited': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingTransfer',
|
||||||
|
'pendingUpdate',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'clientTransferProhibited': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingRenew',
|
||||||
|
'pendingUpdate',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'serverTransferProhibited': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingRenew',
|
||||||
|
'pendingUpdate',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'clientUpdateProhibited': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingRenew',
|
||||||
|
'pendingTransfer',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'serverUpdateProhibited': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingRenew',
|
||||||
|
'pendingTransfer',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'pendingCreate': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'pendingDelete': [
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'pendingRenew': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
|
||||||
|
],
|
||||||
|
'pendingTransfer': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'pendingUpdate': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'inactive',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'serverManualInzone': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingRenew',
|
||||||
|
'pendingTransfer',
|
||||||
|
'pendingUpdate',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'serverRegistrantChangeProhibited': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingRenew',
|
||||||
|
'pendingTransfer',
|
||||||
|
'pendingUpdate',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'serverAdminChangeProhibited': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingRenew',
|
||||||
|
'pendingTransfer',
|
||||||
|
'pendingUpdate',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'serverTechChangeProhibited': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingRenew',
|
||||||
|
'pendingTransfer',
|
||||||
|
'pendingUpdate',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'forceDelete': [
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'inactive',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'deleteCandidate': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingRenew',
|
||||||
|
'pendingTransfer',
|
||||||
|
'pendingUpdate',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
'expired',
|
||||||
|
],
|
||||||
|
'expired': [
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientHold',
|
||||||
|
'serverHold',
|
||||||
|
'clientRenewProhibited',
|
||||||
|
'serverRenewProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'inactive',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingDeleteConfirmation',
|
||||||
|
'pendingRenew',
|
||||||
|
'pendingTransfer',
|
||||||
|
'pendingUpdate',
|
||||||
|
'serverManualInzone',
|
||||||
|
'serverRegistrantChangeProhibited',
|
||||||
|
'serverAdminChangeProhibited',
|
||||||
|
'serverTechChangeProhibited',
|
||||||
|
'forceDelete',
|
||||||
|
'deleteCandidate',
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
puts "\nDomain status can be with other statuses map\n"
|
||||||
|
puts "---------------------------------------------"
|
||||||
|
statuses.each do |s,v|
|
||||||
|
puts "\n#{s} =>"
|
||||||
|
statuses[s].map { |u| puts " #{u}" }
|
||||||
|
puts
|
||||||
|
end
|
||||||
|
|
||||||
|
contact_statuses = {
|
||||||
|
'ok': [
|
||||||
|
'linked'
|
||||||
|
],
|
||||||
|
'linked': [
|
||||||
|
'ok'
|
||||||
|
],
|
||||||
|
'clientDeleteProhibited': [
|
||||||
|
'linked',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingTransfer',
|
||||||
|
'pendingUpdate',
|
||||||
|
],
|
||||||
|
'serverDeleteProhibited': [
|
||||||
|
'linked',
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingTransfer',
|
||||||
|
'pendingUpdate',
|
||||||
|
],
|
||||||
|
'clientTransferProhibited': [
|
||||||
|
'linked',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingUpdate',
|
||||||
|
],
|
||||||
|
'serverTransferProhibited': [
|
||||||
|
'linked',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingUpdate',
|
||||||
|
],
|
||||||
|
'clientUpdateProhibited': [
|
||||||
|
'linked',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingTransfer',
|
||||||
|
],
|
||||||
|
'serverUpdateProhibited': [
|
||||||
|
'linked',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'pendingCreate',
|
||||||
|
'pendingDelete',
|
||||||
|
'pendingTransfer',
|
||||||
|
],
|
||||||
|
'pendingCreate': [
|
||||||
|
'linked',
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
],
|
||||||
|
'pendingDelete': [
|
||||||
|
'linked',
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
],
|
||||||
|
'pendingTransfer': [
|
||||||
|
'linked',
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
],
|
||||||
|
'pendingUpdate': [
|
||||||
|
'linked',
|
||||||
|
'clientDeleteProhibited',
|
||||||
|
'serverDeleteProhibited',
|
||||||
|
'clientTransferProhibited',
|
||||||
|
'serverTransferProhibited',
|
||||||
|
'clientUpdateProhibited',
|
||||||
|
'serverUpdateProhibited',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
puts "\n\nContact status can be with other statuses map\n"
|
||||||
|
puts "---------------------------------------------"
|
||||||
|
contact_statuses.each do |s,v|
|
||||||
|
puts "\n#{s} =>"
|
||||||
|
contact_statuses[s].map { |u| puts " #{u}" }
|
||||||
|
puts
|
||||||
|
end
|
||||||
|
end
|
|
@ -3,6 +3,12 @@ require 'rails_helper'
|
||||||
describe 'EPP Contact', epp: true do
|
describe 'EPP Contact', epp: true do
|
||||||
before :all do
|
before :all do
|
||||||
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/contact-eis-1.0.xsd'))
|
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/contact-eis-1.0.xsd'))
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'pri.ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'med.ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'fie.ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'com.ee')
|
||||||
|
|
||||||
@registrar1 = Fabricate(:registrar1)
|
@registrar1 = Fabricate(:registrar1)
|
||||||
@registrar2 = Fabricate(:registrar2)
|
@registrar2 = Fabricate(:registrar2)
|
||||||
@epp_xml = EppXml::Contact.new(cl_trid: 'ABC-12345')
|
@epp_xml = EppXml::Contact.new(cl_trid: 'ABC-12345')
|
||||||
|
|
|
@ -4,6 +4,13 @@ describe 'EPP Domain', epp: true do
|
||||||
before(:all) do
|
before(:all) do
|
||||||
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/domain-eis-1.0.xsd'))
|
@xsd = Nokogiri::XML::Schema(File.read('lib/schemas/domain-eis-1.0.xsd'))
|
||||||
@epp_xml = EppXml.new(cl_trid: 'ABC-12345')
|
@epp_xml = EppXml.new(cl_trid: 'ABC-12345')
|
||||||
|
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'pri.ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'med.ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'fie.ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'com.ee')
|
||||||
|
|
||||||
@registrar1 = Fabricate(:registrar1, code: 'REGDOMAIN1')
|
@registrar1 = Fabricate(:registrar1, code: 'REGDOMAIN1')
|
||||||
@registrar1.credit!({ sum: 10000 })
|
@registrar1.credit!({ sum: 10000 })
|
||||||
@registrar2 = Fabricate(:registrar2, code: 'REGDOMAIN2')
|
@registrar2 = Fabricate(:registrar2, code: 'REGDOMAIN2')
|
||||||
|
@ -3096,5 +3103,13 @@ describe 'EPP Domain', epp: true do
|
||||||
name[:avail].should == '0'
|
name[:avail].should == '0'
|
||||||
reason.text.should == 'invalid format'
|
reason.text.should == 'invalid format'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
### POLL ###
|
||||||
|
it 'should show force delete in poll' do
|
||||||
|
domain.set_force_delete
|
||||||
|
response = epp_plain_request(@epp_xml.session.poll)
|
||||||
|
msg_q = response[:parsed].css('msgQ')
|
||||||
|
msg_q.css('msg').text.should == "Force delete set on domain #{domain.name}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,7 @@ require 'rails_helper'
|
||||||
|
|
||||||
describe 'EPP Keyrelay', epp: true do
|
describe 'EPP Keyrelay', epp: true do
|
||||||
before(:all) do
|
before(:all) do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
@registrar1 = Fabricate(:registrar1)
|
@registrar1 = Fabricate(:registrar1)
|
||||||
@registrar2 = Fabricate(:registrar2)
|
@registrar2 = Fabricate(:registrar2)
|
||||||
@domain = Fabricate(:domain, registrar: @registrar2)
|
@domain = Fabricate(:domain, registrar: @registrar2)
|
||||||
|
|
|
@ -2,6 +2,7 @@ require 'rails_helper'
|
||||||
|
|
||||||
feature 'BlockedDomain', type: :feature do
|
feature 'BlockedDomain', type: :feature do
|
||||||
before :all do
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
@user = Fabricate(:admin_user)
|
@user = Fabricate(:admin_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -22,4 +22,39 @@ feature 'Admin contact', type: :feature do
|
||||||
# indivitually running it's created by autotest
|
# indivitually running it's created by autotest
|
||||||
page.should have_content(/by [unknown|autotest]/)
|
page.should have_content(/by [unknown|autotest]/)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should search contacts by name' do
|
||||||
|
Fabricate(:contact, name: 'first name')
|
||||||
|
Fabricate(:contact, name: 'second name')
|
||||||
|
Fabricate(:contact, name: 'third name')
|
||||||
|
sign_in @user
|
||||||
|
visit admin_contacts_url
|
||||||
|
|
||||||
|
page.should have_content('first name')
|
||||||
|
page.should have_content('second name')
|
||||||
|
page.should have_content('third name')
|
||||||
|
|
||||||
|
fill_in 'q_name_matches', with: 'first name'
|
||||||
|
find('.btn.btn-primary').click
|
||||||
|
|
||||||
|
current_path.should == "/admin/contacts"
|
||||||
|
|
||||||
|
page.should have_content('first name')
|
||||||
|
page.should_not have_content('second name')
|
||||||
|
page.should_not have_content('third name')
|
||||||
|
|
||||||
|
fill_in 'q_name_matches', with: '%name'
|
||||||
|
find('.btn.btn-primary').click
|
||||||
|
|
||||||
|
page.should have_content('first name')
|
||||||
|
page.should have_content('second name')
|
||||||
|
page.should have_content('third name')
|
||||||
|
|
||||||
|
fill_in 'q_name_matches', with: 'sec___ name'
|
||||||
|
find('.btn.btn-primary').click
|
||||||
|
|
||||||
|
page.should_not have_content('first name')
|
||||||
|
page.should have_content('second name')
|
||||||
|
page.should_not have_content('third name')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,8 @@ require 'rails_helper'
|
||||||
|
|
||||||
feature 'Domain', type: :feature do
|
feature 'Domain', type: :feature do
|
||||||
before :all do
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'pri.ee')
|
||||||
@user = Fabricate(:admin_user)
|
@user = Fabricate(:admin_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
47
spec/features/admin/mail_templates_spec.rb
Normal file
47
spec/features/admin/mail_templates_spec.rb
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
feature 'MailTemplate', type: :feature do
|
||||||
|
before :all do
|
||||||
|
@user = Fabricate(:admin_user)
|
||||||
|
end
|
||||||
|
|
||||||
|
before do
|
||||||
|
sign_in @user
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should add a bank statement and transactions manually' do
|
||||||
|
visit admin_mail_templates_url
|
||||||
|
|
||||||
|
click_link 'New'
|
||||||
|
fill_in 'Name', with: 'Testing email template'
|
||||||
|
fill_in 'Subject', with: 'Test subject'
|
||||||
|
fill_in 'From', with: 'example@example.com'
|
||||||
|
fill_in 'mail_template_body', with: 'Liquid <h1>Test</h1>'
|
||||||
|
fill_in 'mail_template_text_body', with: 'Liquid static test'
|
||||||
|
click_button 'Save'
|
||||||
|
|
||||||
|
page.should have_content('Testing email template')
|
||||||
|
page.should have_content('Test subject')
|
||||||
|
page.should have_content('example@example.com')
|
||||||
|
page.should have_content('Liquid Test')
|
||||||
|
page.should have_content('Liquid static test')
|
||||||
|
|
||||||
|
click_link 'Email Templates'
|
||||||
|
page.should have_content('Mail Templates')
|
||||||
|
page.should have_content('Test subject')
|
||||||
|
|
||||||
|
click_link 'Testing email template'
|
||||||
|
page.should have_content('Testing email template')
|
||||||
|
|
||||||
|
click_link 'Edit'
|
||||||
|
page.should have_content('Edit: Testing email template')
|
||||||
|
fill_in 'Subject', with: 'New edited test subject'
|
||||||
|
click_button 'Save'
|
||||||
|
|
||||||
|
page.should have_content 'New edited test subject'
|
||||||
|
click_link 'Delete'
|
||||||
|
|
||||||
|
page.should have_content 'Mail Templates'
|
||||||
|
page.should_not have_content 'New edited test subject'
|
||||||
|
end
|
||||||
|
end
|
|
@ -2,6 +2,7 @@ require 'rails_helper'
|
||||||
|
|
||||||
feature 'ReservedDomain', type: :feature do
|
feature 'ReservedDomain', type: :feature do
|
||||||
before :all do
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
@user = Fabricate(:admin_user)
|
@user = Fabricate(:admin_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
feature 'DomainDeleteConfirm', type: :feature do
|
feature 'DomainDeleteConfirm', type: :feature do
|
||||||
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
end
|
||||||
|
|
||||||
context 'as unknown user with domain without token' do
|
context 'as unknown user with domain without token' do
|
||||||
before :all do
|
before :all do
|
||||||
@domain = Fabricate(:domain)
|
@domain = Fabricate(:domain)
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
feature 'DomainUpdateConfirm', type: :feature do
|
feature 'DomainUpdateConfirm', type: :feature do
|
||||||
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
end
|
||||||
|
|
||||||
context 'as unknown user with domain without update token' do
|
context 'as unknown user with domain without update token' do
|
||||||
before :all do
|
before :all do
|
||||||
@domain = Fabricate(:domain)
|
@domain = Fabricate(:domain)
|
||||||
|
|
|
@ -2,6 +2,8 @@ require 'rails_helper'
|
||||||
|
|
||||||
feature 'Domains', type: :feature do
|
feature 'Domains', type: :feature do
|
||||||
before :all do
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'pri.ee')
|
||||||
@user = Fabricate(:api_user)
|
@user = Fabricate(:api_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -58,7 +60,9 @@ feature 'Domains', type: :feature do
|
||||||
|
|
||||||
it 'should search domains' do
|
it 'should search domains' do
|
||||||
# having shared state across tests is really annoying sometimes...
|
# having shared state across tests is really annoying sometimes...
|
||||||
click_link "#{@user} (#{@user.roles.first}) - #{@user.registrar}"
|
within('.dropdown-menu') do
|
||||||
|
click_link "#{@user} (#{@user.roles.first}) - #{@user.registrar}"
|
||||||
|
end
|
||||||
|
|
||||||
Fabricate(:domain, name: 'abcde.ee', registrar: @user.registrar)
|
Fabricate(:domain, name: 'abcde.ee', registrar: @user.registrar)
|
||||||
Fabricate(:domain, name: 'abcdee.ee', registrar: @user.registrar)
|
Fabricate(:domain, name: 'abcdee.ee', registrar: @user.registrar)
|
||||||
|
|
|
@ -2,6 +2,7 @@ require 'rails_helper'
|
||||||
|
|
||||||
feature 'Sessions', type: :feature do
|
feature 'Sessions', type: :feature do
|
||||||
before :all do
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
@user = Fabricate(:ee_user)
|
@user = Fabricate(:ee_user)
|
||||||
@registrar1 = Fabricate(:registrar1)
|
@registrar1 = Fabricate(:registrar1)
|
||||||
@registrar2 = Fabricate(:registrar2)
|
@registrar2 = Fabricate(:registrar2)
|
||||||
|
|
|
@ -26,6 +26,7 @@ describe ContactMailer do
|
||||||
|
|
||||||
describe 'email changed notification' do
|
describe 'email changed notification' do
|
||||||
before :all do
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
@domain = Fabricate(:domain)
|
@domain = Fabricate(:domain)
|
||||||
@contact = @domain.registrant
|
@contact = @domain.registrant
|
||||||
@contact.reload # until figured out why registrant_domains not loaded
|
@contact.reload # until figured out why registrant_domains not loaded
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe DomainMailer do
|
describe DomainMailer do
|
||||||
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
end
|
||||||
|
|
||||||
describe 'pending update request for an old registrant when delivery turned off' do
|
describe 'pending update request for an old registrant when delivery turned off' do
|
||||||
before :all do
|
before :all do
|
||||||
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
@registrant = Fabricate(:registrant, email: 'test@example.com')
|
||||||
|
|
|
@ -2,6 +2,7 @@ require 'rails_helper'
|
||||||
|
|
||||||
describe Contact do
|
describe Contact do
|
||||||
before :all do
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
@api_user = Fabricate(:api_user)
|
@api_user = Fabricate(:api_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -383,6 +384,7 @@ end
|
||||||
|
|
||||||
describe Contact, '.destroy_orphans' do
|
describe Contact, '.destroy_orphans' do
|
||||||
before do
|
before do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
@contact_1 = Fabricate(:contact, code: 'asd12')
|
@contact_1 = Fabricate(:contact, code: 'asd12')
|
||||||
@contact_2 = Fabricate(:contact, code: 'asd13')
|
@contact_2 = Fabricate(:contact, code: 'asd13')
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe Dnskey do
|
describe Dnskey do
|
||||||
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
end
|
||||||
|
|
||||||
it { should belong_to(:domain) }
|
it { should belong_to(:domain) }
|
||||||
|
|
||||||
context 'with invalid attribute' do
|
context 'with invalid attribute' do
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe Domain do
|
describe Domain do
|
||||||
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'pri.ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'med.ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'fie.ee')
|
||||||
|
Fabricate(:zonefile_setting, origin: 'com.ee')
|
||||||
|
end
|
||||||
|
|
||||||
it { should belong_to(:registrar) }
|
it { should belong_to(:registrar) }
|
||||||
it { should have_many(:nameservers) }
|
it { should have_many(:nameservers) }
|
||||||
it { should belong_to(:registrant) }
|
it { should belong_to(:registrant) }
|
||||||
|
@ -224,6 +232,10 @@ describe Domain do
|
||||||
fda = Time.zone.now + Setting.redemption_grace_period.days
|
fda = Time.zone.now + Setting.redemption_grace_period.days
|
||||||
@domain.force_delete_at.should be_within(20).of(fda)
|
@domain.force_delete_at.should be_within(20).of(fda)
|
||||||
|
|
||||||
|
@domain.registrar.messages.count.should == 1
|
||||||
|
m = @domain.registrar.messages.first
|
||||||
|
m.body.should == "Force delete set on domain #{@domain.name}"
|
||||||
|
|
||||||
@domain.unset_force_delete
|
@domain.unset_force_delete
|
||||||
|
|
||||||
@domain.statuses.should == ['ok']
|
@domain.statuses.should == ['ok']
|
||||||
|
@ -253,7 +265,6 @@ describe Domain do
|
||||||
"forceDelete",
|
"forceDelete",
|
||||||
"pendingDelete",
|
"pendingDelete",
|
||||||
"serverHold",
|
"serverHold",
|
||||||
"serverManualInzone",
|
|
||||||
"serverRenewProhibited",
|
"serverRenewProhibited",
|
||||||
"serverTransferProhibited",
|
"serverTransferProhibited",
|
||||||
"serverUpdateProhibited"
|
"serverUpdateProhibited"
|
||||||
|
@ -570,16 +581,17 @@ describe Domain do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not create zone origin domain' do
|
it 'should not create zone origin domain' do
|
||||||
zs = Fabricate(:zonefile_setting)
|
|
||||||
d = Fabricate.build(:domain, name: 'ee')
|
d = Fabricate.build(:domain, name: 'ee')
|
||||||
d.save.should == false
|
d.save.should == false
|
||||||
d.errors.full_messages.should match_array([
|
d.errors.full_messages.should match_array([
|
||||||
"Data management policy violation: Domain name is blocked [name]"
|
"Data management policy violation: Domain name is blocked [name]"
|
||||||
])
|
])
|
||||||
|
|
||||||
zs.destroy
|
d = Fabricate.build(:domain, name: 'bla')
|
||||||
|
d.save.should == false
|
||||||
d.save.should == true
|
d.errors.full_messages.should match_array([
|
||||||
|
"Domain name Domain name is invalid"
|
||||||
|
])
|
||||||
end
|
end
|
||||||
|
|
||||||
# d = Domain.new
|
# d = Domain.new
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe DomainTransfer do
|
describe DomainTransfer do
|
||||||
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
end
|
||||||
|
|
||||||
it { should belong_to(:domain) }
|
it { should belong_to(:domain) }
|
||||||
|
|
||||||
context 'with invalid attribute' do
|
context 'with invalid attribute' do
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe Keyrelay do
|
describe Keyrelay do
|
||||||
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
end
|
||||||
|
|
||||||
it { should belong_to(:domain) }
|
it { should belong_to(:domain) }
|
||||||
it { should belong_to(:requester) }
|
it { should belong_to(:requester) }
|
||||||
it { should belong_to(:accepter) }
|
it { should belong_to(:accepter) }
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe Nameserver do
|
describe Nameserver do
|
||||||
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
end
|
||||||
|
|
||||||
it { should belong_to(:domain) }
|
it { should belong_to(:domain) }
|
||||||
|
|
||||||
context 'with invalid attribute' do
|
context 'with invalid attribute' do
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe RegistrantVerification do
|
describe RegistrantVerification do
|
||||||
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
end
|
||||||
context 'with invalid attribute' do
|
context 'with invalid attribute' do
|
||||||
before :all do
|
before :all do
|
||||||
@registrant_verification = RegistrantVerification.new
|
@registrant_verification = RegistrantVerification.new
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe WhoisRecord do
|
describe WhoisRecord do
|
||||||
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
|
end
|
||||||
|
|
||||||
context 'with invalid attribute' do
|
context 'with invalid attribute' do
|
||||||
before :all do
|
before :all do
|
||||||
@whois_record = WhoisRecord.new
|
@whois_record = WhoisRecord.new
|
||||||
|
|
|
@ -2,6 +2,7 @@ require 'rails_helper'
|
||||||
|
|
||||||
describe Repp::DomainV1 do
|
describe Repp::DomainV1 do
|
||||||
before :all do
|
before :all do
|
||||||
|
Fabricate(:zonefile_setting, origin: 'ee')
|
||||||
@registrar1 = Fabricate(:registrar1)
|
@registrar1 = Fabricate(:registrar1)
|
||||||
@api_user = Fabricate(:gitlab_api_user, registrar: @registrar1)
|
@api_user = Fabricate(:gitlab_api_user, registrar: @registrar1)
|
||||||
Fabricate.times(2, :domain, registrar: @api_user.registrar)
|
Fabricate.times(2, :domain, registrar: @api_user.registrar)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue