From 494aa87e37c59ea63293c7d8c3a2bb065a10231b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 18 May 2003 09:10:17 +0000 Subject: - Small change that reduces the number of SQL queries when a certain role has no permissions set. --- modules/user.module | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/user.module') 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); } -- cgit v1.2.3