From 3b8c99d91e3733427e9f821ed385f097d18e8ffa Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 11 Jun 2003 18:16:32 +0000 Subject: - Bugfix: fixed the CREATE FUNCTION in database.mssql as it needs to be prefixed with GO for some obscure reason. Patch by Kjartan. - Bugfix: fixed the defaults for blocks in database.mssql so the NOT NULL fields get values. Patch by Kjartan. - Bugfix: changed check_form() to use htmlspecialchars() instead of drupal_specialchars() as this caused Drupal to emit incorrect form items in presence of quotes. Example: IMO, drupal_specialchars() is better called xmlspecialchars() to avoid confusion. - Bugfix: when an anonymous user visits a site, they shouldn't see any content (except the login block, if it is enabled) unless they have the "access content" permissions. Patch by Matt Westgate. - Improvement: improved the error checking and the error messages in the profile module. Updated the code to match the Drupal coding conventions. Modified patch from Matt Westgate. - Improvement: don't generate the tag in the base theme; it is already emitted by theme_head(). Patch by Kristjan. - Improvement: don't execute any SQL queries when checking the permissions of user #1. Patch by Kjartan. - Improvement: made a scalable layout form that works in IE and that behaves better with narrow themes. Part of patch #51 by Al. - Improvement: removed some redundant print statements from the comment module. Modified patch from Craig Courtney. --- modules/user.module | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'modules/user.module') diff --git a/modules/user.module b/modules/user.module index 3c307043f..6a6c1d91d 100644 --- a/modules/user.module +++ b/modules/user.module @@ -211,6 +211,10 @@ function user_access($string) { global $user; static $perm; + if ($user->uid == 1) { + return 1; + } + /* ** To reduce the number of SQL queries, we cache the user's permissions ** in a static variable. @@ -225,13 +229,7 @@ function user_access($string) { } } - if ($user->uid == 1) { - return 1; - } - else { - return strstr($perm, $string); - } - + return strstr($perm, $string); } function user_mail($mail, $subject, $message, $header) { @@ -366,7 +364,6 @@ function user_block($op = "list", $delta = 0) { } break; case 2: - $result = db_query_range("SELECT uid, name FROM users WHERE status != '0' ORDER BY uid DESC", 0, 5); while ($account = db_fetch_object($result)) { $items[] = l((strlen($account->name) > 15 ? substr($account->name, 0, 15) . '...' : $account->name), "user/view/$account->uid"); -- cgit v1.2.3