aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/session.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-08-18 00:33:30 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-08-18 00:33:30 +0000
commitd5f0bfc3e15a2174871e9a714af2c74553acef0b (patch)
tree671970ebdd2792d019b1b68f90301c1a1bbf5b72 /phpBB/includes/session.php
parentbca30bbe4801684831be42c2ef6d8e598856be84 (diff)
downloadforums-d5f0bfc3e15a2174871e9a714af2c74553acef0b.tar
forums-d5f0bfc3e15a2174871e9a714af2c74553acef0b.tar.gz
forums-d5f0bfc3e15a2174871e9a714af2c74553acef0b.tar.bz2
forums-d5f0bfc3e15a2174871e9a714af2c74553acef0b.tar.xz
forums-d5f0bfc3e15a2174871e9a714af2c74553acef0b.zip
Related to permission changes ...
git-svn-id: file:///svn/phpbb/trunk@2876 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r--phpBB/includes/session.php46
1 files changed, 20 insertions, 26 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 88d02d342d..579678b947 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -512,7 +512,7 @@ class acl
$forum_sql = ( $forum_id ) ? "AND a.forum_id IN ($forum_id, 0)" : '';
- $sql = "SELECT a.user_id, o.auth_type, o.auth_option_id, o.auth_option, a.auth_allow_deny FROM " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o, " . USERS_TABLE . " u WHERE a.auth_option_id = o.auth_option_id $forum_sql AND u.user_id = a.user_id AND a.user_id = $user_id";
+ $sql = "SELECT o.auth_option_id, a.auth_allow_deny FROM " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o, " . USERS_TABLE . " u WHERE a.auth_option_id = o.auth_option_id $forum_sql AND u.user_id = a.user_id AND a.user_id = $user_id";
$result = $db->sql_query($sql);
$user_auth = array();
@@ -520,28 +520,25 @@ class acl
{
do
{
- $user_auth[$row['user_id']][$row['auth_type']][$row['auth_option_id']] = $row['auth_allow_deny'];
+ $user_auth[$user_id][$row['auth_option_id']] = $row['auth_allow_deny'];
}
while ( $row = $db->sql_fetchrow($result) );
}
$db->sql_freeresult($result);
- foreach ( $auth as $auth_type => $auth_option_ary )
+ foreach ( $auth as $auth_option_id => $allow )
{
- foreach ( $auth_option_ary as $auth_option => $allow )
+ if ( !empty($user_auth) )
{
- if ( !empty($user_auth) )
+ foreach ( $user_auth as $user => $user_auth_ary )
{
- foreach ( $user_auth as $user => $user_auth_ary )
- {
- $sql_ary[] = ( !isset($user_auth_ary[$auth_type][$auth_option]) ) ? "INSERT INTO " . ACL_USERS_TABLE . " (user_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($user_id, $forum_id, $auth_option, $allow)" : ( ( $user_auth_ary[$auth_type][$auth_option] != $allow ) ? "UPDATE " . ACL_USERS_TABLE . " SET auth_allow_deny = $allow WHERE user_id = $user_id AND forum_id = $forum_id and auth_option_id = $auth_option" : '' );
- }
- }
- else
- {
- $sql_ary[] = "INSERT INTO " . ACL_USERS_TABLE . " (user_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($user_id, $forum_id, $auth_option, $allow)";
+ $sql_ary[] = ( !isset($user_auth_ary[$auth_option_id]) ) ? "INSERT INTO " . ACL_USERS_TABLE . " (user_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($user_id, $forum_id, $auth_option_id, $allow)" : ( ( $user_auth_ary[$auth_option_id] != $allow ) ? "UPDATE " . ACL_USERS_TABLE . " SET auth_allow_deny = $allow WHERE user_id = $user_id AND forum_id = $forum_id AND auth_option_id = $auth_option_id" : '' );
}
}
+ else
+ {
+ $sql_ary[] = "INSERT INTO " . ACL_USERS_TABLE . " (user_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($user_id, $forum_id, $auth_option_id, $allow)";
+ }
}
foreach ( $sql_ary as $sql )
@@ -559,7 +556,7 @@ class acl
$forum_sql = ( $forum_id ) ? "AND a.forum_id IN ($forum_id, 0)" : '';
- $sql = "SELECT a.group_id, o.auth_type, o.auth_option_id, o.auth_option, a.auth_allow_deny FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE a.auth_option_id = o.auth_option_id $forum_sql AND a.group_id = $group_id";
+ $sql = "SELECT o.auth_option_id, a.auth_allow_deny FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE a.auth_option_id = o.auth_option_id $forum_sql AND a.group_id = $group_id";
$result = $db->sql_query($sql);
$group_auth = array();
@@ -567,28 +564,25 @@ class acl
{
do
{
- $group_auth[$row['group_id']][$row['auth_type']][$row['auth_option_id']] = $row['auth_allow_deny'];
+ $group_auth[$group_id][$row['auth_option_id']] = $row['auth_allow_deny'];
}
while ( $row = $db->sql_fetchrow($result) );
}
$db->sql_freeresult($result);
- foreach ( $auth as $auth_type => $auth_option_ary )
+ foreach ( $auth as $auth_option_id => $allow )
{
- foreach ( $auth_option_ary as $auth_option => $allow )
+ if ( !empty($group_auth) )
{
- if ( !empty($group_auth) )
+ foreach ( $group_auth as $group => $group_auth_ary )
{
- foreach ( $group_auth as $group => $group_auth_ary )
- {
- $sql_ary[] = ( !isset($group_auth_ary[$auth_type][$auth_option]) ) ? "INSERT INTO " . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($group_id, $forum_id, $auth_option, $allow)" : ( ( $group_auth_ary[$auth_type][$auth_option] != $allow ) ? "UPDATE " . ACL_GROUPS_TABLE . " SET auth_allow_deny = $allow WHERE group_id = $group_id AND forum_id = $forum_id and auth_option_id = $auth_option" : '' );
- }
- }
- else
- {
- $sql_ary[] = "INSERT INTO " . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($group_id, $forum_id, $auth_option, $allow)";
+ $sql_ary[] = ( !isset($group_auth_ary[$auth_option_id]) ) ? "INSERT INTO " . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($group_id, $forum_id, $auth_option_id, $allow)" : ( ( $group_auth_ary[$auth_option_id] != $allow ) ? "UPDATE " . ACL_GROUPS_TABLE . " SET auth_allow_deny = $allow WHERE group_id = $group_id AND forum_id = $forum_id and auth_option_id = $auth_option_id" : '' );
}
}
+ else
+ {
+ $sql_ary[] = "INSERT INTO " . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($group_id, $forum_id, $auth_option_id, $allow)";
+ }
}
foreach ( $sql_ary as $sql )