Index: modules/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user.module,v retrieving revision 1.480 diff -u -Ff -r1.480 user.module --- modules/user.module 19 Jun 2005 09:06:02 -0000 1.480 +++ modules/user.module 20 Jun 2005 08:28:06 -0000 @@ -304,7 +304,7 @@ * The permission, such as "administer * (optional) The account to check, if not given use currently logged in user. * * @return - * TRUE iff the current user has the requested permission. + * boolean TRUE if the current user has the requested permission. * * All permission checks in Drupal should go through this function. This * way, we guarantee consistent behavior, and ensure that the superuser @@ -320,7 +320,7 @@ if (is_null($account)) { // User #1 has all privileges: if ($account->uid == 1) { - return 1; + return true; } // To reduce the number of SQL queries, we cache the user's permissions @@ -332,10 +332,8 @@ while ($row = db_fetch_object($resul $perm[$account->uid] .= "$row->perm, "; } } - if (isset($perm[$account->uid])) { - return strstr($perm[$account->uid], "$string, "); - } - return FALSE; + + return isset($perm[$account->uid]) && strstr($perm[$account->uid], "$string, "); } /**