aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/auth.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-04-17 13:09:50 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-04-17 13:09:50 +0000
commita0f8e1323a0fb50e6a4b7449f93b493377eddd2c (patch)
treead60ba619c483e390bf767c70ff7c160e087daf5 /phpBB/includes/auth.php
parent8c2f02ca00b41d7aa3282aaacfbf2674a5347a14 (diff)
downloadforums-a0f8e1323a0fb50e6a4b7449f93b493377eddd2c.tar
forums-a0f8e1323a0fb50e6a4b7449f93b493377eddd2c.tar.gz
forums-a0f8e1323a0fb50e6a4b7449f93b493377eddd2c.tar.bz2
forums-a0f8e1323a0fb50e6a4b7449f93b493377eddd2c.tar.xz
forums-a0f8e1323a0fb50e6a4b7449f93b493377eddd2c.zip
- clean up marklist calls (global function)
- added new feature: test out others permissions (admin permissions will not be copied) - changed attachment processing by directly using the template engine - fixed some attachment related bugs - additional tiny fixes git-svn-id: file:///svn/phpbb/trunk@5790 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/auth.php')
-rw-r--r--phpBB/includes/auth.php37
1 files changed, 27 insertions, 10 deletions
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php
index c4dc4cb84a..fb1d2126a7 100644
--- a/phpBB/includes/auth.php
+++ b/phpBB/includes/auth.php
@@ -325,12 +325,34 @@ class auth
{
if (strpos($opt, 'a_') === 0)
{
- $hold_ary[0][$opt] = 1;
+ $hold_ary[0][$opt] = ACL_YES;
}
}
}
+ $hold_str = $this->build_bitstring($hold_ary);
+
+ if ($hold_str)
+ {
+ $userdata['user_permissions'] = $hold_str;
+
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_permissions = '" . $db->sql_escape($userdata['user_permissions']) . "',
+ user_perm_from = 0
+ WHERE user_id = " . $userdata['user_id'];
+ $db->sql_query($sql);
+ }
+
+ return;
+ }
+
+ /**
+ * Build bitstring from permission set
+ */
+ function build_bitstring(&$hold_ary)
+ {
$hold_str = '';
+
if (sizeof($hold_ary))
{
ksort($hold_ary);
@@ -379,16 +401,10 @@ class auth
}
unset($bitstring);
- $userdata['user_permissions'] = rtrim($hold_str);
-
- $sql = 'UPDATE ' . USERS_TABLE . "
- SET user_permissions = '" . $db->sql_escape($userdata['user_permissions']) . "'
- WHERE user_id = " . $userdata['user_id'];
- $db->sql_query($sql);
+ $hold_str = rtrim($hold_str);
}
- unset($hold_ary);
- return;
+ return $hold_str;
}
/**
@@ -401,7 +417,8 @@ class auth
$where_sql = ($user_id !== false) ? ' WHERE user_id ' . ((is_array($user_id)) ? ' IN (' . implode(', ', array_map('intval', $user_id)) . ')' : " = $user_id") : '';
$sql = 'UPDATE ' . USERS_TABLE . "
- SET user_permissions = ''
+ SET user_permissions = '',
+ user_perm_from = 0
$where_sql";
$db->sql_query($sql);