? 28604_dateien
? INSTALL.patch
? access.patch
? add_book_index.patch
? add_comment_stats_index.patch
? autocomplete.patch
? better_book_cache.patch
? better_caching.patch
? better_taxo_caching.patch
? block_cache.patch
? block_rehash_head.patch.txt
? cache_block.patch
? cache_date.patch
? cache_index_pgsql.patch
? cache_path.patch
? cache_path.patch.1
? comment_cache.patch
? comment_cache_1.patch
? convert.php
? database.mysql
? db_faith_46.sql
? drupal.org-slow.log
? drupal.org-slow.log2
? drupal.org-slow.log3
? feed
? file_download.patch
? files
? files.sql
? grep
? hardening-drupal.txt
? heap.patch
? htaccess.patch
? infinite_loop.patch
? ip.patch
? is_denied.patch
? locale
? mail-alternative.php
? mail-node.php
? mail-utf8.php
? mail.php
? merge.patch
? merge.patch_20060817_2249_sammys.txt
? move_defines.patch
? no_block.patch
? no_distinct.patch
? no_global.patch
? no_lock.patch
? no_lock_0.patch
? node-admin.patch
? node_show.patch
? nodecounter.patch
? notice_followup.patch
? path_cache-47.patch
? path_cache.patch
? phpinfo.php
? proxy_4.patch
? proxy_4.patch.1
? reasonable_age.patch
? reasonable_age.patch_0.txt
? sesscachejv.patch
? stats.patch
? swap_file_revision_index.patch
? system.patch
? taxo_names
? taxo_projects
? test.php
? tune_user_access.patch
? unblock.patch
? upload.patch
? url_refactor.patch
? urlalias.patch
? users_access.patch
? xmlrpx-out.php
? modules/search/search.module-patched
? modules/user/access_control.js
? modules/user/no_distinct.patch
? sites/localhost.~killes2
? sites/default/locale
? sites/default/settings.php
? themes/bluemarine/template.php
? themes/pushbutton/page.tpl.php-foo
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.851
diff -u -p -r1.851 user.module
--- modules/user/user.module	3 Oct 2007 13:01:04 -0000	1.851
+++ modules/user/user.module	6 Oct 2007 13:02:29 -0000
@@ -453,16 +453,17 @@ function user_access($string, $account =
   // To reduce the number of SQL queries, we cache the user's permissions
   // in a static variable.
   if (!isset($perm[$account->uid])) {
-    $result = db_query("SELECT DISTINCT(p.perm) FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (". db_placeholders($account->roles) .")", array_keys($account->roles));
+    $result = db_query("SELECT p.perm FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (". db_placeholders($account->roles) .")", array_keys($account->roles));
 
-    $perm[$account->uid] = '';
+    $perms = array();
     while ($row = db_fetch_object($result)) {
-      $perm[$account->uid] .= "$row->perm, ";
+      $perms[] = explode(', ', $row->perm);
     }
+    $perm[$account->uid] = array_unique($perms);
   }
 
   if (isset($perm[$account->uid])) {
-    return strpos($perm[$account->uid], "$string, ") !== FALSE;
+    return in_array($string, $perm[$account->uid]);
   }
 
   return FALSE;
