Search in sources :

Example 6 with RegistrationConfiguration

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;
    }
}
Also used : RegistrationScript(org.gluu.oxtrust.service.python.interfaces.RegistrationScript) RegistrationInterceptorScript(org.gluu.oxtrust.model.RegistrationInterceptorScript) RegistrationConfiguration(org.gluu.oxtrust.model.RegistrationConfiguration) GluuOrganization(org.gluu.oxtrust.model.GluuOrganization)

Example 7 with RegistrationConfiguration

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;
}
Also used : RegistrationConfiguration(org.gluu.oxtrust.model.RegistrationConfiguration) GluuOrganization(org.gluu.oxtrust.model.GluuOrganization) GluuAttribute(org.xdi.model.GluuAttribute)

Aggregations

GluuOrganization (org.gluu.oxtrust.model.GluuOrganization)7 RegistrationConfiguration (org.gluu.oxtrust.model.RegistrationConfiguration)7 RegistrationInterceptorScript (org.gluu.oxtrust.model.RegistrationInterceptorScript)3 RegistrationScript (org.gluu.oxtrust.service.python.interfaces.RegistrationScript)3 GluuAttribute (org.xdi.model.GluuAttribute)3 ArrayList (java.util.ArrayList)2 GluuCustomAttribute (org.gluu.oxtrust.model.GluuCustomAttribute)1