Merge branch 'master' of github.com:internetee/registry

This commit is contained in:
Andres Keskküla 2014-09-01 11:49:05 +03:00
commit cf68c0a8fc
5 changed files with 40 additions and 11 deletions

View file

@ -68,6 +68,15 @@ module Epp::DomainsHelper
render '/epp/domains/transfer'
end
def delete_domain
@domain = find_domain
handle_errors(@domain) and return unless @domain
handle_errors(@domain) and return unless @domain.destroy
render '/epp/domains/success'
end
### HELPER METHODS ###
private
@ -127,6 +136,12 @@ module Epp::DomainsHelper
xml_attrs_present?(@ph, [['name']])
end
## DELETE
def validate_domain_delete_request
@ph = params_hash['epp']['command']['delete']['delete']
xml_attrs_present?(@ph, [['name']])
end
## SHARED
def find_domain(secure = { secure: true })
domain = Domain.find_by(name: @ph[:name], registrar: current_epp_user.registrar) if secure[:secure] == true