mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Merge branch 'master' into registry-887-revoke-certificate-before-removing-it
This commit is contained in:
commit
24b87d8592
70 changed files with 611 additions and 449 deletions
|
@ -6,7 +6,8 @@ module Admin
|
|||
|
||||
domain.transaction do
|
||||
domain.schedule_force_delete
|
||||
domain.registrar.messages.create!(body: t('force_delete_set_on_domain', domain_name: domain.name))
|
||||
domain.registrar.notifications.create!(text: t('force_delete_set_on_domain',
|
||||
domain_name: domain.name))
|
||||
|
||||
if notify_by_email?
|
||||
DomainDeleteMailer.forced(domain: domain,
|
||||
|
|
|
@ -9,12 +9,12 @@ class Epp::PollsController < EppController
|
|||
private
|
||||
|
||||
def req_poll
|
||||
@message = current_user.queued_messages.order('created_at DESC').take
|
||||
@notification = current_user.unread_notifications.order('created_at DESC').take
|
||||
|
||||
render_epp_response 'epp/poll/poll_no_messages' and return unless @message
|
||||
if @message.attached_obj_type && @message.attached_obj_id
|
||||
render_epp_response 'epp/poll/poll_no_messages' and return unless @notification
|
||||
if @notification.attached_obj_type && @notification.attached_obj_id
|
||||
begin
|
||||
@object = Object.const_get(@message.attached_obj_type).find(@message.attached_obj_id)
|
||||
@object = Object.const_get(@notification.attached_obj_type).find(@notification.attached_obj_id)
|
||||
rescue => problem
|
||||
# the data model might be inconsistent; or ...
|
||||
# this could happen if the registrar does not dequeue messages, and then the domain was deleted
|
||||
|
@ -28,7 +28,7 @@ class Epp::PollsController < EppController
|
|||
end
|
||||
end
|
||||
|
||||
if @message.attached_obj_type == 'Keyrelay'
|
||||
if @notification.attached_obj_type == 'Keyrelay'
|
||||
render_epp_response 'epp/poll/poll_keyrelay'
|
||||
else
|
||||
render_epp_response 'epp/poll/poll_req'
|
||||
|
@ -36,9 +36,9 @@ class Epp::PollsController < EppController
|
|||
end
|
||||
|
||||
def ack_poll
|
||||
@message = current_user.queued_messages.find_by(id: params[:parsed_frame].css('poll').first['msgID'])
|
||||
@notification = current_user.unread_notifications.find_by(id: params[:parsed_frame].css('poll').first['msgID'])
|
||||
|
||||
unless @message
|
||||
unless @notification
|
||||
epp_errors << {
|
||||
code: '2303',
|
||||
msg: I18n.t('message_was_not_found'),
|
||||
|
@ -47,7 +47,7 @@ class Epp::PollsController < EppController
|
|||
handle_errors and return
|
||||
end
|
||||
|
||||
handle_errors(@message) and return unless @message.dequeue
|
||||
handle_errors(@notification) and return unless @notification.mark_as_read
|
||||
render_epp_response 'epp/poll/poll_ack'
|
||||
end
|
||||
|
||||
|
@ -56,6 +56,6 @@ class Epp::PollsController < EppController
|
|||
end
|
||||
|
||||
def resource
|
||||
@message
|
||||
@notification
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
class Registrant::ContactsController < RegistrantController
|
||||
helper_method :domain_ids
|
||||
helper_method :domain
|
||||
|
||||
def show
|
||||
@contact = Contact.where(id: contacts).find_by(id: params[:id])
|
||||
|
@ -25,4 +26,19 @@ class Registrant::ContactsController < RegistrantController
|
|||
BusinessRegistryCache.fetch_by_ident_and_cc(ident, ident_cc).associated_domain_ids
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def domain
|
||||
current_user_domains.find(params[:domain_id])
|
||||
end
|
||||
|
||||
def current_user_domains
|
||||
ident_cc, ident = current_registrant_user.registrant_ident.split '-'
|
||||
begin
|
||||
BusinessRegistryCache.fetch_associated_domains ident, ident_cc
|
||||
rescue Soap::Arireg::NotAvailableError => error
|
||||
flash[:notice] = I18n.t(error.json[:message])
|
||||
Rails.logger.fatal("[EXCEPTION] #{error.to_s}")
|
||||
current_registrant_user.domains
|
||||
end
|
||||
end
|
||||
end
|
|
@ -3,7 +3,8 @@ class Registrar
|
|||
protect_from_forgery except: [:back, :callback]
|
||||
|
||||
skip_authorization_check # actually anyone can pay, no problems at all
|
||||
skip_before_action :authenticate_user!, :check_ip_restriction, only: [:back, :callback]
|
||||
skip_before_action :authenticate_registrar_user!, :check_ip_restriction,
|
||||
only: [:back, :callback]
|
||||
before_action :check_supported_payment_method
|
||||
|
||||
def pay
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue