aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-06-06 20:53:46 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-06-06 20:53:46 +0000
commitdd9ad539fdab80badedf801a816b8a0beafbbf5c (patch)
treedb8ae8a184b060d5576604cc0dfa723773daedb8 /phpBB/includes/acp
parent2c8afb820e3842bed2ab6cec4053e71b5c566985 (diff)
downloadforums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar
forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.gz
forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.bz2
forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.tar.xz
forums-dd9ad539fdab80badedf801a816b8a0beafbbf5c.zip
ok, this one is rather large... the most important change:
re-introduce append_sid: old style continues to work, not a performance hog as it was in 2.0.x -> structure is different apart from this, code cleanage, bug fixing, etc. git-svn-id: file:///svn/phpbb/trunk@6015 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_attachments.php6
-rw-r--r--phpBB/includes/acp/acp_ban.php4
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php2
-rw-r--r--phpBB/includes/acp/acp_board.php10
-rw-r--r--phpBB/includes/acp/acp_bots.php6
-rw-r--r--phpBB/includes/acp/acp_database.php2
-rw-r--r--phpBB/includes/acp/acp_disallow.php2
-rw-r--r--phpBB/includes/acp/acp_email.php6
-rw-r--r--phpBB/includes/acp/acp_forums.php99
-rw-r--r--phpBB/includes/acp/acp_groups.php14
-rw-r--r--phpBB/includes/acp/acp_icons.php3
-rw-r--r--phpBB/includes/acp/acp_jabber.php2
-rw-r--r--phpBB/includes/acp/acp_language.php8
-rw-r--r--phpBB/includes/acp/acp_logs.php2
-rw-r--r--phpBB/includes/acp/acp_main.php8
-rw-r--r--phpBB/includes/acp/acp_modules.php2
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php2
-rw-r--r--phpBB/includes/acp/acp_permissions.php6
-rw-r--r--phpBB/includes/acp/acp_php_info.php2
-rw-r--r--phpBB/includes/acp/acp_profile.php4
-rw-r--r--phpBB/includes/acp/acp_prune.php8
-rw-r--r--phpBB/includes/acp/acp_ranks.php2
-rw-r--r--phpBB/includes/acp/acp_reasons.php2
-rw-r--r--phpBB/includes/acp/acp_search.php20
-rw-r--r--phpBB/includes/acp/acp_styles.php20
-rw-r--r--phpBB/includes/acp/acp_users.php22
-rw-r--r--phpBB/includes/acp/acp_words.php2
-rw-r--r--phpBB/includes/acp/auth.php12
28 files changed, 143 insertions, 135 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index cbee63aaf7..976c2b2257 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -19,7 +19,7 @@ class acp_attachments
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
@@ -684,7 +684,7 @@ class acp_attachments
'S_NO_IMAGE' => $no_image_select,
'S_FORUM_IDS' => (sizeof($forum_ids)) ? true : false,
- 'U_EXTENSIONS' => $phpbb_admin_path . "index.$phpEx$SID&amp;i=$id&amp;mode=extensions",
+ 'U_EXTENSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;mode=extensions"),
'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP'],
)
@@ -1108,7 +1108,7 @@ class acp_attachments
// Submit Attachment
$attach_sql = $message_parser->attachment_data;
- $db->sql_transaction();
+ $db->sql_transaction('begin');
$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $attach_sql);
$db->sql_query($sql);
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index 778809d1b0..834fdd19a8 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -18,7 +18,7 @@ class acp_ban
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -91,7 +91,7 @@ class acp_ban
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
'U_ACTION' => $this->u_action,
- 'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=acp_ban&amp;field=ban",
+ 'U_FIND_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_ban&amp;field=ban'),
)
);
}
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 4f7f4b191b..4dfcaf7e8a 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -18,7 +18,7 @@ class acp_bbcodes
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/posting');
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 60f6706d75..60d3631673 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -20,7 +20,7 @@ class acp_board
function main($id, $mode)
{
global $db, $user, $auth, $template;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/board');
@@ -61,6 +61,7 @@ class acp_board
'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'type' => 'radio:yes_no', 'explain' => false),
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
+ 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig' => array('lang' => 'ALLOW_SIG', 'type' => 'radio:yes_no', 'explain' => false),
@@ -112,9 +113,7 @@ class acp_board
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false),
'auth_download_pm' => array('lang' => 'ALLOW_DOWNLOAD_PM', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'type' => 'radio:yes_no', 'explain' => false),
-// 'auth_quote_pm' => array('lang' => 'ALLOW_QUOTE_PM', 'type' => 'radio:yes_no', 'explain' => false),
'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false),
-// 'email_pm' => array('lang' => 'ALLOW_EMAIL_PM', 'type' => 'radio:yes_no', 'explain' => false),
'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'type' => 'radio:yes_no', 'explain' => false),
'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'type' => 'radio:yes_no', 'explain' => false),
@@ -263,6 +262,7 @@ class acp_board
'load_db_track' => array('lang' => 'YES_POST_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
'load_db_lastread' => array('lang' => 'YES_READ_MARKING', 'type' => 'radio:yes_no', 'explain' => true),
'load_online' => array('lang' => 'YES_ONLINE', 'type' => 'radio:yes_no', 'explain' => true),
+ 'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'type' => 'radio:yes_no', 'explain' => true),
'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'type' => 'radio:yes_no', 'explain' => true),
'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'type' => 'radio:yes_no', 'explain' => false),
'load_moderators' => array('lang' => 'YES_MODERATORS', 'type' => 'radio:yes_no', 'explain' => false),
@@ -323,6 +323,7 @@ class acp_board
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'type' => 'text:3:3', 'explain' => true),
'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS','type' => 'text:3:3', 'explain' => true),
+ 'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'type' => 'radio:yes_no', 'explain' => true),
)
);
break;
@@ -339,7 +340,8 @@ class acp_board
'board_contact' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => true),
'board_email' => array('lang' => 'ADMIN_EMAIL', 'type' => 'text:25:100', 'explain' => true),
'board_email_sig' => array('lang' => 'EMAIL_SIG', 'type' => 'textarea:5:30', 'explain' => true),
-
+ 'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'type' => 'radio:yes_no', 'explain' => true),
+
'legend2' => 'SMTP_SETTINGS',
'smtp_delivery' => array('lang' => 'USE_SMTP', 'type' => 'radio:yes_no', 'explain' => true),
'smtp_host' => array('lang' => 'SMTP_SERVER', 'type' => 'text:25:50', 'explain' => false),
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index 070ac75bea..407bf554a5 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -18,7 +18,7 @@ class acp_bots
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$action = request_var('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
@@ -86,7 +86,7 @@ class acp_bots
}
$db->sql_freeresult($result);
- $db->sql_transaction();
+ $db->sql_transaction('begin');
$sql = 'DELETE FROM ' . BOTS_TABLE . "
WHERE bot_id $sql_id";
@@ -142,7 +142,7 @@ class acp_bots
if (!sizeof($error))
{
- $db->sql_transaction();
+ $db->sql_transaction('begin');
// New bot? Create a new user and group entry
if ($action == 'add')
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 7502cbe8be..fc38a5ed9d 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -18,7 +18,7 @@ class acp_database
function main($id, $mode)
{
global $db, $user, $auth, $template, $table_prefix;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/database');
diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php
index 53fde19048..3065b8cceb 100644
--- a/phpBB/includes/acp/acp_disallow.php
+++ b/phpBB/includes/acp/acp_disallow.php
@@ -18,7 +18,7 @@ class acp_disallow
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index 86ddd5ce56..2109011014 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -18,7 +18,7 @@ class acp_email
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$user->add_lang('acp/email');
$this->tpl_name = 'acp_email';
@@ -188,7 +188,7 @@ class acp_email
}
else
{
- $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . $phpbb_admin_path . "index.$phpEx$SID&amp;i=logs&amp;mode=critical" . '">', '</a>');
+ $message = sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=critical') . '">', '</a>');
}
trigger_error($message . adm_back_link($this->u_action));
}
@@ -215,7 +215,7 @@ class acp_email
'U_ACTION' => $this->u_action,
'S_GROUP_OPTIONS' => $select_list,
'USERNAMES' => $usernames,
- 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=acp_email&amp;field=usernames",
+ 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_email&amp;field=usernames'),
'SUBJECT' => $subject,
'MESSAGE' => $message,
'S_PRIORITY_OPTIONS' => $s_priority_options)
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index a9e9e727ce..d8d9aadeec 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -15,11 +15,11 @@ class acp_forums
{
var $u_action;
var $parent_id = 0;
-
+
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $SID;
+ global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
$user->add_lang('acp/forums');
$this->tpl_name = 'acp_forums';
@@ -136,7 +136,7 @@ class acp_forums
}
$errors = $this->update_forum_data($forum_data);
-
+
if (!sizeof($errors))
{
$forum_perm_from = request_var('forum_perm_from', 0);
@@ -147,7 +147,6 @@ class acp_forums
// From the mysql documentation:
// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
// Due to this we stay on the safe side if we do the insertion "the manual way"
-
// Copy permisisons from/to the acl users table (only forum_id gets changed)
$sql = 'SELECT user_id, auth_option_id, auth_role_id, auth_setting
@@ -225,12 +224,12 @@ class acp_forums
// Redirect to permissions
$message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED'];
- $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . $phpbb_admin_path . "index.$phpEx$SID&amp;i=permissions" . $acl_url . '">', '</a>');
+ $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
// redirect directly to permission settings screen
if ($action == 'add' && !$forum_perm_from)
{
- meta_refresh(4, $phpbb_admin_path . "index.$phpEx$SID&amp;i=permissions" . $acl_url);
+ meta_refresh(4, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url));
}
trigger_error($message . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
@@ -244,12 +243,12 @@ class acp_forums
{
case 'move_up':
case 'move_down':
-
+
if (!$forum_id)
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
-
+
$sql = 'SELECT parent_id, left_id, right_id
FROM ' . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
@@ -519,7 +518,7 @@ class acp_forums
$db->sql_freeresult($result);
$s_show_display_on_index = false;
-
+
if ($forum_data['parent_id'] > 0)
{
// if this forum is a subforum put the "display on index" checkbox
@@ -603,7 +602,7 @@ class acp_forums
{
trigger_error($user->lang['NO_FORUM'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
-
+
$forum_data = $this->get_forum_info($forum_id);
$subforums_id = array();
@@ -706,12 +705,13 @@ class acp_forums
default:
$folder_image = ($row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['SUBFORUM'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['FOLDER'] . '" />';
+ break;
}
}
$url = $this->u_action . "&amp;parent_id=$this->parent_id&amp;f={$row['forum_id']}";
-
- $forum_title = ($forum_type != FORUM_LINK) ? "<a href=\"admin_forums.$phpEx$SID&amp;parent_id=" . $row['forum_id'] . '">' : '';
+
+ $forum_title = ($forum_type != FORUM_LINK) ? '<a href="' . $this->u_action . '&amp;parent_id=' . $row['forum_id'] . '">' : '';
$forum_title .= $row['forum_name'];
$forum_title .= ($forum_type != FORUM_LINK) ? '</a>' : '';
@@ -721,17 +721,16 @@ class acp_forums
'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield']),
'FORUM_TOPICS' => $row['forum_topics'],
'FORUM_POSTS' => $row['forum_posts'],
-
+
'S_FORUM_LINK' => ($forum_type == FORUM_LINK) ? true : false,
'S_FORUM_POST' => ($forum_type == FORUM_POST) ? true : false,
-
+
'U_FORUM' => $this->u_action . '&amp;parent_id=' . $row['forum_id'],
'U_MOVE_UP' => $url . '&amp;action=move_up',
'U_MOVE_DOWN' => $url . '&amp;action=move_down',
'U_EDIT' => $url . '&amp;action=edit',
'U_DELETE' => $url . '&amp;action=delete',
- 'U_SYNC' => $url . '&amp;action=sync',
- )
+ 'U_SYNC' => $url . '&amp;action=sync')
);
}
while ($row = $db->sql_fetchrow($result));
@@ -759,7 +758,6 @@ class acp_forums
'U_SEL_ACTION' => $this->u_action,
'U_ACTION' => $this->u_action . '&amp;parent_id=' . $this->parent_id)
);
-
}
/**
@@ -778,7 +776,7 @@ class acp_forums
if (!$row)
{
- trigger_error("Forum #$forum_id does not exist");
+ trigger_error("Forum #$forum_id does not exist", E_USER_ERROR);
}
return $row;
@@ -792,7 +790,7 @@ class acp_forums
global $db, $user;
$errors = array();
-
+
if (!$forum_data['forum_name'])
{
$errors[] = $user->lang['FORUM_NAME_EMPTY'];
@@ -853,12 +851,13 @@ class acp_forums
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $forum_data['parent_id'];
$result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- if (!$row = $db->sql_fetchrow($result))
+ if (!$row)
{
trigger_error($user->lang['PARENT_NOT_EXIST'] . adm_back_link($this->u_action . '&amp;' . $this->parent_id));
}
- $db->sql_freeresult($result);
$sql = 'UPDATE ' . FORUMS_TABLE . '
SET left_id = left_id + 2, right_id = right_id + 2
@@ -878,7 +877,6 @@ class acp_forums
$sql = 'SELECT MAX(right_id) AS right_id
FROM ' . FORUMS_TABLE;
$result = $db->sql_query($sql);
-
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -890,7 +888,7 @@ class acp_forums
$db->sql_query($sql);
$forum_data['forum_id'] = $db->sql_nextid();
-
+
add_log('admin', 'LOG_FORUM_ADD', $forum_data['forum_name']);
}
else
@@ -929,19 +927,19 @@ class acp_forums
{
return $errors;
}
-
+
if ($row['parent_id'] != $forum_data['parent_id'])
{
$errors = $this->move_forum($forum_data['forum_id'], $forum_data['parent_id']);
}
-
+
if (sizeof($errors))
{
return $errors;
}
unset($forum_data['type_action']);
-
+
if ($row['forum_name'] != $forum_data['forum_name'])
{
// the forum name has changed, clear the parents list of child forums
@@ -1020,7 +1018,7 @@ class acp_forums
// Resync moved branch
$to_data['right_id'] += $diff;
-
+
if ($to_data['right_id'] > $from_data['right_id'])
{
$diff = '+ ' . ($to_data['right_id'] - $from_data['right_id'] - 1);
@@ -1036,7 +1034,6 @@ class acp_forums
FROM ' . FORUMS_TABLE . '
WHERE forum_id NOT IN (' . implode(', ', $moved_ids) . ')';
$result = $db->sql_query($sql);
-
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1057,7 +1054,7 @@ class acp_forums
global $db;
$table_ary = array(LOG_TABLE, POSTS_TABLE, TOPICS_TABLE, DRAFTS_TABLE, TOPICS_TRACK_TABLE);
-
+
foreach ($table_ary as $table)
{
$sql = "UPDATE $table
@@ -1078,8 +1075,7 @@ class acp_forums
if ($sync)
{
- // Delete ghost topics that link back to the same forum
- // then resync counters
+ // Delete ghost topics that link back to the same forum then resync counters
sync('topic_moved');
sync('forum', 'forum_id', $to_id);
}
@@ -1118,16 +1114,17 @@ class acp_forums
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $posts_to_id;
$result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- if (!$row = $db->sql_fetchrow($result))
+ if (!$row)
{
$errors[] = $user->lang['NO_FORUM'];
}
else
{
$posts_to_name = $row['forum_name'];
-
- $errors = array_merge($errors, $this->move_forum_content($forum_id, $subforums_to_id));
+ $errors = array_merge($errors, $this->move_forum_content($forum_id, $posts_to_id));
}
}
}
@@ -1175,8 +1172,10 @@ class acp_forums
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $subforums_to_id;
$result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- if (!$row = $db->sql_fetchrow($result))
+ if (!$row)
{
$errors[] = $user->lang['NO_FORUM'];
}
@@ -1238,12 +1237,16 @@ class acp_forums
// Delete forum ids from extension groups table
$sql = 'SELECT group_id, allowed_forums
- FROM ' . EXTENSION_GROUPS_TABLE . "
- WHERE allowed_forums <> ''";
+ FROM ' . EXTENSION_GROUPS_TABLE;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
+ if (!$row['allowed_forums'])
+ {
+ continue;
+ }
+
$allowed_forums = unserialize(trim($row['allowed_forums']));
$allowed_forums = array_diff($allowed_forums, $forum_ids);
@@ -1252,6 +1255,8 @@ class acp_forums
WHERE group_id = {$row['group_id']}";
$db->sql_query($sql);
}
+ $db->sql_freeresult($result);
+
$cache->destroy('_extensions');
$log_action = implode('_', array($log_action_posts, $log_action_forums));
@@ -1261,19 +1266,19 @@ class acp_forums
case 'MOVE_POSTS_MOVE_FORUMS':
add_log('admin', 'LOG_FORUM_DEL_MOVE_POSTS_MOVE_FORUMS', $posts_to_name, $subforums_to_name, $forum_data['forum_name']);
break;
-
+
case 'MOVE_POSTS_FORUMS':
add_log('admin', 'LOG_FORUM_DEL_MOVE_POSTS_FORUMS', $posts_to_name, $forum_data['forum_name']);
break;
-
+
case 'POSTS_MOVE_FORUMS':
add_log('admin', 'LOG_FORUM_DEL_POSTS_MOVE_FORUMS', $subforums_to_name, $forum_data['forum_name']);
break;
-
+
case '_MOVE_FORUMS':
add_log('admin', 'LOG_FORUM_DEL_MOVE_FORUMS', $subforums_to_name, $forum_data['forum_name']);
break;
-
+
case 'MOVE_POSTS_':
add_log('admin', 'LOG_FORUM_DEL_MOVE_POSTS', $posts_to_name, $forum_data['forum_name']);
break;
@@ -1281,11 +1286,11 @@ class acp_forums
case 'POSTS_FORUMS':
add_log('admin', 'LOG_FORUM_DEL_POSTS_FORUMS', $forum_data['forum_name']);
break;
-
+
case '_FORUMS':
add_log('admin', 'LOG_FORUM_DEL_FORUMS', $forum_data['forum_name']);
break;
-
+
case 'POSTS_':
add_log('admin', 'LOG_FORUM_DEL_POSTS', $forum_data['forum_name']);
break;
@@ -1316,14 +1321,14 @@ class acp_forums
AND a.in_message = 0
AND a.topic_id = p.topic_id";
$result = $db->sql_query($sql);
-
+
$topic_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$topic_ids[] = $row['topic_id'];
}
$db->sql_freeresult($result);
-
+
delete_attachments('topic', $topic_ids, false);
switch (SQL_LAYER)
@@ -1367,7 +1372,7 @@ class acp_forums
REPORTS_TABLE,
WARNINGS_TABLE,
),
-
+
'topic_id' => array(
BOOKMARKS_TABLE,
TOPICS_WATCH_TABLE,
@@ -1380,7 +1385,7 @@ class acp_forums
foreach ($tables_ary as $field => $tables)
{
$start = 0;
-
+
do
{
$sql = "SELECT $field
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 9a0aa1409d..a216a4d24f 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -18,7 +18,7 @@ class acp_groups
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
$user->add_lang('acp/groups');
$this->tpl_name = 'acp_groups';
@@ -473,7 +473,7 @@ class acp_groups
switch ($back_link)
{
case 'acp_users_groups':
- $u_back = $phpbb_admin_path . "index.$phpEx$SID&amp;i=users&amp;mode=groups&amp;u=" . request_var('u', 0);
+ $u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=groups&amp;u=' . request_var('u', 0));
break;
default:
@@ -523,8 +523,8 @@ class acp_groups
'GROUP_HIDDEN' => $type_hidden,
'U_BACK' => $u_back,
- 'U_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&amp;form=settings&amp;name=group_colour",
- 'UA_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=settings&name=group_colour",
+ 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&amp;name=group_colour'),
+ 'UA_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=settings&name=group_colour', false),
'U_ACTION' => "{$this->u_action}&amp;action=$action&amp;g=$group_id",
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),
)
@@ -607,13 +607,13 @@ class acp_groups
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
'U_BACK' => $this->u_action,
- 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=list&amp;field=usernames")
+ 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=list&amp;field=usernames'))
);
foreach ($group_data['leader'] as $row)
{
$template->assign_block_vars('leader', array(
- 'U_USER_EDIT' => $phpbb_admin_path . "index.$phpEx$SID&amp;i=users&amp;action=edit&amp;u={$row['user_id']}",
+ 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;action=edit&amp;u={$row['user_id']}"),
'USERNAME' => $row['username'],
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
@@ -637,7 +637,7 @@ class acp_groups
}
$template->assign_block_vars('member', array(
- 'U_USER_EDIT' => $phpbb_admin_path . "index.$phpEx$SID&amp;i=users&amp;action=edit&amp;u={$row['user_id']}",
+ 'U_USER_EDIT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;action=edit&amp;u={$row['user_id']}"),
'USERNAME' => $row['username'],
'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false,
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 69b37c2427..1f99793462 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -19,7 +19,7 @@ class acp_icons
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/posting');
@@ -374,6 +374,7 @@ class acp_icons
trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action));
}
+ // Stripslash here because it got addslashed before... (on export)
$img = stripslashes($data[1][0]);
$width = stripslashes($data[1][1]);
$height = stripslashes($data[1][2]);
diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php
index c62cede3df..2977859b2f 100644
--- a/phpBB/includes/acp/acp_jabber.php
+++ b/phpBB/includes/acp/acp_jabber.php
@@ -19,7 +19,7 @@ class acp_jabber
function main($id, $mode)
{
global $db, $user, $auth, $template;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/board');
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index 3a6ee380ac..2fbe2aec2f 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -24,7 +24,7 @@ class acp_language
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
global $safe_mode, $file_uploads;
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -702,9 +702,9 @@ class acp_language
$lang_pack = array(
'iso' => $lang_iso,
- 'name' => trim(htmlspecialchars(stripslashes($file[0]))),
- 'local_name'=> trim(htmlspecialchars(stripslashes($file[1]))),
- 'author' => trim(htmlspecialchars(stripslashes($file[2])))
+ 'name' => trim(htmlspecialchars($file[0])),
+ 'local_name'=> trim(htmlspecialchars($file[1])),
+ 'author' => trim(htmlspecialchars($file[2]))
);
unset($file);
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index 33a4ce13c2..038a3b0d3c 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -18,7 +18,7 @@ class acp_logs
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('mcp');
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 3cc00db36e..292d78973f 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -18,7 +18,7 @@ class acp_main
function main($id, $mode)
{
global $config, $db, $user, $auth, $template;
- global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
$action = request_var('action', '');
$mark = (isset($_REQUEST['mark'])) ? implode(', ', request_var('mark', array(0))) : '';
@@ -49,7 +49,7 @@ class acp_main
if ($action == 'activate')
{
- include($phpbb_root_path . 'includes/functions_user.php');
+ include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$mark_ary = explode(', ', $mark);
foreach ($mark_ary as $user_id)
@@ -424,7 +424,7 @@ class acp_main
'UPLOAD_DIR_SIZE' => $upload_dir_size,
'GZIP_COMPRESSION' => ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF'],
- 'U_ACTION' => "{$phpbb_admin_path}index.$phpEx$SID",
+ 'U_ACTION' => append_sid("{$phpbb_admin_path}index.$phpEx"),
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? $s_action_options : '',
)
@@ -462,7 +462,7 @@ class acp_main
'DATE' => $user->format_date($row['user_regdate']),
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
- 'U_USER_ADMIN' => "{$phpbb_admin_path}index.$phpEx$SID&amp;i=users&amp;mode=overview&amp;u={$row['user_id']}")
+ 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
);
}
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index ebb1245c22..f5c7d5fd55 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -29,7 +29,7 @@ class acp_modules
function main($id, $mode)
{
global $db, $user, $auth, $template;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $SID;
+ global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
// Set a global define for modules we might include (the author is able to prevent executing of code with this)
define('MODULE_INCLUDE', true);
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index c161f8c0f2..8022498f67 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -18,7 +18,7 @@ class acp_permission_roles
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 8aa17017cc..79f55a7dd2 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -19,7 +19,7 @@ class acp_permissions
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
@@ -304,7 +304,7 @@ class acp_permissions
$template->assign_vars(array(
'S_SELECT_USER' => true,
- 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=select_victim&amp;field=username")
+ 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_victim&amp;field=username'))
);
break;
@@ -435,7 +435,7 @@ class acp_permissions
'S_DEFINED_USER_OPTIONS' => $s_defined_user_options,
'S_DEFINED_GROUP_OPTIONS' => $s_defined_group_options,
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $defined_group_ids),
- 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=add_user&amp;field=username")
+ 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=add_user&amp;field=username'))
);
break;
diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php
index 55f1227c1d..44917bd8fc 100644
--- a/phpBB/includes/acp/acp_php_info.php
+++ b/phpBB/includes/acp/acp_php_info.php
@@ -18,7 +18,7 @@ class acp_php_info
function main($id, $mode)
{
global $db, $user, $auth, $template;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
if ($mode != 'info')
{
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 9ee89fcf35..4822e9158d 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -18,7 +18,7 @@ class acp_profile
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -1386,7 +1386,7 @@ class acp_profile
}
}
- $db->sql_transaction();
+ $db->sql_transaction('begin');
if ($action == 'create')
{
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index 2214a8c9bd..cb9cf02573 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -17,7 +17,7 @@ class acp_prune
function main($id, $mode)
{
- global $user, $phpEx, $SID, $phpbb_admin_path, $phpbb_root_path;
+ global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path;
$user->add_lang('acp/prune');
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -44,7 +44,7 @@ class acp_prune
function prune_forums($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$forum_id = request_var('f', array(0));
$submit = (isset($_POST['submit'])) ? true : false;
@@ -186,7 +186,7 @@ class acp_prune
function prune_users($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('memberlist');
@@ -359,7 +359,7 @@ class acp_prune
'S_JOINED_OPTIONS' => $s_find_join_time,
'S_ACTIVE_OPTIONS' => $s_find_active_time,
'S_COUNT_OPTIONS' => $s_find_count,
- 'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=acp_prune&amp;field=users")
+ 'U_FIND_USER' => append_sid($phpbb_root_path . "memberlist.$phpEx", 'mode=searchuser&amp;form=acp_prune&amp;field=users'))
);
}
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index 3978ed25ec..f5ec4bae30 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -18,7 +18,7 @@ class acp_ranks
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/posting');
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index 02e06e87f2..0867158eff 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -18,7 +18,7 @@ class acp_reasons
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang(array('mcp', 'acp/posting'));
diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php
index 8a601467dd..cafb3c795d 100644
--- a/phpBB/includes/acp/acp_search.php
+++ b/phpBB/includes/acp/acp_search.php
@@ -40,7 +40,7 @@ class acp_search
function settings($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$submit = (isset($_POST['submit'])) ? true : false;
@@ -148,7 +148,7 @@ class acp_search
{
add_log('admin', 'LOG_CONFIG_SEARCH');
}
- $extra_message = '<br />' . $user->lang['SWITCHED_SEARCH_BACKEND'] . "<br /><a href=\"{$phpbb_admin_path}index.$phpEx$SID&amp;i=search&amp;mode=index\">&raquo; " . $user->lang['GO_TO_SEARCH_INDEX'] . '</a>';
+ $extra_message = '<br />' . $user->lang['SWITCHED_SEARCH_BACKEND'] . '<br /><a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=search&amp;mode=index') . '">&raquo; ' . $user->lang['GO_TO_SEARCH_INDEX'] . '</a>';
}
else
{
@@ -197,7 +197,7 @@ class acp_search
function index($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
if (isset($_REQUEST['action']) && is_array($_REQUEST['action']))
{
@@ -258,7 +258,7 @@ class acp_search
if (method_exists($this->search, 'delete_index'))
{
// pass a reference to myself so the $search object can make use of save_state() and attributes
- if ($error = $this->search->delete_index($this, $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=delete"))
+ if ($error = $this->search->delete_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=delete", false)))
{
$this->state = array('');
$this->save_state();
@@ -293,7 +293,7 @@ class acp_search
if ($post_counter <= $this->max_post_id)
{
- redirect($phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=delete", 3);
+ redirect($this->u_action . '&amp;action=delete', 3);
}
}
@@ -309,7 +309,7 @@ class acp_search
if (method_exists($this->search, 'create_index'))
{
// pass a reference to myself so the $search object can make use of save_state() and attributes
- if ($error = $this->search->create_index($this, $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=create"))
+ if ($error = $this->search->create_index($this, append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=create", false)))
{
$this->state = array('');
$this->save_state();
@@ -337,7 +337,7 @@ class acp_search
if ($post_counter <= $this->max_post_id)
{
- redirect($phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=create", 3);
+ redirect($this->u_action . '&amp;action=create', 3);
}
}
@@ -415,15 +415,15 @@ class acp_search
$template->assign_vars(array(
'S_INDEX' => true,
'U_ACTION' => $this->u_action,
- 'U_PROGRESS_BAR' => $phpbb_admin_path . "index.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;action=progress_bar",
- 'UA_PROGRESS_BAR' => $phpbb_admin_path . "index.$phpEx$SID&i=$id&mode=$mode&action=progress_bar")
+ 'U_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;mode=$mode&amp;action=progress_bar"),
+ 'UA_PROGRESS_BAR' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=$mode&action=progress_bar", false))
);
if (isset($this->state[1]))
{
$template->assign_vars(array(
'S_CONTINUE_INDEXING' => $this->state[1],
- 'U_CONTINUE_INDEXING' => $phpbb_admin_path . "index.$phpEx$SID&amp;i=$id&amp;mode=$mode&amp;action=" . $this->state[1],
+ 'U_CONTINUE_INDEXING' => $this->u_action . '&amp;action=' . $this->state[1],
'L_CONTINUE' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING'] : $user->lang['CONTINUE_INDEX_DELETING'],
'L_CONTINUE_EXPLAIN' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING_EXPLAIN'] : $user->lang['CONTINUE_INDEX_DELETING_EXPLAIN'])
);
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index d0257dfed7..548cb743d8 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -24,7 +24,7 @@ class acp_styles
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
// Hardcoded template bitfield to add for new templates
define('TEMPLATE_BITFIELD', 6921);
@@ -332,7 +332,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
*/
function frontend($mode, $options)
{
- global $user, $template, $db, $config, $phpbb_root_path, $phpEx, $SID;
+ global $user, $template, $db, $config, $phpbb_root_path, $phpEx;
$sql_from = '';
$style_count = array();
@@ -414,7 +414,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
'U_STYLE_ACT_DEACT' => $this->u_action . '&amp;action=' . $stylevis . '&amp;id=' . $row[$mode . '_id'],
'L_STYLE_ACT_DEACT' => $user->lang['STYLE_' . strtoupper($stylevis)],
'S_OPTIONS' => implode(' | ', $s_options),
- 'U_PREVIEW' => ($mode == 'style') ? "{$phpbb_root_path}index.$phpEx$SID&amp;$mode=" . $row[$mode . '_id'] : '',
+ 'U_PREVIEW' => ($mode == 'style') ? append_sid("{$phpbb_root_path}index.$phpEx", "$mode=" . $row[$mode . '_id']) : '',
'NAME' => $row[$mode . '_name'],
'STYLE_COUNT' => ($mode == 'style' && isset($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : 0,
@@ -477,7 +477,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
*/
function edit_template($template_id)
{
- global $phpbb_root_path, $phpEx, $SID, $config, $db, $cache, $user, $template, $safe_mode;
+ global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template, $safe_mode;
$this->page_title = 'EDIT_TEMPLATE';
@@ -687,7 +687,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
*/
function template_cache($template_id)
{
- global $phpbb_root_path, $phpEx, $SID, $config, $db, $cache, $user, $template;
+ global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
$source = str_replace('/', '.', request_var('source', ''));
$file_ary = array_diff(request_var('delete', array('')), array(''));
@@ -811,7 +811,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
*/
function edit_theme($theme_id)
{
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $config, $db, $cache, $user, $template, $safe_mode;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $config, $db, $cache, $user, $template, $safe_mode;
$this->page_title = 'EDIT_THEME';
@@ -1214,8 +1214,8 @@ pagination_sep = \'{PAGINATION_SEP}\'
$template->assign_vars(array(
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),
- 'U_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&amp;form=acp_theme&amp;name=",
- 'UA_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=acp_theme&name=",
+ 'U_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=acp_theme') . '&amp;name=',
+ 'UA_SWATCH' => append_sid("{$phpbb_admin_path}swatch.$phpEx", 'form=acp_theme', false) . '&name=',
'CSS_DATA' => htmlspecialchars($css_data))
);
@@ -2350,7 +2350,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
*/
function install($mode)
{
- global $phpbb_root_path, $phpEx, $SID, $config, $db, $cache, $user, $template;
+ global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
$l_type = strtoupper($mode);
@@ -2498,7 +2498,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
*/
function add($mode)
{
- global $phpbb_root_path, $phpEx, $SID, $config, $db, $cache, $user, $template;
+ global $phpbb_root_path, $phpEx, $config, $db, $cache, $user, $template;
$l_type = strtoupper($mode);
$element_ary = array('template' => STYLES_TPL_TABLE, 'theme' => STYLES_CSS_TABLE, 'imageset' => STYLES_IMAGE_TABLE);
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 071996d192..8621f30324 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -18,7 +18,7 @@ class acp_users
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
$user->add_lang(array('posting', 'ucp', 'acp/users'));
$this->tpl_name = 'acp_users';
@@ -68,7 +68,7 @@ class acp_users
'ANONYMOUS_USER_ID' => ANONYMOUS,
'S_SELECT_USER' => true,
- 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=select_user&amp;field=username",
+ 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=select_user&amp;field=username'),
)
);
@@ -125,7 +125,7 @@ class acp_users
$template->assign_vars(array(
'U_BACK' => $this->u_action,
- 'U_MODE_SELECT' => "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;u=$user_id",
+ 'U_MODE_SELECT' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;u=$user_id"),
'U_ACTION' => $this->u_action . '&amp;u=' . $user_id,
'S_FORM_OPTIONS' => $s_form_options)
);
@@ -729,7 +729,7 @@ class acp_users
'U_SHOW_IP' => $this->u_action . "&amp;u=$user_id&amp;ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
'U_WHOIS' => $this->u_action . "&amp;action=whois&amp;user_ip={$user_row['user_ip']}",
- 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? "{$phpbb_root_path}ucp.$phpEx$SID&amp;mode=switch_perm&amp;u={$user_row['user_id']}" : '',
+ 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_row['user_id']}") : '',
'USER' => $user_row['username'],
'USER_REGISTERED' => $user->format_date($user_row['user_regdate']),
@@ -1494,7 +1494,7 @@ class acp_users
'S_SMILIES_CHECKED' => (!$enable_smilies) ? 'checked="checked"' : '',
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? 'checked="checked"' : '',
- 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . $phpbb_root_path . "faq.$phpEx$SID&amp;mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . "{$phpbb_root_path}faq.$phpEx$SID&amp;mode=bbcode" . '" onclick="target=\'_phpbbcode\';">', '</a>'),
+ 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '" onclick="target=\'_phpbbcode\';">', '</a>'),
'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
@@ -1596,11 +1596,11 @@ class acp_users
{
if ($row['in_message'])
{
- $view_topic = "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=pm&amp;p={$row['post_msg_id']}";
+ $view_topic = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;p={$row['post_msg_id']}");
}
else
{
- $view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;t={$row['topic_id']}&amp;p={$row['post_msg_id']}#{$row['post_msg_id']}";
+ $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&amp;p={$row['post_msg_id']}#{$row['post_msg_id']}");
}
$template->assign_block_vars('attach', array(
@@ -1618,7 +1618,7 @@ class acp_users
'S_IN_MESSAGE' => $row['in_message'],
- 'U_DOWNLOAD' => $phpbb_root_path . 'download.' . $phpEx . $SID . '&amp;id=' . $row['attach_id'],
+ 'U_DOWNLOAD' => append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $row['attach_id']),
'U_VIEW_TOPIC' => $view_topic)
);
}
@@ -1757,7 +1757,7 @@ class acp_users
foreach ($data_ary as $data)
{
$template->assign_block_vars('group', array(
- 'U_EDIT_GROUP' => "{$phpbb_admin_path}index.$phpEx$SID&amp;i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g=" . $data['group_id'] . '&amp;back_link=acp_users_groups',
+ 'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&amp;mode=manage&amp;action=edit&amp;u=$user_id&amp;g={$data['group_id']}&amp;back_link=acp_users_groups"),
'U_DEFAULT' => $this->u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_DEMOTE_PROMOTE' => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'],
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id'],
@@ -1819,8 +1819,8 @@ class acp_users
$template->assign_vars(array(
'S_PERMISSIONS' => true,
- 'U_USER_PERMISSIONS' => $phpbb_admin_path . 'index.' . $phpEx . $SID . '&amp;i=permissions&amp;mode=setting_user_global&amp;user_id[]=' . $user_id,
- 'U_USER_FORUM_PERMISSIONS' => $phpbb_admin_path . 'index.' . $phpEx . $SID . '&amp;i=permissions&amp;mode=setting_user_local&amp;user_id[]=' . $user_id)
+ 'U_USER_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx" ,'i=permissions&amp;mode=setting_user_global&amp;user_id[]=' . $user_id),
+ 'U_USER_FORUM_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions&amp;mode=setting_user_local&amp;user_id[]=' . $user_id))
);
break;
diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php
index ef75eedcba..155443f04b 100644
--- a/phpBB/includes/acp/acp_words.php
+++ b/phpBB/includes/acp/acp_words.php
@@ -19,7 +19,7 @@ class acp_words
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
- global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/posting');
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 7007c05104..3da19f5c0b 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -271,7 +271,7 @@ class auth_admin extends auth
*/
function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true)
{
- global $template, $user, $db, $phpbb_root_path, $phpEx, $SID;
+ global $template, $user, $db, $phpbb_root_path, $phpEx;
// Define names for template loops, might be able to be set
$tpl_pmask = 'p_mask';
@@ -570,7 +570,7 @@ class auth_admin extends auth
*/
function display_role_mask(&$hold_ary)
{
- global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID;
+ global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;
if (!sizeof($hold_ary))
{
@@ -610,7 +610,7 @@ class auth_admin extends auth
$template->assign_block_vars('role_mask.users', array(
'USER_ID' => $row['user_id'],
'USERNAME' => $row['username'],
- 'U_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u={$row['user_id']}")
+ 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=viewprofile&amp;u={$row['user_id']}"))
);
}
$db->sql_freeresult($result);
@@ -629,7 +629,7 @@ class auth_admin extends auth
$template->assign_block_vars('role_mask.groups', array(
'GROUP_ID' => $row['group_id'],
'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],
- 'U_PROFILE' => $phpbb_root_path . "memberlist.$phpEx$SID&amp;mode=group&amp;g={$row['group_id']}")
+ 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&amp;g={$row['group_id']}"))
);
}
$db->sql_freeresult($result);
@@ -1083,7 +1083,7 @@ class auth_admin extends auth
*/
function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false)
{
- global $template, $user, $phpbb_admin_path, $phpEx, $SID;
+ global $template, $user, $phpbb_admin_path, $phpEx;
foreach ($category_array as $cat => $cat_array)
{
@@ -1107,7 +1107,7 @@ class auth_admin extends auth
'FIELD_NAME' => $permission,
'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
- 'U_TRACE' => ($show_trace) ? "{$phpbb_admin_path}index.$phpEx$SID&amp;i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission" : '',
+ 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
);