use of org.gluu.oxtrust.model.RegistrationInterceptorScript in project oxTrust by GluuFederation.
the class RegistrationInterceptionService method runPostRegistrationScripts.
public boolean runPostRegistrationScripts(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> sortedEnabledPostRegistrationScripts = sort(getActive(getPostRegistrationScripts(scripts)));
if (sortedEnabledPostRegistrationScripts != null) {
boolean result = true;
for (RegistrationInterceptorScript script : sortedEnabledPostRegistrationScripts) {
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.RegistrationInterceptorScript in project oxTrust by GluuFederation.
the class RegistrationInterceptionService method runPreRegistrationScripts.
public boolean runPreRegistrationScripts(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> sortedEnabledPreRegistrationScripts = sort(getActive(getPreRegistrationScripts(scripts)));
if (sortedEnabledPreRegistrationScripts != null) {
boolean result = true;
for (RegistrationInterceptorScript script : sortedEnabledPreRegistrationScripts) {
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.RegistrationInterceptorScript 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.RegistrationInterceptorScript in project oxTrust by GluuFederation.
the class RegistrationManagementAction method addRegistrationInterceptor.
public String addRegistrationInterceptor() {
RegistrationInterceptorScript registrationScript = new RegistrationInterceptorScript();
registrationInterceptors.add(registrationScript);
return OxTrustConstants.RESULT_SUCCESS;
}
Aggregations