Validateing rest of the contact requests

This commit is contained in:
Andres Keskküla 2014-08-11 15:52:16 +03:00
parent e99af041f1
commit 2f0b0c35d4
3 changed files with 41 additions and 0 deletions

View file

@ -10,6 +10,7 @@ module Epp::ContactsHelper
end
def update_contact
#TODO add support for rem and add
code = params_hash['epp']['command']['update']['update'][:id]
@contact = Contact.where(code: code).first
stamp @contact
@ -78,6 +79,27 @@ module Epp::ContactsHelper
['authInfo']])
end
def validate_contact_update_request
@ph = params_hash['epp']['command']['update']['update']
xml_attrs_present?(@ph, [['id'] ])
end
def validate_contact_delete_request
@ph = params_hash['epp']['command']['delete']['delete']
xml_attrs_present?(@ph, [ ['id'] ] )
end
def validate_contact_check_request
@ph = params_hash['epp']['command']['check']['check']
xml_attrs_present?(@ph, [ ['id'] ])
end
def validate_contact_info_request
@ph = params_hash['epp']['command']['info']['info']
xml_attrs_present?(@ph, [ ['id'] ])
end
def contact_and_address_attributes
ph = params_hash['epp']['command'][params[:command]][params[:command]]
ph = ph[:chg] if params[:command] == 'update'