Disabled contact org

This commit is contained in:
Priit Tark 2015-03-10 10:56:55 +02:00
parent 67f23d2769
commit 94a3b7beff
5 changed files with 40 additions and 6 deletions

View file

@ -99,6 +99,7 @@ class Epp::ContactsController < EppController
msg: I18n.t('errors.messages.required_attribute_missing', key: 'ident country code missing')
}
end
contact_org_disabled
@prefix = nil
requires 'extension > extdata > ident'
end
@ -111,6 +112,7 @@ class Epp::ContactsController < EppController
msg: I18n.t('errors.messages.required_parameter_missing', key: 'add, rem or chg')
}
end
contact_org_disabled
requires 'id', 'authInfo > pw'
@prefix = nil
end
@ -120,4 +122,13 @@ class Epp::ContactsController < EppController
requires 'id', 'authInfo > pw'
@prefix = nil
end
def contact_org_disabled
return true if ENV['contact_org_enabled'] == 'true'
return true if params[:parsed_frame].css('postalInfo org').text.blank?
epp_errors << {
code: '2306',
msg: I18n.t(:parameter_value_policy_error)
}
end
end