Projet

Général

Profil

Révision 6ff32cea

Ajouté par Florent Torregrosa il y a environ 9 ans

Update core to 7.36

Voir les différences:

drupal7/modules/user/user.module
32 32
define('USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL', 2);
33 33

  
34 34
/**
35
 * Implement hook_help().
35
 * Implements hook_help().
36 36
 */
37 37
function user_help($path, $arg) {
38 38
  global $user;
......
848 848
    ->execute()->fetchObject();
849 849
}
850 850

  
851
/**
852
 * Checks if a user has a role.
853
 *
854
 * @param int $rid
855
 *   A role ID.
856
 *
857
 * @param object|null $account
858
 *   (optional) A user account. Defaults to the current user.
859
 *
860
 * @return bool
861
 *   TRUE if the user has the role, or FALSE if not.
862
 */
863
function user_has_role($rid, $account = NULL) {
864
  if (!$account) {
865
    $account = $GLOBALS['user'];
866
  }
867

  
868
  return isset($account->roles[$rid]);
869
}
870

  
851 871
/**
852 872
 * Implements hook_permission().
853 873
 */

Formats disponibles : Unified diff