diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 8a8397ab8..bae69e876 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -9,13 +9,8 @@ class ApplicationController < ActionController::Base
params[resource] &&= send(method) if respond_to?(method, true)
end
- def after_sign_in_path_for(resource)
+ def after_sign_in_path_for(_resource)
return session[:user_return_to].to_s if session[:user_return_to]
-
- if resource.admin? && can?(:create, :admin_session)
- admin_root_path
- else
- client_root_path
- end
+ admin_root_path
end
end
diff --git a/app/controllers/client/contact_versions_controller.rb b/app/controllers/client/contact_versions_controller.rb
deleted file mode 100644
index e4f824c44..000000000
--- a/app/controllers/client/contact_versions_controller.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class Client::ContactVersionsController < ClientController
- before_action :set_version, only: [:show]
-
- def index
- @versions = ContactVersion.registrar_events(current_registrar.id)
- @versions.flatten!
- end
-
- def show
- @event = params[:event]
- @contact = @version.reify(has_one: true) unless @event == 'create'
- end
-
- private
-
- def set_version
- @version = ContactVersion.find(params[:id])
- end
-end
diff --git a/app/controllers/client/contacts_controller.rb b/app/controllers/client/contacts_controller.rb
deleted file mode 100644
index fe34502ce..000000000
--- a/app/controllers/client/contacts_controller.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-class Client::ContactsController < ClientController
- before_action :set_contact, only: [:show, :destroy, :edit, :update]
-
- def index
- @q = Contact.current_registrars(current_registrar.id).search(params[:q])
- @contacts = @q.result.page(params[:page])
- end
-
- def new
- @contact = Contact.new
- @contact.build_address
- end
-
- def show
- # rubocop: disable Style/GuardClause
- if @contact.registrar != current_registrar
- flash[:alert] = I18n.t('shared.authentication_error')
- redirect_to client_contacts_path
- end
- # rubocop: enable Style/GuardClause
- end
-
- def create
- @contact = Contact.new(contact_params)
- @contact.generate_code
- @contact.registrar = current_registrar
- if @contact.save
- flash[:notice] = I18n.t('shared.contact_added')
- redirect_to [:client, @contact]
- else
- flash[:alert] = I18n.t('shared.failed_to_create_contact')
- render 'new'
- end
- end
-
- def destroy
- if @contact.destroy_and_clean
- flash[:notice] = I18n.t('shared.contact_deleted')
- redirect_to client_contacts_path
- else
- flash[:alert] = I18n.t('shared.failed_to_delete_contact')
- redirect_to [:client, @contact]
- end
- end
-
- def update
- if @contact.update_attributes(contact_params)
- flash[:notice] = I18n.t('shared.contact_updated')
- redirect_to [:client, @contact]
- else
- flash[:alert] = I18n.t('shared.failed_to_update_contact')
- redirect_to [:client, @contact]
- end
- end
-
- # TODO: Add Registrar to Contacts and search only contacts that belong to this domain
- def search
- render json: Contact.search_by_query(params[:q])
- end
-
- private
-
- def set_contact
- @contact = Contact.find(params[:id])
- end
-
- def contact_params
- params.require(:contact).permit(:email, :phone, :fax, :ident_type, :ident, :auth_info, :name, :org_name,
- address_attributes: [:city, :street, :zip, :street2, :street3, :country_id])
- end
-end
diff --git a/app/controllers/client/domain_transfers_controller.rb b/app/controllers/client/domain_transfers_controller.rb
deleted file mode 100644
index 67cb2ac16..000000000
--- a/app/controllers/client/domain_transfers_controller.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-class Client::DomainTransfersController < ClientController
- before_action :set_domain_transfer, only: [:show, :approve]
- before_action :set_domain, only: [:create]
-
- def index
- @q = current_registrar.domain_transfers.search(params[:q])
- @q.sorts = 'created_at desc' if @q.sorts.empty?
- @domain_transfers = @q.result.page(params[:page])
- end
-
- def new
- @domain_transfer = DomainTransfer.new
- end
-
- # rubocop: disable Metrics/PerceivedComplexity
- # rubocop: disable Metrics/CyclomaticComplexity
- def create
- @domain_transfer = @domain.pending_transfer
-
- if @domain_transfer
- if can? :read, @domain_transfer
- flash[:notice] = I18n.t('shared.domain_transfer_requested') if @domain.registrar != current_registrar
- redirect_to [:client, @domain_transfer] and return
- else
- flash.now[:alert] = I18n.t('shared.other_registrar_has_already_requested_to_transfer_this_domain')
- render 'new' and return
- end
- end
-
- @domain_transfer = @domain.domain_transfers.create(domain_transfer_params)
- @domain_transfer.approve_as_server if Setting.transfer_wait_time == 0
-
- if @domain_transfer.approved?
- flash[:notice] = I18n.t('shared.domain_transfer_approved')
- redirect_to [:client, @domain_transfer]
- else
- flash[:notice] = I18n.t('shared.domain_transfer_requested')
- redirect_to [:client, @domain_transfer]
- end
- end
- # rubocop: enable Metrics/PerceivedComplexity
- # rubocop: enable Metrics/CyclomaticComplexity
-
- def approve
- if can? :approve_as_client, @domain_transfer
- @domain_transfer.approve_as_client
- flash[:notice] = I18n.t('shared.domain_transfer_approved')
- else
- flash[:alert] = I18n.t('shared.failed_to_approve_domain_transfer')
- end
-
- redirect_to [:client, @domain_transfer]
- end
-
- private
-
- def set_domain_transfer
- @domain_transfer = DomainTransfer.find(params[:id])
- end
-
- def domain_transfer_params
- {
- status: DomainTransfer::PENDING,
- transfer_requested_at: Time.zone.now,
- transfer_to: current_registrar,
- transfer_from: @domain.registrar
- }
- end
-
- # rubocop: disable Metrics/PerceivedComplexity
- # rubocop: disable Metrics/CyclomaticComplexity
- def set_domain
- @domain_transfer = DomainTransfer.new
- @domain = Domain.find_by(name: params[:domain_name])
- if @domain
- if @domain.auth_info != params[:domain_pw]
- flash.now[:alert] = I18n.t('shared.password_invalid')
- render 'new' and return
- end
-
- if @domain.registrar == current_registrar && !@domain.pending_transfer
- flash.now[:alert] = I18n.t('shared.domain_already_belongs_to_the_querying_registrar')
- render 'new' and return
- end
- else
- flash.now[:alert] = I18n.t('shared.domain_was_not_found')
- render 'new'
- end
- end
- # rubocop: enbale Metrics/PerceivedComplexity
- # rubocop: enable Metrics/CyclomaticComplexity
-end
diff --git a/app/controllers/client/domain_versions_controller.rb b/app/controllers/client/domain_versions_controller.rb
deleted file mode 100644
index adf4a75b0..000000000
--- a/app/controllers/client/domain_versions_controller.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class Client::DomainVersionsController < ClientController
- helper WhodunnitHelper
- before_action :set_domain, only: [:show]
-
- def index
- @versions = DomainVersion.registrar_events(current_registrar.id)
- @versions.flatten!
- end
-
- def show
- @versions = @domain.versions.reverse
- end
-
- private
-
- def set_domain
- @domain = Domain.find(params[:id])
- end
-end
diff --git a/app/controllers/client/domains_controller.rb b/app/controllers/client/domains_controller.rb
deleted file mode 100644
index bc20dbc3a..000000000
--- a/app/controllers/client/domains_controller.rb
+++ /dev/null
@@ -1,105 +0,0 @@
-class Client::DomainsController < ClientController
- load_and_authorize_resource
- before_action :set_domain, only: [:show, :edit, :update, :destroy]
- before_action :verify_deletion, only: [:destroy]
-
- def index
- @q = current_registrar.domains.includes(:owner_contact).search(params[:q])
- @domains = @q.result.page(params[:page])
- end
-
- def new
- owner_contact = Contact.find(params[:owner_contact_id]) if params[:owner_contact_id]
- @domain = Domain.new(owner_contact: owner_contact, registrar: current_registrar)
- params[:domain_owner_contact] = owner_contact
-
- build_associations
- end
-
- def create
- add_prefix_to_statuses
-
- @domain = Domain.new(domain_params)
- @domain.registrar = current_registrar
-
- if @domain.save
- flash[:notice] = I18n.t('shared.domain_added')
- redirect_to [:client, @domain]
- else
- build_associations
- flash.now[:alert] = I18n.t('shared.failed_to_add_domain')
- render 'new'
- end
- end
-
- def show
- @domain.all_dependencies_valid?
- end
-
- def edit
- build_associations
- end
-
- def update
- add_prefix_to_statuses
- if @domain.update(domain_params)
- flash[:notice] = I18n.t('shared.domain_updated')
- redirect_to [:client, @domain]
- else
- build_associations
- flash.now[:alert] = I18n.t('shared.failed_to_update_domain')
- render 'edit'
- end
- end
-
- def destroy
- if @domain.destroy
- flash[:notice] = I18n.t('shared.domain_deleted')
- redirect_to client_domains_path
- else
- flash[:alert] = I18n.t('shared.failed_to_delete_domain')
- redirect_to [:client, @domain]
- end
- end
-
- private
-
- def domain_params
- params.require(:domain).permit(
- :name,
- :period,
- :period_unit,
- :owner_contact_id,
- :owner_contact_typeahead,
- nameservers_attributes: [:id, :hostname, :ipv4, :ipv6, :_destroy],
- domain_contacts_attributes: [:id, :contact_type, :contact_id, :value_typeahead, :_destroy],
- domain_statuses_attributes: [:id, :value, :description, :_destroy],
- dnskeys_attributes: [:id, :flags, :alg, :protocol, :public_key, :_destroy]
- )
- end
-
- def add_prefix_to_statuses
- domain_params[:domain_statuses_attributes].each do |_k, hash|
- hash[:value] = hash[:value].prepend('client') if hash[:value].present?
- end
- end
-
- def set_domain
- @domain = Domain.find(params[:id])
- end
-
- def build_associations
- @domain.nameservers.build if @domain.nameservers.empty?
- @domain.dnskeys.build if @domain.dnskeys.empty?
- @domain.domain_contacts.build if @domain.domain_contacts.empty?
-
- @client_statuses = @domain.domain_statuses.select(&:client_status?)
- @client_statuses << @domain.domain_statuses.build if @client_statuses.empty?
- end
-
- def verify_deletion
- return if @domain.can_be_deleted?
- flash[:alert] = I18n.t('shared.domain_status_prohibits_deleting')
- redirect_to [:client, @domain]
- end
-end
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index c878393e1..76f4188a2 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -4,8 +4,6 @@ class SessionsController < Devise::SessionsController
# this is just testing config
# if Rails.env.development? || Rails.env.test?
@user = User.find_by(username: 'gitlab') if params[:gitlab]
- @user = User.find_by(username: 'zone') if params[:zone]
- @user = User.find_by(username: 'elkdata') if params[:elkdata]
session[:current_user_registrar_id] = Registrar.first.id if @user.admin?
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 77cfbedb3..de6be7945 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1,5 +1,2 @@
module ApplicationHelper
- def coffee_script_tag(&block)
- content_tag(:script, CoffeeScript.compile(capture(&block)).html_safe, type: 'text/javascript')
- end
end
diff --git a/app/helpers/epp/domains_helper.rb b/app/helpers/epp/domains_helper.rb
index 9d049e7ed..65b34e458 100644
--- a/app/helpers/epp/domains_helper.rb
+++ b/app/helpers/epp/domains_helper.rb
@@ -105,16 +105,23 @@ module Epp::DomainsHelper
## CREATE
def validate_domain_create_request
+ ret = true
+
@ph = params_hash['epp']['command']['create']['create']
# TODO: Verify contact presence if registrant is juridical
attrs_present = xml_attrs_present?(@ph, [['name'], ['ns'], ['registrant']])
- return false unless attrs_present
+ ret = false unless attrs_present
+
+ if parsed_frame.css('hostObj').any?
+ epp_errors << { code: '2306', msg: I18n.t('host_obj_is_not_allowed') }
+ ret = false
+ end
if parsed_frame.css('dsData').count > 0 && parsed_frame.css('create > keyData').count > 0
epp_errors << { code: '2306', msg: I18n.t('shared.ds_data_and_key_data_must_not_exists_together') }
- return false
+ ret = false
end
- true
+ ret
end
def domain_create_params
diff --git a/app/views/client/contact_versions/index.haml b/app/views/client/contact_versions/index.haml
deleted file mode 100644
index 4cc0c9547..000000000
--- a/app/views/client/contact_versions/index.haml
+++ /dev/null
@@ -1,35 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs= t('shared.contacts')
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.create_new_contact'), new_client_contact_path, class: 'btn btn-primary')
-%hr
-.row
- .col-md-12
- .table-responsive
- %table.table.table-hover.table-bordered.table-condensed
- %thead
- %tr
- %th{class: 'col-xs-2'}
- = t('shared.event')
- %th{class: 'col-xs-2'}
- = t('shared.whodunnit')
- %th{class: 'col-xs-2'}
- = t('shared.created_at')
- %th{class: 'col-xs-1'}
- = t('shared.contact')
- %th{class: 'col-xs-1'}
- = t('shared.details')
- =# sort_link(@q, 'email', t('shared.email'))
- %tbody
- - @versions.each do |x|
- %tr
- %td= x.event
- %td= whodunnit_with_protocol(x.whodunnit)
- %td= l(x.created_at, format: :short)
- %td= link_to(t('shared.contact'), client_contact_path(x.item_id))
- %td= link_to(t('shared.details'), client_contact_version_path(x, event: x.event))
-.row
- .col-md-12
- =# paginate @contacts
diff --git a/app/views/client/contact_versions/show.haml b/app/views/client/contact_versions/show.haml
deleted file mode 100644
index 958ce31be..000000000
--- a/app/views/client/contact_versions/show.haml
+++ /dev/null
@@ -1,24 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs= t('shared.contacts')
-%hr
-.row
- .col-sm-6
- .panel.panel-default
- .panel-heading
- %h3.panel-title= t('shared.version')
- .panel-body
- %dl.dl-horizontal
- %dt= t('shared.whodunnit')
- %dd= @version.whodunnit
- %dt= t('shared.event')
- %dd= @version.event
- %dt= t('shared.created_at')
- %dd= l(@version.created_at, format: :short)
- - if @event != 'create' && @contact.address
- - # TODO fix address not being available with reify
- = render 'admin/contacts/partials/address'
-
-
-
- .col-sm-6= render 'admin/contacts/partials/general' unless @event == 'create'
diff --git a/app/views/client/contacts/_form.haml b/app/views/client/contacts/_form.haml
deleted file mode 100644
index b204d2423..000000000
--- a/app/views/client/contacts/_form.haml
+++ /dev/null
@@ -1,52 +0,0 @@
-= form_for([:client, @contact]) do |f|
- - if @contact.errors.any?
- - @contact.errors.each do |attr, err|
- = err
- %br
- - if @contact.errors.any?
- %hr
-
- .row
- .col-md-6.text-left
- %h3
- Contact
- .form-group
- = f.label :name
- = f.text_field(:name, class: 'form-control')
- = f.label :email
- = f.text_field(:email, class: 'form-control')
- = f.label :phone
- = f.text_field(:phone, class: 'form-control')
- = f.label :fax
- = f.text_field(:fax, class: 'form-control')
- = f.label :org_name
- = f.text_field(:org_name, class: 'form-control')
- = f.label :ident_type
- = f.select :ident_type, options_for_select(Contact::IDENT_TYPES, @contact.ident_type), {}, {class: 'form-control'}
- = f.label :ident
- = f.text_field(:ident, class: 'form-control')
- = f.label :auth_info
- = f.text_field(:auth_info, class: 'form-control')
-
- .col-md-6.text-left
- %h3
- Address
- .form-group
- = f.fields_for :address do |ia|
- = ia.label :country_id, t(:country)
- = ia.collection_select :country_id, Country.all, :id, :name,{}, { class: 'form-control' }
-
- = ia.label :city
- = ia.text_field(:city, class: 'form-control')
- = ia.label :street
- = ia.text_field(:street, class: 'form-control')
- = ia.label :street2
- = ia.text_field(:street2, class: 'form-control')
- = ia.label :street3
- = ia.text_field(:street2, class: 'form-control')
-
-
- %hr
- .row
- .col-md-12.text-right
- = button_tag(t('shared.save'), class: 'btn btn-primary')
diff --git a/app/views/client/contacts/edit.haml b/app/views/client/contacts/edit.haml
deleted file mode 100644
index 0db9999f6..000000000
--- a/app/views/client/contacts/edit.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs
- = "#{t('shared.edit_contact')}"
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.back_to_contact'), [:client, @contact], class: 'btn btn-default')
-%hr
-= render 'form'
diff --git a/app/views/client/contacts/index.haml b/app/views/client/contacts/index.haml
deleted file mode 100644
index f7d2a5fce..000000000
--- a/app/views/client/contacts/index.haml
+++ /dev/null
@@ -1,44 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs= t('shared.contacts')
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.create_new_contact'), new_client_contact_path, class: 'btn btn-primary')
-%hr
-.row
- .col-md-12
- = search_form_for [:client, @q], html: { class: 'form-horizontal' } do |f|
- .col-md-11
- .form-group
- = f.search_field :name_cont, class: 'form-control'
- .col-md-1.text-right.text-center-xs
- .form-group
- %button.btn.btn-primary
-
- %span.glyphicon.glyphicon-search
-
-%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('shared.name'))
- %th{class: 'col-xs-2'}
- = sort_link(@q, 'code', t('shared.code'))
- %th{class: 'col-xs-2'}
- = sort_link(@q, 'ident', t('shared.identity_code'))
- %th{class: 'col-xs-2'}
- = sort_link(@q, 'email', t('shared.email'))
- %tbody
- - @contacts.each do |x|
- %tr
- %td= link_to(x, [:client, x])
- %td= x.code
- %td= x.ident
- %td= x.email
-.row
- .col-md-12
- = paginate @contacts
diff --git a/app/views/client/contacts/new.haml b/app/views/client/contacts/new.haml
deleted file mode 100644
index fa31344fc..000000000
--- a/app/views/client/contacts/new.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-%h2= t('shared.new_contact')
-%hr
-= render 'form'
diff --git a/app/views/client/contacts/partials/_domains.haml b/app/views/client/contacts/partials/_domains.haml
deleted file mode 100644
index 2d5d813fc..000000000
--- a/app/views/client/contacts/partials/_domains.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-#contacts.panel.panel-default
- .panel-heading.clearfix
- .pull-left
- = t('shared.domains')
- .pull-right
- = link_to(t('shared.create_new_domain'), new_client_domain_path(owner_contact_id: @contact), class: 'btn btn-primary btn-xs')
- .table-responsive
- %table.table.table-hover.table-bordered.table-condensed
- %thead
- %tr
- %th{class: 'col-xs-4'}= t('shared.domain_name')
- %th{class: 'col-xs-4'}= t('shared.registrar')
- %th{class: 'col-xs-4'}= t('shared.valid_to')
- %tbody
- - @contact.domains_owned.each do |x|
- %tr
- %td= link_to(x.name, [:admin, x])
- %td= link_to(x.registrar, [:admin, x.registrar])
- %td= l(x.valid_to, format: :short)
diff --git a/app/views/client/contacts/show.haml b/app/views/client/contacts/show.haml
deleted file mode 100644
index 80fcccccf..000000000
--- a/app/views/client/contacts/show.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs
- = "#{t('shared.contact_details')}"
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.edit'), edit_client_contact_path(@contact), class: 'btn btn-primary')
- = link_to(t('shared.delete'), client_contact_path(@contact), method: :delete, data: { confirm: t('shared.are_you_sure') }, class: 'btn btn-danger')
-
-%hr
-.row
- .col-md-6= render 'admin/contacts/partials/general'
- .col-md-6= render 'admin/contacts/partials/address'
-.row
- .col-md-12= render 'client/contacts/partials/domains'
-
-- if @contact.versions.present?
- = render 'client/shared/versions', versions: @contact.versions
-
diff --git a/app/views/client/domain_transfers/index.haml b/app/views/client/domain_transfers/index.haml
deleted file mode 100644
index c295020df..000000000
--- a/app/views/client/domain_transfers/index.haml
+++ /dev/null
@@ -1,39 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs= t('shared.domain_transfers')
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.request_domain_transfer'), new_client_domain_transfer_path, class: 'btn btn-primary')
-%hr
-.row
- .col-md-12
- .table-responsive
- %table.table.table-hover.table-bordered.table-condensed
- %thead
- %tr
- %th{class: 'col-xs-2'}
- = sort_link(@q, 'domain_name')
- %th{class: 'col-xs-2'}
- = sort_link(@q, 'status')
- %th{class: 'col-xs-2'}
- = sort_link(@q, 'transfer_from', t('shared.transfer_from'))
- %th{class: 'col-xs-2'}
- = sort_link(@q, 'transfer_to', t('shared.transfer_to'))
- %th{class: 'col-xs-2'}=t('shared.actions')
- %tbody
- - @domain_transfers.each do |x|
- %tr
- - if current_registrar == x.domain.registrar
- %td= link_to(x.domain, client_domain_path(x.domain))
- - else
- %td= x.domain
- %td= x.status
- %td= x.transfer_from
- %td= x.transfer_to
- %td
- = link_to(t('shared.details'), [:client, x], class: 'btn btn-xs btn-primary')
-
-.row
- .col-md-12
- = paginate @domain_transfers
-
diff --git a/app/views/client/domain_transfers/new.haml b/app/views/client/domain_transfers/new.haml
deleted file mode 100644
index c058a572d..000000000
--- a/app/views/client/domain_transfers/new.haml
+++ /dev/null
@@ -1,25 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs= t('shared.transfer_domain')
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.domain_transfers'), client_domain_transfers_path, class: 'btn btn-default')
-
-%hr
-= form_for([:client, @domain_transfer]) do |f|
- = render 'shared/errors', object: @domain_transfer
- - if @domain_transfer.errors.any?
- %hr
- .row
- .col-md-6
- .form-group
- = label_tag :domain_name
- = text_field_tag(:domain_name, params[:domain_name], class: 'form-control')
- .row
- .col-md-6
- .form-group
- = label_tag :domain_pw, t('shared.domain_pw')
- = text_field_tag(:domain_pw, params[:domain_pw], class: 'form-control')
- .row
- .col-md-12.text-right
- = button_tag(t('shared.request_domain_transfer'), class: 'btn btn-primary', name: 'request')
diff --git a/app/views/client/domain_transfers/show.haml b/app/views/client/domain_transfers/show.haml
deleted file mode 100644
index a5bf9ee60..000000000
--- a/app/views/client/domain_transfers/show.haml
+++ /dev/null
@@ -1,39 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs
- = "#{t('shared.domain_transfer')}"
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.domain_transfers'), client_domain_transfers_path, class: 'btn btn-default')
- - if can? :approve_as_client, @domain_transfer
- = link_to(t('shared.approve'), approve_client_domain_transfer_path, method: :post, class: 'btn btn-success')
-%hr
-.row
- .col-md-12
- %dl.dl-horizontal
- %dt= t('shared.domain')
- - if current_registrar == @domain_transfer.domain.registrar
- %dd= link_to(@domain_transfer.domain, client_domain_path(@domain_transfer.domain))
- - else
- %dd= @domain_transfer.domain
-
- %dt= t('shared.status')
- %dd= @domain_transfer.status
-
- %dt= t('shared.transfer_requested_at')
- %dd= l(@domain_transfer.transfer_requested_at)
-
- %dt= t('shared.transfer_from')
- %dd= @domain_transfer.transfer_from
-
- %dt= t('shared.transfer_to')
- %dd= @domain_transfer.transfer_to
-
- %dt= t('shared.accept_time')
- - if @domain_transfer.transferred_at
- %dd= l(@domain_transfer.transferred_at)
- - else
- %dd= l(@domain_transfer.wait_until)
-
- %dt= t('shared.domain_valid_to')
- %dd= l(@domain_transfer.domain.valid_to)
diff --git a/app/views/client/domain_versions/index.haml b/app/views/client/domain_versions/index.haml
deleted file mode 100644
index 0280e1b81..000000000
--- a/app/views/client/domain_versions/index.haml
+++ /dev/null
@@ -1,36 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs= t('shared.domains')
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.create_new_contact'), new_client_domain_path, class: 'btn btn-primary')
-%hr
-.row
- .col-md-12
- .table-responsive
- %table.table.table-hover.table-bordered.table-condensed
- %thead
- %tr
- %th{class: 'col-xs-2'}
- = t('shared.event')
- %th{class: 'col-xs-2'}
- = t('shared.whodunnit')
- %th{class: 'col-xs-2'}
- = t('shared.created_at')
- -#%th{class: 'col-xs-1'}
- = t('shared.item_id')
- =# sort_link(@q, 'email', t('shared.email'))
- %th{class: 'col-xs-1'}
- = t('shared.details')
-
- %tbody
- - @versions.each do |x|
- %tr
- %td= x.event
- %td= whodunnit_with_protocol(x.whodunnit)
- %td= l(x.created_at, format: :short)
- -#%td= link_to(t('shared.domain'), client_domain_path(x.item_id))
- %td= link_to(t('shared.details'), client_domain_version_path(x, event: x.event))
-.row
- .col-md-12
- =# paginate @contacts
diff --git a/app/views/client/domain_versions/show.haml b/app/views/client/domain_versions/show.haml
deleted file mode 100644
index 189958520..000000000
--- a/app/views/client/domain_versions/show.haml
+++ /dev/null
@@ -1,67 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs= t('shared.domains')
-%hr
-
-.row
- .col-md-12
- .table-responsive
- %table.table-hover.table-bordered.table-condensed
- %thead
- %tr
- %th{class: 'col-xs-1'}= 'domain'
- %th{class: 'col-xs-2'}= 'owner'
- %th{class: 'col-xs-2'}= 'admins'
- %th{class: 'col-xs-2'}= 'techs'
- %th{class: 'col-xs-2'}= 'ns'
- %th{class: 'col-xs-1'}= 'datetime'
- %tbody
- - @versions.each do |version|
- - next unless version.snapshot.is_a?(String)
- - children = YAML.load(version.snapshot)
- - next unless children.is_a?(Hash)
- - children = HashWithIndifferentAccess.new(children)
- - changes = version.changed_elements
-
- %tr
- %td{ :class => ('edit-highlight' if changes.include?(:domain)) }
- - if children[:domain]
- = children[:domain][:name]
- = children[:domain][:status]
- %td{ :class => ('edit-highlight' if changes.include?(:owner_contact)) }
- - if children[:owner_contact]
- %p{:style => "font-size:x-small;"}
- = children[:owner_contact][:name] + ","
- = children[:owner_contact][:phone] + ","
- = children[:owner_contact][:email] + ","
- = children[:owner_contact][:code]
- %td{ :class => ('edit-highlight' if changes.include?(:admin_contacts)) }
- - if children[:admin_contacts]
- - children[:admin_contacts].each do |ac|
- %p{:style => "font-size:x-small;"}
- = ac[:name] + ","
- = ac[:phone] + ","
- = ac[:email] + ","
- = ac[:code]
- %td{ :class => ('edit-highlight' if changes.include?(:tech_contacts)) }
- - if children[:tech_contacts]
- - children[:tech_contacts].each do |tc|
- %p{:style => "font-size:x-small;"}
- = tc[:name] + ","
- = tc[:phone] + ","
- = tc[:email] + ","
- = tc[:code]
- %td{ :class => ('edit-highlight' if changes.include?(:nameservers)) }
- - if children[:nameservers]
- - children[:nameservers].each do |ns|
- %p{:style => "font-size:x-small;"}
- = ns[:hostname] + ","
- = ns[:ipv4] || ns[:ipv6]
-
- %td
- %p{ :style => 'font-size:x-small;' }
- = l(version.created_at, format: :short)
- = whodunnit_with_protocol(version.whodunnit)
- =# version.whodunnit
- =# version.event
-
diff --git a/app/views/client/domains/_form.haml b/app/views/client/domains/_form.haml
deleted file mode 100644
index 154bc6b93..000000000
--- a/app/views/client/domains/_form.haml
+++ /dev/null
@@ -1,36 +0,0 @@
-= form_for([:client, @domain], html: { class: 'form-horizontal' }) do |f|
- = render 'shared/errors', object: @domain
- - unless @domain.parent_valid?
- %hr
- .row
- .col-md-12
- / Nav tabs
- %ul.nav.nav-tabs{:role => "tablist", id: 'tabs'}
- - li_class = @domain.general_tab_valid? ? nil : 'error-tab'
- %li.active{class: li_class}
- %a{"data-toggle" => "tab", :href => "#general-tab", :role => "tab"}= t('shared.general')
- - li_class = @domain.statuses_tab_valid? ? nil : 'error-tab'
- %li{class: li_class}
- %a{"data-toggle" => "tab", :href => "#statuses-tab", :role => "tab"}= t('shared.statuses')
- / Tab panes
- .tab-content{style:'margin-top: 20px;'}
- #general-tab.tab-pane.active
- = render 'client/domains/form_partials/general', f: f
- %hr
- = render 'client/domains/form_partials/contacts', f: f
- %hr
- = render 'client/domains/form_partials/nameservers', f: f
- / %hr
- / = render 'client/domains/form_partials/dnskeys', f: f
- #statuses-tab.tab-pane
- = render 'client/domains/form_partials/statuses', f: f
- .row
- .col-md-12.text-right
- = button_tag(t('shared.save'), class: 'btn btn-primary')
-
-:javascript
- $(function () {
- $('#tabs a:first').tab('show')
- })
-
- Autocomplete.bindClientContactSearch();
diff --git a/app/views/client/domains/edit.haml b/app/views/client/domains/edit.haml
deleted file mode 100644
index 2b5229e1b..000000000
--- a/app/views/client/domains/edit.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs
- = "#{t('shared.edit_domain')}"
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.back_to_domain'), [:client, @domain], class: 'btn btn-default')
-%hr
-= render 'form'
diff --git a/app/views/client/domains/form_partials/_contacts.haml b/app/views/client/domains/form_partials/_contacts.haml
deleted file mode 100644
index 2290c49ff..000000000
--- a/app/views/client/domains/form_partials/_contacts.haml
+++ /dev/null
@@ -1,34 +0,0 @@
-#domain-contacts
- = f.fields_for :domain_contacts do |contact_fields|
- .panel.panel-default
- .panel-heading.clearfix
- .pull-left= t('shared.contact')
- .pull-right
- = link_to(t('shared.add_another'), '#', class: 'btn btn-primary btn-xs add-domain-contact')
- = link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
- .panel-body
- .errors
- = render 'shared/errors', object: contact_fields.object
- - if contact_fields.object.errors.any?
- %hr
- .form-group
- = contact_fields.label :contact_type, class: 'col-md-2 control-label'
- .col-md-10
- = contact_fields.select :contact_type, options_for_select(DomainContact::TYPES, contact_fields.object.contact_type), {}, {class: 'form-control'}
-
- .form-group
- = contact_fields.label :value_typeahead, t('shared.contact'), class: 'col-md-2 control-label'
- .col-md-10.has-feedback.js-typeahead-container
- = contact_fields.text_field(:value_typeahead, class: 'form-control js-contact-typeahead', placeholder: t('shared.contact_code'), autocomplete: 'off')
- %span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden
- %span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
- = contact_fields.hidden_field(:contact_id, class: 'js-contact-id')
-:javascript
- $("#domain-contacts").nestedAttributes({
- bindAddTo: $(".add-domain-contact"),
- afterAdd: function(item) {
- item.find('.errors').html('');
- item.find('.js-contact-id').val('')
- Autocomplete.bindClientContactSearch();
- }
- });
diff --git a/app/views/client/domains/form_partials/_dnskeys.haml b/app/views/client/domains/form_partials/_dnskeys.haml
deleted file mode 100644
index 859204b89..000000000
--- a/app/views/client/domains/form_partials/_dnskeys.haml
+++ /dev/null
@@ -1,39 +0,0 @@
-#dnskeys
- = f.fields_for :dnskeys do |key_fields|
- .panel.panel-default
- .panel-heading.clearfix
- .pull-left= t('shared.dnskey')
- .pull-right
- = link_to(t('shared.add_another'), '#', class: 'btn btn-primary btn-xs add-dnskey')
- = link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
- .panel-body
- .errors
- = render 'shared/errors', object: key_fields.object
- - if key_fields.object.errors.any?
- %hr
- .form-group
- = key_fields.label :flags, class: 'col-md-2 control-label'
- .col-md-10
- = key_fields.select :flags, options_for_select(Dnskey::FLAGS, key_fields.object.flags), {}, {class: 'form-control'}
-
- .form-group
- = key_fields.label :protocol, class: 'col-md-2 control-label'
- .col-md-10
- = key_fields.select :protocol, options_for_select(Dnskey::PROTOCOLS, key_fields.object.protocol), {}, {class: 'form-control'}
-
- .form-group
- = key_fields.label :alg, class: 'col-md-2 control-label'
- .col-md-10
- = key_fields.select :alg, options_for_select(Dnskey::ALGORITHMS, key_fields.object.alg), {}, {class: 'form-control'}
-
- .form-group
- = key_fields.label :public_key, class: 'col-md-2 control-label'
- .col-md-10
- = key_fields.text_field :public_key, class: 'form-control'
-:javascript
- $("#dnskeys").nestedAttributes({
- bindAddTo: $(".add-dnskey"),
- afterAdd: function(item) {
- item.find('.errors').html('');
- }
- });
diff --git a/app/views/client/domains/form_partials/_general.haml b/app/views/client/domains/form_partials/_general.haml
deleted file mode 100644
index 30f9c289a..000000000
--- a/app/views/client/domains/form_partials/_general.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-.form-group
- = f.label :name, class: 'col-md-2 control-label'
- .col-md-10
- = f.text_field(:name, class: 'form-control')
-
-.form-group
- = f.label :period, class: 'col-md-2 control-label'
- .col-md-5
- = f.text_field(:period, class: 'form-control')
- .col-md-5
- = f.select :period_unit, options_for_select(['y', 'm', 'd'], @domain.period_unit), {}, { class: 'form-control' }
-
-.form-group
- = f.label :owner_contact_typeahead, t('shared.owner'), class: 'col-md-2 control-label'
- .col-md-10.has-feedback.js-typeahead-container
- = f.text_field(:owner_contact_typeahead, class: 'form-control js-contact-typeahead', placeholder: t('shared.contact_code'), autocomplete: 'off')
- %span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden
- %span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove
- = f.hidden_field(:owner_contact_id, class: 'js-contact-id')
diff --git a/app/views/client/domains/form_partials/_nameservers.haml b/app/views/client/domains/form_partials/_nameservers.haml
deleted file mode 100644
index 607fa14db..000000000
--- a/app/views/client/domains/form_partials/_nameservers.haml
+++ /dev/null
@@ -1,32 +0,0 @@
-#nameservers
- = f.fields_for :nameservers do |ns_fields|
- .panel.panel-default
- .panel-heading.clearfix
- .pull-left= t('shared.nameserver')
- .pull-right
- = link_to(t('shared.add_another'), '#', class: 'btn btn-primary btn-xs add-nameserver')
- = link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
- .panel-body
- .errors
- = render 'shared/errors', object: ns_fields.object
- - if ns_fields.object.errors.any?
- %hr
- .form-group
- = ns_fields.label :hostname, class: 'col-md-2 control-label'
- .col-md-10
- = ns_fields.text_field :hostname, class: 'form-control'
- .form-group
- = ns_fields.label :ipv4, class: 'col-md-2 control-label'
- .col-md-10
- = ns_fields.text_field :ipv4, class: 'form-control'
- .form-group
- = ns_fields.label :ipv6, class: 'col-md-2 control-label'
- .col-md-10
- = ns_fields.text_field :ipv6, class: 'form-control'
-:javascript
- $("#nameservers").nestedAttributes({
- bindAddTo: $(".add-nameserver"),
- afterAdd: function(item) {
- item.find('.errors').html('');
- }
- });
diff --git a/app/views/client/domains/form_partials/_statuses.haml b/app/views/client/domains/form_partials/_statuses.haml
deleted file mode 100644
index c7374382c..000000000
--- a/app/views/client/domains/form_partials/_statuses.haml
+++ /dev/null
@@ -1,29 +0,0 @@
-#domain-statuses
- = f.fields_for :domain_statuses, @client_statuses do |status_fields|
- .panel.panel-default
- .panel-heading.clearfix
- .pull-left= t('shared.status')
- .pull-right
- = link_to(t('shared.add_another'), '#', class: 'btn btn-primary btn-xs add-domain-status')
- = link_to(t('shared.delete'), '#', class: 'btn btn-danger btn-xs destroy')
- .panel-body
- .errors
- = render 'shared/errors', object: status_fields.object
- - if status_fields.object.errors.any?
- %hr
- .form-group
- = status_fields.label :value, class: 'col-md-2 control-label'
- .col-md-10
- = status_fields.select :value, options_for_select(DomainStatus.statuses_for_client, status_fields.object.value.try(:sub, 'client', '')), {include_blank: true}, {class: 'form-control'}
-
- .form-group
- = status_fields.label :description, class: 'col-md-2 control-label'
- .col-md-10
- = status_fields.text_field :description, class: 'form-control', autocomplete: 'off'
-:javascript
- $("#domain-statuses").nestedAttributes({
- bindAddTo: $(".add-domain-status"),
- afterAdd: function(item) {
- item.find('.errors').html('');
- }
- });
diff --git a/app/views/client/domains/index.haml b/app/views/client/domains/index.haml
deleted file mode 100644
index b1ecf3421..000000000
--- a/app/views/client/domains/index.haml
+++ /dev/null
@@ -1,44 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs= t('shared.domains')
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.create_new_domain'), new_client_domain_path, class: 'btn btn-primary')
-%hr
-.row
- .col-md-12
- = search_form_for [:client, @q], html: { class: 'form-horizontal' } do |f|
- .col-md-11
- .form-group
- = f.search_field :name_cont, class: 'form-control'
- .col-md-1.text-right.text-center-xs
- .form-group
- %button.btn.btn-primary
-
- %span.glyphicon.glyphicon-search
-
-%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')
- %th{class: 'col-xs-2'}
- = sort_link(@q, 'owner_contact_name', t('shared.owner'))
- %th{class: 'col-xs-2'}
- = sort_link(@q, 'valid_to', t('shared.valid_to'))
- %th{class: 'col-xs-1'}
- %tbody
- - @domains.each do |x|
- %tr
- %td= link_to(x, client_domain_path(x))
- %td= link_to(x.owner_contact, [:client, x.owner_contact])
- %td= l(x.valid_to, format: :short)
- %td= link_to t('shared.history'), client_domain_version_path(x.id), class: 'btn btn-primary'
-.row
- .col-md-12
- = paginate @domains
-
diff --git a/app/views/client/domains/new.haml b/app/views/client/domains/new.haml
deleted file mode 100644
index d5313c958..000000000
--- a/app/views/client/domains/new.haml
+++ /dev/null
@@ -1,3 +0,0 @@
-%h2= t('shared.new_domain')
-%hr
-= render 'form'
diff --git a/app/views/client/domains/partials/_admin_contacts.haml b/app/views/client/domains/partials/_admin_contacts.haml
deleted file mode 100644
index 7e38b9aaf..000000000
--- a/app/views/client/domains/partials/_admin_contacts.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-- panel_class = @domain.errors.messages[:admin_contacts] ? 'panel-danger' : 'panel-default'
-.panel{class: panel_class}
- .panel-heading.clearfix
- = t('shared.admin_contacts')
- .table-responsive
- %table.table.table-hover.table-bordered.table-condensed
- %thead
- %tr
- %th{class: 'col-xs-4'}= t('shared.name')
- %th{class: 'col-xs-4'}= t('shared.code')
- %th{class: 'col-xs-4'}= t('shared.email')
- %tbody
- - @domain.domain_contacts.admin.each do |x|
- %tr
- %td= link_to(x.contact, '#')
- %td= x.contact.code
- %td= x.contact.email
- - if @domain.errors.messages[:admin_contacts]
- %tfoot
- - @domain.errors.messages[:admin_contacts].each do |x|
- %tr
- %td{colspan: 4}= x
diff --git a/app/views/client/domains/partials/_general.haml b/app/views/client/domains/partials/_general.haml
deleted file mode 100644
index cc347eab1..000000000
--- a/app/views/client/domains/partials/_general.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-.panel.panel-default
- .panel-heading
- %h3.panel-title= t('shared.general')
- .panel-body
- %dl.dl-horizontal
- %dt= t('shared.name')
- %dd= @domain.name
-
- %dt= t('shared.registered_at')
- %dd= l(@domain.registered_at)
-
- %dt= t('shared.password')
- %dd= @domain.auth_info
-
- %dt= t('shared.valid_from')
- %dd= l(@domain.valid_from)
-
- %dt= t('shared.valid_to')
- %dd= l(@domain.valid_to)
diff --git a/app/views/client/domains/partials/_owner.haml b/app/views/client/domains/partials/_owner.haml
deleted file mode 100644
index cca5e1636..000000000
--- a/app/views/client/domains/partials/_owner.haml
+++ /dev/null
@@ -1,19 +0,0 @@
-.panel.panel-default
- .panel-heading
- %h3.panel-title= t('shared.owner')
- .panel-body
- %dl.dl-horizontal
- %dt= t('shared.name')
- %dd= link_to(@domain.owner_contact, '#')
-
- %dt= t('shared.code')
- %dd= @domain.owner_contact_code
-
- %dt= t('shared.identity_code')
- %dd= @domain.owner_contact_ident
-
- %dt= t('shared.email')
- %dd= @domain.owner_contact_email
-
- %dt= t('shared.phone')
- %dd= @domain.owner_contact_phone
diff --git a/app/views/client/domains/partials/_tech_contacts.haml b/app/views/client/domains/partials/_tech_contacts.haml
deleted file mode 100644
index bf3a89bbe..000000000
--- a/app/views/client/domains/partials/_tech_contacts.haml
+++ /dev/null
@@ -1,22 +0,0 @@
-- panel_class = @domain.errors.messages[:tech_contacts] ? 'panel-danger' : 'panel-default'
-#tech_contacts.panel{class: panel_class}
- .panel-heading.clearfix
- = t('shared.tech_contacts')
- .table-responsive
- %table.table.table-hover.table-bordered.table-condensed
- %thead
- %tr
- %th{class: 'col-xs-4'}= t('shared.name')
- %th{class: 'col-xs-4'}= t('shared.code')
- %th{class: 'col-xs-4'}= t('shared.email')
- %tbody
- - @domain.domain_contacts.tech.each do |x|
- %tr
- %td= link_to(x.contact, '#')
- %td= x.contact.code
- %td= x.contact.email
- - if @domain.errors.messages[:tech_contacts]
- %tfoot
- - @domain.errors.messages[:tech_contacts].each do |x|
- %tr
- %td{colspan: 4}= x
diff --git a/app/views/client/domains/show.haml b/app/views/client/domains/show.haml
deleted file mode 100644
index c8c59f303..000000000
--- a/app/views/client/domains/show.haml
+++ /dev/null
@@ -1,27 +0,0 @@
-.row
- .col-sm-6
- %h2.text-center-xs
- = "#{t('shared.domain_details')}"
- .col-sm-6
- %h2.text-right.text-center-xs
- = link_to(t('shared.edit'), edit_client_domain_path(@domain), class: 'btn btn-primary')
- = link_to(t('shared.delete'), client_domain_path(@domain), method: :delete, data: { confirm: t('shared.are_you_sure') }, class: 'btn btn-danger')
-
-%hr
-.row
- .col-md-6= render 'client/domains/partials/general'
- .col-md-6= render 'client/domains/partials/owner'
-.row
- .col-md-12= render 'client/domains/partials/tech_contacts'
-.row
- .col-md-12= render 'client/domains/partials/admin_contacts'
-.row
- .col-md-12= render 'admin/domains/partials/statuses'
-.row
- .col-md-12= render 'admin/domains/partials/nameservers'
-.row
- .col-md-12= render 'admin/domains/partials/dnskeys'
-
-- if @domain.versions.present?
- = render 'client/shared/versions', versions: @domain.versions
-
diff --git a/app/views/client/shared/_versions.haml b/app/views/client/shared/_versions.haml
deleted file mode 100644
index 3f9a95305..000000000
--- a/app/views/client/shared/_versions.haml
+++ /dev/null
@@ -1,24 +0,0 @@
-.row
- .col-md-12
- #nameservers.panel{ class: 'panel-default' }
- .panel-heading.clearfix
- = t('shared.history')
- .table-responsive
- %table.table.table-hover.table-bordered.table-condensed
- %thead
- %tr
- %th
- =t('shared.whodunnit')
- %th
- =t('shared.event')
- %th
- =t('shared.created_at')
-
- %tbody
- -versions.each do |version|
- %tr
- %td= whodunnit_with_protocol(version.whodunnit)
- %td= version.event
- %td= version.created_at
-
-
diff --git a/app/views/layouts/login.haml b/app/views/layouts/login.haml
index 4e3bbf69f..7b3a1da76 100644
--- a/app/views/layouts/login.haml
+++ b/app/views/layouts/login.haml
@@ -22,10 +22,5 @@
%hr
/ TODO: Refactor this when ID card login is done
- if can? :create, :admin_session
- = button_to 'ID card (gitlab)', 'sessions',
+ = button_to 'ID card (gitlab)', 'sessions',
class: 'btn btn-lg btn-primary btn-block', name: 'gitlab'
- - if can? :create, :session
- = button_to 'ID card (zone)', 'sessions',
- class: 'btn btn-lg btn-primary btn-block', name: 'zone'
- = button_to 'ID card (elkdata)', 'sessions',
- class: 'btn btn-lg btn-primary btn-block', name: 'elkdata'
diff --git a/config/locales/en.yml b/config/locales/en.yml
index da8dc2c87..2b9da78f3 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -422,3 +422,4 @@ en:
registrar: 'Registrar'
transfer_requested: 'Transfer requested.'
message_was_not_found: 'Message was not found'
+ host_obj_is_not_allowed: 'hostObj object is not allowed'
diff --git a/config/routes.rb b/config/routes.rb
index 05316c6eb..a3aacba3c 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -33,27 +33,6 @@ Rails.application.routes.draw do
end
- ## CLIENT ROUTES
- namespace(:client) do
- resources :domains
- resources :domain_transfers do
- member do
- post 'approve'
- end
- end
-
- resources :contacts do
- collection do
- get 'search'
- end
- end
-
- resources :contact_versions
- resources :domain_versions
-
- root 'domains#index'
- end
-
devise_for :users
devise_scope :user do
diff --git a/spec/epp/domain_spec.rb b/spec/epp/domain_spec.rb
index 0e82f727e..a36ea7e39 100644
--- a/spec/epp/domain_spec.rb
+++ b/spec/epp/domain_spec.rb
@@ -273,8 +273,16 @@ describe 'EPP Domain', epp: true do
it 'validates nameserver ipv4 when in same zone as domain' do
xml = domain_create_xml({
ns: [
- { hostObj: { value: 'ns1.example.ee' } },
- { hostObj: { value: 'ns2.example.ee' } }
+ {
+ hostAttr: [
+ { hostName: { value: 'ns1.example.ee' } }
+ ]
+ },
+ {
+ hostAttr: {
+ hostName: { value: 'ns2.example.ee' }
+ }
+ }
]
})
@@ -319,7 +327,13 @@ describe 'EPP Domain', epp: true do
it 'does not create domain with too many nameservers' do
nameservers = []
- 14.times { |i| nameservers << { hostObj: { value: "ns#{i}.example.net" } } }
+ 14.times do |i|
+ nameservers << {
+ hostAttr: {
+ hostName: { value: "ns#{i}.example.net" }
+ }
+ }
+ end
xml = domain_create_xml(ns: nameservers)
response = epp_request(xml, :xml)
@@ -330,10 +344,17 @@ describe 'EPP Domain', epp: true do
it 'returns error when invalid nameservers are present' do
xml = domain_create_xml({
ns: [
- { hostObj: { value: 'invalid1-' } },
- { hostObj: { value: '-invalid2' } }
+ {
+ hostAttr: {
+ hostName: { value: 'invalid1-' }
+ }
+ },
+ {
+ hostAttr: {
+ hostName: { value: '-invalid2' }
+ }
+ }
]
-
})
response = epp_request(xml, :xml)
@@ -341,8 +362,25 @@ describe 'EPP Domain', epp: true do
expect(response[:msg]).to eq('Hostname is invalid')
end
+ it 'does not allow hostObj' do
+ xml = domain_create_xml({
+ ns: [
+ {
+ hostObj: { value: 'ns1.example.ee' }
+ },
+ {
+ hostObj: { value: 'ns2.example.ee' }
+ }
+ ]
+ })
+
+ response = epp_request(xml, :xml)
+ expect(response[:result_code]).to eq('2306')
+ expect(response[:msg]).to eq('hostObj object is not allowed')
+ end
+
it 'creates domain with nameservers with ips' do
- epp_request('domains/create_w_host_attrs.xml')
+ epp_request(domain_create_with_host_attrs, :xml)
expect(Domain.first.nameservers.count).to eq(2)
ns = Domain.first.nameservers.first
expect(ns.ipv4).to eq('192.0.2.2')
@@ -350,7 +388,7 @@ describe 'EPP Domain', epp: true do
end
it 'returns error when nameserver has invalid ips' do
- response = epp_request('domains/create_w_invalid_ns_ip.xml')
+ response = epp_request(domain_create_with_invalid_ns_ip_xml, :xml)
expect(response[:results][0][:result_code]).to eq '2005'
expect(response[:results][0][:msg]).to eq 'IPv4 is invalid'
expect(response[:results][0][:value]).to eq '192.0.2.2.invalid'
diff --git a/spec/epp/requests/domains/create_w_host_attrs.xml b/spec/epp/requests/domains/create_w_host_attrs.xml
deleted file mode 100644
index 173649aff..000000000
--- a/spec/epp/requests/domains/create_w_host_attrs.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
- example.ee
- 1
-
-
- ns1.example.net
- 192.0.2.2
- 1080:0:0:0:8:800:200C:417A
-
-
- ns2.example.net
-
-
- jd1234
- sh8013
- sh8013
- sh801333
-
- 2fooBAR
-
-
-
- ABC-12345
-
-
diff --git a/spec/epp/requests/domains/create_w_invalid_ns_ip.xml b/spec/epp/requests/domains/create_w_invalid_ns_ip.xml
deleted file mode 100644
index 80ef19ec2..000000000
--- a/spec/epp/requests/domains/create_w_invalid_ns_ip.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
- example.ee
- 1
-
-
- ns1.example.net
- 192.0.2.2.invalid
-
-
- ns2.example.net
- invalid_ipv6
-
-
- jd1234
- sh8013
- sh8013
- sh801333
-
- 2fooBAR
-
-
-
- ABC-12345
-
-
diff --git a/spec/features/sessions_spec.rb b/spec/features/sessions_spec.rb
index 9ce6ccea4..d8bc66794 100644
--- a/spec/features/sessions_spec.rb
+++ b/spec/features/sessions_spec.rb
@@ -15,7 +15,6 @@ feature 'Sessions', type: :feature do
scenario 'Admin logs in' do
visit root_path
expect(page).to have_button('ID card (gitlab)')
- expect(page).to have_button('ID card (zone)')
click_on 'ID card (gitlab)'
expect(page).to have_text('Welcome!')
@@ -26,22 +25,4 @@ feature 'Sessions', type: :feature do
expect(page).to have_link('Elkdata', count: 2)
expect(page).to have_link('Zone Media OÜ', count: 2)
end
-
- scenario 'Client logs in' do
- visit root_path
-
- click_on 'ID card (zone)'
- expect(page).to have_text('Welcome!')
-
- uri = URI.parse(current_url)
- expect(uri.path).to eq(client_root_path)
-
- zone.domains.pluck(:name).each do |name|
- expect(page).to have_link(name)
- end
-
- elkdata.domains.pluck(:name).each do |name|
- expect(page).to_not have_link(name)
- end
- end
end
diff --git a/spec/features/setting_management_spec.rb b/spec/features/setting_management_spec.rb
index a8e082f13..20af17a3f 100644
--- a/spec/features/setting_management_spec.rb
+++ b/spec/features/setting_management_spec.rb
@@ -2,7 +2,7 @@ require 'rails_helper'
feature 'Setting management', type: :feature do
let(:zone) { Fabricate(:registrar) }
- let(:zone_user) { Fabricate(:user, registrar: zone, username: 'zone', admin: true, identity_code: '37810013087') }
+ let(:zone_user) { Fabricate(:user, registrar: zone, username: 'gitlab', admin: true, identity_code: '37810013087') }
background { create_settings }
diff --git a/spec/support/epp.rb b/spec/support/epp.rb
index 3c482d97a..ceb3fad69 100644
--- a/spec/support/epp.rb
+++ b/spec/support/epp.rb
@@ -64,13 +64,24 @@ module Epp
EppXml::Domain.info(xml_params)
end
+ # rubocop: disable Metrics/MethodLength
def domain_create_xml(xml_params = {}, dnssec_params = {})
defaults = {
name: { value: 'example.ee' },
period: { value: '1', attrs: { unit: 'y' } },
ns: [
- { hostObj: { value: 'ns1.example.net' } },
- { hostObj: { value: 'ns2.example.net' } }
+ {
+ hostAttr: [
+ { hostName: { value: 'ns1.example.net' } },
+ { hostAddr: { value: '192.0.2.2', attrs: { ip: 'v4' } } },
+ { hostAddr: { value: '1080:0:0:0:8:800:200C:417A', attrs: { ip: 'v6' } } }
+ ]
+ },
+ {
+ hostAttr: {
+ hostName: { value: 'ns2.example.net' }
+ }
+ }
],
registrant: { value: 'jd1234' },
_anonymus: [
@@ -97,6 +108,70 @@ module Epp
EppXml::Domain.create(xml_params, dnssec_params)
end
+ def domain_create_with_invalid_ns_ip_xml
+ xml_params = {
+ name: { value: 'example.ee' },
+ period: { value: '1', attrs: { unit: 'y' } },
+ ns: [
+ {
+ hostAttr: {
+ hostName: { value: 'ns1.example.net' },
+ hostAddr: { value: '192.0.2.2.invalid', attrs: { ip: 'v4' } }
+ }
+ },
+ {
+ hostAttr: {
+ hostName: { value: 'ns2.example.net' },
+ hostAddr: { value: 'invalid_ipv6', attrs: { ip: 'v6' } }
+ }
+ }
+ ],
+ registrant: { value: 'jd1234' },
+ contact: { value: 'sh8013', attrs: { type: 'admin' } },
+ contact: { value: 'sh8013', attrs: { type: 'tech' } },
+ contact: { value: 'sh801333', attrs: { type: 'tech' } },
+ authInfo: {
+ pw: {
+ value: '2fooBAR'
+ }
+ }
+ }
+
+ EppXml::Domain.create(xml_params, false)
+ end
+
+ def domain_create_with_host_attrs
+ xml_params = {
+ name: { value: 'example.ee' },
+ period: { value: '1', attrs: { unit: 'y' } },
+ ns: [
+ {
+ hostAttr: [
+ { hostName: { value: 'ns1.example.net' } },
+ { hostAddr: { value: '192.0.2.2', attrs: { ip: 'v4' } } },
+ { hostAddr: { value: '1080:0:0:0:8:800:200C:417A', attrs: { ip: 'v6' } } }
+ ]
+ },
+ {
+ hostAttr: {
+ hostName: { value: 'ns2.example.net' }
+ }
+ }
+ ],
+ registrant: { value: 'jd1234' },
+ contact: { value: 'sh8013', attrs: { type: 'admin' } },
+ contact: { value: 'sh8013', attrs: { type: 'tech' } },
+ contact: { value: 'sh801333', attrs: { type: 'tech' } },
+ authInfo: {
+ pw: {
+ value: '2fooBAR'
+ }
+ }
+ }
+
+ EppXml::Domain.create(xml_params, false)
+ end
+
def domain_update_xml(xml_params = {}, dnssec_params = false)
defaults = {
name: { value: 'example.ee' }
diff --git a/spec/support/feature.rb b/spec/support/feature.rb
index 5dd9fcde2..f529e8bcf 100644
--- a/spec/support/feature.rb
+++ b/spec/support/feature.rb
@@ -2,8 +2,6 @@ module Feature
def sign_in(user)
visit '/logout'
click_on 'ID card (gitlab)' if user.username == 'gitlab'
- click_on 'ID card (zone)' if user.username == 'zone'
- click_on 'ID card (elkdata)' if user.username == 'elkdata'
end
end