Commit 494aa87e authored by Dries's avatar Dries
Browse files

- Small change that reduces the number of SQL queries when a certain role has
  no permissions set.
parent 9c43f544
......@@ -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);
}
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment