Merge branch '105842700-registrants_portal' into staging

* 105842700-registrants_portal:
  105842700-related_commit_for_113525877
This commit is contained in:
Stas 2016-02-17 17:54:07 +02:00
commit e60a6ae647
8 changed files with 40 additions and 4 deletions

View file

@ -19,6 +19,22 @@ class Registrant::DomainsController < RegistrantController
@domain = domains.find(params[:id])
end
def domain_verification_url
authorize! :view, :registrant_domains
dom = domains.find(params[:id])
if (dom.statuses.include?(DomainStatus::PENDING_UPDATE) || dom.statuses.include?(DomainStatus::PENDING_DELETE)) &&
dom.pending_json.present?
@domain = dom
confirm_path = "#{ENV['registrant_url']}/registrant/domain_update_confirms"
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
else
flash[:warning] = I18n.t('available_verification_url_not_found')
redirect_to registrant_domain_path(dom.id)
end
end
def download_list
authorize! :view, :registrant_domains
params[:q] ||= {}

View file

@ -2,6 +2,7 @@ class Registrant::RegistrantsController < RegistrantController
def show
@contact = Registrant.find(params[:id])
@current_user = current_user
authorize! :read, @contact
@contact.valid?
end