aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/index.php10
-rw-r--r--phpBB/includes/acp/acp_attachments.php22
-rw-r--r--phpBB/includes/acp/acp_ban.php10
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php16
-rw-r--r--phpBB/includes/acp/acp_board.php7
-rw-r--r--phpBB/includes/acp/acp_bots.php26
-rw-r--r--phpBB/includes/acp/acp_disallow.php12
-rw-r--r--phpBB/includes/acp/acp_email.php10
-rw-r--r--phpBB/includes/acp/acp_forums.php4
-rw-r--r--phpBB/includes/acp/acp_groups.php54
-rw-r--r--phpBB/includes/acp/acp_icons.php40
-rw-r--r--phpBB/includes/acp/acp_jabber.php13
-rw-r--r--phpBB/includes/acp/acp_language.php57
-rw-r--r--phpBB/includes/acp/acp_logs.php8
-rw-r--r--phpBB/includes/acp/acp_main.php2
-rw-r--r--phpBB/includes/acp/acp_modules.php38
-rw-r--r--phpBB/includes/acp/acp_permissions.php3
-rw-r--r--phpBB/includes/acp/acp_php_info.php2
-rw-r--r--phpBB/includes/acp/acp_profile.php3
-rw-r--r--phpBB/includes/acp/acp_prune.php4
-rw-r--r--phpBB/includes/acp/acp_ranks.php22
-rw-r--r--phpBB/includes/acp/acp_styles.php2
-rw-r--r--phpBB/includes/acp/acp_users.php76
-rw-r--r--phpBB/includes/acp/acp_words.php24
-rw-r--r--phpBB/includes/acp/auth.php592
-rw-r--r--phpBB/includes/functions.php17
-rw-r--r--phpBB/includes/functions_module.php258
-rw-r--r--phpBB/install/schemas/schema_data.sql56
-rw-r--r--phpBB/viewforum.php6
29 files changed, 741 insertions, 653 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index d7260afe55..37f872dbdd 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -11,7 +11,6 @@
/**
*/
define('IN_PHPBB', 1);
-define('IN_ADMIN', true);
define('NEED_SID', true);
// Include files
@@ -47,19 +46,22 @@ if (!$auth->acl_get('a_'))
trigger_error($user->lang['NO_ADMIN']);
}
+// We define it now, because the user is now able to use the admin related features...
+define('IN_ADMIN', true);
+
// Some oft used variables
$safe_mode = (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on') ? true : false;
$file_uploads = (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on') ? true : false;
$module_id = request_var('i', '');
$mode = request_var('mode', '');
-// Force pagination seperation for admin style
-$user->theme['pagination_sep'] = '';
-
// Set custom template for admin area
$template->set_custom_template($phpbb_admin_path . 'style', 'admin');
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
+// Force pagination seperation for admin style
+$user->theme['pagination_sep'] = '';
+
// Instantiate new module
$module = new p_master();
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 5a220639eb..3871f921b6 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -13,13 +13,13 @@
*/
class acp_attachments
{
+ var $u_action;
+
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
global $config, $SID, $phpbb_admin_path, $phpbb_root_path, $phpEx;
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
-
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
$error = $notify = array();
@@ -54,7 +54,7 @@ class acp_attachments
$template->assign_vars(array(
'L_TITLE' => $user->lang[$l_title],
'L_TITLE_EXPLAIN' => $user->lang[$l_title . '_EXPLAIN'],
- 'U_ACTION' => $u_action,
+ 'U_ACTION' => $this->u_action,
)
);
@@ -125,7 +125,7 @@ class acp_attachments
if (!sizeof($error))
{
- trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($u_action));
+ trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
}
@@ -185,7 +185,7 @@ class acp_attachments
'LINK_WIDTH' => $new['img_link_width'],
'LINK_HEIGHT' => $new['img_link_height'],
- 'U_SEARCH_IMAGICK' => $u_action . '&action=imgmagick',
+ 'U_SEARCH_IMAGICK' => $this->u_action . '&action=imgmagick',
'S_QUOTA_SIZE_OPTIONS' => $s_quota_size_options,
'S_MAX_FILESIZE_OPTIONS' => $s_size_options,
@@ -537,7 +537,7 @@ class acp_attachments
$this->rewrite_extensions();
- trigger_error($user->lang['EXTENSION_GROUP_DELETED'] . adm_back_link($u_action));
+ trigger_error($user->lang['EXTENSION_GROUP_DELETED'] . adm_back_link($this->u_action));
}
else
{
@@ -556,7 +556,7 @@ class acp_attachments
if (!$group_id)
{
- trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($this->u_action));
}
$sql = 'SELECT * FROM ' . EXTENSION_GROUPS_TABLE . "
@@ -738,7 +738,7 @@ class acp_attachments
if (!$group_id)
{
- trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_EXTENSION_GROUP'] . adm_back_link($this->u_action));
}
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
@@ -765,9 +765,9 @@ class acp_attachments
$template->assign_block_vars('groups', array(
'S_ADD_SPACER' => $s_add_spacer,
- 'U_EDIT' => $u_action . "&action=edit&g={$row['group_id']}",
- 'U_DELETE' => $u_action . "&action=delete&g={$row['group_id']}",
- 'U_ACT_DEACT' => $u_action . "&action=$act_deact&g={$row['group_id']}",
+ 'U_EDIT' => $this->u_action . "&action=edit&g={$row['group_id']}",
+ 'U_DELETE' => $this->u_action . "&action=delete&g={$row['group_id']}",
+ 'U_ACT_DEACT' => $this->u_action . "&action=$act_deact&g={$row['group_id']}",
'L_ACT_DEACT' => $user->lang[strtoupper($act_deact)],
'GROUP_NAME' => $row['group_name'],
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index acef324c42..4c8a1a0dfc 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -13,6 +13,8 @@
*/
class acp_ban
{
+ var $u_action;
+
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
@@ -27,8 +29,6 @@ class acp_ban
$user->add_lang('acp/ban');
$this->tpl_name = 'acp_ban';
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
-
// Ban submitted?
if ($bansubmit)
{
@@ -42,7 +42,7 @@ class acp_ban
user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
- trigger_error($user->lang['BAN_UPDATE_SUCESSFUL'] . adm_back_link($u_action));
+ trigger_error($user->lang['BAN_UPDATE_SUCESSFUL'] . adm_back_link($this->u_action));
}
else if ($unbansubmit)
{
@@ -50,7 +50,7 @@ class acp_ban
user_unban($mode, $ban);
- trigger_error($user->lang['BAN_UPDATE_SUCESSFUL'] . adm_back_link($u_action));
+ trigger_error($user->lang['BAN_UPDATE_SUCESSFUL'] . adm_back_link($this->u_action));
}
// Ban length options
@@ -176,7 +176,7 @@ class acp_ban
'S_BANNED_OPTIONS' => ($banned_options) ? true : false,
'BANNED_OPTIONS' => $banned_options,
- 'U_ACTION' => $u_action,
+ 'U_ACTION' => $this->u_action,
'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_ban&field=ban",
)
);
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 9ddd925557..81ccd1daaa 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -13,6 +13,8 @@
*/
class acp_bbcodes
{
+ var $u_action;
+
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
@@ -27,8 +29,6 @@ class acp_bbcodes
$this->tpl_name = 'acp_bbcodes';
$this->page_title = 'ACP_BBCODES';
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
-
// Set up mode-specific vars
switch ($action)
{
@@ -80,8 +80,8 @@ class acp_bbcodes
$template->assign_vars(array(
'S_EDIT_BBCODE' => true,
- 'U_BACK' => $u_action,
- 'U_ACTION' => $u_action . '&action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&bbcode=$bbcode_id" : ''),
+ 'U_BACK' => $this->u_action,
+ 'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&bbcode=$bbcode_id" : ''),
'BBCODE_MATCH' => $bbcode_match,
'BBCODE_TPL' => $bbcode_tpl,
@@ -165,7 +165,7 @@ class acp_bbcodes
add_log('admin', $log_action, $data['bbcode_tag']);
- trigger_error($user->lang[$lang] . adm_back_link($u_action));
+ trigger_error($user->lang[$lang] . adm_back_link($this->u_action));
break;
@@ -186,7 +186,7 @@ class acp_bbcodes
}
$template->assign_vars(array(
- 'U_ACTION' => $u_action . '&mode=add')
+ 'U_ACTION' => $this->u_action . '&mode=add')
);
$sql = 'SELECT *
@@ -198,8 +198,8 @@ class acp_bbcodes
{
$template->assign_block_vars('bbcodes', array(
'BBCODE_TAG' => $row['bbcode_tag'],
- 'U_EDIT' => $u_action . '&action=edit&bbcode=' . $row['bbcode_id'],
- 'U_DELETE' => $u_action . '&action=delete&bbcode=' . $row['bbcode_id'])
+ 'U_EDIT' => $this->u_action . '&action=edit&bbcode=' . $row['bbcode_id'],
+ 'U_DELETE' => $this->u_action . '&action=delete&bbcode=' . $row['bbcode_id'])
);
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index fbcd0b0a03..46d55a5ef5 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -13,6 +13,7 @@
*/
class acp_board
{
+ var $u_action;
var $new_config = array();
function main($id, $mode)
@@ -255,8 +256,6 @@ class acp_board
trigger_error('NO_MODE');
}
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
-
if (isset($display_vars['lang']))
{
$user->add_lang($display_vars['lang']);
@@ -347,7 +346,7 @@ class acp_board
{
add_log('admin', 'LOG_CONFIG_' . strtoupper($mode));
- trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($u_action));
+ trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
$this->tpl_name = 'acp_board';
@@ -356,7 +355,7 @@ class acp_board
$template->assign_vars(array(
'L_TITLE' => $user->lang[$display_vars['title']],
'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'],
- 'U_ACTION' => $u_action)
+ 'U_ACTION' => $this->u_action)
);
// Output relevant page
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index 8ddc5016b2..0672c45dc2 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -13,6 +13,8 @@
*/
class acp_bots
{
+ var $u_action;
+
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
@@ -34,8 +36,6 @@ class acp_bots
$this->tpl_name = 'acp_bots';
$this->page_title = 'ACP_BOTS';
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
-
// User wants to do something, how inconsiderate of them!
switch ($action)
{
@@ -105,7 +105,7 @@ class acp_bots
$cache->destroy('bots');
add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary));
- trigger_error($user->lang['BOT_DELETED'] . adm_back_link($u_action));
+ trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action));
}
break;
@@ -157,7 +157,7 @@ class acp_bots
if (!$group_row)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action . "&id=$bot_id&action=$action"));
+ trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"));
}
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
@@ -202,7 +202,7 @@ class acp_bots
if (!$row)
{
- trigger_error($user->lang['NO_BOT'] . adm_back_link($u_action . "&id=$bot_id&action=$action"));
+ trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"));
}
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
@@ -227,7 +227,7 @@ class acp_bots
$cache->destroy('bots');
add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
- trigger_error($user->lang['BOT_' . $log] . adm_back_link($u_action . "&id=$bot_id&action=$action"));
+ trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"));
}
}
else if ($bot_id)
@@ -242,7 +242,7 @@ class acp_bots
if (!$bot_row)
{
- trigger_error($user->lang['NO_BOT'] . adm_back_link($u_action . "&id=$bot_id&action=$action"));
+ trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"));
}
$bot_row['bot_lang'] = $bot_row['user_lang'];
@@ -265,8 +265,8 @@ class acp_bots
$template->assign_vars(array(
'L_TITLE' => $user->lang['BOT_' . $l_title],
- 'U_ACTION' => $u_action . "&id=$bot_id&action=$action",
- 'U_BACK' => $u_action,
+ 'U_ACTION' => $this->u_action . "&id=$bot_id&action=$action",
+ 'U_BACK' => $this->u_action,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'BOT_NAME' => $bot_row['bot_name'],
@@ -294,7 +294,7 @@ class acp_bots
}
$template->assign_vars(array(
- 'U_ACTION' => $u_action,
+ 'U_ACTION' => $this->u_action,
'S_BOT_OPTIONS' => $s_options)
);
@@ -314,10 +314,10 @@ class acp_bots
'BOT_ID' => $row['bot_id'],
'LAST_VISIT' => ($row['user_lastvisit']) ? $user->format_date($row['user_lastvisit']) : $user->lang['BOT_NEVER'],
- 'U_ACTIVATE_DEACTIVATE' => $u_action . "&amp;id={$row['bot_id']}&amp;action=$active_value",
+ 'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&amp;id={$row['bot_id']}&amp;action=$active_value",
'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang],
- 'U_EDIT' => $u_action . "&amp;id={$row['bot_id']}&amp;action=edit",
- 'U_DELETE' => $u_action . "&amp;id={$row['bot_id']}&amp;action=delete")
+ 'U_EDIT' => $this->u_action . "&amp;id={$row['bot_id']}&amp;action=edit",
+ 'U_DELETE' => $this->u_action . "&amp;id={$row['bot_id']}&amp;action=delete")
);
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php
index 5d0e3fd787..2e02fb4e83 100644
--- a/phpBB/includes/acp/acp_disallow.php
+++ b/phpBB/includes/acp/acp_disallow.php
@@ -13,6 +13,8 @@
*/
class acp_disallow
{
+ var $u_action;
+
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
@@ -29,8 +31,6 @@ class acp_disallow
$disallow = (isset($_POST['disallow'])) ? true : false;
$allow = (isset($_POST['allow'])) ? true : false;
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
if ($disallow)
{
$disallowed_user = str_replace('*', '%', request_var('disallowed_user', ''));
@@ -45,7 +45,7 @@ class acp_disallow
add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user));
}
- trigger_error($message . adm_back_link($u_action));
+ trigger_error($message . adm_back_link($this->u_action));
}
else if ($allow)
{
@@ -53,7 +53,7 @@ class acp_disallow
if (!$disallowed_id)
{
- trigger_error($user->lang['NO_USER'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action));
}
$sql = 'DELETE FROM ' . DISALLOW_TABLE . "
@@ -62,7 +62,7 @@ class acp_disallow
add_log('admin', 'LOG_DISALLOW_DELETE');
- trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($u_action));
+ trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action));
}
// Grab the current list of disallowed usernames...
@@ -78,7 +78,7 @@ class acp_disallow
$db->sql_freeresult($result);
$template->assign_vars(array(
- 'U_ACTION' => $u_action,
+ 'U_ACTION' => $this->u_action,
'S_DISALLOWED_NAMES' => $disallow_select)
);
}
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index 597d8a1115..b870a451db 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -13,6 +13,8 @@
*/
class acp_email
{
+ var $u_action;
+
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
@@ -22,8 +24,6 @@ class acp_email
$this->tpl_name = 'acp_email';
$this->page_title = 'ACP_MASS_EMAIL';
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
// Set some vars
$submit = (isset($_POST['submit'])) ? true : false;
$error = array();
@@ -87,7 +87,7 @@ class acp_email
if (!($row = $db->sql_fetchrow($result)))
{
- trigger_error($user->lang['NO_USER'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action));
}
$db->sql_freeresult($result);
@@ -186,7 +186,7 @@ class acp_email
add_log('admin', 'LOG_MASS_EMAIL', $group_name);
$message = (!$errored) ? $user->lang['EMAIL_SENT'] : sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . $phpbb_admin_path . "index.$phpEx$SID&amp;i=logs&amp;mode=critical" . '">', '</a>');
- trigger_error($message . adm_back_link($u_action));
+ trigger_error($message . adm_back_link($this->u_action));
}
}
@@ -206,7 +206,7 @@ class acp_email
$template->assign_vars(array(
'S_WARNING' => (sizeof($error)) ? true : false,
'WARNING_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'U_ACTION' => $u_action,
+ '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",
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 1a28cd905c..a193808010 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -13,7 +13,7 @@
*/
class acp_forums
{
- var $u_action = '';
+ var $u_action;
var $parent_id = 0;
function main($id, $mode)
@@ -26,8 +26,6 @@ class acp_forums
$this->tpl_name = 'acp_forums';
$this->page_title = 'ACP_MANAGE_FORUMS';
- $this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
$action = request_var('action', '');
$update = (isset($_POST['update'])) ? true : false;
$forum_id = request_var('f', 0);
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index cfd1cb6c9b..5fa8d8b5fd 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -14,6 +14,8 @@
*/
class acp_groups
{
+ var $u_action;
+
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
@@ -23,8 +25,6 @@ class acp_groups
$this->tpl_name = 'acp_groups';
$this->page_title = 'ACP_GROUPS_MANAGE';
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
// Check and set some common vars
@@ -53,7 +53,7 @@ class acp_groups
if (!$group_row)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
}
}
@@ -65,7 +65,7 @@ class acp_groups
case 'promote':
if (!$group_id)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
}
// Approve, demote or promote
@@ -86,13 +86,13 @@ class acp_groups
break;
}
- trigger_error($user->lang[$message] . adm_back_link($u_action));
+ trigger_error($user->lang[$message] . adm_back_link($this->u_action));
break;
case 'default':
if (!$group_id)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
}
if (confirm_box(true))
@@ -135,7 +135,7 @@ class acp_groups
group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row);
}
- trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($u_action));
+ trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action));
}
else
{
@@ -156,7 +156,7 @@ class acp_groups
{
if (!$group_id)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
}
$error = '';
@@ -174,11 +174,11 @@ class acp_groups
if ($error)
{
- trigger_error($user->lang[$error] . adm_back_link($u_action));
+ trigger_error($user->lang[$error] . adm_back_link($this->u_action));
}
$message = ($action == 'delete') ? 'GROUP_DELETED' : 'GROUP_USERS_REMOVE';
- trigger_error($user->lang[$message] . adm_back_link($u_action));
+ trigger_error($user->lang[$message] . adm_back_link($this->u_action));
}
else
{
@@ -195,12 +195,12 @@ class acp_groups
case 'addusers':
if (!$group_id)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
}
if (!$name_ary)
{
- trigger_error($user->lang['NO_USERS'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action));
}
$name_ary = array_unique(explode("\n", $name_ary));
@@ -208,11 +208,11 @@ class acp_groups
// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_row['group_name'], $default, $leader, 0, $group_row))
{
- trigger_error($user->lang[$error] . adm_back_link($u_action));
+ trigger_error($user->lang[$error] . adm_back_link($this->u_action));
}
$message = ($action == 'addleaders') ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED';
- trigger_error($user->lang[$message] . adm_back_link($u_action));
+ trigger_error($user->lang[$message] . adm_back_link($this->u_action));
break;
case 'edit':
@@ -222,7 +222,7 @@ class acp_groups
if ($action == 'edit' && !$group_id)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
}
$error = array();
@@ -318,7 +318,7 @@ class acp_groups
if (!($error = group_create($group_id, $group_type, $group_name, $group_description, $group_attributes)))
{
$message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED';
- trigger_error($user->lang[$message] . adm_back_link($u_action));
+ trigger_error($user->lang[$message] . adm_back_link($this->u_action));
}
}
else if (!$group_id)
@@ -392,7 +392,7 @@ class acp_groups
break;
default:
- $u_back = $u_action;
+ $u_back = $this->u_action;
break;
}
@@ -432,7 +432,7 @@ class acp_groups
'U_BACK' => $u_back,
'U_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=settings&name=group_colour",
- 'U_ACTION' => "{$u_action}&amp;action=$action&amp;g=$group_id",
+ '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)),
)
);
@@ -444,7 +444,7 @@ class acp_groups
if (!$group_id)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action));
}
$this->page_title = 'GROUP_MEMBERS';
@@ -509,10 +509,10 @@ class acp_groups
'S_ACTION_OPTIONS' => $s_action_options,
'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination($u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start, true),
+ 'PAGINATION' => generate_pagination($this->u_action . "&amp;action=$action&amp;g=$group_id", $total_members, $config['topics_per_page'], $start, true),
- 'U_ACTION' => $u_action . "&amp;g=$group_id",
- 'U_BACK' => $u_action,
+ '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")
);
@@ -561,7 +561,7 @@ class acp_groups
}
$template->assign_vars(array(
- 'U_ACTION' => $u_action,
+ 'U_ACTION' => $this->u_action,
)
);
@@ -606,10 +606,10 @@ class acp_groups
$group_name = (!empty($user->lang['G_' . $row['group_name']]))? $user->lang['G_' . $row['group_name']] : $row['group_name'];
$template->assign_block_vars('groups', array(
- 'U_LIST' => "{$u_action}&amp;action=list&amp;g=$group_id",
- 'U_DEFAULT' => "{$u_action}&amp;action=default&amp;g=$group_id",
- 'U_EDIT' => "{$u_action}&amp;action=edit&amp;g=$group_id",
- 'U_DELETE' => "{$u_action}&amp;action=delete&amp;g=$group_id",
+ 'U_LIST' => "{$this->u_action}&amp;action=list&amp;g=$group_id",
+ 'U_DEFAULT' => "{$this->u_action}&amp;action=default&amp;g=$group_id",
+ 'U_EDIT' => "{$this->u_action}&amp;action=edit&amp;g=$group_id",
+ 'U_DELETE' => "{$this->u_action}&amp;action=delete&amp;g=$group_id",
'S_GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL) ? true : false,
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index b4cd830870..dd581475f2 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -14,6 +14,8 @@
*/
class acp_icons
{
+ var $u_action;
+
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
@@ -29,8 +31,6 @@ class acp_icons
$this->tpl_name = 'acp_icons';
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
// What are we working on?
switch ($mode)
{
@@ -170,8 +170,8 @@ class acp_icons
'COLSPAN' => $colspan,
'ID' => $icon_id,
- 'U_BACK' => $u_action,
- 'U_ACTION' => $u_action . '&amp;action=' . (($action == 'add') ? 'create' : 'modify'),
+ 'U_BACK' => $this->u_action,
+ 'U_ACTION' => $this->u_action . '&amp;action=' . (($action == 'add') ? 'create' : 'modify'),
)
);
@@ -306,11 +306,11 @@ class acp_icons
if ($action == 'modify')
{
- trigger_error($user->lang[$lang . '_EDITED'] . adm_back_link($u_action));
+ trigger_error($user->lang[$lang . '_EDITED'] . adm_back_link($this->u_action));
}
else
{
- trigger_error($user->lang[$lang . '_ADDED'] . adm_back_link($u_action));
+ trigger_error($user->lang[$lang . '_ADDED'] . adm_back_link($this->u_action));
}
break;
@@ -358,7 +358,7 @@ class acp_icons
if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak)))
{
- trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($u_action));
+ trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action));
}
foreach ($pak_ary as $pak_entry)
@@ -369,7 +369,7 @@ class acp_icons
if ((sizeof($data[1]) != 3 && $mode == 'icons') ||
(sizeof($data[1]) != 5 && $mode == 'smilies'))
{
- trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($u_action));
+ trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action));
}
$img = stripslashes($data[1][0]);
@@ -427,7 +427,7 @@ class acp_icons
}
$cache->destroy('icons');
- trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($u_action));
+ trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action));
}
else
{
@@ -450,8 +450,8 @@ class acp_icons
'L_CURRENT_EXPLAIN' => $user->lang['CURRENT_' . $lang . '_EXPLAIN'],
'L_IMPORT_SUBMIT' => $user->lang['IMPORT_' . $lang],
- 'U_BACK' => $u_action,
- 'U_ACTION' => $u_action . '&amp;action=import',
+ 'U_BACK' => $this->u_action,
+ 'U_ACTION' => $this->u_action . '&amp;action=import',
)
);
}
@@ -464,7 +464,7 @@ class acp_icons
$template->assign_vars(array(
'MESSAGE_TITLE' => $user->lang['EXPORT_' . $lang],
- 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $u_action . '&amp;action=send">', '</a>'))
+ 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $this->u_action . '&amp;action=send">', '</a>'))
);
return;
@@ -509,7 +509,7 @@ class acp_icons
}
else
{
- trigger_error($user->lang['NO_' . $fields . '_EXPORT'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_' . $fields . '_EXPORT'] . adm_back_link($this->u_action));
}
break;
@@ -594,9 +594,9 @@ class acp_icons
'S_SMILIES' => ($mode == 'smilies') ? true : false,
- 'U_ACTION' => $u_action,
- 'U_IMPORT' => $u_action . '&amp;action=import',
- 'U_EXPORT' => $u_action . '&amp;action=export',
+ 'U_ACTION' => $this->u_action,
+ 'U_IMPORT' => $this->u_action . '&amp;action=import',
+ 'U_EXPORT' => $this->u_action . '&amp;action=export',
)
);
@@ -619,10 +619,10 @@ class acp_icons
'HEIGHT' => $row[$fields . '_height'],
'CODE' => (isset($row['code'])) ? $row['code'] : '',
'EMOTION' => (isset($row['emotion'])) ? $row['emotion'] : '',
- 'U_EDIT' => $u_action . '&amp;action=edit&amp;id=' . $row[$fields . '_id'],
- 'U_DELETE' => $u_action . '&amp;action=delete&amp;id=' . $row[$fields . '_id'],
- 'U_MOVE_UP' => $u_action . '&amp;action=move_up&amp;order=' . $row[$fields . '_order'],
- 'U_MOVE_DOWN' => $u_action . '&amp;action=move_down&amp;order=' . $row[$fields . '_order'])
+ 'U_EDIT' => $this->u_action . '&amp;action=edit&amp;id=' . $row[$fields . '_id'],
+ 'U_DELETE' => $this->u_action . '&amp;action=delete&amp;id=' . $row[$fields . '_id'],
+ 'U_MOVE_UP' => $this->u_action . '&amp;action=move_up&amp;order=' . $row[$fields . '_order'],
+ 'U_MOVE_DOWN' => $this->u_action . '&amp;action=move_down&amp;order=' . $row[$fields . '_order'])
);
if (!$spacer && !$row['display_on_posting'])
diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php
index 58e88f5020..2b974028a6 100644
--- a/phpBB/includes/acp/acp_jabber.php
+++ b/phpBB/includes/acp/acp_jabber.php
@@ -14,6 +14,8 @@
*/
class acp_jabber
{
+ var $u_action;
+
function main($id, $mode)
{
global $db, $user, $auth, $template;
@@ -31,7 +33,6 @@ class acp_jabber
return;
}
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
$this->tpl_name = 'acp_jabber';
$this->page_title = 'ACP_JABBER_SETTINGS';
@@ -63,7 +64,7 @@ class acp_jabber
{
if (!$jabber->Connect())
{
- trigger_error('Could not connect to Jabber server' . adm_back_link($u_action));
+ trigger_error('Could not connect to Jabber server' . adm_back_link($this->u_action));
}
// First we'll try to authorise using this account, if that fails we'll
@@ -93,12 +94,12 @@ class acp_jabber
{
if (!$jabber->Connect())
{
- trigger_error('Could not connect to Jabber server' . adm_back_link($u_action));
+ trigger_error('Could not connect to Jabber server' . adm_back_link($this->u_action));
}
if (!$jabber->SendAuth())
{
- trigger_error('Could not authorise on Jabber server' . adm_back_link($u_action));
+ trigger_error('Could not authorise on Jabber server' . adm_back_link($this->u_action));
}
$jabber->SendPresence(NULL, NULL, 'online');
@@ -140,7 +141,7 @@ class acp_jabber
if ($submit && !sizeof($error))
{
add_log('admin', 'LOG_' . $log);
- trigger_error($message . adm_back_link($u_action));
+ trigger_error($message . adm_back_link($this->u_action));
}
if (sizeof($error))
@@ -152,7 +153,7 @@ class acp_jabber
}
$template->assign_vars(array(
- 'U_ACTION' => $u_action,
+ 'U_ACTION' => $this->u_action,
'JAB_ENABLE' => $new['jab_enable'],
'L_JAB_SERVER_EXPLAIN' => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '<a href="http://www.jabber.org/user/publicservers.php" rel="external">', '</a>'),
'JAB_HOST' => $new['jab_host'],
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index 414c313b21..b0a52eb64d 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -13,6 +13,7 @@
*/
class acp_language
{
+ var $u_action;
var $main_files;
var $language_header = '';
var $lang_header = '';
@@ -54,15 +55,13 @@ class acp_language
$this->tpl_name = 'acp_language';
$this->page_title = 'ACP_LANGUAGE_PACKS';
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
switch ($action)
{
case 'update_details':
if (!$lang_id)
{
- trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
}
$sql = 'SELECT * FROM ' . LANG_TABLE . "
@@ -83,7 +82,7 @@ class acp_language
add_log('admin', 'LOG_LANGUAGE_PACK_UPDATED', $sql_ary['lang_english_name']);
- trigger_error($user->lang['LANGUAGE_DETAILS_UPDATED'] . adm_back_link($u_action));
+ trigger_error($user->lang['LANGUAGE_DETAILS_UPDATED'] . adm_back_link($this->u_action));
break;
case 'submit_file':
@@ -91,12 +90,12 @@ class acp_language
if (!$lang_id || !isset($_POST['entry']) || !is_array($_POST['entry']))
{
- trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
}
if (!$this->language_file || (!$this->language_directory && !in_array($this->language_file, $this->main_files)))
{
- trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_FILE_SELECTED'] . adm_back_link($this->u_action));
}
$sql = 'SELECT * FROM ' . LANG_TABLE . "
@@ -235,7 +234,7 @@ class acp_language
if (!$lang_id)
{
- trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
}
$this->page_title = 'LANGUAGE_PACK_DETAILS';
@@ -267,28 +266,28 @@ class acp_language
case 'email':
if (!in_array($this->language_file, $email_files))
{
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($u_action . '&amp;action=details&amp;id=' . $lang_id));
+ trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
}
break;
case 'acp':
if (!in_array($this->language_file, $acp_files))
{
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($u_action . '&amp;action=details&amp;id=' . $lang_id));
+ trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
}
break;
case 'mods':
if (!in_array($this->language_file, $mods_files))
{
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($u_action . '&amp;action=details&amp;id=' . $lang_id));
+ trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
}
break;
default:
if (!in_array($this->language_file, $this->main_files))
{
- trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($u_action . '&amp;action=details&amp;id=' . $lang_id));
+ trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&amp;action=details&amp;id=' . $lang_id));
}
}
@@ -300,8 +299,8 @@ class acp_language
$template->assign_vars(array(
'S_DETAILS' => true,
- 'U_ACTION' => $u_action . "&amp;action=details&amp;id=$lang_id",
- 'U_BACK' => $u_action,
+ 'U_ACTION' => $this->u_action . "&amp;action=details&amp;id=$lang_id",
+ 'U_BACK' => $this->u_action,
'LANG_LOCAL_NAME' => $lang_entries['lang_local_name'],
'LANG_ENGLISH_NAME' => $lang_entries['lang_english_name'],
'LANG_ISO' => $lang_entries['lang_iso'],
@@ -392,7 +391,7 @@ class acp_language
$template->assign_vars(array(
'S_MISSING_VARS' => true,
'L_MISSING_VARS_EXPLAIN' => sprintf($user->lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']),
- 'U_MISSING_ACTION' => $u_action . "&amp;action=$action&amp;id=$lang_id")
+ 'U_MISSING_ACTION' => $this->u_action . "&amp;action=$action&amp;id=$lang_id")
);
foreach ($missing_vars as $file => $vars)
@@ -496,7 +495,7 @@ class acp_language
// Normal language pack entries
$template->assign_vars(array(
- 'U_ENTRY_ACTION' => $u_action . "&amp;action=details&amp;id=$lang_id#entries",
+ 'U_ENTRY_ACTION' => $this->u_action . "&amp;action=details&amp;id=$lang_id#entries",
'S_EMAIL_FILE' => $is_email_file,
'S_FROM_STORE' => $file_from_store,
'S_LANG_OPTIONS' => $s_lang_options,
@@ -536,7 +535,7 @@ class acp_language
if (!$lang_id)
{
- trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
}
$sql = 'SELECT * FROM ' . LANG_TABLE . '
@@ -547,7 +546,7 @@ class acp_language
if ($row['lang_iso'] == $config['default_lang'])
{
- trigger_error($user->lang['NO_REMOVE_DEFAULT_LANG'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_REMOVE_DEFAULT_LANG'] . adm_back_link($this->u_action));
}
$db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id);
@@ -559,7 +558,7 @@ class acp_language
add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']);
- trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($u_action));
+ trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action));
break;
case 'install':
@@ -568,7 +567,7 @@ class acp_language
if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt"))
{
- trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($u_action));
+ trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action));
}
$file = file("{$phpbb_root_path}language/$lang_iso/iso.txt");
@@ -587,13 +586,13 @@ class acp_language
if ($row = $db->sql_fetchrow($result))
{
- trigger_error($user->lang['LANGUAGE_PACK_ALREADY_INSTALLED'] . adm_back_link($u_action));
+ trigger_error($user->lang['LANGUAGE_PACK_ALREADY_INSTALLED'] . adm_back_link($this->u_action));
}
$db->sql_freeresult($result);
if (!$lang_pack['name'] || !$lang_pack['local_name'])
{
- trigger_error($user->lang['INVALID_LANGUAGE_PACK'] . adm_back_link($u_action));
+ trigger_error($user->lang['INVALID_LANGUAGE_PACK'] . adm_back_link($this->u_action));
}
// Add language pack
@@ -609,7 +608,7 @@ class acp_language
add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']);
- trigger_error(sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']) . adm_back_link($u_action));
+ trigger_error(sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']) . adm_back_link($this->u_action));
break;
@@ -617,7 +616,7 @@ class acp_language
if (!$lang_id)
{
- trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
}
$sql = 'SELECT * FROM ' . LANG_TABLE . '
@@ -653,8 +652,8 @@ class acp_language
$template->assign_vars(array(
'S_SELECT_METHOD' => true,
- 'U_BACK' => $u_action,
- 'U_ACTION' => $u_action . "&amp;action=$action&amp;id=$lang_id",
+ 'U_BACK' => $this->u_action,
+ 'U_ACTION' => $this->u_action . "&amp;action=$action&amp;id=$lang_id",
'RADIO_BUTTONS' => $radio_buttons)
);
@@ -747,9 +746,9 @@ class acp_language
$tagstyle = ($row['lang_iso'] == $config['default_lang']) ? '*' : '';
$template->assign_block_vars('lang', array(
- 'U_DETAILS' => $u_action . "&amp;action=details&amp;id={$row['lang_id']}",
- 'U_DOWNLOAD' => $u_action . "&amp;action=download&amp;id={$row['lang_id']}",
- 'U_DELETE' => $u_action . "&amp;action=delete&amp;id={$row['lang_id']}",
+ 'U_DETAILS' => $this->u_action . "&amp;action=details&amp;id={$row['lang_id']}",
+ 'U_DOWNLOAD' => $this->u_action . "&amp;action=download&amp;id={$row['lang_id']}",
+ 'U_DELETE' => $this->u_action . "&amp;action=delete&amp;id={$row['lang_id']}",
'ENGLISH_NAME' => $row['lang_english_name'],
'TAG' => $tagstyle,
@@ -797,7 +796,7 @@ class acp_language
'ISO' => $lang_ary['iso'],
'LOCAL_NAME' => $lang_ary['local_name'],
'NAME' => $lang_ary['name'],
- 'U_INSTALL' => $u_action . '&amp;action=install&amp;iso=' . urlencode($lang_ary['iso']))
+ 'U_INSTALL' => $this->u_action . '&amp;action=install&amp;iso=' . urlencode($lang_ary['iso']))
);
}
}
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index 0bf02970d0..0133c2a87d 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -13,6 +13,8 @@
*/
class acp_logs
{
+ var $u_action;
+
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
@@ -36,8 +38,6 @@ class acp_logs
$this->tpl_name = 'acp_logs';
$this->log_type = constant('LOG_' . strtoupper($mode));
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
// Delete entries if requested and able
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
{
@@ -100,10 +100,10 @@ class acp_logs
$template->assign_vars(array(
'L_TITLE' => $l_title,
'L_EXPLAIN' => $l_title_explain,
- 'U_ACTION' => $u_action,
+ 'U_ACTION' => $this->u_action,
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination($u_action . "&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
+ 'PAGINATION' => generate_pagination($this->u_action . "&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 3631272e75..a73a83e1bb 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -13,6 +13,8 @@
*/
class acp_main
{
+ var $u_action;
+
function main($id, $mode)
{
global $config, $db, $user, $auth, $template;
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index ba366c6982..39239d8901 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -24,6 +24,7 @@
class acp_modules
{
var $module_class = '';
+ var $u_action;
function main($id, $mode)
{
@@ -51,7 +52,6 @@ class acp_modules
$this->page_title = strtoupper($this->module_class);
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
$parent_id = request_var('parent_id', 0);
$module_id = request_var('m', 0);
$action = request_var('action', '');
@@ -62,7 +62,7 @@ class acp_modules
case 'delete':
if (!$module_id)
{
- trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($u_action . '&amp;parent_id=' . $parent_id));
+ trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
}
if (confirm_box(true))
@@ -72,7 +72,7 @@ class acp_modules
if (!sizeof($errors))
{
$this->remove_cache_file();
- trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($u_action . '&amp;parent_id=' . $parent_id));
+ trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
}
}
else
@@ -92,7 +92,7 @@ class acp_modules
case 'disable':
if (!$module_id)
{
- trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($u_action . '&amp;parent_id=' . $parent_id));
+ trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
}
$sql = 'UPDATE ' . MODULES_TABLE . '
@@ -109,7 +109,7 @@ class acp_modules
case 'move_down':
if (!$module_id)
{
- trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($u_action . '&amp;parent_id=' . $parent_id));
+ trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
}
$sql = 'SELECT parent_id, left_id, right_id, module_langname
@@ -120,7 +120,7 @@ class acp_modules
if (!($row = $db->sql_fetchrow($result)))
{
- trigger_error($user->lang['NO_MODULE'] . adm_back_link($u_action . '&amp;parent_id=' . $parent_id));
+ trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
}
$db->sql_freeresult($result);
@@ -251,7 +251,7 @@ class acp_modules
recalc_btree('module_id', MODULES_TABLE, $this->module_class);
$this->remove_cache_file();
- trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($u_action . '&amp;parent_id=' . $parent_id));
+ trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
}
}
}
@@ -272,7 +272,7 @@ class acp_modules
if (!$module_id)
{
- trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($u_action . '&amp;parent_id=' . $parent_id));
+ trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
}
$module_row = $this->get_module_row($module_id);
@@ -310,7 +310,7 @@ class acp_modules
{
if (!$module_data['module_langname'])
{
- trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($u_action . '&amp;parent_id=' . $parent_id));
+ trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
}
$module_type = request_var('module_type', 'category');
@@ -341,7 +341,7 @@ class acp_modules
recalc_btree('module_id', MODULES_TABLE, $this->module_class);
$this->remove_cache_file();
- trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($u_action . '&amp;parent_id=' . $parent_id));
+ trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&amp;parent_id=' . $parent_id));
}
}
@@ -388,8 +388,8 @@ class acp_modules
'S_CAT_OPTIONS' => $s_cat_option . $this->make_module_select($module_data['parent_id'], ($action == 'edit') ? $module_row['module_id'] : false, false, false, false, true),
'S_MODULE_NAMES' => $s_name_options,
'S_MODULE_MODES' => $s_mode_options,
- 'U_BACK' => $u_action . '&amp;parent_id=' . $parent_id,
- 'U_EDIT_ACTION' => $u_action . '&amp;parent_id=' . $parent_id,
+ 'U_BACK' => $this->u_action . '&amp;parent_id=' . $parent_id,
+ 'U_EDIT_ACTION' => $this->u_action . '&amp;parent_id=' . $parent_id,
'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'],
@@ -429,7 +429,7 @@ class acp_modules
}
else
{
- $navigation = '<a href="' . $u_action . '">' . strtoupper($this->module_class) . '</a>';
+ $navigation = '<a href="' . $this->u_action . '">' . strtoupper($this->module_class) . '</a>';
$modules_nav = $this->get_module_branch($parent_id, 'parents', 'descending');
foreach ($modules_nav as $row)
@@ -442,7 +442,7 @@ class acp_modules
}
else
{
- $navigation .= ' -&gt; <a href="' . $u_action . '&amp;parent_id=' . $row['module_id'] . '">' . $langname . '</a>';
+ $navigation .= ' -&gt; <a href="' . $this->u_action . '&amp;parent_id=' . $row['module_id'] . '">' . $langname . '</a>';
}
}
}
@@ -472,7 +472,7 @@ class acp_modules
$module_image = (!$row['module_name'] || $row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" width="46" height="25" alt="' . $user->lang['CATEGORY'] . '" />' : '<img src="images/icon_folder.gif" width="46" height="25" alt="' . $user->lang['MODULE'] . '" />';
}
- $url = $u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
+ $url = $this->u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
$template->assign_block_vars('modules', array(
'MODULE_IMAGE' => $module_image,
@@ -480,7 +480,7 @@ class acp_modules
'MODULE_ENABLED' => ($row['module_enabled']) ? true : false,
'MODULE_DISPLAYED' => ($row['module_display']) ? true : false,
- 'U_MODULE' => $u_action . '&amp;parent_id=' . $row['module_id'],
+ 'U_MODULE' => $this->u_action . '&amp;parent_id=' . $row['module_id'],
'U_MOVE_UP' => $url . '&amp;action=move_up',
'U_MOVE_DOWN' => $url . '&amp;action=move_down',
'U_EDIT' => $url . '&amp;action=edit',
@@ -495,7 +495,7 @@ class acp_modules
{
$row = $this->get_module_row($parent_id);
- $url = $u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
+ $url = $this->u_action . '&amp;parent_id=' . $parent_id . '&amp;m=' . $row['module_id'];
$template->assign_vars(array(
'S_NO_MODULES' => true,
@@ -528,8 +528,8 @@ class acp_modules
}
$template->assign_vars(array(
- 'U_SEL_ACTION' => $u_action,
- 'U_ACTION' => $u_action . '&amp;parent_id=' . $parent_id,
+ 'U_SEL_ACTION' => $this->u_action,
+ 'U_ACTION' => $this->u_action . '&amp;parent_id=' . $parent_id,
'NAVIGATION' => $navigation,
'MODULE_BOX' => $module_box,
'PARENT_ID' => $parent_id,
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 103c226611..f47133c7b9 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -30,7 +30,6 @@ class acp_permissions
$user->add_lang('acp/permissions_phpbb');
$this->tpl_name = 'acp_permissions';
- $this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
// Set some vars
$action = request_var('action', array('' => 0));
@@ -577,7 +576,7 @@ class acp_permissions
*/
function remove_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id, &$forum_id)
{
- global $user, $db;
+ global $user, $db, $auth;
// User or group to be set?
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php
index 87d74b8f3a..05779cec1c 100644
--- a/phpBB/includes/acp/acp_php_info.php
+++ b/phpBB/includes/acp/acp_php_info.php
@@ -13,6 +13,8 @@
*/
class acp_php_info
{
+ var $u_action;
+
function main($id, $mode)
{
global $db, $user, $auth, $template;
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 495f958481..6e19c0d09c 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -13,7 +13,7 @@
*/
class acp_profile
{
- var $u_action = '';
+ var $u_action;
function main($id, $mode)
{
@@ -30,7 +30,6 @@ class acp_profile
$action = (isset($_POST['create'])) ? 'create' : request_var('action', '');
- $this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
$error = array();
$s_hidden_fields = '';
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index 532380aa66..f5972da0e9 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -13,7 +13,7 @@
*/
class acp_prune
{
- var $u_action = '';
+ var $u_action;
function main($id, $mode)
{
@@ -21,8 +21,6 @@ class acp_prune
$user->add_lang('acp/prune');
- $this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
switch ($mode)
{
case 'forums':
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index 66c899d290..3e36f10af1 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -13,6 +13,8 @@
*/
class acp_ranks
{
+ var $u_action;
+
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
@@ -29,8 +31,6 @@ class acp_ranks
$this->tpl_name = 'acp_ranks';
$this->page_title = 'ACP_MANAGE_RANKS';
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
switch ($action)
{
case 'save':
@@ -48,7 +48,7 @@ class acp_ranks
if (!$rank_title)
{
- trigger_error($user->lang['NO_RANK_TITLE'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_RANK_TITLE'] . adm_back_link($this->u_action));
}
$sql_ary = array(
@@ -72,7 +72,7 @@ class acp_ranks
$cache->destroy('ranks');
- trigger_error($message . adm_back_link($u_action));
+ trigger_error($message . adm_back_link($this->u_action));
break;
@@ -92,11 +92,11 @@ class acp_ranks
$cache->destroy('ranks');
- trigger_error($user->lang['RANK_REMOVED'] . adm_back_link($u_action));
+ trigger_error($user->lang['RANK_REMOVED'] . adm_back_link($this->u_action));
}
else
{
- trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($u_action));
+ trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action));
}
break;
@@ -154,9 +154,9 @@ class acp_ranks
$template->assign_vars(array(
'S_EDIT' => true,
- 'U_BACK' => $u_action,
+ 'U_BACK' => $this->u_action,
'RANKS_PATH' => $phpbb_root_path . $config['ranks_path'],
- 'U_ACTION' => $u_action . '&amp;id=' . $rank_id,
+ 'U_ACTION' => $this->u_action . '&amp;id=' . $rank_id,
'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '',
'S_FILENAME_LIST' => $filename_list,
@@ -172,7 +172,7 @@ class acp_ranks
}
$template->assign_vars(array(
- 'U_ACTION' => $u_action)
+ 'U_ACTION' => $this->u_action)
);
$sql = 'SELECT *
@@ -190,8 +190,8 @@ class acp_ranks
'RANK_TITLE' => $row['rank_title'],
'MIN_POSTS' => $row['rank_min'],
- 'U_EDIT' => $u_action . '&amp;action=edit&amp;id=' . $row['rank_id'],
- 'U_DELETE' => $u_action . '&amp;action=delete&amp;id=' . $row['rank_id'])
+ 'U_EDIT' => $this->u_action . '&amp;action=edit&amp;id=' . $row['rank_id'],
+ 'U_DELETE' => $this->u_action . '&amp;action=delete&amp;id=' . $row['rank_id'])
);
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 3b14c3d6aa..c5dc6ae154 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -40,8 +40,6 @@ class acp_styles
$action = (isset($_POST['add'])) ? 'add' : $action;
$style_id = request_var('id', 0);
- $this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
// Fill the configuration variables
$this->style_cfg = $this->template_cfg = $this->theme_cfg = $this->imageset_cfg = '
#
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index fdb02fc42e..927a6436f3 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -13,6 +13,8 @@
*/
class acp_users
{
+ var $u_action;
+
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
@@ -22,8 +24,6 @@ class acp_users
$this->tpl_name = 'acp_users';
$this->page_title = 'ACP_USER_' . strtoupper($mode);
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
@@ -63,7 +63,7 @@ class acp_users
$this->page_title = 'SELECT_USER';
$template->assign_vars(array(
- 'U_ACTION' => $u_action,
+ 'U_ACTION' => $this->u_action,
'ANONYMOUS_USER_ID' => ANONYMOUS,
'S_SELECT_USER' => true,
@@ -85,7 +85,7 @@ class acp_users
if (!$user_id)
{
- trigger_error($user->lang['NO_USER'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action));
}
}
@@ -101,7 +101,7 @@ class acp_users
if (!$user_row)
{
- trigger_error($user->lang['NO_USER'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action));
}
// Generate overall "header" for user admin
@@ -122,9 +122,9 @@ class acp_users
}
$template->assign_vars(array(
- 'U_BACK' => $u_action,
+ 'U_BACK' => $this->u_action,
'U_MODE_SELECT' => "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;u=$user_id",
- 'U_ACTION' => $u_action . '&amp;u=' . $user_id,
+ 'U_ACTION' => $this->u_action . '&amp;u=' . $user_id,
'S_FORM_OPTIONS' => $s_form_options)
);
@@ -143,7 +143,7 @@ class acp_users
{
if (!$auth->acl_get('a_userdel'))
{
- trigger_error($user->lang['NO_ADMIN'] . adm_back_link($u_action . '&amp;u=' . $user_id));
+ trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
if (confirm_box(true))
@@ -151,7 +151,7 @@ class acp_users
user_delete($delete_type, $user_id);
add_log('admin', 'LOG_USER_DELETED', $user_row['username']);
- trigger_error($user->lang['USER_DELETED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_DELETED'] . adm_back_link($this->u_action));
}
else
{
@@ -213,7 +213,7 @@ class acp_users
add_log('admin', $log, $user->lang['reason']);
add_log('user', $user_id, $log, $user->lang['reason']);
- trigger_error($user->lang['BAN_SUCCESSFULL'] . adm_back_link($u_action));
+ trigger_error($user->lang['BAN_SUCCESSFULL'] . adm_back_link($this->u_action));
break;
@@ -261,7 +261,7 @@ class acp_users
add_log('admin', 'LOG_USER_REACTIVATE', $user_row['username']);
add_log('user', $user_id, 'LOG_USER_REACTIVATE_USER');
- trigger_error($user->lang['FORCE_REACTIVATION_SUCCESS'] . adm_back_link($u_action));
+ trigger_error($user->lang['FORCE_REACTIVATION_SUCCESS'] . adm_back_link($this->u_action));
}
break;
@@ -275,7 +275,7 @@ class acp_users
add_log('user', $user_id, $log . '_USER');
- trigger_error($user->lang[$message] . adm_back_link($u_action));
+ trigger_error($user->lang[$message] . adm_back_link($this->u_action));
break;
@@ -294,7 +294,7 @@ class acp_users
add_log('admin', 'LOG_USER_DEL_SIG', $user_row['username']);
add_log('user', $user_id, 'LOG_USER_DEL_SIG_USER');
- trigger_error($user->lang['USER_ADMIN_SIG_REMOVED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_ADMIN_SIG_REMOVED'] . adm_back_link($this->u_action));
break;
@@ -321,7 +321,7 @@ class acp_users
add_log('admin', 'LOG_USER_DEL_AVATAR', $user_row['username']);
add_log('user', $user_id, 'LOG_USER_DEL_AVATAR_USER');
- trigger_error($user->lang['USER_ADMIN_AVATAR_REMOVED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_ADMIN_AVATAR_REMOVED'] . adm_back_link($this->u_action));
break;
case 'delposts':
@@ -370,7 +370,7 @@ class acp_users
delete_posts('poster_id', $user_id);
add_log('admin', 'LOG_USER_DEL_POSTS', $user_row['username']);
- trigger_error($user->lang['USER_POSTS_DELETED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_POSTS_DELETED'] . adm_back_link($this->u_action));
}
else
{
@@ -392,7 +392,7 @@ class acp_users
delete_attachments('user', $user_id);
add_log('admin', 'LOG_USER_DEL_ATTACH', $user_row['username']);
- trigger_error($user->lang['USER_ATTACHMENTS_REMOVED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_ATTACHMENTS_REMOVED'] . adm_back_link($this->u_action));
}
else
{
@@ -417,8 +417,8 @@ class acp_users
$template->assign_vars(array(
'S_SELECT_FORUM' => true,
- 'U_ACTION' => $u_action . "&amp;action=$action&amp;u=$user_id",
- 'U_BACK' => $u_action . "&amp;u=$user_id",
+ 'U_ACTION' => $this->u_action . "&amp;action=$action&amp;u=$user_id",
+ 'U_BACK' => $this->u_action . "&amp;u=$user_id",
'S_FORUM_OPTIONS' => make_forum_select(false, false, false, true))
);
@@ -540,7 +540,7 @@ class acp_users
add_log('admin', 'LOG_USER_MOVE_POSTS', $user_row['username'], $forum_info['forum_name']);
add_log('user', $user_id, 'LOG_USER_MOVE_POSTS_USER', $forum_info['forum_name']);
- trigger_error($user->lang['USER_POSTS_MOVED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_POSTS_MOVED'] . adm_back_link($this->u_action));
break;
}
@@ -670,7 +670,7 @@ class acp_users
add_log('admin', 'LOG_USER_USER_UPDATE', $data['username']);
- trigger_error($user->lang['USER_OVERVIEW_UPDATED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_OVERVIEW_UPDATED'] . adm_back_link($this->u_action));
}
// Replace "error" strings with their real, localised form
@@ -701,8 +701,8 @@ class acp_users
'S_USER_FOUNDER' => ($user_row['user_type'] == USER_FOUNDER) ? true : false,
'S_ACTION_OPTIONS' => $s_action_options,
- 'U_SHOW_IP' => $u_action . "&amp;u=$user_id&amp;ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
- 'U_WHOIS' => $u_action . "&amp;action=whois&amp;user_ip={$user_row['user_ip']}",
+ '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']}",
'USER' => $user_row['username'],
'USER_REGISTERED' => $user->format_date($user_row['user_regdate']),
@@ -762,7 +762,7 @@ class acp_users
add_log('admin', 'LOG_USER_FEEDBACK', $user_row['username']);
add_log('user', $user_id, 'LOG_USER_GENERAL', $message);
- trigger_error($user->lang['USER_FEEDBACK_ADDED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_FEEDBACK_ADDED'] . adm_back_link($this->u_action));
}
// Sorting
@@ -785,7 +785,7 @@ class acp_users
$template->assign_vars(array(
'S_FEEDBACK' => true,
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
- 'PAGINATION' => generate_pagination($u_action . "&amp;u=$user_id&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
+ 'PAGINATION' => generate_pagination($this->u_action . "&amp;u=$user_id&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
'S_LIMIT_DAYS' => $s_limit_days,
'S_SORT_KEY' => $s_sort_key,
@@ -916,7 +916,7 @@ class acp_users
}
}
- trigger_error($user->lang['USER_PROFILE_UPDATED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_PROFILE_UPDATED'] . adm_back_link($this->u_action));
}
// Replace "error" strings with their real, localised form
@@ -1085,7 +1085,7 @@ class acp_users
WHERE user_id = $user_id";
$db->sql_query($sql);
- trigger_error($user->lang['USER_PREFS_UPDATED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_PREFS_UPDATED'] . adm_back_link($this->u_action));
}
// Replace "error" strings with their real, localised form
@@ -1303,7 +1303,7 @@ class acp_users
}
}
- trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_AVATAR_UPDATED'] . adm_back_link($this->u_action));
}
// Replace "error" strings with their real, localised form
@@ -1368,7 +1368,7 @@ class acp_users
WHERE user_id = $user_id";
$db->sql_query($sql);
- trigger_error($user->lang['USER_RANK_UPDATED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_RANK_UPDATED'] . adm_back_link($this->u_action));
}
$sql = 'SELECT *
@@ -1432,7 +1432,7 @@ class acp_users
WHERE user_id = ' . $user_id;
$db->sql_query($sql);
- trigger_error($user->lang['USER_SIG_UPDATED'] . adm_back_link($u_action));
+ trigger_error($user->lang['USER_SIG_UPDATED'] . adm_back_link($this->u_action));
}
// Replace "error" strings with their real, localised form
@@ -1508,7 +1508,7 @@ class acp_users
$message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
add_log('admin', $log, implode(', ', $log_attachments));
- trigger_error($message . adm_back_link($u_action));
+ trigger_error($message . adm_back_link($this->u_action));
}
else
{
@@ -1599,7 +1599,7 @@ class acp_users
'S_SORT_KEY' => $s_sort_key,
'S_SORT_DIR' => $s_sort_dir,
- 'PAGINATION' => generate_pagination($u_action . "&amp;sk=$sort_key&amp;sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start, true))
+ 'PAGINATION' => generate_pagination($this->u_action . "&amp;sk=$sort_key&amp;sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start, true))
);
break;
@@ -1628,12 +1628,12 @@ class acp_users
{
if (!$group_id)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action . '&amp;u=' . $user_id));
+ trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
if ($error = group_user_del($group_id, $user_id))
{
- trigger_error($user->lang[$error] . adm_back_link($u_action . '&amp;u=' . $user_id));
+ trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
$error = array();
@@ -1657,13 +1657,13 @@ class acp_users
{
if (!$group_id)
{
- trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action . '&amp;u=' . $user_id));
+ trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
// Add user/s to group
if ($error = group_user_add($group_id, $user_id))
{
- trigger_error($user->lang[$error] . adm_back_link($u_action . '&amp;u=' . $user_id));
+ trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
$error = array();
@@ -1722,9 +1722,9 @@ class acp_users
{
$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_DEFAULT' => $u_action . "&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id'],
- 'U_DEMOTE_PROMOTE' => $u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'],
- 'U_DELETE' => $u_action . "&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id'],
+ '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'],
'GROUP_NAME' => ($group_type == 'special') ? $user->lang['G_' . $data['group_name']] : $data['group_name'],
'L_DEMOTE_PROMOTE' => ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE'],
diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php
index 41884a07de..d7f1a9d724 100644
--- a/phpBB/includes/acp/acp_words.php
+++ b/phpBB/includes/acp/acp_words.php
@@ -14,6 +14,8 @@
*/
class acp_words
{
+ var $u_action;
+
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
@@ -31,8 +33,6 @@ class acp_words
$this->tpl_name = 'acp_words';
$this->page_title = 'ACP_WORDS';
- $u_action = "{$phpbb_admin_path}index.$phpEx$SID&amp;i=$id&amp;mode=$mode";
-
switch ($action)
{
case 'edit':
@@ -40,7 +40,7 @@ class acp_words
if (!$word_id)
{
- trigger_error($user->lang['NO_WORD'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action));
}
$sql = 'SELECT *
@@ -56,8 +56,8 @@ class acp_words
$template->assign_vars(array(
'S_EDIT_WORD' => true,
- 'U_ACTION' => $u_action,
- 'U_BACK' => $u_action,
+ 'U_ACTION' => $this->u_action,
+ 'U_BACK' => $this->u_action,
'WORD' => (isset($word_info['word'])) ? $word_info['word'] : '',
'REPLACEMENT' => (isset($word_info['replacement'])) ? $word_info['replacement'] : '',
'S_HIDDEN_FIELDS' => $s_hidden_fields)
@@ -74,7 +74,7 @@ class acp_words
if (!$word || !$replacement)
{
- trigger_error($user->lang['ENTER_WORD'] . adm_back_link($u_action));
+ trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action));
}
$sql_ary = array(
@@ -97,7 +97,7 @@ class acp_words
add_log('admin', $log_action, $word);
$message = ($word_id) ? $user->lang['WORD_UPDATED'] : $user->lang['WORD_ADDED'];
- trigger_error($message . adm_back_link($u_action));
+ trigger_error($message . adm_back_link($this->u_action));
break;
@@ -107,7 +107,7 @@ class acp_words
if (!$word_id)
{
- trigger_error($user->lang['NO_WORD'] . adm_back_link($u_action));
+ trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action));
}
$sql = 'SELECT word
@@ -125,14 +125,14 @@ class acp_words
add_log('admin', 'LOG_WORD_DELETE', $deleted_word);
- trigger_error($user->lang['WORD_REMOVED'] . adm_back_link($u_action));
+ trigger_error($user->lang['WORD_REMOVED'] . adm_back_link($this->u_action));
break;
}
$template->assign_vars(array(
- 'U_ACTION' => $u_action,
+ 'U_ACTION' => $this->u_action,
'S_HIDDEN_FIELDS' => $s_hidden_fields)
);
@@ -146,8 +146,8 @@ class acp_words
$template->assign_block_vars('words', array(
'WORD' => $row['word'],
'REPLACEMENT' => $row['replacement'],
- 'U_EDIT' => $u_action . '&amp;action=edit&amp;id=' . $row['word_id'],
- 'U_DELETE' => $u_action . '&amp;action=delete&amp;id=' . $row['word_id'])
+ 'U_EDIT' => $this->u_action . '&amp;action=edit&amp;id=' . $row['word_id'],
+ 'U_DELETE' => $this->u_action . '&amp;action=delete&amp;id=' . $row['word_id'])
);
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 59a6b03d54..ab744990a2 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -205,6 +205,186 @@ class auth_admin extends auth
}
/**
+ * Display permission mask (assign to template)
+ */
+ 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;
+
+ // Define names for template loops, might be able to be set
+ $tpl_pmask = 'p_mask';
+ $tpl_fmask = 'f_mask';
+ $tpl_category = 'category';
+ $tpl_mask = 'mask';
+
+ $l_acl_type = (isset($user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)])) ? $user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)] : 'ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type);
+
+ // Get names
+ if ($user_mode == 'user')
+ {
+ $sql = 'SELECT user_id as ug_id, username as ug_name
+ FROM ' . USERS_TABLE . '
+ WHERE user_id IN (' . implode(', ', array_keys($hold_ary)) . ')
+ ORDER BY username ASC';
+ }
+ else
+ {
+ $sql = 'SELECT group_id as ug_id, group_name as ug_name, group_type
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_id IN (' . implode(', ', array_keys($hold_ary)) . ')
+ ORDER BY group_type DESC, group_name ASC';
+ }
+ $result = $db->sql_query($sql);
+
+ $ug_names_ary = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $ug_names_ary[$row['ug_id']] = ($user_mode == 'user') ? $row['ug_name'] : (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['ug_name']] : $row['ug_name']);
+ }
+ $db->sql_freeresult($result);
+
+ // Get used forums
+ $forum_ids = array();
+ foreach ($hold_ary as $ug_id => $row)
+ {
+ $forum_ids = array_merge($forum_ids, array_keys($row));
+ }
+ $forum_ids = array_unique($forum_ids);
+
+ $forum_names_ary = array();
+ if ($local)
+ {
+ $forum_names_ary = make_forum_select(false, false, true, false, false, true);
+ }
+ else
+ {
+ $forum_names_ary[0] = $l_acl_type;
+ }
+
+ // Now obtain memberships
+ $user_groups_default = $user_groups_custom = array();
+ if ($user_mode == 'user' && $group_display)
+ {
+ $sql = 'SELECT group_id, group_name, group_type
+ FROM ' . GROUPS_TABLE . '
+ ORDER BY group_type DESC, group_name ASC';
+ $result = $db->sql_query($sql);
+
+ $groups = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $groups[$row['group_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ $memberships = group_memberships(false, array_keys($hold_ary), false);
+
+ foreach ($memberships as $row)
+ {
+ if ($groups[$row['group_id']]['group_type'] == GROUP_SPECIAL)
+ {
+ $user_groups_default[$row['user_id']][] = $user->lang['G_' . $groups[$row['group_id']]['group_name']];
+ }
+ else
+ {
+ $user_groups_custom[$row['user_id']][] = $groups[$row['group_id']]['group_name'];
+ }
+ }
+ unset($memberships, $groups);
+ }
+
+ // If we only have one forum id to display, we switch the complete interface to group by user/usergroup instead of grouping by forum
+ // To achive this, we need to switch the array a bit
+ if (sizeof($forum_ids) == 1)
+ {
+ $hold_ary_temp = $hold_ary;
+ $hold_ary = array();
+ foreach ($hold_ary_temp as $ug_id => $row)
+ {
+ foreach ($row as $forum_id => $auth_row)
+ {
+ $hold_ary[$forum_id][$ug_id] = $auth_row;
+ }
+ }
+ unset($hold_ary_temp);
+
+ foreach ($hold_ary as $forum_id => $forum_array)
+ {
+ $content_array = $categories = array();
+ $this->build_permission_array($hold_ary[$forum_id], $content_array, $categories, array_keys($ug_names_ary));
+
+ $template->assign_block_vars($tpl_pmask, array(
+ 'NAME' => ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'],
+ 'CATEGORIES' => implode('</th><th>', $categories),
+
+ 'L_ACL_TYPE' => $l_acl_type,
+
+ 'S_LOCAL' => ($local) ? true : false,
+ 'S_GLOBAL' => (!$local) ? true : false,
+ 'S_NUM_CATS' => sizeof($categories),
+ 'S_VIEW' => ($mode == 'view') ? true : false,
+ 'S_NUM_OBJECTS' => sizeof($content_array),
+ 'S_USER_MODE' => ($user_mode == 'user') ? true : false,
+ 'S_GROUP_MODE' => ($user_mode == 'group') ? true : false)
+ );
+
+ foreach ($content_array as $ug_id => $ug_array)
+ {
+ $template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
+ 'NAME' => $ug_names_ary[$ug_id],
+ 'UG_ID' => $ug_id,
+ 'FORUM_ID' => $forum_id)
+ );
+
+ $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id);
+ }
+ }
+ }
+ else
+ {
+ foreach ($ug_names_ary as $ug_id => $ug_name)
+ {
+ if (!isset($hold_ary[$ug_id]))
+ {
+ continue;
+ }
+
+ $content_array = $categories = array();
+ $this->build_permission_array($hold_ary[$ug_id], $content_array, $categories, array_keys($forum_names_ary));
+
+ $template->assign_block_vars($tpl_pmask, array(
+ 'NAME' => $ug_name,
+ 'CATEGORIES' => implode('</th><th>', $categories),
+
+ 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode(', ', $user_groups_default[$ug_id]) : '',
+ 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode(', ', $user_groups_custom[$ug_id]) : '',
+ 'L_ACL_TYPE' => $l_acl_type,
+
+ 'S_LOCAL' => ($local) ? true : false,
+ 'S_GLOBAL' => (!$local) ? true : false,
+ 'S_NUM_CATS' => sizeof($categories),
+ 'S_VIEW' => ($mode == 'view') ? true : false,
+ 'S_NUM_OBJECTS' => sizeof($content_array),
+ 'S_USER_MODE' => ($user_mode == 'user') ? true : false,
+ 'S_GROUP_MODE' => ($user_mode == 'group') ? true : false)
+ );
+
+ foreach ($content_array as $forum_id => $forum_array)
+ {
+ $template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
+ 'NAME' => ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'],
+ 'PADDING' => ($forum_id == 0) ? '' : $forum_names_ary[$forum_id]['padding'],
+ 'UG_ID' => $ug_id,
+ 'FORUM_ID' => $forum_id)
+ );
+
+ $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id);
+ }
+ }
+ }
+ }
+
+ /**
* Display permission mask for presets
*/
function display_preset_mask(&$hold_ary)
@@ -384,123 +564,6 @@ class auth_admin extends auth
}
/**
- * Set a preset ACL record
- */
- function acl_set_preset($preset_id, &$auth)
- {
- global $db;
-
- if (!sizeof($this->option_ids))
- {
- $sql = 'SELECT auth_option_id, auth_option
- FROM ' . ACL_OPTIONS_TABLE;
- $result = $db->sql_query($sql);
-
- $this->option_ids = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $this->option_ids[$row['auth_option']] = $row['auth_option_id'];
- }
- $db->sql_freeresult($result);
- }
-
- // Set any flags as required
- foreach ($auth as $auth_option => $setting)
- {
- $flag = substr($auth_option, 0, strpos($auth_option, '_') + 1);
-
- if (!isset($auth[$flag]) || !$auth[$flag])
- {
- $auth[$flag] = $setting;
- }
- }
-
- $sql = 'SELECT auth_option_id, auth_setting
- FROM ' . ACL_PRESETS_DATA_TABLE . '
- WHERE preset_id = ' . $preset_id;
- $result = $db->sql_query($sql);
-
- $cur_auth = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $cur_auth[$row['auth_option_id']] = $row['auth_setting'];
- }
- $db->sql_freeresult($result);
-
- $sql_ary = array();
-
- foreach ($auth as $auth_option => $setting)
- {
- $auth_option_id = (int) $this->option_ids[$auth_option];
-
- switch ($setting)
- {
- case ACL_UNSET:
- if (isset($cur_auth[$auth_option_id]))
- {
- $sql_ary['delete'][] = 'DELETE FROM ' . ACL_PRESETS_DATA_TABLE . '
- WHERE auth_option_id = ' . $auth_option_id . '
- AND preset_id = ' . $preset_id;
- }
- break;
-
- default:
- if (!isset($cur_auth[$auth_option_id]))
- {
- $sql_ary['insert'][] = array(
- 'preset_id' => (int) $preset_id,
- 'auth_option_id' => (int) $auth_option_id,
- 'auth_setting' => (int) $setting
- );
- }
- else if ($cur_auth[$auth_option_id] != $setting)
- {
- $sql_ary['update'][] = 'UPDATE ' . ACL_PRESETS_DATA_TABLE . '
- SET auth_setting = ' . (int) $setting . '
- WHERE preset_id = ' . $preset_id . '
- AND auth_option_id = ' . $auth_option_id;
- }
- break;
- }
- }
- unset($cur_auth);
-
- foreach ($sql_ary as $sql_type => $sql_subary)
- {
- switch ($sql_type)
- {
- case 'insert':
- switch (SQL_LAYER)
- {
- case 'mysql':
- case 'mysql4':
- case 'mysqli':
- $db->sql_query('INSERT INTO ' . ACL_PRESETS_DATA_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_subary));
- break;
-
- default:
- foreach ($sql_subary as $ary)
- {
- $db->sql_query('INSERT INTO ' . ACL_PRESETS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
- }
- break;
- }
- break;
-
- case 'update':
- case 'delete':
- foreach ($sql_subary as $sql)
- {
- $db->sql_query($sql);
- }
- break;
- }
- }
-
- $this->acl_clear_prefetch();
- }
-
- /**
* Set a user or group ACL record
*/
function acl_set($ug_type, &$forum_id, &$ug_id, &$auth)
@@ -659,222 +722,159 @@ class auth_admin extends auth
}
/**
- * Remove local permission
+ * Set a preset ACL record
*/
- function acl_delete($mode, $ug_id = false, $forum_id = false, $auth_id = false)
+ function acl_set_preset($preset_id, &$auth)
{
global $db;
- if ($ug_id === false && $forum_id === false && $auth_ids === false)
+ if (!sizeof($this->option_ids))
{
- return;
- }
-
- $table = ($mode == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE;
- $id_field = $mode . '_id';
-
- $sql = array();
+ $sql = 'SELECT auth_option_id, auth_option
+ FROM ' . ACL_OPTIONS_TABLE;
+ $result = $db->sql_query($sql);
- if ($auth_id !== false)
- {
- $sql[] = (!is_array($auth_id)) ? 'auth_option_id = ' . (int) $auth_id : 'auth_option_id IN (' . implode(', ', array_map('intval', $auth_id)) . ')';
- }
-
- if ($forum_id !== false)
- {
- $sql[] = (!is_array($forum_id)) ? 'forum_id = ' . (int) $forum_id : 'forum_id IN (' . implode(', ', array_map('intval', $forum_id)) . ')';
+ $this->option_ids = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $this->option_ids[$row['auth_option']] = $row['auth_option_id'];
+ }
+ $db->sql_freeresult($result);
}
- if ($ug_id !== false)
+ // Set any flags as required
+ foreach ($auth as $auth_option => $setting)
{
- $sql[] = (!is_array($ug_id)) ? $id_field . ' = ' . (int) $ug_id : $id_field . ' IN (' . implode(', ', array_map('intval', $ug_id)) . ')';
- }
-
- $sql = "DELETE FROM $table
- WHERE " . implode(' AND ', $sql);
- $db->sql_query($sql);
-
- $this->acl_clear_prefetch();
- }
-
- /**
- * Display permission mask (assign to template)
- */
- 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;
-
- // Define names for template loops, might be able to be set
- $tpl_pmask = 'p_mask';
- $tpl_fmask = 'f_mask';
- $tpl_category = 'category';
- $tpl_mask = 'mask';
+ $flag = substr($auth_option, 0, strpos($auth_option, '_') + 1);
- $l_acl_type = (isset($user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)])) ? $user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)] : 'ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type);
-
- // Get names
- if ($user_mode == 'user')
- {
- $sql = 'SELECT user_id as ug_id, username as ug_name
- FROM ' . USERS_TABLE . '
- WHERE user_id IN (' . implode(', ', array_keys($hold_ary)) . ')
- ORDER BY username ASC';
- }
- else
- {
- $sql = 'SELECT group_id as ug_id, group_name as ug_name, group_type
- FROM ' . GROUPS_TABLE . '
- WHERE group_id IN (' . implode(', ', array_keys($hold_ary)) . ')
- ORDER BY group_type DESC, group_name ASC';
+ if (!isset($auth[$flag]) || !$auth[$flag])
+ {
+ $auth[$flag] = $setting;
+ }
}
+
+ $sql = 'SELECT auth_option_id, auth_setting
+ FROM ' . ACL_PRESETS_DATA_TABLE . '
+ WHERE preset_id = ' . $preset_id;
$result = $db->sql_query($sql);
- $ug_names_ary = array();
+ $cur_auth = array();
while ($row = $db->sql_fetchrow($result))
{
- $ug_names_ary[$row['ug_id']] = ($user_mode == 'user') ? $row['ug_name'] : (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['ug_name']] : $row['ug_name']);
+ $cur_auth[$row['auth_option_id']] = $row['auth_setting'];
}
$db->sql_freeresult($result);
- // Get used forums
- $forum_ids = array();
- foreach ($hold_ary as $ug_id => $row)
- {
- $forum_ids = array_merge($forum_ids, array_keys($row));
- }
- $forum_ids = array_unique($forum_ids);
-
- $forum_names_ary = array();
- if ($local)
- {
- $forum_names_ary = make_forum_select(false, false, true, false, false, true);
- }
- else
- {
- $forum_names_ary[0] = $l_acl_type;
- }
+ $sql_ary = array();
- // Now obtain memberships
- $user_groups_default = $user_groups_custom = array();
- if ($user_mode == 'user' && $group_display)
+ foreach ($auth as $auth_option => $setting)
{
- $sql = 'SELECT group_id, group_name, group_type
- FROM ' . GROUPS_TABLE . '
- ORDER BY group_type DESC, group_name ASC';
- $result = $db->sql_query($sql);
+ $auth_option_id = (int) $this->option_ids[$auth_option];
- $groups = array();
- while ($row = $db->sql_fetchrow($result))
+ switch ($setting)
{
- $groups[$row['group_id']] = $row;
- }
- $db->sql_freeresult($result);
-
- $memberships = group_memberships(false, array_keys($hold_ary), false);
+ case ACL_UNSET:
+ if (isset($cur_auth[$auth_option_id]))
+ {
+ $sql_ary['delete'][] = 'DELETE FROM ' . ACL_PRESETS_DATA_TABLE . '
+ WHERE auth_option_id = ' . $auth_option_id . '
+ AND preset_id = ' . $preset_id;
+ }
+ break;
- foreach ($memberships as $row)
- {
- if ($groups[$row['group_id']]['group_type'] == GROUP_SPECIAL)
- {
- $user_groups_default[$row['user_id']][] = $user->lang['G_' . $groups[$row['group_id']]['group_name']];
- }
- else
- {
- $user_groups_custom[$row['user_id']][] = $groups[$row['group_id']]['group_name'];
- }
+ default:
+ if (!isset($cur_auth[$auth_option_id]))
+ {
+ $sql_ary['insert'][] = array(
+ 'preset_id' => (int) $preset_id,
+ 'auth_option_id' => (int) $auth_option_id,
+ 'auth_setting' => (int) $setting
+ );
+ }
+ else if ($cur_auth[$auth_option_id] != $setting)
+ {
+ $sql_ary['update'][] = 'UPDATE ' . ACL_PRESETS_DATA_TABLE . '
+ SET auth_setting = ' . (int) $setting . '
+ WHERE preset_id = ' . $preset_id . '
+ AND auth_option_id = ' . $auth_option_id;
+ }
+ break;
}
- unset($memberships, $groups);
}
+ unset($cur_auth);
- // If we only have one forum id to display, we switch the complete interface to group by user/usergroup instead of grouping by forum
- // To achive this, we need to switch the array a bit
- if (sizeof($forum_ids) == 1)
+ foreach ($sql_ary as $sql_type => $sql_subary)
{
- $hold_ary_temp = $hold_ary;
- $hold_ary = array();
- foreach ($hold_ary_temp as $ug_id => $row)
- {
- foreach ($row as $forum_id => $auth_row)
- {
- $hold_ary[$forum_id][$ug_id] = $auth_row;
- }
- }
- unset($hold_ary_temp);
-
- foreach ($hold_ary as $forum_id => $forum_array)
+ switch ($sql_type)
{
- $content_array = $categories = array();
- $this->build_permission_array($hold_ary[$forum_id], $content_array, $categories, array_keys($ug_names_ary));
+ case 'insert':
+ switch (SQL_LAYER)
+ {
+ case 'mysql':
+ case 'mysql4':
+ case 'mysqli':
+ $db->sql_query('INSERT INTO ' . ACL_PRESETS_DATA_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_subary));
+ break;
- $template->assign_block_vars($tpl_pmask, array(
- 'NAME' => ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'],
- 'CATEGORIES' => implode('</th><th>', $categories),
+ default:
+ foreach ($sql_subary as $ary)
+ {
+ $db->sql_query('INSERT INTO ' . ACL_PRESETS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $ary));
+ }
+ break;
+ }
+ break;
- 'L_ACL_TYPE' => $l_acl_type,
+ case 'update':
+ case 'delete':
+ foreach ($sql_subary as $sql)
+ {
+ $db->sql_query($sql);
+ }
+ break;
+ }
+ }
- 'S_LOCAL' => ($local) ? true : false,
- 'S_GLOBAL' => (!$local) ? true : false,
- 'S_NUM_CATS' => sizeof($categories),
- 'S_VIEW' => ($mode == 'view') ? true : false,
- 'S_NUM_OBJECTS' => sizeof($content_array),
- 'S_USER_MODE' => ($user_mode == 'user') ? true : false,
- 'S_GROUP_MODE' => ($user_mode == 'group') ? true : false)
- );
+ $this->acl_clear_prefetch();
+ }
- foreach ($content_array as $ug_id => $ug_array)
- {
- $template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
- 'NAME' => $ug_names_ary[$ug_id],
- 'UG_ID' => $ug_id,
- 'FORUM_ID' => $forum_id)
- );
+ /**
+ * Remove local permission
+ */
+ function acl_delete($mode, $ug_id = false, $forum_id = false, $auth_id = false)
+ {
+ global $db;
- $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id);
- }
- }
- }
- else
+ if ($ug_id === false && $forum_id === false && $auth_ids === false)
{
- foreach ($ug_names_ary as $ug_id => $ug_name)
- {
- if (!isset($hold_ary[$ug_id]))
- {
- continue;
- }
+ return;
+ }
- $content_array = $categories = array();
- $this->build_permission_array($hold_ary[$ug_id], $content_array, $categories, array_keys($forum_names_ary));
+ $table = ($mode == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE;
+ $id_field = $mode . '_id';
- $template->assign_block_vars($tpl_pmask, array(
- 'NAME' => $ug_name,
- 'CATEGORIES' => implode('</th><th>', $categories),
+ $sql = array();
- 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode(', ', $user_groups_default[$ug_id]) : '',
- 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode(', ', $user_groups_custom[$ug_id]) : '',
- 'L_ACL_TYPE' => $l_acl_type,
+ if ($auth_id !== false)
+ {
+ $sql[] = (!is_array($auth_id)) ? 'auth_option_id = ' . (int) $auth_id : 'auth_option_id IN (' . implode(', ', array_map('intval', $auth_id)) . ')';
+ }
+
+ if ($forum_id !== false)
+ {
+ $sql[] = (!is_array($forum_id)) ? 'forum_id = ' . (int) $forum_id : 'forum_id IN (' . implode(', ', array_map('intval', $forum_id)) . ')';
+ }
- 'S_LOCAL' => ($local) ? true : false,
- 'S_GLOBAL' => (!$local) ? true : false,
- 'S_NUM_CATS' => sizeof($categories),
- 'S_VIEW' => ($mode == 'view') ? true : false,
- 'S_NUM_OBJECTS' => sizeof($content_array),
- 'S_USER_MODE' => ($user_mode == 'user') ? true : false,
- 'S_GROUP_MODE' => ($user_mode == 'group') ? true : false)
- );
+ if ($ug_id !== false)
+ {
+ $sql[] = (!is_array($ug_id)) ? $id_field . ' = ' . (int) $ug_id : $id_field . ' IN (' . implode(', ', array_map('intval', $ug_id)) . ')';
+ }
- foreach ($content_array as $forum_id => $forum_array)
- {
- $template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
- 'NAME' => ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'],
- 'PADDING' => ($forum_id == 0) ? '' : $forum_names_ary[$forum_id]['padding'],
- 'UG_ID' => $ug_id,
- 'FORUM_ID' => $forum_id)
- );
+ $sql = "DELETE FROM $table
+ WHERE " . implode(' AND ', $sql);
+ $db->sql_query($sql);
- $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id);
- }
- }
- }
+ $this->acl_clear_prefetch();
}
/**
@@ -898,9 +898,9 @@ class auth_admin extends auth
foreach ($cat_array['permissions'] as $permission => $allowed)
{
$template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array(
- 'S_YES' => ($allowed == 1) ? true : false,
- 'S_NO' => ($allowed == 0) ? true : false,
- 'S_UNSET' => ($allowed == -1) ? true : false,
+ 'S_YES' => ($allowed == ACL_YES) ? true : false,
+ 'S_NO' => ($allowed == ACL_NO) ? true : false,
+ 'S_UNSET' => ($allowed == ACL_UNSET) ? true : false,
'UG_ID' => $ug_id,
'FORUM_ID' => $forum_id,
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 1a2d927c99..807aeb6578 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1215,6 +1215,12 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$err = '';
+ // Make sure user->setup() has been called
+ if (empty($user->lang))
+ {
+ $user->setup();
+ }
+
if (isset($_POST['login']))
{
$username = request_var('username', '');
@@ -1229,9 +1235,16 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
// If admin authentication
if ($admin)
{
- add_log('admin', 'LOG_ADMIN_AUTH_SUCCESS');
+ if ($auth->acl_get('a_'))
+ {
+ add_log('admin', 'LOG_ADMIN_AUTH_SUCCESS');
+ }
+ else
+ {
+ add_log('admin', 'LOG_ADMIN_AUTH_FAIL');
+ }
}
-
+
$redirect = request_var('redirect', "index.$phpEx$SID");
meta_refresh(3, $redirect);
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 2f696967e6..031c6405de 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -65,41 +65,27 @@ class p_master
{
global $cache;
- // Get active modules
+ // Get modules
$sql = 'SELECT *
FROM ' . MODULES_TABLE . "
WHERE module_class = '" . $db->sql_escape($p_class) . "'
ORDER BY left_id ASC";
$result = $db->sql_query($sql);
- $this->module_cache['modules'] = array();
+ $rows = array();
while ($row = $db->sql_fetchrow($result))
{
- $this->module_cache['modules'][] = $row;
- }
- $db->sql_freeresult($result);
-
- // Get module parents
- $this->module_cache['parents'] = array();
-
- // We pre-get all parents due to the huge amount of queries required if we do not do so. ;)
- $sql = 'SELECT module_id, parent_id, left_id, right_id
- FROM ' . MODULES_TABLE . '
- ORDER BY left_id ASC';
- $result = $db->sql_query($sql);
-
- $parents = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $parents[$row['module_id']] = $row;
+ $rows[$row['module_id']] = $row;
}
$db->sql_freeresult($result);
- foreach ($this->module_cache['modules'] as $row)
+ $this->module_cache = array();
+ foreach ($rows as $module_id => $row)
{
- $this->module_cache['parents'][$row['module_id']] = $this->get_parents($row['parent_id'], $row['left_id'], $row['right_id'], $parents);
+ $this->module_cache['modules'][] = $row;
+ $this->module_cache['parents'][$row['module_id']] = $this->get_parents($row['parent_id'], $row['left_id'], $row['right_id'], $rows);
}
- unset($parents);
+ unset($rows);
$file = '<?php $this->module_cache=' . $cache->format_array($this->module_cache) . "; ?>";
@@ -114,9 +100,13 @@ class p_master
unset($file);
}
- $right = $depth = $i = 0;
- $depth_ary = $disable = array();
+ // We "could" build a true tree with this function - maybe mod authors want to use this...
+ // Functions for traversing and manipulating the tree are not available though
+ // We might re-structure the module system to use true trees in 3.2.x...
+ // $tree = $this->build_tree($this->module_cache['modules'], $this->module_cache['parents']);
+ // Clean up module cache array to only let survive modules the user can access
+ $right_id = false;
foreach ($this->module_cache['modules'] as $key => $row)
{
// Not allowed to view module?
@@ -129,102 +119,98 @@ class p_master
// Category with no members, ignore
if (!$row['module_name'] && ($row['left_id'] + 1 == $row['right_id']))
{
+ unset($this->module_cache['modules'][$key]);
continue;
}
- // Category with no members on their way down (we have to check every level)
- if (!$row['module_name'])
+ // Skip branch
+ if ($right_id !== false)
{
- $empty_category = true;
-
- // If we do find members we can add this module to the array
- $right_id = $row['right_id'];
-
- // Get branch (from this module to module with left_id >= right_id)
- $temp_module_cache = array_slice($this->module_cache['modules'], $key + 1);
-
- if (!sizeof($temp_module_cache))
+ if ($row['left_id'] < $right_id)
{
+ unset($this->module_cache['modules'][$key]);
continue;
}
-
- foreach ($temp_module_cache as $temp_row)
- {
- if ($temp_row['left_id'] >= $right_id)
- {
- break;
- }
-
- // Module there
- if ($temp_row['module_name'] && $temp_row['module_enabled'])
- {
- $empty_category = false;
- break;
- }
- }
-
- unset($temp_module_cache);
- if ($empty_category)
- {
- continue;
- }
+ $right_id = false;
}
// Not enabled?
if (!$row['module_enabled'])
{
// If category is disabled then disable every child too
- if (!$row['module_name'])
- {
- $disable['left_id'] = $row['left_id'];
- $disable['right_id'] = $row['right_id'];
- }
-
+ unset($this->module_cache['modules'][$key]);
+ $right_id = $row['right_id'];
continue;
}
-
- if (sizeof($disable))
+ }
+
+ // Re-index (this is needed, else we are not able to array_slice later)
+ $this->module_cache['modules'] = array_merge($this->module_cache['modules']);
+
+ // Now build the module array, but exclude completely empty categories...
+ $right_id = false;
+ $names = array();
+
+ foreach ($this->module_cache['modules'] as $key => $row)
+ {
+ // Skip branch
+ if ($right_id !== false)
{
- if ($row['left_id'] > $disable['left_id'] && $row['left_id'] < $disable['right_id'] &&
- $row['right_id'] > $disable['left_id'] && $row['right_id'] < $disable['right_id'])
+ if ($row['left_id'] < $right_id)
{
continue;
}
-
- $disable = array();
+
+ $right_id = false;
}
- if ($row['left_id'] < $right)
- {
- $depth++;
- $depth_ary[$row['parent_id']] = $depth;
- }
- else if ($row['left_id'] > $right + 1)
+ // Category with no members on their way down (we have to check every level)
+ if (!$row['module_name'])
{
- if (!isset($depth_ary[$row['parent_id']]))
+ $empty_category = true;
+
+ // We go through the branch and look for an activated module
+ foreach (array_slice($this->module_cache['modules'], $key + 1) as $temp_row)
{
- $depth = 0;
+ if ($temp_row['left_id'] > $row['left_id'] && $temp_row['left_id'] < $row['right_id'])
+ {
+ // Module there
+ if ($temp_row['module_name'] && $temp_row['module_enabled'])
+ {
+ $empty_category = false;
+ break;
+ }
+ continue;
+ }
+ break;
}
- else
+
+ // Skip the branch
+ if ($empty_category)
{
- $depth = $depth_ary[$row['parent_id']];
+ $right_id = $row['right_id'];
+ continue;
}
}
- $right = $row['right_id'];
+ $depth = sizeof($this->module_cache['parents'][$row['module_id']]);
// We need to prefix the functions to not create a naming conflict
$url_func = '_module_' . $row['module_name'] . '_' . $row['module_mode'] . '_url';
$lang_func = '_module_' . $row['module_name'];
- $this->module_ary[$i] = array(
+ $names[$row['module_name'] . '_' . $row['module_mode']][] = true;
+
+ $this->module_ary[] = array(
'depth' => $depth,
'id' => (int) $row['module_id'],
'parent' => (int) $row['parent_id'],
'cat' => ($row['right_id'] > $row['left_id'] + 1) ? true : false,
+ 'is_duplicate' => ($row['module_name'] && sizeof($names[$row['module_name'] . '_' . $row['module_mode']]) > 1) ? true : false,
+
'name' => (string) $row['module_name'],
'mode' => (string) $row['module_mode'],
'display' => (int) $row['module_display'],
@@ -237,11 +223,9 @@ class p_master
'left' => $row['left_id'],
'right' => $row['right_id'],
);
-
- $i++;
}
- unset($this->module_cache['modules']);
+ unset($this->module_cache['modules'], $names);
}
/**
@@ -266,8 +250,19 @@ class p_master
return $is_auth;
}
+ /**
+ * Set active module
+ */
function set_active($id = false, $mode = false)
{
+ $icat = false;
+
+ if (request_var('icat', ''))
+ {
+ $icat = $id;
+ $id = request_var('icat', '');
+ }
+
$category = false;
foreach ($this->module_ary as $row_id => $itep_ary)
{
@@ -276,12 +271,20 @@ class p_master
// If this is a module and no mode selected, select first mode
// If no category or module selected, go active for first module in first category
if (
- (($itep_ary['name'] === $id || $itep_ary['id'] === (int) $id) && $itep_ary['mode'] == $mode && !$itep_ary['cat']) ||
- ($itep_ary['parent'] === $category && !$itep_ary['cat']) ||
+ (($itep_ary['name'] === $id || $itep_ary['id'] === (int) $id) && (($itep_ary['mode'] == $mode && !$itep_ary['cat']) || ($icat && $itep_ary['cat']))) ||
+ ($itep_ary['parent'] === $category && !$itep_ary['cat'] && !$icat) ||
(($itep_ary['name'] === $id || $itep_ary['id'] === (int) $id) && !$mode && !$itep_ary['cat']) ||
(!$id && !$mode && !$itep_ary['cat'])
)
{
+ if ($itep_ary['cat'])
+ {
+ $id = $icat;
+ $icat = false;
+
+ continue;
+ }
+
$this->p_id = $itep_ary['id'];
$this->p_parent = $itep_ary['parent'];
$this->p_name = $itep_ary['name'];
@@ -293,7 +296,7 @@ class p_master
break;
}
- else if (($itep_ary['cat'] && $itep_ary['id'] == $id) || ($itep_ary['parent'] === $category && $itep_ary['cat']))
+ else if (($itep_ary['cat'] && $itep_ary['id'] === (int) $id) || ($itep_ary['parent'] === $category && $itep_ary['cat']))
{
$category = $itep_ary['id'];
}
@@ -309,9 +312,10 @@ class p_master
*/
function load_active($mode = false)
{
- global $phpbb_root_path, $phpEx;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID;
$module_path = $phpbb_root_path . 'includes/' . $this->p_class;
+ $icat = request_var('icat', '');
if (!class_exists("{$this->p_class}_$this->p_name"))
{
@@ -338,6 +342,9 @@ class p_master
$this->module = new $instance($this);
+ // We pre-define the action parameter we are using all over the place
+ $this->module->u_action = "{$phpbb_admin_path}index.$phpEx$SID" . (($icat) ? '&amp;icat=' . $icat : '') . "&amp;i={$this->p_id}&amp;mode={$this->p_mode}";
+
// Execute the main method for the new instance, we send the module
// id and mode as parameters
$this->module->main(($this->p_name) ? $this->p_name : $this->p_id, $this->p_mode);
@@ -346,6 +353,9 @@ class p_master
}
}
+ /**
+ * Get parents
+ */
function get_parents($parent_id, $left_id, $right_id, &$all_parents)
{
global $db;
@@ -370,11 +380,73 @@ class p_master
return $parents;
}
-
+
+ /**
+ * Get tree branch
+ */
+ function get_branch($left_id, $right_id, $remaining)
+ {
+ $branch = array();
+
+ foreach ($remaining as $key => $row)
+ {
+ if ($row['left_id'] > $left_id && $row['left_id'] < $right_id)
+ {
+ $branch[] = $row;
+ continue;
+ }
+ break;
+ }
+
+ return $branch;
+ }
+
+ /**
+ * Build true binary tree from given array
+ */
+ function build_tree(&$modules, &$parents)
+ {
+ $tree = array();
+
+ foreach ($modules as $row)
+ {
+ $branch = &$tree;
+
+ if ($row['parent_id'])
+ {
+ // Go through the tree to find our branch
+ $parent_tree = $parents[$row['module_id']];
+
+ foreach ($parent_tree as $id => $value)
+ {
+ if (!isset($branch[$id]) && isset($branch['child']))
+ {
+ $branch = &$branch['child'];
+ }
+ $branch = &$branch[$id];
+ }
+ $branch = &$branch['child'];
+ }
+
+ $branch[$row['module_id']] = $row;
+ if (!isset($branch[$row['module_id']]['child']))
+ {
+ $branch[$row['module_id']]['child'] = array();
+ }
+ }
+
+ return $tree;
+ }
+
+ /**
+ * Build navigation structure
+ */
function assign_tpl_vars($module_url)
{
global $template;
+ $current_id = false;
+
$current_padding = $current_depth = 0;
$linear_offset = 'l_block1';
$tabular_offset = 't_block2';
@@ -390,6 +462,12 @@ class p_master
continue;
}
+ // Select first id we can get
+ if (!$current_id && (in_array($itep_ary['id'], array_keys($this->module_cache['parents'])) || $itep_ary['id'] == $this->p_id))
+ {
+ $current_id = $itep_ary['id'];
+ }
+
$depth = $itep_ary['depth'];
if ($depth > $current_depth)
@@ -406,7 +484,7 @@ class p_master
}
}
- $u_title = $module_url . '&amp;i=' . (($itep_ary['cat']) ? $itep_ary['id'] : $itep_ary['name'] . '&amp;mode=' . $itep_ary['mode']);
+ $u_title = $module_url . (($itep_ary['is_duplicate']) ? '&amp;icat=' . $current_id : '') . '&amp;i=' . (($itep_ary['cat']) ? $itep_ary['id'] : $itep_ary['name'] . '&amp;mode=' . $itep_ary['mode']);
$u_title .= (!$itep_ary['cat'] && isset($itep_ary['url_extra'])) ? $itep_ary['url_extra'] : '';
// Only output a categories items if it's currently selected
@@ -507,7 +585,7 @@ class p_master
{
foreach ($this->module_ary as $row_id => $itep_ary)
{
- if ($itep_ary['mode'] === $id || $itep_ary['id'] === (int) $id)
+ if ($itep_ary['name'] === $id || $itep_ary['id'] === (int) $id)
{
$this->module_ary[$row_id]['display'] = (int) $display;
break;
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index fefbbd4b01..d6baabef71 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -252,43 +252,43 @@ INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_ip'
INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_info', 1, 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_server', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_jabber', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_defaults', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_aauth', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_attach', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_authgroups', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_authusers', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_ban', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_bbcode', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_board', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_cookies', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_phpinfo', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_bots', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_clearlogs', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_viewlogs', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_words', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_icons', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_bbcode', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_attach', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_cookies', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_defaults', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_email', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_styles', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_bots', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_user', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_userdel', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_ranks', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_ban', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_names', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_group', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_groupadd', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_groupdel', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_fauth', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_forum', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_forumadd', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_forumdel', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_prune', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_profile', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_modules', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_group', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_groupadd', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_groupdel', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_icons', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_jabber', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_language', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_viewauth', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_fauth', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_mauth', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_aauth', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_modules', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_names', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_phpinfo', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_profile', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_prune', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_ranks', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_server', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_styles', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_uauth', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_authgroups', 1);
-INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_authusers', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_user', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_userdel', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_viewauth', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_viewlogs', 1);
+INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_words', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_', 1);
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_sendemail', 1);
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index df238c13a8..c576c2c1af 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -68,6 +68,9 @@ if (!($forum_data = $db->sql_fetchrow($result)))
}
$db->sql_freeresult($result);
+// Configure style, language, etc.
+$user->setup('viewforum', $forum_data['forum_style']);
+
// Redirect to login upon emailed notification links
if (isset($_GET['e']) && !$user->data['is_registered'])
{
@@ -101,9 +104,6 @@ if ($forum_data['forum_link'])
redirect(str_replace('&amp;', '&', $forum_data['forum_link']));
}
-// Configure style, language, etc.
-$user->setup('viewforum', $forum_data['forum_style']);
-
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
if ($forum_data['forum_password'])