use of org.gluu.oxtrust.model.RegistrationConfiguration in project oxTrust by GluuFederation.
the class RegistrationInterceptionService method runInitRegistrationScripts.
public boolean runInitRegistrationScripts(GluuCustomPerson person, Map<String, String[]> requestParameters) {
GluuOrganization org = organizationService.getOrganization();
RegistrationConfiguration config = org.getOxRegistrationConfiguration();
if (config != null && config.isRegistrationInterceptorsConfigured()) {
List<RegistrationInterceptorScript> scripts = config.getRegistrationInterceptorScripts();
List<RegistrationInterceptorScript> sortedEnabledInitRegistrationScripts = sort(getActive(getInitRegistrationScripts(scripts)));
if (sortedEnabledInitRegistrationScripts != null) {
boolean result = true;
for (RegistrationInterceptorScript script : sortedEnabledInitRegistrationScripts) {
RegistrationScript registrationScript = createRegistrationScriptFromStringWithPythonException(script);
result &= registrationScript.execute(script.getCustomAttributes(), person, requestParameters);
}
return result;
} else {
return true;
}
} else {
return true;
}
}
use of org.gluu.oxtrust.model.RegistrationConfiguration in project oxTrust by GluuFederation.
the class RegistrationManagementAction method init.
public String init() {
customScriptTypes = new ArrayList<String>();
customScriptTypes.add(OxTrustConstants.INIT_REGISTRATION_SCRIPT);
customScriptTypes.add(OxTrustConstants.PRE_REGISTRATION_SCRIPT);
customScriptTypes.add(OxTrustConstants.POST_REGISTRATION_SCRIPT);
this.oxTrustappConfiguration = jsonConfigurationService.getOxTrustappConfiguration();
GluuOrganization org = organizationService.getOrganization();
RegistrationConfiguration config = org.getOxRegistrationConfiguration();
if (config != null) {
captchaDisabled = config.isCaptchaDisabled();
List<String> attributeList = config.getAdditionalAttributes();
if (attributeList != null && !attributeList.isEmpty()) {
configureRegistrationForm = true;
for (String attributeInum : attributeList) {
GluuAttribute attribute = attributeService.getAttributeByInum(attributeInum);
selectedAttributes.add(attribute);
attributes.add(attribute);
}
}
}
search();
return OxTrustConstants.RESULT_SUCCESS;
}
Aggregations