diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-21 16:54:19 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-21 16:54:19 +0000 |
commit | 530b7e94c5e10eb1b9aa2ea488825265b685651e (patch) | |
tree | e679fd1af844e3b80d36923bde481873aee0e56d /phpBB/includes/functions_user.php | |
parent | 2ddac1037550a12e6a49dd7d78f7884ce584eedc (diff) | |
download | forums-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/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 0b3ace62b4..d932ae312b 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1211,11 +1211,11 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow if (sizeof($group_attributes)) { - foreach ($attribute_ary as $attribute => $type) + foreach ($attribute_ary as $attribute => $_type) { if (isset($group_attributes[$attribute])) { - settype($group_attributes[$attribute], $type); + settype($group_attributes[$attribute], $_type); $sql_ary[$attribute] = $group_attributes[$attribute]; } } @@ -1224,7 +1224,16 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow // Setting the log message before we set the group id (if group gets added) $log = ($group_id) ? 'LOG_GROUP_UPDATED' : 'LOG_GROUP_CREATED'; - $sql = ($group_id) ? 'UPDATE ' . GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE group_id = $group_id" : 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + if ($group_id) + { + $sql = 'UPDATE ' . GROUPS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE group_id = $group_id"; + } + else + { + $sql = 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + } $db->sql_query($sql); if (!$group_id) @@ -1236,7 +1245,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow $sql_ary = array(); if (sizeof($group_attributes)) { - foreach ($attribute_ary as $attribute => $type) + foreach ($attribute_ary as $attribute => $_type) { if (isset($group_attributes[$attribute]) && !in_array($attribute, $group_only_ary)) { @@ -1258,6 +1267,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow $db->sql_query($sql); } + $name = ($type == GROUP_SPECIAL) ? $user->lang['G_' . $name] : $name; add_log('admin', $log, $name); } |