Projet

Général

Profil

Révision 7547bb19

Ajouté par Assos Assos il y a environ 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.module
81 81
    'type' => MENU_CALLBACK,
82 82
    'file' => 'ldap_authentication.pages.inc',
83 83
  );
84
  
84

  
85 85
  $items['admin/config/people/ldap/authentication'] = array(
86 86
    'title' => 'Authentication',
87 87
    'description' => 'Configure LDAP Authentication',
......
183 183
/**
184 184
 * Helper function that determines whether or not the user's profile
185 185
 * is valid or needs to be updated on login.
186
 * 
186
 *
187 187
 * Currently this only checks if mail is valid or not according to the
188 188
 * authentication settings.
189
 * 
189
 *
190 190
 * @return boolean
191 191
 *   TRUE if the user's profile is valid, otherwise FALSE.
192
 * 
192
 *
193 193
 */
194 194
function _ldap_authentication_verify_user_profile() {
195 195
  global $user;
......
262 262

  
263 263

  
264 264
/**
265
 * Determines if the passed user has a valid authmap record.
265 266
 *
266 267
 * @param object $user
268
 *   A drupal user account.
269
 *
267 270
 * @return boolean
268 271
 *    true if user is recorded as ldap authenticated and identified (ldap_authentified)
269 272
 */
270

  
271 273
function ldap_authentication_ldap_authenticated($user) {
272

  
273
  if (is_numeric($user)) {
274
    $user = @user_load((int)$user);
275
  }
276 274
  if (!is_object($user) || $user->uid == 0) {
277 275
    return FALSE;
278 276
  }
......
321 319

  
322 320
  $use_warnings = array();
323 321
  $auth_conf = ldap_authentication_get_valid_conf();
324
  if ($auth_conf && in_array($sid, array_keys($auth_conf->sids))) {
322
  if ($auth_conf && in_array($sid, array_keys($auth_conf->sids)) && !empty($auth_conf->sids[$sid])) {
325 323
    $use_warnings[] = t('This server (%server_name) may not be deleted or
326 324
      disabled because it is being used for ldap authentication.',
327 325
      array('%server_name' => $server_name));
......
335 333
    global $user;
336 334
  }
337 335
  $auth_conf = ldap_authentication_get_valid_conf();
338
  if (current_path() == 'user/password' || $user->uid == 1 || !$auth_conf) {
336
  // Hide user/password form if ldap authentication is required and deny access
337
  // to users without ldap authorizations is enabled
338
  if ($user->uid == 1 || $auth_conf || (current_path() == 'user/password' && $auth_conf->authenticationMode != LDAP_AUTHENTICATION_EXCLUSIVE)) {
339 339
    return TRUE;
340 340
   // always show at user/passwordurl. otherwise user 1 will not be able to reset password.
341 341
  }

Formats disponibles : Unified diff