diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-06-01 01:45:50 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-06-01 01:45:50 +0000 |
commit | f3d9aa24f069ccc9f50e05e51e1cd4a30304fd1d (patch) | |
tree | 63c6629981e81c1c48121178b1a6619fdfb2ffa6 /phpBB/includes/auth.php | |
parent | cb1e99cb910cd8fcc1436d2d41f1f7e164edbc24 (diff) | |
download | forums-f3d9aa24f069ccc9f50e05e51e1cd4a30304fd1d.tar forums-f3d9aa24f069ccc9f50e05e51e1cd4a30304fd1d.tar.gz forums-f3d9aa24f069ccc9f50e05e51e1cd4a30304fd1d.tar.bz2 forums-f3d9aa24f069ccc9f50e05e51e1cd4a30304fd1d.tar.xz forums-f3d9aa24f069ccc9f50e05e51e1cd4a30304fd1d.zip |
Something else broke, now fixed, probably ... sleep uuugghhh
git-svn-id: file:///svn/phpbb/trunk@401 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/auth.php')
-rw-r--r-- | phpBB/includes/auth.php | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 2b0b849b14..86a4b3bbcd 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -147,17 +147,18 @@ function auth($type, $forum_id, $userdata, $f_access = -1) else { $forum_match_sql = ($forum_id != AUTH_LIST_ALL) ? "AND aa.forum_id = $forum_id" : ""; - $sql = "SELECT aa.forum_id, $a_sql, aa.auth_mod, g.single_user, u.user_level - FROM ".AUTH_ACCESS_TABLE." aa, " . USER_GROUP_TABLE. " ug, " . GROUPS_TABLE. " g, " . USERS_TABLE . " u + $sql = "SELECT aa.forum_id, $a_sql, aa.auth_mod, g.single_user + FROM ".AUTH_ACCESS_TABLE." aa, " . USER_GROUP_TABLE. " ug, " . GROUPS_TABLE. " g WHERE ug.user_id = ".$userdata['user_id']. " AND g.group_id = ug.group_id AND aa.group_id = ug.group_id - AND u.user_id = ug.user_id $forum_match_sql"; $au_result = $db->sql_query($sql); $u_access = $db->sql_fetchrowset($au_result); + $is_admin = ($userdata['user_level'] == ADMIN) ? 1 : 0; + $auth_user = array(); for($i = 0; $i < count($auth_fields); $i++) { @@ -222,7 +223,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) { $single_user = $u_access[$j]['single_user']; - $auth_user[$key] = (!$single_user) ? ($auth_user[$key] || $u_access[$j][$key] || $u_access[$i]['auth_mod'] || ($userdata['user_level'] == ADMIN)) : ($u_access[$j][$key] || $u_access[$i]['auth_mod'] || ($userdata['user_level'] == ADMIN)); + $auth_user[$key] = (!$single_user) ? ($auth_user[$key] || $u_access[$j][$key] || $u_access[$i]['auth_mod'] || $is_admin) : ($u_access[$j][$key] || $u_access[$i]['auth_mod'] || $is_admin); } } break; @@ -234,7 +235,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) { $single_user = $u_access[$j]['single_user']; - $auth_user[$key] = (!$single_user) ? ($auth_user[$key] || $u_access[$i]['auth_mod'] || ($userdata['user_level'] == ADMIN)) : ($u_access[$i]['auth_mod'] || ($userdata['user_level'] == ADMIN)); + $auth_user[$key] = (!$single_user) ? ($auth_user[$key] || $u_access[$j]['auth_mod'] || $is_admin) : ($u_access[$j]['auth_mod'] || $is_admin); } } break; @@ -261,8 +262,9 @@ function auth($type, $forum_id, $userdata, $f_access = -1) { if(!$single_user) { - $auth_user['auth_mod'] = $auth_user['auth_mod'] || $u_access[$j]['auth_mod']; $single_user = $u_access[$j]['single_user']; + + $auth_user['auth_mod'] = (!$single_user) ? ($auth_user['auth_mod'] || $u_access[$j]['auth_mod'] || $is_admin) : ($u_access[$j]['auth_mod'] || $is_admin); } } @@ -270,7 +272,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1) // Is user an admin (this is // really redundant at this time) // - $auth_user[$key] = ($userdata['user_level'] == ADMIN) ? 1 : 0; + $auth_user['auth_admin'] = $is_admin; } |