function ldap_user_form_register_form_submit2 in Lightweight Directory Access Protocol (LDAP) 7.2
Same name and namespace in other branches
- 8.4 ldap_user/ldap_user.module \ldap_user_form_register_form_submit2()
- 8.2 ldap_user/ldap_user.module \ldap_user_form_register_form_submit2()
- 8.3 ldap_user/ldap_user.module \ldap_user_form_register_form_submit2()
Called after user_register_form_submit .*
1 string reference to 'ldap_user_form_register_form_submit2'
- ldap_user_form_user_register_form_alter in ldap_user/
ldap_user.module - Implements hook_form_FORM_ID_alter(). for user_register_form.
File
- ldap_user/
ldap_user.module, line 629 - Module for the LDAP User Entity.
Code
function ldap_user_form_register_form_submit2($form, &$form_state) {
$values = $form_state['values'];
$ldap_user_association_set = FALSE;
if (@$values['ldap_user_create_ldap_acct']) {
if ($account = user_load_by_name($values['name'])) {
$ldap_user_conf = ldap_user_conf();
$ldap_provision_entry = $ldap_user_conf
->getProvisionRelatedLdapEntry($account);
if (!$ldap_provision_entry) {
$provision_result = $ldap_user_conf
->provisionLdapEntry($account);
}
else {
$ldap_user_association_set = TRUE;
}
}
else {
// don't do anything here. If account is not created, other user module warnings will exist.
}
}
if ($ldap_user_association_set || @$values['ldap_user_association'] == LDAP_USER_MANUAL_ACCT_CONFLICT_LDAP_ASSOCIATE) {
$ldap_user_conf = ldap_user_conf();
$ldap_user_conf
->ldapAssociateDrupalAccount($form_state['values']['name']);
}
}