Révision 32700c57
Ajouté par Assos Assos il y a environ 5 ans
drupal7/sites/all/modules/ldap/ldap_user/ldap_user.admin.inc | ||
---|---|---|
3 | 3 |
/** |
4 | 4 |
* @file |
5 | 5 |
* LDAP User editing UI. |
6 |
* |
|
7 | 6 |
*/ |
8 | 7 |
|
9 | 8 |
/** |
10 |
* form for adding, updating, and deleting a single ldap authorization mapping
|
|
9 |
* Form for adding, updating, and deleting a single ldap authorization mapping.
|
|
11 | 10 |
*/ |
12 | 11 |
function ldap_user_admin_form($form, &$form_state) { |
13 | 12 |
$ldap_user_conf = ldap_user_conf('admin'); |
... | ... | |
15 | 14 |
return $form; |
16 | 15 |
} |
17 | 16 |
|
18 |
|
|
19 | 17 |
/** |
20 |
* validate handler for the ldap_user_admin_form
|
|
18 |
* Validate handler for the ldap_user_admin_form.
|
|
21 | 19 |
*/ |
22 | 20 |
function ldap_user_admin_form_validate($form, &$form_state) { |
23 | 21 |
|
... | ... | |
29 | 27 |
foreach ($warnings as $warning_name => $warning_text) { |
30 | 28 |
drupal_set_message($warning_text, 'warning'); |
31 | 29 |
} |
32 |
$form_state['ldap_warnings'] = (boolean)(count($warnings) > 0); |
|
30 |
$form_state['ldap_warnings'] = (boolean) (count($warnings) > 0);
|
|
33 | 31 |
} |
34 | 32 |
|
35 | 33 |
/** |
36 |
* submit handler function for ldap_user_admin_form
|
|
34 |
* Submit handler function for ldap_user_admin_form.
|
|
37 | 35 |
*/ |
38 | 36 |
function ldap_user_admin_form_submit($form, &$form_state) { |
39 | 37 |
|
40 | 38 |
$ldap_user_conf = ldap_user_conf('admin'); |
41 |
$ldap_user_conf->drupalFormSubmit($form_state['values'], $form['#storage']); // add form data to object and save or create |
|
39 |
// Add form data to object and save or create. |
|
40 |
$ldap_user_conf->drupalFormSubmit($form_state['values'], $form['#storage']); |
|
42 | 41 |
|
43 | 42 |
if ($ldap_user_conf->hasError == FALSE) { |
44 | 43 |
drupal_set_message(t('LDAP user configuration saved'), 'status'); |
45 | 44 |
drupal_goto(LDAP_SERVERS_MENU_BASE_PATH . '/user'); |
46 | 45 |
} |
47 | 46 |
else { |
48 |
form_set_error($conf->errorName, $conf->errorMsg);
|
|
47 |
form_set_error($ldap_user_conf->errorName, $ldap_user_conf->errorMsg);
|
|
49 | 48 |
$ldap_user_conf->clearError(); |
50 | 49 |
} |
51 | 50 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules