From c64e48a3722f73b8c1549683994850c7e5ae7920 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 12 Mar 2007 18:05:43 +0000 Subject: a performance improvement git-svn-id: file:///svn/phpbb/trunk@7177 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/auth.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'phpBB/includes/auth.php') 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); -- cgit v1.2.1