diff options
author | Nils Adermann <naderman@naderman.de> | 2007-03-12 18:05:43 +0000 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2007-03-12 18:05:43 +0000 |
commit | c64e48a3722f73b8c1549683994850c7e5ae7920 (patch) | |
tree | 53beb535fd5f563c9c38834cf1fed0b8c4c6aa12 /phpBB/includes/auth.php | |
parent | 9d78487f96258b87e1dc61335e21a5fa6a3b9352 (diff) | |
download | forums-c64e48a3722f73b8c1549683994850c7e5ae7920.tar forums-c64e48a3722f73b8c1549683994850c7e5ae7920.tar.gz forums-c64e48a3722f73b8c1549683994850c7e5ae7920.tar.bz2 forums-c64e48a3722f73b8c1549683994850c7e5ae7920.tar.xz forums-c64e48a3722f73b8c1549683994850c7e5ae7920.zip |
a performance improvement
git-svn-id: file:///svn/phpbb/trunk@7177 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/auth.php')
-rw-r--r-- | phpBB/includes/auth.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index cf1b053f8c..28b3384d9c 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -537,26 +537,28 @@ class auth 'SELECT' => 'ug.user_id, ao.auth_option, a.forum_id, a.auth_setting, a.auth_role_id, r.auth_setting as role_auth_setting', 'FROM' => array( - USER_GROUP_TABLE => 'ug', - ACL_OPTIONS_TABLE => 'ao', - ACL_GROUPS_TABLE => 'a' + ACL_GROUPS_TABLE => 'a', ), 'LEFT_JOIN' => array( array( + 'FROM' => array(USER_GROUP_TABLE => 'ug'), + 'ON' => 'a.group_id = ug.group_id' + ), + array( 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), 'ON' => 'a.auth_role_id = r.role_id' - ) + ), + array( + 'FROM' => array(ACL_OPTIONS_TABLE => 'ao'), + 'ON' => '(ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id)' + ), ), - 'WHERE' => '(ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) - AND a.group_id = ug.group_id - AND ug.user_pending = 0 + 'WHERE' => 'ug.user_pending = 0 ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " $sql_forum $sql_opts", - - 'ORDER_BY' => 'a.forum_id, ao.auth_option' )); $result = $db->sql_query($sql); |