diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-11-02 12:20:59 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-11-02 12:20:59 +0000 |
commit | f69437deadac37dcb646035bccaaa5c7610305d8 (patch) | |
tree | dcfa40e1d482e3fbc658d206e448b0bfa2253803 | |
parent | 29b32eff2b9ad55c5990a3393ef9e55ec8980d67 (diff) | |
download | brdo-f69437deadac37dcb646035bccaaa5c7610305d8.tar.gz brdo-f69437deadac37dcb646035bccaaa5c7610305d8.tar.bz2 |
#12363: Bug in user_access() with uid 1 and $account parameter.
-rw-r--r-- | modules/user.module | 8 | ||||
-rw-r--r-- | modules/user/user.module | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/modules/user.module b/modules/user.module index 1e30d6f41..68fcc0b4c 100644 --- a/modules/user.module +++ b/modules/user.module @@ -307,15 +307,15 @@ function user_access($string, $account = NULL) { global $user; static $perm = array(); + if (is_null($account)) { + $account = $user; + } + // User #1 has all privileges: if ($user->uid == 1) { return 1; } - if (is_null($account)) { - $account = $user; - } - // To reduce the number of SQL queries, we cache the user's permissions // in a static variable. if (!isset($perm[$account->uid])) { diff --git a/modules/user/user.module b/modules/user/user.module index 1e30d6f41..68fcc0b4c 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -307,15 +307,15 @@ function user_access($string, $account = NULL) { global $user; static $perm = array(); + if (is_null($account)) { + $account = $user; + } + // User #1 has all privileges: if ($user->uid == 1) { return 1; } - if (is_null($account)) { - $account = $user; - } - // To reduce the number of SQL queries, we cache the user's permissions // in a static variable. if (!isset($perm[$account->uid])) { |