summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-02-19 12:09:30 +0000
committerDries Buytaert <dries@buytaert.net>2009-02-19 12:09:30 +0000
commit802f7aa03dea53ce4e4b941f4944f93b1ea582fc (patch)
tree45c598ce82a1cce22cfd8a7de744c9b60c15d77c /modules
parentff9e842730ccf251cf8b76401e4df1b1c6edcea2 (diff)
downloadbrdo-802f7aa03dea53ce4e4b941f4944f93b1ea582fc.tar.gz
brdo-802f7aa03dea53ce4e4b941f4944f93b1ea582fc.tar.bz2
- Patch #374568 by chx: remove useless JOIN from permission query.
Diffstat (limited to 'modules')
-rw-r--r--modules/user/user.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index 5892786f8..015facca2 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -572,10 +572,10 @@ function user_role_permissions($roles = array(), $reset = FALSE) {
if ($fetch) {
// Get from the database permissions that were not in the static variable.
// Only role IDs with at least one permission assigned will return rows.
- $result = db_query("SELECT r.rid, p.permission FROM {role} r INNER JOIN {role_permission} p ON p.rid = r.rid WHERE r.rid IN (:fetch)", array(':fetch' => $fetch));
+ $result = db_query("SELECT rid, permission FROM {role_permission} WHERE rid IN (:fetch)", array(':fetch' => $fetch));
- while ($row = db_fetch_array($result)) {
- $stored_permissions[$row['rid']][$row['permission']] = TRUE;
+ foreach ($result as $row) {
+ $stored_permissions[$row->rid][$row->permission] = TRUE;
}
foreach ($fetch as $rid) {
// For every rid, we know we at least assigned an empty array.