diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-05-18 09:10:17 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-05-18 09:10:17 +0000 |
commit | 494aa87e37c59ea63293c7d8c3a2bb065a10231b (patch) | |
tree | d3ae1b71d68032b284f6c943e67a397eea97c43f | |
parent | 9c43f5440eb5b9c38e546d81ed763d155bbdd99a (diff) | |
download | brdo-494aa87e37c59ea63293c7d8c3a2bb065a10231b.tar.gz brdo-494aa87e37c59ea63293c7d8c3a2bb065a10231b.tar.bz2 |
- Small change that reduces the number of SQL queries when a certain role has
no permissions set.
-rw-r--r-- | modules/user.module | 4 | ||||
-rw-r--r-- | modules/user/user.module | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/user.module b/modules/user.module index 5782a2782..01d144bf6 100644 --- a/modules/user.module +++ b/modules/user.module @@ -214,8 +214,8 @@ function user_access($string) { ** To reduce the number of SQL queries, we cache the user's permissions ** in a static variable. */ - - if (!$perm) { + + if (isset($perm)) { if ($user->uid) { $perm = db_result(db_query("SELECT p.perm FROM role r, permission p WHERE r.rid = p.rid AND name = '%s'", $user->role), 0); } diff --git a/modules/user/user.module b/modules/user/user.module index 5782a2782..01d144bf6 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -214,8 +214,8 @@ function user_access($string) { ** To reduce the number of SQL queries, we cache the user's permissions ** in a static variable. */ - - if (!$perm) { + + if (isset($perm)) { if ($user->uid) { $perm = db_result(db_query("SELECT p.perm FROM role r, permission p WHERE r.rid = p.rid AND name = '%s'", $user->role), 0); } |