aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/auth.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-05-21 16:54:19 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-05-21 16:54:19 +0000
commit530b7e94c5e10eb1b9aa2ea488825265b685651e (patch)
treee679fd1af844e3b80d36923bde481873aee0e56d /phpBB/includes/acp/auth.php
parent2ddac1037550a12e6a49dd7d78f7884ce584eedc (diff)
downloadforums-530b7e94c5e10eb1b9aa2ea488825265b685651e.tar
forums-530b7e94c5e10eb1b9aa2ea488825265b685651e.tar.gz
forums-530b7e94c5e10eb1b9aa2ea488825265b685651e.tar.bz2
forums-530b7e94c5e10eb1b9aa2ea488825265b685651e.tar.xz
forums-530b7e94c5e10eb1b9aa2ea488825265b685651e.zip
- fixing a few smaller bugs/glitches
- init user session in cron.php (else it can produce errors if functions expect the user object being set) - fix sql escaping for mssql/mssql_odbc git-svn-id: file:///svn/phpbb/trunk@5957 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/auth.php')
-rw-r--r--phpBB/includes/acp/auth.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index b1448b100c..1bfde0887c 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -307,13 +307,20 @@ class auth_admin extends auth
if (sizeof($roles))
{
+ $s_role_js_array = array();
+
+ // Make sure every role (even if empty) has its array defined
+ foreach ($roles as $_role_id => $null)
+ {
+ $s_role_js_array[$_role_id] = "\n" . 'role_options[' . $_role_id . '] = new Array();' . "\n";
+ }
+
$sql = 'SELECT r.role_id, o.auth_option, r.auth_setting
FROM ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' o
WHERE o.auth_option_id = r.auth_option_id
AND r.role_id IN (' . implode(', ', array_keys($roles)) . ')';
$result = $db->sql_query($sql);
- $s_role_js_array = array();
while ($row = $db->sql_fetchrow($result))
{
$flag = substr($row['auth_option'], 0, strpos($row['auth_option'], '_') + 1);
@@ -322,10 +329,6 @@ class auth_admin extends auth
continue;
}
- if (!isset($s_role_js_array[$row['role_id']]))
- {
- $s_role_js_array[$row['role_id']] = "\n" . 'role_options[' . $row['role_id'] . '] = new Array();' . "\n";
- }
$s_role_js_array[$row['role_id']] .= 'role_options[' . $row['role_id'] . '][\'' . $row['auth_option'] . '\'] = ' . $row['auth_setting'] . '; ';
}
$db->sql_freeresult($result);