mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
- fix some tiny bugs
- fix module system (sometimes the layout is broken due to falsly deactivated categories) - auth updates (setting permissions) - fix "category jumping" bug in acp - u_action is defined by the module itself git-svn-id: file:///svn/phpbb/trunk@5558 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
f2f0dc7892
commit
26a6d215d0
29 changed files with 954 additions and 866 deletions
|
@ -11,7 +11,6 @@
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
define('IN_PHPBB', 1);
|
define('IN_PHPBB', 1);
|
||||||
define('IN_ADMIN', true);
|
|
||||||
define('NEED_SID', true);
|
define('NEED_SID', true);
|
||||||
|
|
||||||
// Include files
|
// Include files
|
||||||
|
@ -47,19 +46,22 @@ if (!$auth->acl_get('a_'))
|
||||||
trigger_error($user->lang['NO_ADMIN']);
|
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
|
// Some oft used variables
|
||||||
$safe_mode = (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on') ? true : false;
|
$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;
|
$file_uploads = (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on') ? true : false;
|
||||||
$module_id = request_var('i', '');
|
$module_id = request_var('i', '');
|
||||||
$mode = request_var('mode', '');
|
$mode = request_var('mode', '');
|
||||||
|
|
||||||
// Force pagination seperation for admin style
|
|
||||||
$user->theme['pagination_sep'] = '';
|
|
||||||
|
|
||||||
// Set custom template for admin area
|
// Set custom template for admin area
|
||||||
$template->set_custom_template($phpbb_admin_path . 'style', 'admin');
|
$template->set_custom_template($phpbb_admin_path . 'style', 'admin');
|
||||||
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
|
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
|
||||||
|
|
||||||
|
// Force pagination seperation for admin style
|
||||||
|
$user->theme['pagination_sep'] = '';
|
||||||
|
|
||||||
// Instantiate new module
|
// Instantiate new module
|
||||||
$module = new p_master();
|
$module = new p_master();
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,13 @@
|
||||||
*/
|
*/
|
||||||
class acp_attachments
|
class acp_attachments
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache;
|
||||||
global $config, $SID, $phpbb_admin_path, $phpbb_root_path, $phpEx;
|
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'));
|
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
|
||||||
|
|
||||||
$error = $notify = array();
|
$error = $notify = array();
|
||||||
|
@ -54,7 +54,7 @@ class acp_attachments
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'L_TITLE' => $user->lang[$l_title],
|
'L_TITLE' => $user->lang[$l_title],
|
||||||
'L_TITLE_EXPLAIN' => $user->lang[$l_title . '_EXPLAIN'],
|
'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))
|
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_WIDTH' => $new['img_link_width'],
|
||||||
'LINK_HEIGHT' => $new['img_link_height'],
|
'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_QUOTA_SIZE_OPTIONS' => $s_quota_size_options,
|
||||||
'S_MAX_FILESIZE_OPTIONS' => $s_size_options,
|
'S_MAX_FILESIZE_OPTIONS' => $s_size_options,
|
||||||
|
@ -537,7 +537,7 @@ class acp_attachments
|
||||||
|
|
||||||
$this->rewrite_extensions();
|
$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
|
else
|
||||||
{
|
{
|
||||||
|
@ -556,7 +556,7 @@ class acp_attachments
|
||||||
|
|
||||||
if (!$group_id)
|
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 . "
|
$sql = 'SELECT * FROM ' . EXTENSION_GROUPS_TABLE . "
|
||||||
|
@ -738,7 +738,7 @@ class acp_attachments
|
||||||
|
|
||||||
if (!$group_id)
|
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 . '
|
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . '
|
||||||
|
@ -765,9 +765,9 @@ class acp_attachments
|
||||||
$template->assign_block_vars('groups', array(
|
$template->assign_block_vars('groups', array(
|
||||||
'S_ADD_SPACER' => $s_add_spacer,
|
'S_ADD_SPACER' => $s_add_spacer,
|
||||||
|
|
||||||
'U_EDIT' => $u_action . "&action=edit&g={$row['group_id']}",
|
'U_EDIT' => $this->u_action . "&action=edit&g={$row['group_id']}",
|
||||||
'U_DELETE' => $u_action . "&action=delete&g={$row['group_id']}",
|
'U_DELETE' => $this->u_action . "&action=delete&g={$row['group_id']}",
|
||||||
'U_ACT_DEACT' => $u_action . "&action=$act_deact&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)],
|
'L_ACT_DEACT' => $user->lang[strtoupper($act_deact)],
|
||||||
'GROUP_NAME' => $row['group_name'],
|
'GROUP_NAME' => $row['group_name'],
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_ban
|
class acp_ban
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache;
|
||||||
|
@ -27,8 +29,6 @@ class acp_ban
|
||||||
$user->add_lang('acp/ban');
|
$user->add_lang('acp/ban');
|
||||||
$this->tpl_name = 'acp_ban';
|
$this->tpl_name = 'acp_ban';
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
// Ban submitted?
|
// Ban submitted?
|
||||||
if ($bansubmit)
|
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);
|
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)
|
else if ($unbansubmit)
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ class acp_ban
|
||||||
|
|
||||||
user_unban($mode, $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
|
// Ban length options
|
||||||
|
@ -176,7 +176,7 @@ class acp_ban
|
||||||
'S_BANNED_OPTIONS' => ($banned_options) ? true : false,
|
'S_BANNED_OPTIONS' => ($banned_options) ? true : false,
|
||||||
'BANNED_OPTIONS' => $banned_options,
|
'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",
|
'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_ban&field=ban",
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_bbcodes
|
class acp_bbcodes
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache;
|
||||||
|
@ -27,8 +29,6 @@ class acp_bbcodes
|
||||||
$this->tpl_name = 'acp_bbcodes';
|
$this->tpl_name = 'acp_bbcodes';
|
||||||
$this->page_title = 'ACP_BBCODES';
|
$this->page_title = 'ACP_BBCODES';
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
// Set up mode-specific vars
|
// Set up mode-specific vars
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
|
@ -80,8 +80,8 @@ class acp_bbcodes
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_EDIT_BBCODE' => true,
|
'S_EDIT_BBCODE' => true,
|
||||||
'U_BACK' => $u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'U_ACTION' => $u_action . '&action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&bbcode=$bbcode_id" : ''),
|
'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&bbcode=$bbcode_id" : ''),
|
||||||
|
|
||||||
'BBCODE_MATCH' => $bbcode_match,
|
'BBCODE_MATCH' => $bbcode_match,
|
||||||
'BBCODE_TPL' => $bbcode_tpl,
|
'BBCODE_TPL' => $bbcode_tpl,
|
||||||
|
@ -165,7 +165,7 @@ class acp_bbcodes
|
||||||
|
|
||||||
add_log('admin', $log_action, $data['bbcode_tag']);
|
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;
|
break;
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ class acp_bbcodes
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ACTION' => $u_action . '&mode=add')
|
'U_ACTION' => $this->u_action . '&mode=add')
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
|
@ -198,8 +198,8 @@ class acp_bbcodes
|
||||||
{
|
{
|
||||||
$template->assign_block_vars('bbcodes', array(
|
$template->assign_block_vars('bbcodes', array(
|
||||||
'BBCODE_TAG' => $row['bbcode_tag'],
|
'BBCODE_TAG' => $row['bbcode_tag'],
|
||||||
'U_EDIT' => $u_action . '&action=edit&bbcode=' . $row['bbcode_id'],
|
'U_EDIT' => $this->u_action . '&action=edit&bbcode=' . $row['bbcode_id'],
|
||||||
'U_DELETE' => $u_action . '&action=delete&bbcode=' . $row['bbcode_id'])
|
'U_DELETE' => $this->u_action . '&action=delete&bbcode=' . $row['bbcode_id'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
*/
|
*/
|
||||||
class acp_board
|
class acp_board
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
var $new_config = array();
|
var $new_config = array();
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
|
@ -255,8 +256,6 @@ class acp_board
|
||||||
trigger_error('NO_MODE');
|
trigger_error('NO_MODE');
|
||||||
}
|
}
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
if (isset($display_vars['lang']))
|
if (isset($display_vars['lang']))
|
||||||
{
|
{
|
||||||
$user->add_lang($display_vars['lang']);
|
$user->add_lang($display_vars['lang']);
|
||||||
|
@ -347,7 +346,7 @@ class acp_board
|
||||||
{
|
{
|
||||||
add_log('admin', 'LOG_CONFIG_' . strtoupper($mode));
|
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';
|
$this->tpl_name = 'acp_board';
|
||||||
|
@ -356,7 +355,7 @@ class acp_board
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'L_TITLE' => $user->lang[$display_vars['title']],
|
'L_TITLE' => $user->lang[$display_vars['title']],
|
||||||
'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'],
|
'L_TITLE_EXPLAIN' => $user->lang[$display_vars['title'] . '_EXPLAIN'],
|
||||||
'U_ACTION' => $u_action)
|
'U_ACTION' => $this->u_action)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Output relevant page
|
// Output relevant page
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_bots
|
class acp_bots
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache;
|
||||||
|
@ -34,8 +36,6 @@ class acp_bots
|
||||||
$this->tpl_name = 'acp_bots';
|
$this->tpl_name = 'acp_bots';
|
||||||
$this->page_title = '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!
|
// User wants to do something, how inconsiderate of them!
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ class acp_bots
|
||||||
$cache->destroy('bots');
|
$cache->destroy('bots');
|
||||||
|
|
||||||
add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary));
|
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;
|
break;
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ class acp_bots
|
||||||
|
|
||||||
if (!$group_row)
|
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(
|
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
|
||||||
|
@ -202,7 +202,7 @@ class acp_bots
|
||||||
|
|
||||||
if (!$row)
|
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(
|
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
|
||||||
|
@ -227,7 +227,7 @@ class acp_bots
|
||||||
$cache->destroy('bots');
|
$cache->destroy('bots');
|
||||||
|
|
||||||
add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
|
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)
|
else if ($bot_id)
|
||||||
|
@ -242,7 +242,7 @@ class acp_bots
|
||||||
|
|
||||||
if (!$bot_row)
|
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'];
|
$bot_row['bot_lang'] = $bot_row['user_lang'];
|
||||||
|
@ -265,8 +265,8 @@ class acp_bots
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'L_TITLE' => $user->lang['BOT_' . $l_title],
|
'L_TITLE' => $user->lang['BOT_' . $l_title],
|
||||||
'U_ACTION' => $u_action . "&id=$bot_id&action=$action",
|
'U_ACTION' => $this->u_action . "&id=$bot_id&action=$action",
|
||||||
'U_BACK' => $u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||||
|
|
||||||
'BOT_NAME' => $bot_row['bot_name'],
|
'BOT_NAME' => $bot_row['bot_name'],
|
||||||
|
@ -294,7 +294,7 @@ class acp_bots
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ACTION' => $u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'S_BOT_OPTIONS' => $s_options)
|
'S_BOT_OPTIONS' => $s_options)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -314,10 +314,10 @@ class acp_bots
|
||||||
'BOT_ID' => $row['bot_id'],
|
'BOT_ID' => $row['bot_id'],
|
||||||
'LAST_VISIT' => ($row['user_lastvisit']) ? $user->format_date($row['user_lastvisit']) : $user->lang['BOT_NEVER'],
|
'LAST_VISIT' => ($row['user_lastvisit']) ? $user->format_date($row['user_lastvisit']) : $user->lang['BOT_NEVER'],
|
||||||
|
|
||||||
'U_ACTIVATE_DEACTIVATE' => $u_action . "&id={$row['bot_id']}&action=$active_value",
|
'U_ACTIVATE_DEACTIVATE' => $this->u_action . "&id={$row['bot_id']}&action=$active_value",
|
||||||
'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang],
|
'L_ACTIVATE_DEACTIVATE' => $user->lang[$active_lang],
|
||||||
'U_EDIT' => $u_action . "&id={$row['bot_id']}&action=edit",
|
'U_EDIT' => $this->u_action . "&id={$row['bot_id']}&action=edit",
|
||||||
'U_DELETE' => $u_action . "&id={$row['bot_id']}&action=delete")
|
'U_DELETE' => $this->u_action . "&id={$row['bot_id']}&action=delete")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_disallow
|
class acp_disallow
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache;
|
||||||
|
@ -29,8 +31,6 @@ class acp_disallow
|
||||||
$disallow = (isset($_POST['disallow'])) ? true : false;
|
$disallow = (isset($_POST['disallow'])) ? true : false;
|
||||||
$allow = (isset($_POST['allow'])) ? true : false;
|
$allow = (isset($_POST['allow'])) ? true : false;
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
if ($disallow)
|
if ($disallow)
|
||||||
{
|
{
|
||||||
$disallowed_user = str_replace('*', '%', request_var('disallowed_user', ''));
|
$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));
|
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)
|
else if ($allow)
|
||||||
{
|
{
|
||||||
|
@ -53,7 +53,7 @@ class acp_disallow
|
||||||
|
|
||||||
if (!$disallowed_id)
|
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 . "
|
$sql = 'DELETE FROM ' . DISALLOW_TABLE . "
|
||||||
|
@ -62,7 +62,7 @@ class acp_disallow
|
||||||
|
|
||||||
add_log('admin', 'LOG_DISALLOW_DELETE');
|
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...
|
// Grab the current list of disallowed usernames...
|
||||||
|
@ -78,7 +78,7 @@ class acp_disallow
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ACTION' => $u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'S_DISALLOWED_NAMES' => $disallow_select)
|
'S_DISALLOWED_NAMES' => $disallow_select)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_email
|
class acp_email
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache;
|
||||||
|
@ -22,8 +24,6 @@ class acp_email
|
||||||
$this->tpl_name = 'acp_email';
|
$this->tpl_name = 'acp_email';
|
||||||
$this->page_title = 'ACP_MASS_EMAIL';
|
$this->page_title = 'ACP_MASS_EMAIL';
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
// Set some vars
|
// Set some vars
|
||||||
$submit = (isset($_POST['submit'])) ? true : false;
|
$submit = (isset($_POST['submit'])) ? true : false;
|
||||||
$error = array();
|
$error = array();
|
||||||
|
@ -87,7 +87,7 @@ class acp_email
|
||||||
|
|
||||||
if (!($row = $db->sql_fetchrow($result)))
|
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);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ class acp_email
|
||||||
|
|
||||||
add_log('admin', 'LOG_MASS_EMAIL', $group_name);
|
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&i=logs&mode=critical" . '">', '</a>');
|
$message = (!$errored) ? $user->lang['EMAIL_SENT'] : sprintf($user->lang['EMAIL_SEND_ERROR'], '<a href="' . $phpbb_admin_path . "index.$phpEx$SID&i=logs&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(
|
$template->assign_vars(array(
|
||||||
'S_WARNING' => (sizeof($error)) ? true : false,
|
'S_WARNING' => (sizeof($error)) ? true : false,
|
||||||
'WARNING_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
'WARNING_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||||
'U_ACTION' => $u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'S_GROUP_OPTIONS' => $select_list,
|
'S_GROUP_OPTIONS' => $select_list,
|
||||||
'USERNAMES' => $usernames,
|
'USERNAMES' => $usernames,
|
||||||
'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_email&field=usernames",
|
'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_email&field=usernames",
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*/
|
*/
|
||||||
class acp_forums
|
class acp_forums
|
||||||
{
|
{
|
||||||
var $u_action = '';
|
var $u_action;
|
||||||
var $parent_id = 0;
|
var $parent_id = 0;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
|
@ -26,8 +26,6 @@ class acp_forums
|
||||||
$this->tpl_name = 'acp_forums';
|
$this->tpl_name = 'acp_forums';
|
||||||
$this->page_title = 'ACP_MANAGE_FORUMS';
|
$this->page_title = 'ACP_MANAGE_FORUMS';
|
||||||
|
|
||||||
$this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
$action = request_var('action', '');
|
$action = request_var('action', '');
|
||||||
$update = (isset($_POST['update'])) ? true : false;
|
$update = (isset($_POST['update'])) ? true : false;
|
||||||
$forum_id = request_var('f', 0);
|
$forum_id = request_var('f', 0);
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_groups
|
class acp_groups
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache;
|
||||||
|
@ -23,8 +25,6 @@ class acp_groups
|
||||||
$this->tpl_name = 'acp_groups';
|
$this->tpl_name = 'acp_groups';
|
||||||
$this->page_title = 'ACP_GROUPS_MANAGE';
|
$this->page_title = 'ACP_GROUPS_MANAGE';
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||||
|
|
||||||
// Check and set some common vars
|
// Check and set some common vars
|
||||||
|
@ -53,7 +53,7 @@ class acp_groups
|
||||||
|
|
||||||
if (!$group_row)
|
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':
|
case 'promote':
|
||||||
if (!$group_id)
|
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
|
// Approve, demote or promote
|
||||||
|
@ -86,13 +86,13 @@ class acp_groups
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error($user->lang[$message] . adm_back_link($u_action));
|
trigger_error($user->lang[$message] . adm_back_link($this->u_action));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'default':
|
case 'default':
|
||||||
if (!$group_id)
|
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))
|
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);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -156,7 +156,7 @@ class acp_groups
|
||||||
{
|
{
|
||||||
if (!$group_id)
|
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 = '';
|
$error = '';
|
||||||
|
@ -174,11 +174,11 @@ class acp_groups
|
||||||
|
|
||||||
if ($error)
|
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';
|
$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
|
else
|
||||||
{
|
{
|
||||||
|
@ -195,12 +195,12 @@ class acp_groups
|
||||||
case 'addusers':
|
case 'addusers':
|
||||||
if (!$group_id)
|
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)
|
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));
|
$name_ary = array_unique(explode("\n", $name_ary));
|
||||||
|
@ -208,11 +208,11 @@ class acp_groups
|
||||||
// Add user/s to group
|
// Add user/s to group
|
||||||
if ($error = group_user_add($group_id, false, $name_ary, $group_row['group_name'], $default, $leader, 0, $group_row))
|
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';
|
$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;
|
break;
|
||||||
|
|
||||||
case 'edit':
|
case 'edit':
|
||||||
|
@ -222,7 +222,7 @@ class acp_groups
|
||||||
|
|
||||||
if ($action == 'edit' && !$group_id)
|
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();
|
$error = array();
|
||||||
|
@ -318,7 +318,7 @@ class acp_groups
|
||||||
if (!($error = group_create($group_id, $group_type, $group_name, $group_description, $group_attributes)))
|
if (!($error = group_create($group_id, $group_type, $group_name, $group_description, $group_attributes)))
|
||||||
{
|
{
|
||||||
$message = ($action == 'edit') ? 'GROUP_UPDATED' : 'GROUP_CREATED';
|
$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)
|
else if (!$group_id)
|
||||||
|
@ -392,7 +392,7 @@ class acp_groups
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$u_back = $u_action;
|
$u_back = $this->u_action;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ class acp_groups
|
||||||
|
|
||||||
'U_BACK' => $u_back,
|
'U_BACK' => $u_back,
|
||||||
'U_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=settings&name=group_colour",
|
'U_SWATCH' => "{$phpbb_admin_path}swatch.$phpEx$SID&form=settings&name=group_colour",
|
||||||
'U_ACTION' => "{$u_action}&action=$action&g=$group_id",
|
'U_ACTION' => "{$this->u_action}&action=$action&g=$group_id",
|
||||||
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),
|
'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)
|
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';
|
$this->page_title = 'GROUP_MEMBERS';
|
||||||
|
@ -509,10 +509,10 @@ class acp_groups
|
||||||
'S_ACTION_OPTIONS' => $s_action_options,
|
'S_ACTION_OPTIONS' => $s_action_options,
|
||||||
|
|
||||||
'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
|
'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start),
|
||||||
'PAGINATION' => generate_pagination($u_action . "&action=$action&g=$group_id", $total_members, $config['topics_per_page'], $start, true),
|
'PAGINATION' => generate_pagination($this->u_action . "&action=$action&g=$group_id", $total_members, $config['topics_per_page'], $start, true),
|
||||||
|
|
||||||
'U_ACTION' => $u_action . "&g=$group_id",
|
'U_ACTION' => $this->u_action . "&g=$group_id",
|
||||||
'U_BACK' => $u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=list&field=usernames")
|
'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=list&field=usernames")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -561,7 +561,7 @@ class acp_groups
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$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'];
|
$group_name = (!empty($user->lang['G_' . $row['group_name']]))? $user->lang['G_' . $row['group_name']] : $row['group_name'];
|
||||||
|
|
||||||
$template->assign_block_vars('groups', array(
|
$template->assign_block_vars('groups', array(
|
||||||
'U_LIST' => "{$u_action}&action=list&g=$group_id",
|
'U_LIST' => "{$this->u_action}&action=list&g=$group_id",
|
||||||
'U_DEFAULT' => "{$u_action}&action=default&g=$group_id",
|
'U_DEFAULT' => "{$this->u_action}&action=default&g=$group_id",
|
||||||
'U_EDIT' => "{$u_action}&action=edit&g=$group_id",
|
'U_EDIT' => "{$this->u_action}&action=edit&g=$group_id",
|
||||||
'U_DELETE' => "{$u_action}&action=delete&g=$group_id",
|
'U_DELETE' => "{$this->u_action}&action=delete&g=$group_id",
|
||||||
|
|
||||||
'S_GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL) ? true : false,
|
'S_GROUP_SPECIAL' => ($row['group_type'] == GROUP_SPECIAL) ? true : false,
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_icons
|
class acp_icons
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache;
|
||||||
|
@ -29,8 +31,6 @@ class acp_icons
|
||||||
|
|
||||||
$this->tpl_name = 'acp_icons';
|
$this->tpl_name = 'acp_icons';
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
// What are we working on?
|
// What are we working on?
|
||||||
switch ($mode)
|
switch ($mode)
|
||||||
{
|
{
|
||||||
|
@ -170,8 +170,8 @@ class acp_icons
|
||||||
'COLSPAN' => $colspan,
|
'COLSPAN' => $colspan,
|
||||||
'ID' => $icon_id,
|
'ID' => $icon_id,
|
||||||
|
|
||||||
'U_BACK' => $u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'U_ACTION' => $u_action . '&action=' . (($action == 'add') ? 'create' : 'modify'),
|
'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'create' : 'modify'),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -306,11 +306,11 @@ class acp_icons
|
||||||
|
|
||||||
if ($action == 'modify')
|
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
|
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;
|
break;
|
||||||
|
@ -358,7 +358,7 @@ class acp_icons
|
||||||
|
|
||||||
if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak)))
|
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)
|
foreach ($pak_ary as $pak_entry)
|
||||||
|
@ -369,7 +369,7 @@ class acp_icons
|
||||||
if ((sizeof($data[1]) != 3 && $mode == 'icons') ||
|
if ((sizeof($data[1]) != 3 && $mode == 'icons') ||
|
||||||
(sizeof($data[1]) != 5 && $mode == 'smilies'))
|
(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]);
|
$img = stripslashes($data[1][0]);
|
||||||
|
@ -427,7 +427,7 @@ class acp_icons
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache->destroy('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
|
else
|
||||||
{
|
{
|
||||||
|
@ -450,8 +450,8 @@ class acp_icons
|
||||||
'L_CURRENT_EXPLAIN' => $user->lang['CURRENT_' . $lang . '_EXPLAIN'],
|
'L_CURRENT_EXPLAIN' => $user->lang['CURRENT_' . $lang . '_EXPLAIN'],
|
||||||
'L_IMPORT_SUBMIT' => $user->lang['IMPORT_' . $lang],
|
'L_IMPORT_SUBMIT' => $user->lang['IMPORT_' . $lang],
|
||||||
|
|
||||||
'U_BACK' => $u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'U_ACTION' => $u_action . '&action=import',
|
'U_ACTION' => $this->u_action . '&action=import',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -464,7 +464,7 @@ class acp_icons
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'MESSAGE_TITLE' => $user->lang['EXPORT_' . $lang],
|
'MESSAGE_TITLE' => $user->lang['EXPORT_' . $lang],
|
||||||
'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $u_action . '&action=send">', '</a>'))
|
'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="' . $this->u_action . '&action=send">', '</a>'))
|
||||||
);
|
);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -509,7 +509,7 @@ class acp_icons
|
||||||
}
|
}
|
||||||
else
|
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;
|
break;
|
||||||
|
@ -594,9 +594,9 @@ class acp_icons
|
||||||
|
|
||||||
'S_SMILIES' => ($mode == 'smilies') ? true : false,
|
'S_SMILIES' => ($mode == 'smilies') ? true : false,
|
||||||
|
|
||||||
'U_ACTION' => $u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'U_IMPORT' => $u_action . '&action=import',
|
'U_IMPORT' => $this->u_action . '&action=import',
|
||||||
'U_EXPORT' => $u_action . '&action=export',
|
'U_EXPORT' => $this->u_action . '&action=export',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -619,10 +619,10 @@ class acp_icons
|
||||||
'HEIGHT' => $row[$fields . '_height'],
|
'HEIGHT' => $row[$fields . '_height'],
|
||||||
'CODE' => (isset($row['code'])) ? $row['code'] : '',
|
'CODE' => (isset($row['code'])) ? $row['code'] : '',
|
||||||
'EMOTION' => (isset($row['emotion'])) ? $row['emotion'] : '',
|
'EMOTION' => (isset($row['emotion'])) ? $row['emotion'] : '',
|
||||||
'U_EDIT' => $u_action . '&action=edit&id=' . $row[$fields . '_id'],
|
'U_EDIT' => $this->u_action . '&action=edit&id=' . $row[$fields . '_id'],
|
||||||
'U_DELETE' => $u_action . '&action=delete&id=' . $row[$fields . '_id'],
|
'U_DELETE' => $this->u_action . '&action=delete&id=' . $row[$fields . '_id'],
|
||||||
'U_MOVE_UP' => $u_action . '&action=move_up&order=' . $row[$fields . '_order'],
|
'U_MOVE_UP' => $this->u_action . '&action=move_up&order=' . $row[$fields . '_order'],
|
||||||
'U_MOVE_DOWN' => $u_action . '&action=move_down&order=' . $row[$fields . '_order'])
|
'U_MOVE_DOWN' => $this->u_action . '&action=move_down&order=' . $row[$fields . '_order'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$spacer && !$row['display_on_posting'])
|
if (!$spacer && !$row['display_on_posting'])
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_jabber
|
class acp_jabber
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template;
|
global $db, $user, $auth, $template;
|
||||||
|
@ -31,7 +33,6 @@ class acp_jabber
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
$this->tpl_name = 'acp_jabber';
|
$this->tpl_name = 'acp_jabber';
|
||||||
$this->page_title = 'ACP_JABBER_SETTINGS';
|
$this->page_title = 'ACP_JABBER_SETTINGS';
|
||||||
|
|
||||||
|
@ -63,7 +64,7 @@ class acp_jabber
|
||||||
{
|
{
|
||||||
if (!$jabber->Connect())
|
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
|
// First we'll try to authorise using this account, if that fails we'll
|
||||||
|
@ -93,12 +94,12 @@ class acp_jabber
|
||||||
{
|
{
|
||||||
if (!$jabber->Connect())
|
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())
|
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');
|
$jabber->SendPresence(NULL, NULL, 'online');
|
||||||
|
|
||||||
|
@ -140,7 +141,7 @@ class acp_jabber
|
||||||
if ($submit && !sizeof($error))
|
if ($submit && !sizeof($error))
|
||||||
{
|
{
|
||||||
add_log('admin', 'LOG_' . $log);
|
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))
|
if (sizeof($error))
|
||||||
|
@ -152,7 +153,7 @@ class acp_jabber
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ACTION' => $u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'JAB_ENABLE' => $new['jab_enable'],
|
'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>'),
|
'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'],
|
'JAB_HOST' => $new['jab_host'],
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
*/
|
*/
|
||||||
class acp_language
|
class acp_language
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
var $main_files;
|
var $main_files;
|
||||||
var $language_header = '';
|
var $language_header = '';
|
||||||
var $lang_header = '';
|
var $lang_header = '';
|
||||||
|
@ -54,15 +55,13 @@ class acp_language
|
||||||
$this->tpl_name = 'acp_language';
|
$this->tpl_name = 'acp_language';
|
||||||
$this->page_title = 'ACP_LANGUAGE_PACKS';
|
$this->page_title = 'ACP_LANGUAGE_PACKS';
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'update_details':
|
case 'update_details':
|
||||||
|
|
||||||
if (!$lang_id)
|
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 . "
|
$sql = 'SELECT * FROM ' . LANG_TABLE . "
|
||||||
|
@ -83,7 +82,7 @@ class acp_language
|
||||||
|
|
||||||
add_log('admin', 'LOG_LANGUAGE_PACK_UPDATED', $sql_ary['lang_english_name']);
|
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;
|
break;
|
||||||
|
|
||||||
case 'submit_file':
|
case 'submit_file':
|
||||||
|
@ -91,12 +90,12 @@ class acp_language
|
||||||
|
|
||||||
if (!$lang_id || !isset($_POST['entry']) || !is_array($_POST['entry']))
|
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)))
|
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 . "
|
$sql = 'SELECT * FROM ' . LANG_TABLE . "
|
||||||
|
@ -235,7 +234,7 @@ class acp_language
|
||||||
|
|
||||||
if (!$lang_id)
|
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';
|
$this->page_title = 'LANGUAGE_PACK_DETAILS';
|
||||||
|
@ -267,28 +266,28 @@ class acp_language
|
||||||
case 'email':
|
case 'email':
|
||||||
if (!in_array($this->language_file, $email_files))
|
if (!in_array($this->language_file, $email_files))
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($u_action . '&action=details&id=' . $lang_id));
|
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'acp':
|
case 'acp':
|
||||||
if (!in_array($this->language_file, $acp_files))
|
if (!in_array($this->language_file, $acp_files))
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($u_action . '&action=details&id=' . $lang_id));
|
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'mods':
|
case 'mods':
|
||||||
if (!in_array($this->language_file, $mods_files))
|
if (!in_array($this->language_file, $mods_files))
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($u_action . '&action=details&id=' . $lang_id));
|
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (!in_array($this->language_file, $this->main_files))
|
if (!in_array($this->language_file, $this->main_files))
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($u_action . '&action=details&id=' . $lang_id));
|
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,8 +299,8 @@ class acp_language
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_DETAILS' => true,
|
'S_DETAILS' => true,
|
||||||
'U_ACTION' => $u_action . "&action=details&id=$lang_id",
|
'U_ACTION' => $this->u_action . "&action=details&id=$lang_id",
|
||||||
'U_BACK' => $u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'LANG_LOCAL_NAME' => $lang_entries['lang_local_name'],
|
'LANG_LOCAL_NAME' => $lang_entries['lang_local_name'],
|
||||||
'LANG_ENGLISH_NAME' => $lang_entries['lang_english_name'],
|
'LANG_ENGLISH_NAME' => $lang_entries['lang_english_name'],
|
||||||
'LANG_ISO' => $lang_entries['lang_iso'],
|
'LANG_ISO' => $lang_entries['lang_iso'],
|
||||||
|
@ -392,7 +391,7 @@ class acp_language
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_MISSING_VARS' => true,
|
'S_MISSING_VARS' => true,
|
||||||
'L_MISSING_VARS_EXPLAIN' => sprintf($user->lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']),
|
'L_MISSING_VARS_EXPLAIN' => sprintf($user->lang['THOSE_MISSING_LANG_VARIABLES'], $lang_entries['lang_local_name']),
|
||||||
'U_MISSING_ACTION' => $u_action . "&action=$action&id=$lang_id")
|
'U_MISSING_ACTION' => $this->u_action . "&action=$action&id=$lang_id")
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($missing_vars as $file => $vars)
|
foreach ($missing_vars as $file => $vars)
|
||||||
|
@ -496,7 +495,7 @@ class acp_language
|
||||||
|
|
||||||
// Normal language pack entries
|
// Normal language pack entries
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ENTRY_ACTION' => $u_action . "&action=details&id=$lang_id#entries",
|
'U_ENTRY_ACTION' => $this->u_action . "&action=details&id=$lang_id#entries",
|
||||||
'S_EMAIL_FILE' => $is_email_file,
|
'S_EMAIL_FILE' => $is_email_file,
|
||||||
'S_FROM_STORE' => $file_from_store,
|
'S_FROM_STORE' => $file_from_store,
|
||||||
'S_LANG_OPTIONS' => $s_lang_options,
|
'S_LANG_OPTIONS' => $s_lang_options,
|
||||||
|
@ -536,7 +535,7 @@ class acp_language
|
||||||
|
|
||||||
if (!$lang_id)
|
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 . '
|
$sql = 'SELECT * FROM ' . LANG_TABLE . '
|
||||||
|
@ -547,7 +546,7 @@ class acp_language
|
||||||
|
|
||||||
if ($row['lang_iso'] == $config['default_lang'])
|
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);
|
$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']);
|
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;
|
break;
|
||||||
|
|
||||||
case 'install':
|
case 'install':
|
||||||
|
@ -568,7 +567,7 @@ class acp_language
|
||||||
|
|
||||||
if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt"))
|
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");
|
$file = file("{$phpbb_root_path}language/$lang_iso/iso.txt");
|
||||||
|
@ -587,13 +586,13 @@ class acp_language
|
||||||
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
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);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if (!$lang_pack['name'] || !$lang_pack['local_name'])
|
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
|
// Add language pack
|
||||||
|
@ -609,7 +608,7 @@ class acp_language
|
||||||
|
|
||||||
add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']);
|
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;
|
break;
|
||||||
|
|
||||||
|
@ -617,7 +616,7 @@ class acp_language
|
||||||
|
|
||||||
if (!$lang_id)
|
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 . '
|
$sql = 'SELECT * FROM ' . LANG_TABLE . '
|
||||||
|
@ -653,8 +652,8 @@ class acp_language
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_SELECT_METHOD' => true,
|
'S_SELECT_METHOD' => true,
|
||||||
'U_BACK' => $u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'U_ACTION' => $u_action . "&action=$action&id=$lang_id",
|
'U_ACTION' => $this->u_action . "&action=$action&id=$lang_id",
|
||||||
'RADIO_BUTTONS' => $radio_buttons)
|
'RADIO_BUTTONS' => $radio_buttons)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -747,9 +746,9 @@ class acp_language
|
||||||
$tagstyle = ($row['lang_iso'] == $config['default_lang']) ? '*' : '';
|
$tagstyle = ($row['lang_iso'] == $config['default_lang']) ? '*' : '';
|
||||||
|
|
||||||
$template->assign_block_vars('lang', array(
|
$template->assign_block_vars('lang', array(
|
||||||
'U_DETAILS' => $u_action . "&action=details&id={$row['lang_id']}",
|
'U_DETAILS' => $this->u_action . "&action=details&id={$row['lang_id']}",
|
||||||
'U_DOWNLOAD' => $u_action . "&action=download&id={$row['lang_id']}",
|
'U_DOWNLOAD' => $this->u_action . "&action=download&id={$row['lang_id']}",
|
||||||
'U_DELETE' => $u_action . "&action=delete&id={$row['lang_id']}",
|
'U_DELETE' => $this->u_action . "&action=delete&id={$row['lang_id']}",
|
||||||
|
|
||||||
'ENGLISH_NAME' => $row['lang_english_name'],
|
'ENGLISH_NAME' => $row['lang_english_name'],
|
||||||
'TAG' => $tagstyle,
|
'TAG' => $tagstyle,
|
||||||
|
@ -797,7 +796,7 @@ class acp_language
|
||||||
'ISO' => $lang_ary['iso'],
|
'ISO' => $lang_ary['iso'],
|
||||||
'LOCAL_NAME' => $lang_ary['local_name'],
|
'LOCAL_NAME' => $lang_ary['local_name'],
|
||||||
'NAME' => $lang_ary['name'],
|
'NAME' => $lang_ary['name'],
|
||||||
'U_INSTALL' => $u_action . '&action=install&iso=' . urlencode($lang_ary['iso']))
|
'U_INSTALL' => $this->u_action . '&action=install&iso=' . urlencode($lang_ary['iso']))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_logs
|
class acp_logs
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache;
|
||||||
|
@ -36,8 +38,6 @@ class acp_logs
|
||||||
$this->tpl_name = 'acp_logs';
|
$this->tpl_name = 'acp_logs';
|
||||||
$this->log_type = constant('LOG_' . strtoupper($mode));
|
$this->log_type = constant('LOG_' . strtoupper($mode));
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
// Delete entries if requested and able
|
// Delete entries if requested and able
|
||||||
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
|
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
|
||||||
{
|
{
|
||||||
|
@ -100,10 +100,10 @@ class acp_logs
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'L_TITLE' => $l_title,
|
'L_TITLE' => $l_title,
|
||||||
'L_EXPLAIN' => $l_title_explain,
|
'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),
|
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
|
||||||
'PAGINATION' => generate_pagination($u_action . "&$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
|
'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
|
||||||
|
|
||||||
'S_LIMIT_DAYS' => $s_limit_days,
|
'S_LIMIT_DAYS' => $s_limit_days,
|
||||||
'S_SORT_KEY' => $s_sort_key,
|
'S_SORT_KEY' => $s_sort_key,
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_main
|
class acp_main
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template;
|
global $config, $db, $user, $auth, $template;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
class acp_modules
|
class acp_modules
|
||||||
{
|
{
|
||||||
var $module_class = '';
|
var $module_class = '';
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
|
@ -51,7 +52,6 @@ class acp_modules
|
||||||
|
|
||||||
$this->page_title = strtoupper($this->module_class);
|
$this->page_title = strtoupper($this->module_class);
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
$parent_id = request_var('parent_id', 0);
|
$parent_id = request_var('parent_id', 0);
|
||||||
$module_id = request_var('m', 0);
|
$module_id = request_var('m', 0);
|
||||||
$action = request_var('action', '');
|
$action = request_var('action', '');
|
||||||
|
@ -62,7 +62,7 @@ class acp_modules
|
||||||
case 'delete':
|
case 'delete':
|
||||||
if (!$module_id)
|
if (!$module_id)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($u_action . '&parent_id=' . $parent_id));
|
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (confirm_box(true))
|
if (confirm_box(true))
|
||||||
|
@ -72,7 +72,7 @@ class acp_modules
|
||||||
if (!sizeof($errors))
|
if (!sizeof($errors))
|
||||||
{
|
{
|
||||||
$this->remove_cache_file();
|
$this->remove_cache_file();
|
||||||
trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($u_action . '&parent_id=' . $parent_id));
|
trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -92,7 +92,7 @@ class acp_modules
|
||||||
case 'disable':
|
case 'disable':
|
||||||
if (!$module_id)
|
if (!$module_id)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($u_action . '&parent_id=' . $parent_id));
|
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'UPDATE ' . MODULES_TABLE . '
|
$sql = 'UPDATE ' . MODULES_TABLE . '
|
||||||
|
@ -109,7 +109,7 @@ class acp_modules
|
||||||
case 'move_down':
|
case 'move_down':
|
||||||
if (!$module_id)
|
if (!$module_id)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($u_action . '&parent_id=' . $parent_id));
|
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = 'SELECT parent_id, left_id, right_id, module_langname
|
$sql = 'SELECT parent_id, left_id, right_id, module_langname
|
||||||
|
@ -120,7 +120,7 @@ class acp_modules
|
||||||
|
|
||||||
if (!($row = $db->sql_fetchrow($result)))
|
if (!($row = $db->sql_fetchrow($result)))
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_MODULE'] . adm_back_link($u_action . '&parent_id=' . $parent_id));
|
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ class acp_modules
|
||||||
recalc_btree('module_id', MODULES_TABLE, $this->module_class);
|
recalc_btree('module_id', MODULES_TABLE, $this->module_class);
|
||||||
$this->remove_cache_file();
|
$this->remove_cache_file();
|
||||||
|
|
||||||
trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($u_action . '&parent_id=' . $parent_id));
|
trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ class acp_modules
|
||||||
|
|
||||||
if (!$module_id)
|
if (!$module_id)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($u_action . '&parent_id=' . $parent_id));
|
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
$module_row = $this->get_module_row($module_id);
|
$module_row = $this->get_module_row($module_id);
|
||||||
|
@ -310,7 +310,7 @@ class acp_modules
|
||||||
{
|
{
|
||||||
if (!$module_data['module_langname'])
|
if (!$module_data['module_langname'])
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($u_action . '&parent_id=' . $parent_id));
|
trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&parent_id=' . $parent_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
$module_type = request_var('module_type', 'category');
|
$module_type = request_var('module_type', 'category');
|
||||||
|
@ -341,7 +341,7 @@ class acp_modules
|
||||||
recalc_btree('module_id', MODULES_TABLE, $this->module_class);
|
recalc_btree('module_id', MODULES_TABLE, $this->module_class);
|
||||||
$this->remove_cache_file();
|
$this->remove_cache_file();
|
||||||
|
|
||||||
trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($u_action . '&parent_id=' . $parent_id));
|
trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&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_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_NAMES' => $s_name_options,
|
||||||
'S_MODULE_MODES' => $s_mode_options,
|
'S_MODULE_MODES' => $s_mode_options,
|
||||||
'U_BACK' => $u_action . '&parent_id=' . $parent_id,
|
'U_BACK' => $this->u_action . '&parent_id=' . $parent_id,
|
||||||
'U_EDIT_ACTION' => $u_action . '&parent_id=' . $parent_id,
|
'U_EDIT_ACTION' => $this->u_action . '&parent_id=' . $parent_id,
|
||||||
|
|
||||||
'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'],
|
'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'],
|
||||||
|
|
||||||
|
@ -429,7 +429,7 @@ class acp_modules
|
||||||
}
|
}
|
||||||
else
|
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');
|
$modules_nav = $this->get_module_branch($parent_id, 'parents', 'descending');
|
||||||
foreach ($modules_nav as $row)
|
foreach ($modules_nav as $row)
|
||||||
|
@ -442,7 +442,7 @@ class acp_modules
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$navigation .= ' -> <a href="' . $u_action . '&parent_id=' . $row['module_id'] . '">' . $langname . '</a>';
|
$navigation .= ' -> <a href="' . $this->u_action . '&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'] . '" />';
|
$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 . '&parent_id=' . $parent_id . '&m=' . $row['module_id'];
|
$url = $this->u_action . '&parent_id=' . $parent_id . '&m=' . $row['module_id'];
|
||||||
|
|
||||||
$template->assign_block_vars('modules', array(
|
$template->assign_block_vars('modules', array(
|
||||||
'MODULE_IMAGE' => $module_image,
|
'MODULE_IMAGE' => $module_image,
|
||||||
|
@ -480,7 +480,7 @@ class acp_modules
|
||||||
'MODULE_ENABLED' => ($row['module_enabled']) ? true : false,
|
'MODULE_ENABLED' => ($row['module_enabled']) ? true : false,
|
||||||
'MODULE_DISPLAYED' => ($row['module_display']) ? true : false,
|
'MODULE_DISPLAYED' => ($row['module_display']) ? true : false,
|
||||||
|
|
||||||
'U_MODULE' => $u_action . '&parent_id=' . $row['module_id'],
|
'U_MODULE' => $this->u_action . '&parent_id=' . $row['module_id'],
|
||||||
'U_MOVE_UP' => $url . '&action=move_up',
|
'U_MOVE_UP' => $url . '&action=move_up',
|
||||||
'U_MOVE_DOWN' => $url . '&action=move_down',
|
'U_MOVE_DOWN' => $url . '&action=move_down',
|
||||||
'U_EDIT' => $url . '&action=edit',
|
'U_EDIT' => $url . '&action=edit',
|
||||||
|
@ -495,7 +495,7 @@ class acp_modules
|
||||||
{
|
{
|
||||||
$row = $this->get_module_row($parent_id);
|
$row = $this->get_module_row($parent_id);
|
||||||
|
|
||||||
$url = $u_action . '&parent_id=' . $parent_id . '&m=' . $row['module_id'];
|
$url = $this->u_action . '&parent_id=' . $parent_id . '&m=' . $row['module_id'];
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_NO_MODULES' => true,
|
'S_NO_MODULES' => true,
|
||||||
|
@ -528,8 +528,8 @@ class acp_modules
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_SEL_ACTION' => $u_action,
|
'U_SEL_ACTION' => $this->u_action,
|
||||||
'U_ACTION' => $u_action . '&parent_id=' . $parent_id,
|
'U_ACTION' => $this->u_action . '&parent_id=' . $parent_id,
|
||||||
'NAVIGATION' => $navigation,
|
'NAVIGATION' => $navigation,
|
||||||
'MODULE_BOX' => $module_box,
|
'MODULE_BOX' => $module_box,
|
||||||
'PARENT_ID' => $parent_id,
|
'PARENT_ID' => $parent_id,
|
||||||
|
|
|
@ -30,7 +30,6 @@ class acp_permissions
|
||||||
$user->add_lang('acp/permissions_phpbb');
|
$user->add_lang('acp/permissions_phpbb');
|
||||||
|
|
||||||
$this->tpl_name = 'acp_permissions';
|
$this->tpl_name = 'acp_permissions';
|
||||||
$this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
// Set some vars
|
// Set some vars
|
||||||
$action = request_var('action', array('' => 0));
|
$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)
|
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?
|
// User or group to be set?
|
||||||
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
|
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_php_info
|
class acp_php_info
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template;
|
global $db, $user, $auth, $template;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*/
|
*/
|
||||||
class acp_profile
|
class acp_profile
|
||||||
{
|
{
|
||||||
var $u_action = '';
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,6 @@ class acp_profile
|
||||||
|
|
||||||
$action = (isset($_POST['create'])) ? 'create' : request_var('action', '');
|
$action = (isset($_POST['create'])) ? 'create' : request_var('action', '');
|
||||||
|
|
||||||
$this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
$error = array();
|
$error = array();
|
||||||
$s_hidden_fields = '';
|
$s_hidden_fields = '';
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*/
|
*/
|
||||||
class acp_prune
|
class acp_prune
|
||||||
{
|
{
|
||||||
var $u_action = '';
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
|
@ -21,8 +21,6 @@ class acp_prune
|
||||||
|
|
||||||
$user->add_lang('acp/prune');
|
$user->add_lang('acp/prune');
|
||||||
|
|
||||||
$this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
switch ($mode)
|
switch ($mode)
|
||||||
{
|
{
|
||||||
case 'forums':
|
case 'forums':
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_ranks
|
class acp_ranks
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache;
|
||||||
|
@ -29,8 +31,6 @@ class acp_ranks
|
||||||
$this->tpl_name = 'acp_ranks';
|
$this->tpl_name = 'acp_ranks';
|
||||||
$this->page_title = 'ACP_MANAGE_RANKS';
|
$this->page_title = 'ACP_MANAGE_RANKS';
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'save':
|
case 'save':
|
||||||
|
@ -48,7 +48,7 @@ class acp_ranks
|
||||||
|
|
||||||
if (!$rank_title)
|
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(
|
$sql_ary = array(
|
||||||
|
@ -72,7 +72,7 @@ class acp_ranks
|
||||||
|
|
||||||
$cache->destroy('ranks');
|
$cache->destroy('ranks');
|
||||||
|
|
||||||
trigger_error($message . adm_back_link($u_action));
|
trigger_error($message . adm_back_link($this->u_action));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -92,11 +92,11 @@ class acp_ranks
|
||||||
|
|
||||||
$cache->destroy('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
|
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;
|
break;
|
||||||
|
@ -154,9 +154,9 @@ class acp_ranks
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_EDIT' => true,
|
'S_EDIT' => true,
|
||||||
'U_BACK' => $u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'RANKS_PATH' => $phpbb_root_path . $config['ranks_path'],
|
'RANKS_PATH' => $phpbb_root_path . $config['ranks_path'],
|
||||||
'U_ACTION' => $u_action . '&id=' . $rank_id,
|
'U_ACTION' => $this->u_action . '&id=' . $rank_id,
|
||||||
|
|
||||||
'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '',
|
'RANK_TITLE' => (isset($ranks['rank_title'])) ? $ranks['rank_title'] : '',
|
||||||
'S_FILENAME_LIST' => $filename_list,
|
'S_FILENAME_LIST' => $filename_list,
|
||||||
|
@ -172,7 +172,7 @@ class acp_ranks
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ACTION' => $u_action)
|
'U_ACTION' => $this->u_action)
|
||||||
);
|
);
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
|
@ -190,8 +190,8 @@ class acp_ranks
|
||||||
'RANK_TITLE' => $row['rank_title'],
|
'RANK_TITLE' => $row['rank_title'],
|
||||||
'MIN_POSTS' => $row['rank_min'],
|
'MIN_POSTS' => $row['rank_min'],
|
||||||
|
|
||||||
'U_EDIT' => $u_action . '&action=edit&id=' . $row['rank_id'],
|
'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['rank_id'],
|
||||||
'U_DELETE' => $u_action . '&action=delete&id=' . $row['rank_id'])
|
'U_DELETE' => $this->u_action . '&action=delete&id=' . $row['rank_id'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
|
@ -40,8 +40,6 @@ class acp_styles
|
||||||
$action = (isset($_POST['add'])) ? 'add' : $action;
|
$action = (isset($_POST['add'])) ? 'add' : $action;
|
||||||
$style_id = request_var('id', 0);
|
$style_id = request_var('id', 0);
|
||||||
|
|
||||||
$this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
// Fill the configuration variables
|
// Fill the configuration variables
|
||||||
$this->style_cfg = $this->template_cfg = $this->theme_cfg = $this->imageset_cfg = '
|
$this->style_cfg = $this->template_cfg = $this->theme_cfg = $this->imageset_cfg = '
|
||||||
#
|
#
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_users
|
class acp_users
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache;
|
global $config, $db, $user, $auth, $template, $cache;
|
||||||
|
@ -22,8 +24,6 @@ class acp_users
|
||||||
$this->tpl_name = 'acp_users';
|
$this->tpl_name = 'acp_users';
|
||||||
$this->page_title = 'ACP_USER_' . strtoupper($mode);
|
$this->page_title = 'ACP_USER_' . strtoupper($mode);
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||||
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class acp_users
|
||||||
$this->page_title = 'SELECT_USER';
|
$this->page_title = 'SELECT_USER';
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ACTION' => $u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'ANONYMOUS_USER_ID' => ANONYMOUS,
|
'ANONYMOUS_USER_ID' => ANONYMOUS,
|
||||||
|
|
||||||
'S_SELECT_USER' => true,
|
'S_SELECT_USER' => true,
|
||||||
|
@ -85,7 +85,7 @@ class acp_users
|
||||||
|
|
||||||
if (!$user_id)
|
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)
|
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
|
// Generate overall "header" for user admin
|
||||||
|
@ -122,9 +122,9 @@ class acp_users
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_BACK' => $u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'U_MODE_SELECT' => "{$phpbb_admin_path}index.$phpEx$SID&i=$id&u=$user_id",
|
'U_MODE_SELECT' => "{$phpbb_admin_path}index.$phpEx$SID&i=$id&u=$user_id",
|
||||||
'U_ACTION' => $u_action . '&u=' . $user_id,
|
'U_ACTION' => $this->u_action . '&u=' . $user_id,
|
||||||
'S_FORM_OPTIONS' => $s_form_options)
|
'S_FORM_OPTIONS' => $s_form_options)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ class acp_users
|
||||||
{
|
{
|
||||||
if (!$auth->acl_get('a_userdel'))
|
if (!$auth->acl_get('a_userdel'))
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_ADMIN'] . adm_back_link($u_action . '&u=' . $user_id));
|
trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (confirm_box(true))
|
if (confirm_box(true))
|
||||||
|
@ -151,7 +151,7 @@ class acp_users
|
||||||
user_delete($delete_type, $user_id);
|
user_delete($delete_type, $user_id);
|
||||||
|
|
||||||
add_log('admin', 'LOG_USER_DELETED', $user_row['username']);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -213,7 +213,7 @@ class acp_users
|
||||||
add_log('admin', $log, $user->lang['reason']);
|
add_log('admin', $log, $user->lang['reason']);
|
||||||
add_log('user', $user_id, $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;
|
break;
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ class acp_users
|
||||||
add_log('admin', 'LOG_USER_REACTIVATE', $user_row['username']);
|
add_log('admin', 'LOG_USER_REACTIVATE', $user_row['username']);
|
||||||
add_log('user', $user_id, 'LOG_USER_REACTIVATE_USER');
|
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;
|
break;
|
||||||
|
@ -275,7 +275,7 @@ class acp_users
|
||||||
|
|
||||||
add_log('user', $user_id, $log . '_USER');
|
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;
|
break;
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@ class acp_users
|
||||||
add_log('admin', 'LOG_USER_DEL_SIG', $user_row['username']);
|
add_log('admin', 'LOG_USER_DEL_SIG', $user_row['username']);
|
||||||
add_log('user', $user_id, 'LOG_USER_DEL_SIG_USER');
|
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;
|
break;
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ class acp_users
|
||||||
add_log('admin', 'LOG_USER_DEL_AVATAR', $user_row['username']);
|
add_log('admin', 'LOG_USER_DEL_AVATAR', $user_row['username']);
|
||||||
add_log('user', $user_id, 'LOG_USER_DEL_AVATAR_USER');
|
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;
|
break;
|
||||||
|
|
||||||
case 'delposts':
|
case 'delposts':
|
||||||
|
@ -370,7 +370,7 @@ class acp_users
|
||||||
delete_posts('poster_id', $user_id);
|
delete_posts('poster_id', $user_id);
|
||||||
|
|
||||||
add_log('admin', 'LOG_USER_DEL_POSTS', $user_row['username']);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -392,7 +392,7 @@ class acp_users
|
||||||
delete_attachments('user', $user_id);
|
delete_attachments('user', $user_id);
|
||||||
|
|
||||||
add_log('admin', 'LOG_USER_DEL_ATTACH', $user_row['username']);
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -417,8 +417,8 @@ class acp_users
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_SELECT_FORUM' => true,
|
'S_SELECT_FORUM' => true,
|
||||||
'U_ACTION' => $u_action . "&action=$action&u=$user_id",
|
'U_ACTION' => $this->u_action . "&action=$action&u=$user_id",
|
||||||
'U_BACK' => $u_action . "&u=$user_id",
|
'U_BACK' => $this->u_action . "&u=$user_id",
|
||||||
'S_FORUM_OPTIONS' => make_forum_select(false, false, false, true))
|
'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('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']);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -670,7 +670,7 @@ class acp_users
|
||||||
|
|
||||||
add_log('admin', 'LOG_USER_USER_UPDATE', $data['username']);
|
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
|
// 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_USER_FOUNDER' => ($user_row['user_type'] == USER_FOUNDER) ? true : false,
|
||||||
'S_ACTION_OPTIONS' => $s_action_options,
|
'S_ACTION_OPTIONS' => $s_action_options,
|
||||||
|
|
||||||
'U_SHOW_IP' => $u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
|
'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
|
||||||
'U_WHOIS' => $u_action . "&action=whois&user_ip={$user_row['user_ip']}",
|
'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}",
|
||||||
|
|
||||||
'USER' => $user_row['username'],
|
'USER' => $user_row['username'],
|
||||||
'USER_REGISTERED' => $user->format_date($user_row['user_regdate']),
|
'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('admin', 'LOG_USER_FEEDBACK', $user_row['username']);
|
||||||
add_log('user', $user_id, 'LOG_USER_GENERAL', $message);
|
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
|
// Sorting
|
||||||
|
@ -785,7 +785,7 @@ class acp_users
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_FEEDBACK' => true,
|
'S_FEEDBACK' => true,
|
||||||
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
|
'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start),
|
||||||
'PAGINATION' => generate_pagination($u_action . "&u=$user_id&$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
|
'PAGINATION' => generate_pagination($this->u_action . "&u=$user_id&$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
|
||||||
|
|
||||||
'S_LIMIT_DAYS' => $s_limit_days,
|
'S_LIMIT_DAYS' => $s_limit_days,
|
||||||
'S_SORT_KEY' => $s_sort_key,
|
'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
|
// Replace "error" strings with their real, localised form
|
||||||
|
@ -1085,7 +1085,7 @@ class acp_users
|
||||||
WHERE user_id = $user_id";
|
WHERE user_id = $user_id";
|
||||||
$db->sql_query($sql);
|
$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
|
// 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
|
// Replace "error" strings with their real, localised form
|
||||||
|
@ -1368,7 +1368,7 @@ class acp_users
|
||||||
WHERE user_id = $user_id";
|
WHERE user_id = $user_id";
|
||||||
$db->sql_query($sql);
|
$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 *
|
$sql = 'SELECT *
|
||||||
|
@ -1432,7 +1432,7 @@ class acp_users
|
||||||
WHERE user_id = ' . $user_id;
|
WHERE user_id = ' . $user_id;
|
||||||
$db->sql_query($sql);
|
$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
|
// 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'];
|
$message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
|
||||||
|
|
||||||
add_log('admin', $log, implode(', ', $log_attachments));
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -1599,7 +1599,7 @@ class acp_users
|
||||||
'S_SORT_KEY' => $s_sort_key,
|
'S_SORT_KEY' => $s_sort_key,
|
||||||
'S_SORT_DIR' => $s_sort_dir,
|
'S_SORT_DIR' => $s_sort_dir,
|
||||||
|
|
||||||
'PAGINATION' => generate_pagination($u_action . "&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start, true))
|
'PAGINATION' => generate_pagination($this->u_action . "&sk=$sort_key&sd=$sort_dir", $num_attachments, $config['topics_per_page'], $start, true))
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -1628,12 +1628,12 @@ class acp_users
|
||||||
{
|
{
|
||||||
if (!$group_id)
|
if (!$group_id)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action . '&u=' . $user_id));
|
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($error = group_user_del($group_id, $user_id))
|
if ($error = group_user_del($group_id, $user_id))
|
||||||
{
|
{
|
||||||
trigger_error($user->lang[$error] . adm_back_link($u_action . '&u=' . $user_id));
|
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
$error = array();
|
$error = array();
|
||||||
|
@ -1657,13 +1657,13 @@ class acp_users
|
||||||
{
|
{
|
||||||
if (!$group_id)
|
if (!$group_id)
|
||||||
{
|
{
|
||||||
trigger_error($user->lang['NO_GROUP'] . adm_back_link($u_action . '&u=' . $user_id));
|
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add user/s to group
|
// Add user/s to group
|
||||||
if ($error = group_user_add($group_id, $user_id))
|
if ($error = group_user_add($group_id, $user_id))
|
||||||
{
|
{
|
||||||
trigger_error($user->lang[$error] . adm_back_link($u_action . '&u=' . $user_id));
|
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
$error = array();
|
$error = array();
|
||||||
|
@ -1722,9 +1722,9 @@ class acp_users
|
||||||
{
|
{
|
||||||
$template->assign_block_vars('group', array(
|
$template->assign_block_vars('group', array(
|
||||||
'U_EDIT_GROUP' => "{$phpbb_admin_path}index.$phpEx$SID&i=groups&mode=manage&action=edit&u=$user_id&g=" . $data['group_id'] . '&back_link=acp_users_groups',
|
'U_EDIT_GROUP' => "{$phpbb_admin_path}index.$phpEx$SID&i=groups&mode=manage&action=edit&u=$user_id&g=" . $data['group_id'] . '&back_link=acp_users_groups',
|
||||||
'U_DEFAULT' => $u_action . "&action=default&u=$user_id&g=" . $data['group_id'],
|
'U_DEFAULT' => $this->u_action . "&action=default&u=$user_id&g=" . $data['group_id'],
|
||||||
'U_DEMOTE_PROMOTE' => $u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'],
|
'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'],
|
||||||
'U_DELETE' => $u_action . "&action=delete&u=$user_id&g=" . $data['group_id'],
|
'U_DELETE' => $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'],
|
||||||
|
|
||||||
'GROUP_NAME' => ($group_type == 'special') ? $user->lang['G_' . $data['group_name']] : $data['group_name'],
|
'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'],
|
'L_DEMOTE_PROMOTE' => ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE'],
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
*/
|
*/
|
||||||
class acp_words
|
class acp_words
|
||||||
{
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $cache;
|
global $db, $user, $auth, $template, $cache;
|
||||||
|
@ -31,8 +33,6 @@ class acp_words
|
||||||
$this->tpl_name = 'acp_words';
|
$this->tpl_name = 'acp_words';
|
||||||
$this->page_title = 'ACP_WORDS';
|
$this->page_title = 'ACP_WORDS';
|
||||||
|
|
||||||
$u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode";
|
|
||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'edit':
|
case 'edit':
|
||||||
|
@ -40,7 +40,7 @@ class acp_words
|
||||||
|
|
||||||
if (!$word_id)
|
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 *
|
$sql = 'SELECT *
|
||||||
|
@ -56,8 +56,8 @@ class acp_words
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_EDIT_WORD' => true,
|
'S_EDIT_WORD' => true,
|
||||||
'U_ACTION' => $u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'U_BACK' => $u_action,
|
'U_BACK' => $this->u_action,
|
||||||
'WORD' => (isset($word_info['word'])) ? $word_info['word'] : '',
|
'WORD' => (isset($word_info['word'])) ? $word_info['word'] : '',
|
||||||
'REPLACEMENT' => (isset($word_info['replacement'])) ? $word_info['replacement'] : '',
|
'REPLACEMENT' => (isset($word_info['replacement'])) ? $word_info['replacement'] : '',
|
||||||
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
||||||
|
@ -74,7 +74,7 @@ class acp_words
|
||||||
|
|
||||||
if (!$word || !$replacement)
|
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(
|
$sql_ary = array(
|
||||||
|
@ -97,7 +97,7 @@ class acp_words
|
||||||
add_log('admin', $log_action, $word);
|
add_log('admin', $log_action, $word);
|
||||||
|
|
||||||
$message = ($word_id) ? $user->lang['WORD_UPDATED'] : $user->lang['WORD_ADDED'];
|
$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;
|
break;
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ class acp_words
|
||||||
|
|
||||||
if (!$word_id)
|
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
|
$sql = 'SELECT word
|
||||||
|
@ -125,14 +125,14 @@ class acp_words
|
||||||
|
|
||||||
add_log('admin', 'LOG_WORD_DELETE', $deleted_word);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'U_ACTION' => $u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -146,8 +146,8 @@ class acp_words
|
||||||
$template->assign_block_vars('words', array(
|
$template->assign_block_vars('words', array(
|
||||||
'WORD' => $row['word'],
|
'WORD' => $row['word'],
|
||||||
'REPLACEMENT' => $row['replacement'],
|
'REPLACEMENT' => $row['replacement'],
|
||||||
'U_EDIT' => $u_action . '&action=edit&id=' . $row['word_id'],
|
'U_EDIT' => $this->u_action . '&action=edit&id=' . $row['word_id'],
|
||||||
'U_DELETE' => $u_action . '&action=delete&id=' . $row['word_id'])
|
'U_DELETE' => $this->u_action . '&action=delete&id=' . $row['word_id'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1215,6 +1215,12 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||||
|
|
||||||
$err = '';
|
$err = '';
|
||||||
|
|
||||||
|
// Make sure user->setup() has been called
|
||||||
|
if (empty($user->lang))
|
||||||
|
{
|
||||||
|
$user->setup();
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_POST['login']))
|
if (isset($_POST['login']))
|
||||||
{
|
{
|
||||||
$username = request_var('username', '');
|
$username = request_var('username', '');
|
||||||
|
@ -1229,9 +1235,16 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||||
// If admin authentication
|
// If admin authentication
|
||||||
if ($admin)
|
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");
|
$redirect = request_var('redirect', "index.$phpEx$SID");
|
||||||
meta_refresh(3, $redirect);
|
meta_refresh(3, $redirect);
|
||||||
|
|
||||||
|
|
|
@ -65,41 +65,27 @@ class p_master
|
||||||
{
|
{
|
||||||
global $cache;
|
global $cache;
|
||||||
|
|
||||||
// Get active modules
|
// Get modules
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . MODULES_TABLE . "
|
FROM ' . MODULES_TABLE . "
|
||||||
WHERE module_class = '" . $db->sql_escape($p_class) . "'
|
WHERE module_class = '" . $db->sql_escape($p_class) . "'
|
||||||
ORDER BY left_id ASC";
|
ORDER BY left_id ASC";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$this->module_cache['modules'] = array();
|
$rows = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$this->module_cache['modules'][] = $row;
|
$rows[$row['module_id']] = $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;
|
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$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) . "; ?>";
|
$file = '<?php $this->module_cache=' . $cache->format_array($this->module_cache) . "; ?>";
|
||||||
|
|
||||||
|
@ -114,9 +100,13 @@ class p_master
|
||||||
unset($file);
|
unset($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
$right = $depth = $i = 0;
|
// We "could" build a true tree with this function - maybe mod authors want to use this...
|
||||||
$depth_ary = $disable = array();
|
// 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)
|
foreach ($this->module_cache['modules'] as $key => $row)
|
||||||
{
|
{
|
||||||
// Not allowed to view module?
|
// Not allowed to view module?
|
||||||
|
@ -129,102 +119,98 @@ class p_master
|
||||||
// Category with no members, ignore
|
// Category with no members, ignore
|
||||||
if (!$row['module_name'] && ($row['left_id'] + 1 == $row['right_id']))
|
if (!$row['module_name'] && ($row['left_id'] + 1 == $row['right_id']))
|
||||||
{
|
{
|
||||||
|
unset($this->module_cache['modules'][$key]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Skip branch
|
||||||
|
if ($right_id !== false)
|
||||||
|
{
|
||||||
|
if ($row['left_id'] < $right_id)
|
||||||
|
{
|
||||||
|
unset($this->module_cache['modules'][$key]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$right_id = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not enabled?
|
||||||
|
if (!$row['module_enabled'])
|
||||||
|
{
|
||||||
|
// If category is disabled then disable every child too
|
||||||
|
unset($this->module_cache['modules'][$key]);
|
||||||
|
$right_id = $row['right_id'];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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'] < $right_id)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$right_id = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Category with no members on their way down (we have to check every level)
|
// Category with no members on their way down (we have to check every level)
|
||||||
if (!$row['module_name'])
|
if (!$row['module_name'])
|
||||||
{
|
{
|
||||||
$empty_category = true;
|
$empty_category = true;
|
||||||
|
|
||||||
// If we do find members we can add this module to the array
|
// We go through the branch and look for an activated module
|
||||||
$right_id = $row['right_id'];
|
foreach (array_slice($this->module_cache['modules'], $key + 1) as $temp_row)
|
||||||
|
|
||||||
// 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))
|
|
||||||
{
|
{
|
||||||
continue;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($temp_module_cache as $temp_row)
|
// Skip the branch
|
||||||
{
|
|
||||||
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)
|
if ($empty_category)
|
||||||
{
|
{
|
||||||
|
$right_id = $row['right_id'];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not enabled?
|
$depth = sizeof($this->module_cache['parents'][$row['module_id']]);
|
||||||
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'];
|
|
||||||
}
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sizeof($disable))
|
|
||||||
{
|
|
||||||
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'])
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$disable = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($row['left_id'] < $right)
|
|
||||||
{
|
|
||||||
$depth++;
|
|
||||||
$depth_ary[$row['parent_id']] = $depth;
|
|
||||||
}
|
|
||||||
else if ($row['left_id'] > $right + 1)
|
|
||||||
{
|
|
||||||
if (!isset($depth_ary[$row['parent_id']]))
|
|
||||||
{
|
|
||||||
$depth = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$depth = $depth_ary[$row['parent_id']];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$right = $row['right_id'];
|
|
||||||
|
|
||||||
// We need to prefix the functions to not create a naming conflict
|
// We need to prefix the functions to not create a naming conflict
|
||||||
$url_func = '_module_' . $row['module_name'] . '_' . $row['module_mode'] . '_url';
|
$url_func = '_module_' . $row['module_name'] . '_' . $row['module_mode'] . '_url';
|
||||||
$lang_func = '_module_' . $row['module_name'];
|
$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,
|
'depth' => $depth,
|
||||||
|
|
||||||
'id' => (int) $row['module_id'],
|
'id' => (int) $row['module_id'],
|
||||||
'parent' => (int) $row['parent_id'],
|
'parent' => (int) $row['parent_id'],
|
||||||
'cat' => ($row['right_id'] > $row['left_id'] + 1) ? true : false,
|
'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'],
|
'name' => (string) $row['module_name'],
|
||||||
'mode' => (string) $row['module_mode'],
|
'mode' => (string) $row['module_mode'],
|
||||||
'display' => (int) $row['module_display'],
|
'display' => (int) $row['module_display'],
|
||||||
|
@ -237,11 +223,9 @@ class p_master
|
||||||
'left' => $row['left_id'],
|
'left' => $row['left_id'],
|
||||||
'right' => $row['right_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;
|
return $is_auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set active module
|
||||||
|
*/
|
||||||
function set_active($id = false, $mode = false)
|
function set_active($id = false, $mode = false)
|
||||||
{
|
{
|
||||||
|
$icat = false;
|
||||||
|
|
||||||
|
if (request_var('icat', ''))
|
||||||
|
{
|
||||||
|
$icat = $id;
|
||||||
|
$id = request_var('icat', '');
|
||||||
|
}
|
||||||
|
|
||||||
$category = false;
|
$category = false;
|
||||||
foreach ($this->module_ary as $row_id => $itep_ary)
|
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 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 no category or module selected, go active for first module in first category
|
||||||
if (
|
if (
|
||||||
(($itep_ary['name'] === $id || $itep_ary['id'] === (int) $id) && $itep_ary['mode'] == $mode && !$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']) ||
|
($itep_ary['parent'] === $category && !$itep_ary['cat'] && !$icat) ||
|
||||||
(($itep_ary['name'] === $id || $itep_ary['id'] === (int) $id) && !$mode && !$itep_ary['cat']) ||
|
(($itep_ary['name'] === $id || $itep_ary['id'] === (int) $id) && !$mode && !$itep_ary['cat']) ||
|
||||||
(!$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_id = $itep_ary['id'];
|
||||||
$this->p_parent = $itep_ary['parent'];
|
$this->p_parent = $itep_ary['parent'];
|
||||||
$this->p_name = $itep_ary['name'];
|
$this->p_name = $itep_ary['name'];
|
||||||
|
@ -293,7 +296,7 @@ class p_master
|
||||||
|
|
||||||
break;
|
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'];
|
$category = $itep_ary['id'];
|
||||||
}
|
}
|
||||||
|
@ -309,9 +312,10 @@ class p_master
|
||||||
*/
|
*/
|
||||||
function load_active($mode = false)
|
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;
|
$module_path = $phpbb_root_path . 'includes/' . $this->p_class;
|
||||||
|
$icat = request_var('icat', '');
|
||||||
|
|
||||||
if (!class_exists("{$this->p_class}_$this->p_name"))
|
if (!class_exists("{$this->p_class}_$this->p_name"))
|
||||||
{
|
{
|
||||||
|
@ -338,6 +342,9 @@ class p_master
|
||||||
|
|
||||||
$this->module = new $instance($this);
|
$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) ? '&icat=' . $icat : '') . "&i={$this->p_id}&mode={$this->p_mode}";
|
||||||
|
|
||||||
// Execute the main method for the new instance, we send the module
|
// Execute the main method for the new instance, we send the module
|
||||||
// id and mode as parameters
|
// id and mode as parameters
|
||||||
$this->module->main(($this->p_name) ? $this->p_name : $this->p_id, $this->p_mode);
|
$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)
|
function get_parents($parent_id, $left_id, $right_id, &$all_parents)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
@ -370,11 +380,73 @@ class p_master
|
||||||
|
|
||||||
return $parents;
|
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)
|
function assign_tpl_vars($module_url)
|
||||||
{
|
{
|
||||||
global $template;
|
global $template;
|
||||||
|
|
||||||
|
$current_id = false;
|
||||||
|
|
||||||
$current_padding = $current_depth = 0;
|
$current_padding = $current_depth = 0;
|
||||||
$linear_offset = 'l_block1';
|
$linear_offset = 'l_block1';
|
||||||
$tabular_offset = 't_block2';
|
$tabular_offset = 't_block2';
|
||||||
|
@ -390,6 +462,12 @@ class p_master
|
||||||
continue;
|
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'];
|
$depth = $itep_ary['depth'];
|
||||||
|
|
||||||
if ($depth > $current_depth)
|
if ($depth > $current_depth)
|
||||||
|
@ -406,7 +484,7 @@ class p_master
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$u_title = $module_url . '&i=' . (($itep_ary['cat']) ? $itep_ary['id'] : $itep_ary['name'] . '&mode=' . $itep_ary['mode']);
|
$u_title = $module_url . (($itep_ary['is_duplicate']) ? '&icat=' . $current_id : '') . '&i=' . (($itep_ary['cat']) ? $itep_ary['id'] : $itep_ary['name'] . '&mode=' . $itep_ary['mode']);
|
||||||
$u_title .= (!$itep_ary['cat'] && isset($itep_ary['url_extra'])) ? $itep_ary['url_extra'] : '';
|
$u_title .= (!$itep_ary['cat'] && isset($itep_ary['url_extra'])) ? $itep_ary['url_extra'] : '';
|
||||||
|
|
||||||
// Only output a categories items if it's currently selected
|
// 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)
|
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;
|
$this->module_ary[$row_id]['display'] = (int) $display;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -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_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_', 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_aauth', 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_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_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_attach', 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_authgroups', 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_authusers', 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_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_bbcode', 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_board', 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_bots', 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_clearlogs', 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_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_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_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_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_group', 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_groupadd', 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_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_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_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_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_user', 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_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_', 1);
|
||||||
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_sendemail', 1);
|
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_sendemail', 1);
|
||||||
|
|
|
@ -68,6 +68,9 @@ if (!($forum_data = $db->sql_fetchrow($result)))
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
// Configure style, language, etc.
|
||||||
|
$user->setup('viewforum', $forum_data['forum_style']);
|
||||||
|
|
||||||
// Redirect to login upon emailed notification links
|
// Redirect to login upon emailed notification links
|
||||||
if (isset($_GET['e']) && !$user->data['is_registered'])
|
if (isset($_GET['e']) && !$user->data['is_registered'])
|
||||||
{
|
{
|
||||||
|
@ -101,9 +104,6 @@ if ($forum_data['forum_link'])
|
||||||
redirect(str_replace('&', '&', $forum_data['forum_link']));
|
redirect(str_replace('&', '&', $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
|
// Forum is passworded ... check whether access has been granted to this
|
||||||
// user this session, if not show login box
|
// user this session, if not show login box
|
||||||
if ($forum_data['forum_password'])
|
if ($forum_data['forum_password'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue