mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
modified some files to get the admin index page working, as well as index page in logged in state and not logged in state
additionally prepare for a working installation git-svn-id: file:///svn/phpbb/trunk@9272 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
0df7a9b3e3
commit
57aea7e62f
18 changed files with 848 additions and 952 deletions
|
@ -19,29 +19,29 @@ if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './../');
|
|||
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
if (!defined('PHPBB_ADMIN_PATH')) define('PHPBB_ADMIN_PATH', './');
|
||||
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/functions_module.' . PHP_EXT);
|
||||
include PHPBB_ROOT_PATH . 'common.' . PHP_EXT;
|
||||
require PHPBB_ROOT_PATH . 'includes/functions_admin.' . PHP_EXT;
|
||||
require PHPBB_ROOT_PATH . 'includes/functions_module.' . PHP_EXT;
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
$user->setup('acp/common');
|
||||
phpbb::$user->session_begin();
|
||||
phpbb::$acl->init(phpbb::$user->data);
|
||||
phpbb::$user->setup('acp/common');
|
||||
// End session management
|
||||
|
||||
// Have they authenticated (again) as an admin for this session?
|
||||
if ($user->data['user_id'] != ANONYMOUS && (!isset($user->data['session_admin']) || !$user->data['session_admin']))
|
||||
if (phpbb::$user->data['user_id'] != ANONYMOUS && (!isset(phpbb::$user->data['session_admin']) || !phpbb::$user->data['session_admin']))
|
||||
{
|
||||
login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false);
|
||||
login_box('', phpbb::$user->lang['LOGIN_ADMIN_CONFIRM'], phpbb::$user->lang['LOGIN_ADMIN_SUCCESS'], true, false);
|
||||
}
|
||||
else if ($user->data['user_id'] == ANONYMOUS)
|
||||
else if (phpbb::$user->data['user_id'] == ANONYMOUS)
|
||||
{
|
||||
login_box('');
|
||||
}
|
||||
|
||||
// Is user any type of admin? No, then stop here, each script needs to
|
||||
// check specific permissions but this is a catchall
|
||||
if (!$auth->acl_get('a_'))
|
||||
if (!phpbb::$acl->acl_get('a_'))
|
||||
{
|
||||
trigger_error('NO_ADMIN');
|
||||
}
|
||||
|
@ -56,8 +56,8 @@ $module_id = request_var('i', '');
|
|||
$mode = request_var('mode', '');
|
||||
|
||||
// Set custom template for admin area
|
||||
$template->set_custom_template(PHPBB_ADMIN_PATH . 'style', 'admin');
|
||||
$template->assign_var('T_TEMPLATE_PATH', PHPBB_ADMIN_PATH . 'style');
|
||||
phpbb::$template->set_custom_template(PHPBB_ADMIN_PATH . 'style', 'admin');
|
||||
phpbb::$template->assign_var('T_TEMPLATE_PATH', PHPBB_ADMIN_PATH . 'style');
|
||||
|
||||
// Instantiate new module
|
||||
$module = new p_master();
|
||||
|
@ -70,7 +70,7 @@ $module->set_active($module_id, $mode);
|
|||
|
||||
// Assign data to the template engine for the list of modules
|
||||
// We do this before loading the active module for correct menu display in trigger_error
|
||||
$module->assign_tpl_vars(append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT));
|
||||
$module->assign_tpl_vars(phpbb::$url->append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT));
|
||||
|
||||
// Load and execute the relevant module
|
||||
$module->load_active();
|
||||
|
@ -78,7 +78,7 @@ $module->load_active();
|
|||
// Generate the page
|
||||
adm_page_header($module->get_page_title());
|
||||
|
||||
$template->set_filenames(array(
|
||||
phpbb::$template->set_filenames(array(
|
||||
'body' => $module->get_tpl_name(),
|
||||
));
|
||||
|
||||
|
@ -89,9 +89,6 @@ adm_page_footer();
|
|||
*/
|
||||
function adm_page_header($page_title)
|
||||
{
|
||||
global $db, $user, $template;
|
||||
global $SID, $_SID;
|
||||
|
||||
if (defined('HEADER_INC'))
|
||||
{
|
||||
return;
|
||||
|
@ -108,22 +105,20 @@ function adm_page_header($page_title)
|
|||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
phpbb::$template->assign_vars(array(
|
||||
'PAGE_TITLE' => $page_title,
|
||||
'USERNAME' => ($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '',
|
||||
'USERNAME' => (phpbb::$user->data['user_id'] != ANONYMOUS) ? phpbb::$user->data['username'] : '',
|
||||
|
||||
'SID' => $SID,
|
||||
'_SID' => $_SID,
|
||||
'SESSION_ID' => $user->session_id,
|
||||
'SESSION_ID' => phpbb::$user->session_id,
|
||||
'ROOT_PATH' => PHPBB_ADMIN_PATH,
|
||||
|
||||
'U_LOGOUT' => append_sid('ucp', 'mode=logout'),
|
||||
'U_ADM_LOGOUT' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'action=admlogout'),
|
||||
'U_ADM_INDEX' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT),
|
||||
'U_INDEX' => append_sid('index'),
|
||||
'U_LOGOUT' => phpbb::$url->append_sid('ucp', 'mode=logout'),
|
||||
'U_ADM_LOGOUT' => phpbb::$url->append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'action=admlogout'),
|
||||
'U_ADM_INDEX' => phpbb::$url->append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT),
|
||||
'U_INDEX' => phpbb::$url->append_sid('index'),
|
||||
|
||||
'S_USER_ADMIN' => $user->data['session_admin'],
|
||||
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS && !$user->data['is_bot']),
|
||||
'S_USER_ADMIN' => phpbb::$user->data['session_admin'],
|
||||
'S_USER_LOGGED_IN' => (phpbb::$user->data['user_id'] != ANONYMOUS && !phpbb::$user->is_bot),
|
||||
|
||||
'T_IMAGES_PATH' => PHPBB_ROOT_PATH . 'images/',
|
||||
'T_SMILIES_PATH' => PHPBB_ROOT_PATH . phpbb::$config['smilies_path'] . '/',
|
||||
|
@ -133,22 +128,22 @@ function adm_page_header($page_title)
|
|||
'T_RANKS_PATH' => PHPBB_ROOT_PATH . phpbb::$config['ranks_path'] . '/',
|
||||
'T_UPLOAD_PATH' => PHPBB_ROOT_PATH . phpbb::$config['upload_path'] . '/',
|
||||
|
||||
'ICON_MOVE_UP' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_UP_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_DOWN' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_EDIT' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||
'ICON_EDIT_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
|
||||
'ICON_DELETE' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
||||
'ICON_DELETE_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />',
|
||||
'ICON_SYNC' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
|
||||
'ICON_SYNC_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />',
|
||||
'ICON_MOVE_UP' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up.gif" alt="' . phpbb::$user->lang['MOVE_UP'] . '" title="' . phpbb::$user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_UP_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_up_disabled.gif" alt="' . phpbb::$user->lang['MOVE_UP'] . '" title="' . phpbb::$user->lang['MOVE_UP'] . '" />',
|
||||
'ICON_MOVE_DOWN' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down.gif" alt="' . phpbb::$user->lang['MOVE_DOWN'] . '" title="' . phpbb::$user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_MOVE_DOWN_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_down_disabled.gif" alt="' . phpbb::$user->lang['MOVE_DOWN'] . '" title="' . phpbb::$user->lang['MOVE_DOWN'] . '" />',
|
||||
'ICON_EDIT' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit.gif" alt="' . phpbb::$user->lang['EDIT'] . '" title="' . phpbb::$user->lang['EDIT'] . '" />',
|
||||
'ICON_EDIT_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_edit_disabled.gif" alt="' . phpbb::$user->lang['EDIT'] . '" title="' . phpbb::$user->lang['EDIT'] . '" />',
|
||||
'ICON_DELETE' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete.gif" alt="' . phpbb::$user->lang['DELETE'] . '" title="' . phpbb::$user->lang['DELETE'] . '" />',
|
||||
'ICON_DELETE_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_delete_disabled.gif" alt="' . phpbb::$user->lang['DELETE'] . '" title="' . phpbb::$user->lang['DELETE'] . '" />',
|
||||
'ICON_SYNC' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_sync.gif" alt="' . phpbb::$user->lang['RESYNC'] . '" title="' . phpbb::$user->lang['RESYNC'] . '" />',
|
||||
'ICON_SYNC_DISABLED' => '<img src="' . PHPBB_ADMIN_PATH . 'images/icon_sync_disabled.gif" alt="' . phpbb::$user->lang['RESYNC'] . '" title="' . phpbb::$user->lang['RESYNC'] . '" />',
|
||||
|
||||
'S_USER_LANG' => $user->lang['USER_LANG'],
|
||||
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
||||
'S_USER_LANG' => phpbb::$user->lang['USER_LANG'],
|
||||
'S_CONTENT_DIRECTION' => phpbb::$user->lang['DIRECTION'],
|
||||
'S_CONTENT_ENCODING' => 'UTF-8',
|
||||
'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
|
||||
'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
|
||||
'S_CONTENT_FLOW_BEGIN' => (phpbb::$user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
|
||||
'S_CONTENT_FLOW_END' => (phpbb::$user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
|
||||
));
|
||||
|
||||
// application/xhtml+xml not used because of IE
|
||||
|
@ -166,7 +161,6 @@ function adm_page_header($page_title)
|
|||
*/
|
||||
function adm_page_footer($copyright_html = true)
|
||||
{
|
||||
global $db, $template, $user, $auth;
|
||||
global $starttime;
|
||||
|
||||
// Output page creation time
|
||||
|
@ -175,14 +169,14 @@ function adm_page_footer($copyright_html = true)
|
|||
$mtime = explode(' ', microtime());
|
||||
$totaltime = $mtime[0] + $mtime[1] - $starttime;
|
||||
|
||||
if (phpbb_request::variable('explain', false) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report'))
|
||||
if (phpbb_request::variable('explain', false) && phpbb::$acl->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists(phpbb::$db, 'sql_report'))
|
||||
{
|
||||
$db->sql_report('display');
|
||||
phpbb::$db->sql_report('display');
|
||||
}
|
||||
|
||||
$debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . ((phpbb::$config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime);
|
||||
$debug_output = sprintf('Time : %.3fs | ' . phpbb::$db->sql_num_queries() . ' Queries | GZIP : ' . ((phpbb::$config['gzip_compress']) ? 'On' : 'Off') . ((phpbb::$user->system['load']) ? ' | Load : ' . phpbb::$user->system['load'] : ''), $totaltime);
|
||||
|
||||
if ($auth->acl_get('a_') && defined('DEBUG_EXTRA'))
|
||||
if (phpbb::$acl->acl_get('a_') && defined('DEBUG_EXTRA'))
|
||||
{
|
||||
if (function_exists('memory_get_usage'))
|
||||
{
|
||||
|
@ -196,18 +190,18 @@ function adm_page_footer($copyright_html = true)
|
|||
}
|
||||
}
|
||||
|
||||
$debug_output .= ' | <a href="' . build_url() . '&explain=1">Explain</a>';
|
||||
$debug_output .= ' | <a href="' . phpbb::$url->build_url() . '&explain=1">Explain</a>';
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
phpbb::$template->assign_vars(array(
|
||||
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
|
||||
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
|
||||
'TRANSLATION_INFO' => (!empty(phpbb::$user->lang['TRANSLATION_INFO'])) ? phpbb::$user->lang['TRANSLATION_INFO'] : '',
|
||||
'S_COPYRIGHT_HTML' => $copyright_html,
|
||||
'VERSION' => phpbb::$config['version'])
|
||||
);
|
||||
|
||||
$template->display('body');
|
||||
phpbb::$template->display('body');
|
||||
|
||||
garbage_collection();
|
||||
exit_handler();
|
||||
|
@ -218,8 +212,7 @@ function adm_page_footer($copyright_html = true)
|
|||
*/
|
||||
function adm_back_link($u_action)
|
||||
{
|
||||
global $user;
|
||||
return '<br /><br /><a href="' . $u_action . '">« ' . $user->lang['BACK_TO_PREV'] . '</a>';
|
||||
return '<br /><br /><a href="' . $u_action . '">« ' . phpbb::$user->lang['BACK_TO_PREV'] . '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -227,13 +220,11 @@ function adm_back_link($u_action)
|
|||
*/
|
||||
function build_select($option_ary, $option_default = false)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$html = '';
|
||||
foreach ($option_ary as $value => $title)
|
||||
{
|
||||
$selected = ($option_default !== false && $value == $option_default) ? ' selected="selected"' : '';
|
||||
$html .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$title] . '</option>';
|
||||
$html .= '<option value="' . $value . '"' . $selected . '>' . phpbb::$user->lang[$title] . '</option>';
|
||||
}
|
||||
|
||||
return $html;
|
||||
|
@ -244,14 +235,12 @@ function build_select($option_ary, $option_default = false)
|
|||
*/
|
||||
function h_radio($name, &$input_ary, $input_default = false, $id = false, $key = false)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$html = '';
|
||||
$id_assigned = false;
|
||||
foreach ($input_ary as $value => $title)
|
||||
{
|
||||
$selected = ($input_default !== false && $value == $input_default) ? ' checked="checked"' : '';
|
||||
$html .= '<label><input type="radio" name="' . $name . '"' . (($id && !$id_assigned) ? ' id="' . $id . '"' : '') . ' value="' . $value . '"' . $selected . (($key) ? ' accesskey="' . $key . '"' : '') . ' class="radio" /> ' . $user->lang[$title] . '</label>';
|
||||
$html .= '<label><input type="radio" name="' . $name . '"' . (($id && !$id_assigned) ? ' id="' . $id . '"' : '') . ' value="' . $value . '"' . $selected . (($key) ? ' accesskey="' . $key . '"' : '') . ' class="radio" /> ' . phpbb::$user->lang[$title] . '</label>';
|
||||
$id_assigned = true;
|
||||
}
|
||||
|
||||
|
@ -263,7 +252,7 @@ function h_radio($name, &$input_ary, $input_default = false, $id = false, $key =
|
|||
*/
|
||||
function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
||||
{
|
||||
global $user, $module;
|
||||
global $module;
|
||||
|
||||
$tpl = '';
|
||||
$name = 'config[' . $config_key . ']';
|
||||
|
@ -299,8 +288,8 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
|||
$tpl_type_cond = explode('_', $tpl_type[1]);
|
||||
$type_no = ($tpl_type_cond[0] == 'disabled' || $tpl_type_cond[0] == 'enabled') ? false : true;
|
||||
|
||||
$tpl_no = '<label><input type="radio" name="' . $name . '" value="0"' . $key_no . ' class="radio" /> ' . (($type_no) ? $user->lang['NO'] : $user->lang['DISABLED']) . '</label>';
|
||||
$tpl_yes = '<label><input type="radio" id="' . $key . '" name="' . $name . '" value="1"' . $key_yes . ' class="radio" /> ' . (($type_no) ? $user->lang['YES'] : $user->lang['ENABLED']) . '</label>';
|
||||
$tpl_no = '<label><input type="radio" name="' . $name . '" value="0"' . $key_no . ' class="radio" /> ' . (($type_no) ? phpbb::$user->lang['NO'] : phpbb::$user->lang['DISABLED']) . '</label>';
|
||||
$tpl_yes = '<label><input type="radio" id="' . $key . '" name="' . $name . '" value="1"' . $key_yes . ' class="radio" /> ' . (($type_no) ? phpbb::$user->lang['YES'] : phpbb::$user->lang['ENABLED']) . '</label>';
|
||||
|
||||
$tpl = ($tpl_type_cond[0] == 'yes' || $tpl_type_cond[0] == 'enabled') ? $tpl_yes . $tpl_no : $tpl_no . $tpl_yes;
|
||||
break;
|
||||
|
@ -378,8 +367,6 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
|
|||
*/
|
||||
function validate_config_vars($config_vars, &$cfg_array, &$error)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$type = 0;
|
||||
$min = 1;
|
||||
$max = 2;
|
||||
|
@ -409,11 +396,11 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
|
||||
if (isset($validator[$min]) && $length < $validator[$min])
|
||||
{
|
||||
$error[] = sprintf($user->lang['SETTING_TOO_SHORT'], $user->lang[$config_definition['lang']], $validator[$min]);
|
||||
$error[] = sprintf(phpbb::$user->lang['SETTING_TOO_SHORT'], phpbb::$user->lang[$config_definition['lang']], $validator[$min]);
|
||||
}
|
||||
else if (isset($validator[$max]) && $length > $validator[2])
|
||||
{
|
||||
$error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$config_definition['lang']], $validator[$max]);
|
||||
$error[] = sprintf(phpbb::$user->lang['SETTING_TOO_LONG'], phpbb::$user->lang[$config_definition['lang']], $validator[$max]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -426,11 +413,11 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
|
||||
if (isset($validator[$min]) && $cfg_array[$config_name] < $validator[$min])
|
||||
{
|
||||
$error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], $validator[$min]);
|
||||
$error[] = sprintf(phpbb::$user->lang['SETTING_TOO_LOW'], phpbb::$user->lang[$config_definition['lang']], $validator[$min]);
|
||||
}
|
||||
else if (isset($validator[$max]) && $cfg_array[$config_name] > $validator[$max])
|
||||
{
|
||||
$error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$config_definition['lang']], $validator[$max]);
|
||||
$error[] = sprintf(phpbb::$user->lang['SETTING_TOO_BIG'], phpbb::$user->lang[$config_definition['lang']], $validator[$max]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -474,7 +461,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
|
||||
if (!file_exists(PHPBB_ROOT_PATH . 'language/' . $cfg_array[$config_name] . '/'))
|
||||
{
|
||||
$error[] = $user->lang['WRONG_DATA_LANG'];
|
||||
$error[] = phpbb::$user->lang['WRONG_DATA_LANG'];
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -522,12 +509,12 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
|
||||
if (!file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
|
||||
{
|
||||
$error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
|
||||
$error[] = sprintf(phpbb::$user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
|
||||
}
|
||||
|
||||
if (file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]) && !is_dir(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
|
||||
{
|
||||
$error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
|
||||
$error[] = sprintf(phpbb::$user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
|
||||
}
|
||||
|
||||
// Check if the path is writable
|
||||
|
@ -535,7 +522,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
{
|
||||
if (file_exists(PHPBB_ROOT_PATH . $cfg_array[$config_name]) && !@is_writable(PHPBB_ROOT_PATH . $cfg_array[$config_name]))
|
||||
{
|
||||
$error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
|
||||
$error[] = sprintf(phpbb::$user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -553,8 +540,6 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
*/
|
||||
function validate_range($value_ary, &$error)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$column_types = array(
|
||||
'BOOL' => array('php_type' => 'int', 'min' => 0, 'max' => 1),
|
||||
'USINT' => array('php_type' => 'int', 'min' => 0, 'max' => 65535),
|
||||
|
@ -584,7 +569,7 @@ function validate_range($value_ary, &$error)
|
|||
$max = (isset($column[1])) ? min($column[1],$type['max']) : $type['max'];
|
||||
if (strlen($value['value']) > $max)
|
||||
{
|
||||
$error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$value['lang']], $max);
|
||||
$error[] = sprintf(phpbb::$user->lang['SETTING_TOO_LONG'], phpbb::$user->lang[$value['lang']], $max);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -593,11 +578,11 @@ function validate_range($value_ary, &$error)
|
|||
$max = (isset($column[2])) ? min($column[2],$type['max']) : $type['max'];
|
||||
if ($value['value'] < $min)
|
||||
{
|
||||
$error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$value['lang']], $min);
|
||||
$error[] = sprintf(phpbb::$user->lang['SETTING_TOO_LOW'], phpbb::$user->lang[$value['lang']], $min);
|
||||
}
|
||||
else if ($value['value'] > $max)
|
||||
{
|
||||
$error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$value['lang']], $max);
|
||||
$error[] = sprintf(phpbb::$user->lang['SETTING_TOO_BIG'], phpbb::$user->lang[$value['lang']], $max);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2287,11 +2287,9 @@ function cache_moderators()
|
|||
*/
|
||||
function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
|
||||
{
|
||||
global $db, $user, $auth;
|
||||
|
||||
$topic_id_list = $reportee_id_list = $is_auth = $is_mod = array();
|
||||
|
||||
$profile_url = (defined('IN_ADMIN')) ? append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&mode=overview') : append_sid('memberlist', 'mode=viewprofile');
|
||||
$profile_url = (defined('IN_ADMIN')) ? phpbb::$url->append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=users&mode=overview') : phpbb::$url->append_sid('memberlist', 'mode=viewprofile');
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
|
@ -2309,7 +2307,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
|||
}
|
||||
else if (is_array($forum_id))
|
||||
{
|
||||
$sql_forum = 'AND ' . $db->sql_in_set('l.forum_id', array_map('intval', $forum_id));
|
||||
$sql_forum = 'AND ' . phpbb::$db->sql_in_set('l.forum_id', array_map('intval', $forum_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2343,11 +2341,11 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
|||
" . (($limit_days) ? "AND l.log_time >= $limit_days" : '') . "
|
||||
$sql_forum
|
||||
ORDER BY $sort_by";
|
||||
$result = $db->sql_query_limit($sql, $limit, $offset);
|
||||
$result = phpbb::$db->sql_query_limit($sql, $limit, $offset);
|
||||
|
||||
$i = 0;
|
||||
$log = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
if ($row['topic_id'])
|
||||
{
|
||||
|
@ -2375,15 +2373,15 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
|||
'forum_id' => $row['forum_id'],
|
||||
'topic_id' => $row['topic_id'],
|
||||
|
||||
'viewforum' => ($row['forum_id'] && $auth->acl_get('f_read', $row['forum_id'])) ? append_sid('viewforum', 'f=' . $row['forum_id']) : false,
|
||||
'action' => (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
|
||||
'viewforum' => ($row['forum_id'] && phpbb::$acl->acl_get('f_read', $row['forum_id'])) ? phpbb::$url->append_sid('viewforum', 'f=' . $row['forum_id']) : false,
|
||||
'action' => (isset(phpbb::$user->lang[$row['log_operation']])) ? phpbb::$user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
|
||||
);
|
||||
|
||||
if (!empty($row['log_data']))
|
||||
{
|
||||
$log_data_ary = unserialize($row['log_data']);
|
||||
|
||||
if (isset($user->lang[$row['log_operation']]))
|
||||
if (isset(phpbb::$user->lang[$row['log_operation']]))
|
||||
{
|
||||
// Check if there are more occurrences of % than arguments, if there are we fill out the arguments array
|
||||
// It doesn't matter if we add more arguments than placeholders
|
||||
|
@ -2417,7 +2415,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
|||
|
||||
$i++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($topic_id_list))
|
||||
{
|
||||
|
@ -2427,25 +2425,25 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
|||
// although it's also used to determine if the topic still exists in the database
|
||||
$sql = 'SELECT topic_id, forum_id
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('topic_id', array_map('intval', $topic_id_list));
|
||||
$result = $db->sql_query($sql);
|
||||
WHERE ' . phpbb::$db->sql_in_set('topic_id', array_map('intval', $topic_id_list));
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
$default_forum_id = 0;
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
if (!$row['forum_id'])
|
||||
{
|
||||
if ($auth->acl_getf_global('f_read'))
|
||||
if (phpbb::$acl->acl_getf_global('f_read'))
|
||||
{
|
||||
if (!$default_forum_id)
|
||||
{
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type = ' . FORUM_POST;
|
||||
$f_result = $db->sql_query_limit($sql, 1);
|
||||
$default_forum_id = (int) $db->sql_fetchfield('forum_id', $f_result);
|
||||
$db->sql_freeresult($f_result);
|
||||
$f_result = phpbb::$db->sql_query_limit($sql, 1);
|
||||
$default_forum_id = (int) phpbb::$db->sql_fetchfield('forum_id', $f_result);
|
||||
phpbb::$db->sql_freeresult($f_result);
|
||||
}
|
||||
|
||||
$is_auth[$row['topic_id']] = $default_forum_id;
|
||||
|
@ -2453,23 +2451,23 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
|||
}
|
||||
else
|
||||
{
|
||||
if ($auth->acl_get('f_read', $row['forum_id']))
|
||||
if (phpbb::$acl->acl_get('f_read', $row['forum_id']))
|
||||
{
|
||||
$is_auth[$row['topic_id']] = $row['forum_id'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($auth->acl_gets('a_', 'm_', $row['forum_id']))
|
||||
if (phpbb::$acl->acl_gets('a_', 'm_', $row['forum_id']))
|
||||
{
|
||||
$is_mod[$row['topic_id']] = $row['forum_id'];
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
foreach ($log as $key => $row)
|
||||
{
|
||||
$log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? append_sid('viewtopic', 'f=' . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id']) : false;
|
||||
$log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? append_sid('mcp', 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, $user->session_id) : false;
|
||||
$log[$key]['viewtopic'] = (isset($is_auth[$row['topic_id']])) ? phpbb::$url->append_sid('viewtopic', 'f=' . $is_auth[$row['topic_id']] . '&t=' . $row['topic_id']) : false;
|
||||
$log[$key]['viewlogs'] = (isset($is_mod[$row['topic_id']])) ? phpbb::$url->append_sid('mcp', 'i=logs&mode=topic_logs&t=' . $row['topic_id'], true, phpbb::$user->session_id) : false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2480,14 +2478,14 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
|||
|
||||
$sql = 'SELECT user_id, username, user_colour
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('user_id', $reportee_id_list);
|
||||
$result = $db->sql_query($sql);
|
||||
WHERE ' . phpbb::$db->sql_in_set('user_id', $reportee_id_list);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
$reportee_names_list[$row['user_id']] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
foreach ($log as $key => $row)
|
||||
{
|
||||
|
@ -2506,9 +2504,9 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
|||
WHERE l.log_type = $log_type
|
||||
AND l.log_time >= $limit_days
|
||||
$sql_forum";
|
||||
$result = $db->sql_query($sql);
|
||||
$log_count = (int) $db->sql_fetchfield('total_entries');
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$log_count = (int) phpbb::$db->sql_fetchfield('total_entries');
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -2629,15 +2627,13 @@ function update_foes($group_id = false, $user_id = false)
|
|||
*/
|
||||
function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $limit_days = 0, $sort_by = 'user_inactive_time DESC')
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
$sql = 'SELECT COUNT(user_id) AS user_count
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type = ' . phpbb::USER_INACTIVE .
|
||||
(($limit_days) ? " AND user_inactive_time >= $limit_days" : '');
|
||||
$result = $db->sql_query($sql);
|
||||
$user_count = (int) $db->sql_fetchfield('user_count');
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$user_count = (int) phpbb::$db->sql_fetchfield('user_count');
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if ($offset >= $user_count)
|
||||
{
|
||||
|
@ -2649,27 +2645,27 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li
|
|||
WHERE user_type = ' . phpbb::USER_INACTIVE .
|
||||
(($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . "
|
||||
ORDER BY $sort_by";
|
||||
$result = $db->sql_query_limit($sql, $limit, $offset);
|
||||
$result = phpbb::$db->sql_query_limit($sql, $limit, $offset);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_UNKNOWN'];
|
||||
$row['inactive_reason'] = phpbb::$user->lang['INACTIVE_REASON_UNKNOWN'];
|
||||
switch ($row['user_inactive_reason'])
|
||||
{
|
||||
case INACTIVE_REGISTER:
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_REGISTER'];
|
||||
$row['inactive_reason'] = phpbb::$user->lang['INACTIVE_REASON_REGISTER'];
|
||||
break;
|
||||
|
||||
case INACTIVE_PROFILE:
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_PROFILE'];
|
||||
$row['inactive_reason'] = phpbb::$user->lang['INACTIVE_REASON_PROFILE'];
|
||||
break;
|
||||
|
||||
case INACTIVE_MANUAL:
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_MANUAL'];
|
||||
$row['inactive_reason'] = phpbb::$user->lang['INACTIVE_REASON_MANUAL'];
|
||||
break;
|
||||
|
||||
case INACTIVE_REMIND:
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_REMIND'];
|
||||
$row['inactive_reason'] = phpbb::$user->lang['INACTIVE_REASON_REMIND'];
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2711,18 +2707,18 @@ function view_warned_users(&$users, &$user_count, $limit = 0, $offset = 0, $limi
|
|||
*/
|
||||
function get_database_size()
|
||||
{
|
||||
global $db, $user, $table_prefix;
|
||||
global $table_prefix;
|
||||
|
||||
$database_size = false;
|
||||
|
||||
// This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0
|
||||
switch ($db->dbms_type)
|
||||
switch (phpbb::$db->dbms_type)
|
||||
{
|
||||
case 'mysql':
|
||||
$sql = 'SELECT VERSION() AS mysql_version';
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if ($row)
|
||||
{
|
||||
|
@ -2730,14 +2726,14 @@ function get_database_size()
|
|||
|
||||
if (preg_match('#(3\.23|[45]\.)#', $version))
|
||||
{
|
||||
$db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->dbname}`" : $db->dbname;
|
||||
$db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`" . phpbb::$db->dbname . "`" : phpbb::$db->dbname;
|
||||
|
||||
$sql = 'SHOW TABLE STATUS
|
||||
FROM ' . $db_name;
|
||||
$result = $db->sql_query($sql, 7200);
|
||||
$result = phpbb::$db->sql_query($sql, 7200);
|
||||
|
||||
$database_size = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
if ((isset($row['Type']) && $row['Type'] != 'MRG_MyISAM') || (isset($row['Engine']) && ($row['Engine'] == 'MyISAM' || $row['Engine'] == 'InnoDB')))
|
||||
{
|
||||
|
@ -2754,7 +2750,7 @@ function get_database_size()
|
|||
}
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -2783,22 +2779,22 @@ function get_database_size()
|
|||
case 'mssql':
|
||||
$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
|
||||
FROM sysfiles';
|
||||
$result = $db->sql_query($sql, 7200);
|
||||
$database_size = ($row = $db->sql_fetchrow($result)) ? $row['dbsize'] : false;
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql, 7200);
|
||||
$database_size = ($row = phpbb::$db->sql_fetchrow($result)) ? $row['dbsize'] : false;
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
break;
|
||||
|
||||
case 'postgres':
|
||||
$sql = "SELECT proname
|
||||
FROM pg_proc
|
||||
WHERE proname = 'pg_database_size'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if ($row['proname'] == 'pg_database_size')
|
||||
{
|
||||
$database = $db->dbname;
|
||||
$database = phpbb::$db->dbname;
|
||||
if (strpos($database, '.') !== false)
|
||||
{
|
||||
list($database, ) = explode('.', $database);
|
||||
|
@ -2807,16 +2803,16 @@ function get_database_size()
|
|||
$sql = "SELECT oid
|
||||
FROM pg_database
|
||||
WHERE datname = '$database'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$oid = $row['oid'];
|
||||
|
||||
$sql = 'SELECT pg_database_size(' . $oid . ') as size';
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$database_size = $row['size'];
|
||||
}
|
||||
|
@ -2825,13 +2821,13 @@ function get_database_size()
|
|||
case 'oracle':
|
||||
$sql = 'SELECT SUM(bytes) as dbsize
|
||||
FROM user_segments';
|
||||
$result = $db->sql_query($sql, 7200);
|
||||
$database_size = ($row = $db->sql_fetchrow($result)) ? $row['dbsize'] : false;
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql, 7200);
|
||||
$database_size = ($row = phpbb::$db->sql_fetchrow($result)) ? $row['dbsize'] : false;
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
break;
|
||||
}
|
||||
|
||||
$database_size = ($database_size !== false) ? get_formatted_filesize($database_size) : $user->lang['NOT_AVAILABLE'];
|
||||
$database_size = ($database_size !== false) ? get_formatted_filesize($database_size) : phpbb::$user->lang['NOT_AVAILABLE'];
|
||||
|
||||
return $database_size;
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
if ($subforum_row['display'] && $subforum_row['name'])
|
||||
{
|
||||
$subforums_list[] = array(
|
||||
'link' => append_sid('viewforum', 'f=' . $subforum_id),
|
||||
'link' => phpbb::$url->append_sid('viewforum', 'f=' . $subforum_id),
|
||||
'name' => $subforum_row['name'],
|
||||
'unread' => $subforum_unread,
|
||||
);
|
||||
|
@ -465,7 +465,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
|||
}
|
||||
|
||||
phpbb::$template->assign_vars(array(
|
||||
'U_MARK_FORUMS' => (phpbb::$user->is_registered || phpbb::$config['load_anon_lastread']) ? append_sid('viewforum', 'hash=' . phpbb::$security->hash_link('global') . '&f=' . $root_data['forum_id'] . '&mark=forums') : '',
|
||||
'U_MARK_FORUMS' => (phpbb::$user->is_registered || phpbb::$config['load_anon_lastread']) ? phpbb::$url->append_sid('viewforum', 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums') : '',
|
||||
'S_HAS_SUBFORUM' => ($visible_forums) ? true : false,
|
||||
'L_SUBFORUM' => phpbb::$user->lang('SUBFORUMS', $visible_forums),
|
||||
'LAST_POST_IMG' => phpbb::$user->img('icon_topic_latest', 'VIEW_LATEST_POST'))
|
||||
|
@ -538,7 +538,7 @@ function generate_forum_nav(&$forum_data)
|
|||
'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false,
|
||||
'FORUM_NAME' => $parent_name,
|
||||
'FORUM_ID' => $parent_forum_id,
|
||||
'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $parent_forum_id))
|
||||
'U_VIEW_FORUM' => phpbb::$url->append_sid('viewforum', 'f=' . $parent_forum_id))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ function generate_forum_nav(&$forum_data)
|
|||
'S_IS_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
|
||||
'FORUM_NAME' => $forum_data['forum_name'],
|
||||
'FORUM_ID' => $forum_data['forum_id'],
|
||||
'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_data['forum_id']))
|
||||
'U_VIEW_FORUM' => phpbb::$url->append_sid('viewforum', 'f=' . $forum_data['forum_id']))
|
||||
);
|
||||
|
||||
$template->assign_vars(array(
|
||||
|
@ -999,8 +999,8 @@ function display_user_activity(&$userdata)
|
|||
'ACTIVE_TOPIC' => censor_text($active_t_name),
|
||||
'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count),
|
||||
'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct),
|
||||
'U_ACTIVE_FORUM' => append_sid('viewforum', 'f=' . $active_f_id),
|
||||
'U_ACTIVE_TOPIC' => append_sid('viewtopic', 't=' . $active_t_id),
|
||||
'U_ACTIVE_FORUM' => phpbb::$url->append_sid('viewforum', 'f=' . $active_f_id),
|
||||
'U_ACTIVE_TOPIC' => phpbb::$url->append_sid('viewtopic', 't=' . $active_t_id),
|
||||
'S_SHOW_ACTIVITY' => true,
|
||||
));
|
||||
}
|
||||
|
@ -1043,7 +1043,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
|||
$uid = request_var('uid', 0);
|
||||
if ($uid != $user_id)
|
||||
{
|
||||
$redirect_url = append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
$redirect_url = phpbb::$url->append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
|
@ -1057,7 +1057,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
|||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$redirect_url = append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
$redirect_url = phpbb::$url->append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
|
||||
meta_refresh(3, $redirect_url);
|
||||
|
||||
|
@ -1083,7 +1083,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
|||
if (phpbb_request::is_set('watch', phpbb_request::GET))
|
||||
{
|
||||
$token = request_var('hash', '');
|
||||
$redirect_url = append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
$redirect_url = phpbb::$url->append_sid("view$mode", "$u_url=$match_id&start=$start");
|
||||
|
||||
if (phpbb_request::variable('watch', '', false, phpbb_request::GET) == $mode && check_link_hash($token, "{$mode}_$match_id"))
|
||||
{
|
||||
|
@ -1124,7 +1124,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
|||
|
||||
if ($can_watch)
|
||||
{
|
||||
$s_watching['link'] = append_sid("view$mode", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id"));
|
||||
$s_watching['link'] = phpbb::$url->append_sid("view$mode", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start&hash=" . generate_link_hash("{$mode}_$match_id"));
|
||||
$s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)];
|
||||
$s_watching['is_watching'] = $is_watching;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class p_master
|
|||
*/
|
||||
public function __construct($include_path = false)
|
||||
{
|
||||
$this->include_path = ($include_path !== false) ? $include_path : PHPBB_ROOT_PATH . 'includes/';
|
||||
$this->include_path = ($include_path !== false) ? $include_path : PHPBB_ROOT_PATH . 'modules/';
|
||||
|
||||
// Make sure the path ends with /
|
||||
if (substr($this->include_path, -1) !== '/')
|
||||
|
@ -78,8 +78,6 @@ class p_master
|
|||
*/
|
||||
function list_modules($p_class)
|
||||
{
|
||||
global $auth, $db, $user;
|
||||
|
||||
// Sanitise for future path use, it's escaped as appropriate for queries
|
||||
$this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class));
|
||||
|
||||
|
@ -89,16 +87,16 @@ class p_master
|
|||
// Get modules
|
||||
$sql = 'SELECT *
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($this->p_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->p_class) . "'
|
||||
ORDER BY left_id ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
$rows = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
$rows[$row['module_id']] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$this->module_cache = array();
|
||||
foreach ($rows as $module_id => $row)
|
||||
|
@ -243,7 +241,7 @@ class p_master
|
|||
|
||||
'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode'], $row) : '',
|
||||
|
||||
'lang' => ($row['module_basename'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']),
|
||||
'lang' => ($row['module_basename'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : phpbb::$user->lang($row['module_langname']),
|
||||
'langname' => $row['module_langname'],
|
||||
|
||||
'left' => $row['left_id'],
|
||||
|
@ -310,8 +308,6 @@ class p_master
|
|||
*/
|
||||
function module_auth($module_auth, $forum_id = false)
|
||||
{
|
||||
global $auth;
|
||||
|
||||
$module_auth = trim($module_auth);
|
||||
|
||||
// Generally allowed to access module if module_auth is empty
|
||||
|
@ -358,7 +354,7 @@ class p_master
|
|||
$forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
|
||||
|
||||
$is_auth = false;
|
||||
eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) phpbb::$config[\'\\1\']', 'phpbb_request::variable(\'\\1\', false)'), $module_auth) . ');');
|
||||
eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) phpbb::$acl->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) phpbb::$acl->acl_getf_global(\'\\1\')', '(int) phpbb::$config[\'\\1\']', 'phpbb_request::variable(\'\\1\', false)'), $module_auth) . ');');
|
||||
|
||||
return $is_auth;
|
||||
}
|
||||
|
@ -426,8 +422,6 @@ class p_master
|
|||
*/
|
||||
function load_active($mode = false, $module_url = false, $execute_module = true)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$module_path = $this->include_path . $this->p_class;
|
||||
$icat = request_var('icat', '');
|
||||
|
||||
|
@ -471,7 +465,7 @@ class p_master
|
|||
}
|
||||
|
||||
// Not being able to overwrite ;)
|
||||
$this->module->u_action = append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||
$this->module->u_action = phpbb::$url->append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -482,10 +476,10 @@ class p_master
|
|||
}
|
||||
else
|
||||
{
|
||||
$this->module->u_action = PHPBB_ROOT_PATH . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name'];
|
||||
$this->module->u_action = PHPBB_ROOT_PATH . ((phpbb::$user->page['page_dir']) ? phpbb::$user->page['page_dir'] . '/' : '') . phpbb::$user->page['page_name'];
|
||||
}
|
||||
|
||||
$this->module->u_action = append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||
$this->module->u_action = phpbb::$url->append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}";
|
||||
}
|
||||
|
||||
// Add url_extra parameter to u_action url
|
||||
|
@ -560,8 +554,6 @@ class p_master
|
|||
*/
|
||||
function get_parents($parent_id, $left_id, $right_id, &$all_parents)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$parents = array();
|
||||
|
||||
if ($parent_id > 0)
|
||||
|
@ -646,8 +638,6 @@ class p_master
|
|||
*/
|
||||
function assign_tpl_vars($module_url)
|
||||
{
|
||||
global $template;
|
||||
|
||||
$current_id = $right_id = false;
|
||||
|
||||
// Make sure the module_url has a question mark set, effectively determining the delimiter to use
|
||||
|
@ -747,7 +737,7 @@ class p_master
|
|||
'U_TITLE' => $u_title
|
||||
);
|
||||
|
||||
$template->assign_block_vars($use_tabular_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
|
||||
phpbb::$template->assign_block_vars($use_tabular_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
|
||||
}
|
||||
|
||||
$tpl_ary = array(
|
||||
|
@ -756,7 +746,7 @@ class p_master
|
|||
'U_TITLE' => $u_title
|
||||
);
|
||||
|
||||
$template->assign_block_vars($linear_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
|
||||
phpbb::$template->assign_block_vars($linear_offset, array_merge($tpl_ary, array_change_key_case($item_ary, CASE_UPPER)));
|
||||
|
||||
$current_depth = $depth;
|
||||
}
|
||||
|
@ -775,14 +765,12 @@ class p_master
|
|||
*/
|
||||
function get_page_title()
|
||||
{
|
||||
global $user;
|
||||
|
||||
if (!isset($this->module->page_title))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
return (isset($user->lang[$this->module->page_title])) ? $user->lang[$this->module->page_title] : $this->module->page_title;
|
||||
return phpbb::$user->lang($this->module->page_title);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -804,10 +792,8 @@ class p_master
|
|||
*/
|
||||
function display($page_title, $display_online_list = true)
|
||||
{
|
||||
global $template, $user;
|
||||
|
||||
// Generate the page
|
||||
if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])
|
||||
if (defined('IN_ADMIN') && isset(phpbb::$user->data['session_admin']) && phpbb::$user->data['session_admin'])
|
||||
{
|
||||
adm_page_header($page_title);
|
||||
}
|
||||
|
@ -816,11 +802,11 @@ class p_master
|
|||
page_header($page_title, $display_online_list);
|
||||
}
|
||||
|
||||
$template->set_filenames(array(
|
||||
phpbb::$template->set_filenames(array(
|
||||
'body' => $this->get_tpl_name())
|
||||
);
|
||||
|
||||
if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])
|
||||
if (defined('IN_ADMIN') && isset(phpbb::$user->data['session_admin']) && phpbb::$user->data['session_admin'])
|
||||
{
|
||||
adm_page_footer();
|
||||
}
|
||||
|
@ -849,13 +835,11 @@ class p_master
|
|||
*/
|
||||
function add_mod_info($module_class)
|
||||
{
|
||||
global $user;
|
||||
|
||||
if (file_exists($user->lang_path . $user->lang_name . '/mods'))
|
||||
if (file_exists(phpbb::$user->lang_path . phpbb::$user->lang_name . '/mods'))
|
||||
{
|
||||
$add_files = array();
|
||||
|
||||
$dir = @opendir($user->lang_path . $user->lang_name . '/mods');
|
||||
$dir = @opendir(phpbb::$user->lang_path . phpbb::$user->lang_name . '/mods');
|
||||
|
||||
if ($dir)
|
||||
{
|
||||
|
@ -871,7 +855,7 @@ class p_master
|
|||
|
||||
if (sizeof($add_files))
|
||||
{
|
||||
$user->add_lang($add_files);
|
||||
phpbb::$user->add_lang($add_files);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -62,7 +62,7 @@ while ($row = phpbb::$db->sql_fetchrow($result))
|
|||
$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
|
||||
$group_name = ($row['group_type'] == GROUP_SPECIAL) ? phpbb::$user->lang['G_' . $row['group_name']] : $row['group_name'];
|
||||
|
||||
if ($row['group_name'] == 'BOTS' || (phpbb::$user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')))
|
||||
if ($row['group_name'] == 'BOTS' || (phpbb::$user->data['user_id'] != ANONYMOUS && !phpbb::$acl->acl_get('u_viewprofile')))
|
||||
{
|
||||
$legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ phpbb::$template->assign_vars(array(
|
|||
'S_LOGIN_ACTION' => phpbb::$url->append_sid('ucp', 'mode=login'),
|
||||
'S_DISPLAY_BIRTHDAY_LIST' => (phpbb::$config['load_birthdays']) ? true : false,
|
||||
|
||||
'U_MARK_FORUMS' => (phpbb::$user->is_registered || phpbb::$config['load_anon_lastread']) ? append_sid('index', 'hash=' . generate_link_hash('global') . '&mark=forums') : '',
|
||||
'U_MARK_FORUMS' => (phpbb::$user->is_registered || phpbb::$config['load_anon_lastread']) ? phpbb::$url->append_sid('index', 'hash=' . generate_link_hash('global') . '&mark=forums') : '',
|
||||
'U_MCP' => (phpbb::$acl->acl_get('m_') || phpbb::$acl->acl_getf_global('m_')) ? phpbb::$url->append_sid('mcp', 'i=main&mode=front', true, phpbb::$user->session_id) : '')
|
||||
);
|
||||
|
||||
|
|
|
@ -416,7 +416,7 @@ switch ($mode)
|
|||
|
||||
// a_user admins and founder are able to view inactive users and bots to be able to manage them more easily
|
||||
// Normal users are able to see at least users having only changed their profile settings but not yet reactivated.
|
||||
if (!$auth->acl_get('a_user') && $user->data['user_type'] != phpbb::USER_FOUNDER)
|
||||
if (!$auth->acl_get('a_user') && !phpbb::$user->is_founder)
|
||||
{
|
||||
if ($member['user_type'] == phpbb::USER_IGNORE)
|
||||
{
|
||||
|
|
|
@ -67,7 +67,7 @@ class acp_groups
|
|||
}
|
||||
|
||||
// Check if the user is allowed to manage this group if set to founder only.
|
||||
if ($user->data['user_type'] != phpbb::USER_FOUNDER && $group_row['group_founder_manage'])
|
||||
if (!phpbb::$user->is_founder && $group_row['group_founder_manage'])
|
||||
{
|
||||
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ class acp_groups
|
|||
'founder_manage' => 0,
|
||||
);
|
||||
|
||||
if ($user->data['user_type'] == phpbb::USER_FOUNDER)
|
||||
if (phpbb::$user->is_founder)
|
||||
{
|
||||
$submit_ary['founder_manage'] = phpbb_request::is_set('group_founder_manage') ? 1 : 0;
|
||||
}
|
||||
|
@ -426,8 +426,9 @@ class acp_groups
|
|||
$db->sql_freeresult($result);
|
||||
|
||||
// Check the group if non-founder
|
||||
if ($check_row && ($user->data['user_type'] == phpbb::USER_FOUNDER || $check_row['group_founder_manage'] == 0))
|
||||
if ($check_row && (phpbb::$user->is_founder || $check_row['group_founder_manage'] == 0))
|
||||
{
|
||||
// @todo CHANGE - do we support < 4.0.14?
|
||||
// From the mysql documentation:
|
||||
// Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
|
||||
// Due to this we stay on the safe side if we do the insertion "the manual way"
|
||||
|
@ -549,7 +550,7 @@ class acp_groups
|
|||
'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false,
|
||||
'S_DISPLAY_GALLERY' => (phpbb::$config['allow_avatar_local'] && !$display_gallery) ? true : false,
|
||||
'S_IN_GALLERY' => (phpbb::$config['allow_avatar_local'] && $display_gallery) ? true : false,
|
||||
'S_USER_FOUNDER' => ($user->data['user_type'] == phpbb::USER_FOUNDER) ? true : false,
|
||||
'S_USER_FOUNDER' => phpbb::$user->is_founder,
|
||||
|
||||
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name,
|
||||
|
@ -568,7 +569,7 @@ class acp_groups
|
|||
'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'],
|
||||
|
||||
'S_RANK_OPTIONS' => $rank_options,
|
||||
'S_GROUP_OPTIONS' => group_select_options(false, false, (($user->data['user_type'] == phpbb::USER_FOUNDER) ? false : 0)),
|
||||
'S_GROUP_OPTIONS' => group_select_options(false, false, ((phpbb::$user->is_founder) ? false : 0)),
|
||||
'AVATAR' => $avatar_img,
|
||||
'AVATAR_IMAGE' => $avatar_img,
|
||||
'AVATAR_MAX_FILESIZE' => phpbb::$config['avatar_filesize'],
|
||||
|
|
|
@ -25,32 +25,30 @@ class acp_main
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template;
|
||||
|
||||
// Show restore permissions notice
|
||||
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
|
||||
if (phpbb::$user->data['user_perm_from'] && phpbb::$acl->acl_get('a_switchperm'))
|
||||
{
|
||||
$this->tpl_name = 'acp_main';
|
||||
$this->page_title = 'ACP_MAIN';
|
||||
|
||||
$sql = 'SELECT user_id, username, user_colour
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_id = ' . $user->data['user_perm_from'];
|
||||
$result = $db->sql_query($sql);
|
||||
$user_row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
WHERE user_id = ' . phpbb::$user->data['user_perm_from'];
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$user_row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$perm_from = '<strong' . (($user_row['user_colour']) ? ' style="color: #' . $user_row['user_colour'] . '">' : '>');
|
||||
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . append_sid('memberlist', 'mode=viewprofile&u=' . $user_row['user_id']) . '">' : '';
|
||||
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '<a href="' . phpbb::$url->append_sid('memberlist', 'mode=viewprofile&u=' . $user_row['user_id']) . '">' : '';
|
||||
$perm_from .= $user_row['username'];
|
||||
$perm_from .= ($user_row['user_id'] != ANONYMOUS) ? '</a>' : '';
|
||||
$perm_from .= '</strong>';
|
||||
|
||||
$template->assign_vars(array(
|
||||
phpbb::$template->assign_vars(array(
|
||||
'S_RESTORE_PERMISSIONS' => true,
|
||||
'U_RESTORE_PERMISSIONS' => append_sid('ucp', 'mode=restore_perm'),
|
||||
'U_RESTORE_PERMISSIONS' => phpbb::$url->append_sid('ucp', 'mode=restore_perm'),
|
||||
'PERM_FROM' => $perm_from,
|
||||
'L_PERMISSIONS_TRANSFERRED_EXPLAIN' => sprintf($user->lang['PERMISSIONS_TRANSFERRED_EXPLAIN'], $perm_from, append_sid('ucp', 'mode=restore_perm')),
|
||||
'L_PERMISSIONS_TRANSFERRED_EXPLAIN' => sprintf(phpbb::$user->lang['PERMISSIONS_TRANSFERRED_EXPLAIN'], $perm_from, phpbb::$url->append_sid('ucp', 'mode=restore_perm')),
|
||||
));
|
||||
|
||||
return;
|
||||
|
@ -62,10 +60,10 @@ class acp_main
|
|||
{
|
||||
if ($action === 'admlogout')
|
||||
{
|
||||
$user->unset_admin();
|
||||
$redirect_url = append_sid(PHPBB_ROOT_PATH . 'index.' . PHP_EXT);
|
||||
phpbb::$user->unset_admin();
|
||||
$redirect_url = phpbb::$url->append_sid(PHPBB_ROOT_PATH . 'index.' . PHP_EXT);
|
||||
meta_refresh(3, $redirect_url);
|
||||
trigger_error($user->lang['ADM_LOGGED_OUT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect_url . '">', '</a>'));
|
||||
trigger_error(phpbb::$user->lang['ADM_LOGGED_OUT'] . '<br /><br />' . sprintf(phpbb::$user->lang['RETURN_INDEX'], '<a href="' . $redirect_url . '">', '</a>'));
|
||||
}
|
||||
|
||||
if (!confirm_box(true))
|
||||
|
@ -104,7 +102,7 @@ class acp_main
|
|||
|
||||
if ($confirm)
|
||||
{
|
||||
confirm_box(false, $user->lang[$confirm_lang], build_hidden_fields(array(
|
||||
confirm_box(false, phpbb::$user->lang[$confirm_lang], build_hidden_fields(array(
|
||||
'i' => $id,
|
||||
'mode' => $mode,
|
||||
'action' => $action,
|
||||
|
@ -117,9 +115,9 @@ class acp_main
|
|||
{
|
||||
|
||||
case 'online':
|
||||
if (!$auth->acl_get('a_board'))
|
||||
if (!phpbb::$acl->acl_get('a_board'))
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
set_config('record_online_users', 1, true);
|
||||
|
@ -128,45 +126,45 @@ class acp_main
|
|||
break;
|
||||
|
||||
case 'stats':
|
||||
if (!$auth->acl_get('a_board'))
|
||||
if (!phpbb::$acl->acl_get('a_board'))
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql = 'SELECT COUNT(post_id) AS stat
|
||||
FROM ' . POSTS_TABLE . '
|
||||
WHERE post_approved = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
set_config('num_posts', (int) $db->sql_fetchfield('stat'), true);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
set_config('num_posts', (int) phpbb::$db->sql_fetchfield('stat'), true);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT COUNT(topic_id) AS stat
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE topic_approved = 1';
|
||||
$result = $db->sql_query($sql);
|
||||
set_config('num_topics', (int) $db->sql_fetchfield('stat'), true);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
set_config('num_topics', (int) phpbb::$db->sql_fetchfield('stat'), true);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT COUNT(user_id) AS stat
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type IN (' . phpbb::USER_NORMAL . ',' . phpbb::USER_FOUNDER . ')';
|
||||
$result = $db->sql_query($sql);
|
||||
set_config('num_users', (int) $db->sql_fetchfield('stat'), true);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
set_config('num_users', (int) phpbb::$db->sql_fetchfield('stat'), true);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT COUNT(attach_id) as stat
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE is_orphan = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
set_config('num_files', (int) $db->sql_fetchfield('stat'), true);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
set_config('num_files', (int) phpbb::$db->sql_fetchfield('stat'), true);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT SUM(filesize) as stat
|
||||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE is_orphan = 0';
|
||||
$result = $db->sql_query($sql);
|
||||
set_config('upload_dir_size', (float) $db->sql_fetchfield('stat'), true);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
set_config('upload_dir_size', (float) phpbb::$db->sql_fetchfield('stat'), true);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if (!function_exists('update_last_username'))
|
||||
{
|
||||
|
@ -178,9 +176,9 @@ class acp_main
|
|||
break;
|
||||
|
||||
case 'user':
|
||||
if (!$auth->acl_get('a_board'))
|
||||
if (!phpbb::$acl->acl_get('a_board'))
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
// Resync post counts
|
||||
|
@ -189,18 +187,18 @@ class acp_main
|
|||
// Find the maximum post ID, we can only stop the cycle when we've reached it
|
||||
$sql = 'SELECT MAX(forum_last_post_id) as max_post_id
|
||||
FROM ' . FORUMS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$max_post_id = (int) $db->sql_fetchfield('max_post_id');
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$max_post_id = (int) phpbb::$db->sql_fetchfield('max_post_id');
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
// No maximum post id? :o
|
||||
if (!$max_post_id)
|
||||
{
|
||||
$sql = 'SELECT MAX(post_id)
|
||||
FROM ' . POSTS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
$max_post_id = (int) $db->sql_fetchfield('max_post_id');
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$max_post_id = (int) phpbb::$db->sql_fetchfield('max_post_id');
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// Still no maximum post id? Then we are finished
|
||||
|
@ -211,7 +209,7 @@ class acp_main
|
|||
}
|
||||
|
||||
$step = (phpbb::$config['num_posts']) ? (max((int) (phpbb::$config['num_posts'] / 5), 20000)) : 20000;
|
||||
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0');
|
||||
phpbb::$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_posts = 0');
|
||||
|
||||
while ($start < $max_post_id)
|
||||
{
|
||||
|
@ -220,18 +218,18 @@ class acp_main
|
|||
WHERE post_id BETWEEN ' . ($start + 1) . ' AND ' . ($start + $step) . '
|
||||
AND post_postcount = 1 AND post_approved = 1
|
||||
GROUP BY poster_id';
|
||||
$result = $db->sql_query($sql);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
if ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = user_posts + {$row['num_posts']} WHERE user_id = {$row['poster_id']}";
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
while ($row = phpbb::$db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$start += $step;
|
||||
}
|
||||
|
@ -241,9 +239,9 @@ class acp_main
|
|||
break;
|
||||
|
||||
case 'date':
|
||||
if (!$auth->acl_get('a_board'))
|
||||
if (!phpbb::$acl->acl_get('a_board'))
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
set_config('board_startdate', time() - 1);
|
||||
|
@ -251,13 +249,13 @@ class acp_main
|
|||
break;
|
||||
|
||||
case 'db_track':
|
||||
if ($db->truncate)
|
||||
if (phpbb::$db->features['truncate'])
|
||||
{
|
||||
$db->sql_query('TRUNCATE TABLE ' . TOPICS_POSTED_TABLE);
|
||||
phpbb::$db->sql_query('TRUNCATE TABLE ' . TOPICS_POSTED_TABLE);
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE);
|
||||
phpbb::$db->sql_query('DELETE FROM ' . TOPICS_POSTED_TABLE);
|
||||
}
|
||||
|
||||
// This can get really nasty... therefore we only do the last six months
|
||||
|
@ -267,14 +265,14 @@ class acp_main
|
|||
$sql = 'SELECT forum_id
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
WHERE forum_type <> ' . FORUM_CAT;
|
||||
$result = $db->sql_query($sql);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
$forum_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_ids[] = $row['forum_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
// Any global announcements? ;)
|
||||
$forum_ids[] = 0;
|
||||
|
@ -290,14 +288,14 @@ class acp_main
|
|||
AND t.topic_id = p.topic_id
|
||||
AND p.poster_id <> ' . ANONYMOUS . '
|
||||
GROUP BY p.poster_id, p.topic_id';
|
||||
$result = $db->sql_query($sql);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
$posted = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
$posted[$row['poster_id']][] = $row['topic_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$sql_ary = array();
|
||||
foreach ($posted as $user_id => $topic_row)
|
||||
|
@ -315,7 +313,7 @@ class acp_main
|
|||
|
||||
if (sizeof($sql_ary))
|
||||
{
|
||||
$db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
|
||||
phpbb::$db->sql_multi_insert(TOPICS_POSTED_TABLE, $sql_ary);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -323,15 +321,15 @@ class acp_main
|
|||
break;
|
||||
|
||||
case 'purge_cache':
|
||||
if ((int) $user->data['user_type'] !== phpbb::USER_FOUNDER)
|
||||
if (!phpbb::$user->is_founder)
|
||||
{
|
||||
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
phpbb::$acm->purge();
|
||||
|
||||
// Clear permissions
|
||||
$auth->acl_clear_prefetch();
|
||||
phpbb::$acl->acl_clear_prefetch();
|
||||
cache_moderators();
|
||||
|
||||
add_log('admin', 'LOG_PURGE_CACHE');
|
||||
|
@ -346,7 +344,7 @@ class acp_main
|
|||
$total_users = phpbb::$config['num_users'];
|
||||
$total_files = phpbb::$config['num_files'];
|
||||
|
||||
$start_date = $user->format_date(phpbb::$config['board_startdate']);
|
||||
$start_date = phpbb::$user->format_date(phpbb::$config['board_startdate']);
|
||||
|
||||
$boarddays = (time() - phpbb::$config['board_startdate']) / 86400;
|
||||
|
||||
|
@ -375,7 +373,7 @@ class acp_main
|
|||
else
|
||||
{
|
||||
// Couldn't open Avatar dir.
|
||||
$avatar_dir_size = $user->lang['NOT_AVAILABLE'];
|
||||
$avatar_dir_size = phpbb::$user->lang['NOT_AVAILABLE'];
|
||||
}
|
||||
|
||||
if ($posts_per_day > $total_posts)
|
||||
|
@ -404,9 +402,9 @@ class acp_main
|
|||
FROM ' . ATTACHMENTS_TABLE . '
|
||||
WHERE is_orphan = 1
|
||||
AND filetime < ' . (time() - 3*60*60);
|
||||
$result = $db->sql_query($sql);
|
||||
$total_orphan = (int) $db->sql_fetchfield('total_orphan');
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$total_orphan = (int) phpbb::$db->sql_fetchfield('total_orphan');
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -415,7 +413,7 @@ class acp_main
|
|||
|
||||
$dbsize = get_database_size();
|
||||
|
||||
$template->assign_vars(array(
|
||||
phpbb::$template->assign_vars(array(
|
||||
'TOTAL_POSTS' => $total_posts,
|
||||
'POSTS_PER_DAY' => $posts_per_day,
|
||||
'TOTAL_TOPICS' => $total_topics,
|
||||
|
@ -430,38 +428,38 @@ class acp_main
|
|||
'UPLOAD_DIR_SIZE' => $upload_dir_size,
|
||||
'TOTAL_ORPHAN' => $total_orphan,
|
||||
'S_TOTAL_ORPHAN' => ($total_orphan === false) ? false : true,
|
||||
'GZIP_COMPRESSION' => (phpbb::$config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF'],
|
||||
'DATABASE_INFO' => $db->sql_server_info(),
|
||||
'GZIP_COMPRESSION' => (phpbb::$config['gzip_compress']) ? phpbb::$user->lang['ON'] : phpbb::$user->lang['OFF'],
|
||||
'DATABASE_INFO' => phpbb::$db->sql_server_info(),
|
||||
'BOARD_VERSION' => phpbb::$config['version'],
|
||||
|
||||
'U_ACTION' => $this->u_action,
|
||||
'U_ADMIN_LOG' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=logs&mode=admin'),
|
||||
'U_INACTIVE_USERS' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=inactive&mode=list'),
|
||||
'U_ADMIN_LOG' => phpbb::$url->append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=logs&mode=admin'),
|
||||
'U_INACTIVE_USERS' => phpbb::$url->append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, 'i=inactive&mode=list'),
|
||||
|
||||
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
|
||||
'S_FOUNDER' => ($user->data['user_type'] == phpbb::USER_FOUNDER) ? true : false,
|
||||
'S_ACTION_OPTIONS' => (phpbb::$acl->acl_get('a_board')) ? true : false,
|
||||
'S_FOUNDER' => phpbb::$user->is_founder,
|
||||
)
|
||||
);
|
||||
|
||||
$log_data = array();
|
||||
$log_count = 0;
|
||||
|
||||
if ($auth->acl_get('a_viewlogs'))
|
||||
if (phpbb::$acl->acl_get('a_viewlogs'))
|
||||
{
|
||||
view_log('admin', $log_data, $log_count, 5);
|
||||
|
||||
foreach ($log_data as $row)
|
||||
{
|
||||
$template->assign_block_vars('log', array(
|
||||
phpbb::$template->assign_block_vars('log', array(
|
||||
'USERNAME' => $row['username_full'],
|
||||
'IP' => $row['ip'],
|
||||
'DATE' => $user->format_date($row['time']),
|
||||
'DATE' => phpbb::$user->format_date($row['time']),
|
||||
'ACTION' => $row['action'])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($auth->acl_get('a_user'))
|
||||
if (phpbb::$acl->acl_get('a_user'))
|
||||
{
|
||||
$inactive = array();
|
||||
$inactive_count = 0;
|
||||
|
@ -470,14 +468,14 @@ class acp_main
|
|||
|
||||
foreach ($inactive as $row)
|
||||
{
|
||||
$template->assign_block_vars('inactive', array(
|
||||
'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']),
|
||||
'JOINED' => $user->format_date($row['user_regdate']),
|
||||
'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
|
||||
phpbb::$template->assign_block_vars('inactive', array(
|
||||
'INACTIVE_DATE' => phpbb::$user->format_date($row['user_inactive_time']),
|
||||
'JOINED' => phpbb::$user->format_date($row['user_regdate']),
|
||||
'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : phpbb::$user->format_date($row['user_lastvisit']),
|
||||
'REASON' => $row['inactive_reason'],
|
||||
'USER_ID' => $row['user_id'],
|
||||
'USERNAME' => $row['username'],
|
||||
'U_USER_ADMIN' => append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&mode=overview&u={$row['user_id']}"))
|
||||
'U_USER_ADMIN' => phpbb::$url->append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, "i=users&mode=overview&u={$row['user_id']}"))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -487,7 +485,7 @@ class acp_main
|
|||
$option_ary += array('remind' => 'REMIND');
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
phpbb::$template->assign_vars(array(
|
||||
'S_INACTIVE_USERS' => true,
|
||||
'S_INACTIVE_OPTIONS' => build_select($option_ary))
|
||||
);
|
||||
|
@ -496,13 +494,13 @@ class acp_main
|
|||
// Warn if install is still present
|
||||
if (file_exists(PHPBB_ROOT_PATH . 'install'))
|
||||
{
|
||||
$template->assign_var('S_REMOVE_INSTALL', true);
|
||||
phpbb::$template->assign_var('S_REMOVE_INSTALL', true);
|
||||
}
|
||||
|
||||
if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) && is_writable(PHPBB_ROOT_PATH . 'config.' . PHP_EXT))
|
||||
{
|
||||
// World-Writable? (000x)
|
||||
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) & 0x0002));
|
||||
phpbb::$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms(PHPBB_ROOT_PATH . 'config.' . PHP_EXT) & 0x0002));
|
||||
}
|
||||
|
||||
$this->tpl_name = 'acp_main';
|
||||
|
|
|
@ -43,12 +43,12 @@ class acp_modules
|
|||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $db, $user, $auth, $template, $module;
|
||||
global $auth, $template, $module;
|
||||
|
||||
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
|
||||
define('MODULE_INCLUDE', true);
|
||||
|
||||
$user->add_lang('acp/modules');
|
||||
phpbb::$user->add_lang('acp/modules');
|
||||
$this->tpl_name = 'acp_modules';
|
||||
|
||||
// module class
|
||||
|
@ -56,11 +56,11 @@ class acp_modules
|
|||
|
||||
if ($this->module_class == 'ucp')
|
||||
{
|
||||
$user->add_lang('ucp');
|
||||
phpbb::$user->add_lang('ucp');
|
||||
}
|
||||
else if ($this->module_class == 'mcp')
|
||||
{
|
||||
$user->add_lang('mcp');
|
||||
phpbb::$user->add_lang('mcp');
|
||||
}
|
||||
|
||||
if ($module->p_class != $this->module_class)
|
||||
|
@ -80,7 +80,7 @@ class acp_modules
|
|||
case 'delete':
|
||||
if (!$module_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if (confirm_box(true))
|
||||
|
@ -91,9 +91,9 @@ class acp_modules
|
|||
$sql = 'SELECT parent_id
|
||||
FROM ' . MODULES_TABLE . '
|
||||
WHERE module_id = ' . $module_id;
|
||||
$result = $db->sql_query($sql);
|
||||
$this->parent_id = (int) $db->sql_fetchfield('parent_id');
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$this->parent_id = (int) phpbb::$db->sql_fetchfield('parent_id');
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$errors = $this->delete_module($module_id);
|
||||
|
@ -101,7 +101,7 @@ class acp_modules
|
|||
if (!sizeof($errors))
|
||||
{
|
||||
$this->remove_cache_file();
|
||||
trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||
trigger_error(phpbb::$user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -121,29 +121,29 @@ class acp_modules
|
|||
case 'disable':
|
||||
if (!$module_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND module_id = $module_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if (!$row)
|
||||
{
|
||||
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . '
|
||||
SET module_enabled = ' . (($action == 'enable') ? 1 : 0) . "
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND module_id = $module_id";
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
add_log('admin', 'LOG_MODULE_' . strtoupper($action), $this->lang_name($row['module_langname']));
|
||||
add_log('admin', 'LOG_MODULE_' . strtoupper($action), phpbb::$user->lang($row['module_langname']));
|
||||
$this->remove_cache_file();
|
||||
|
||||
break;
|
||||
|
@ -152,27 +152,27 @@ class acp_modules
|
|||
case 'move_down':
|
||||
if (!$module_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND module_id = $module_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if (!$row)
|
||||
{
|
||||
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$move_module_name = $this->move_module_by($row, $action, 1);
|
||||
|
||||
if ($move_module_name !== false)
|
||||
{
|
||||
add_log('admin', 'LOG_MODULE_' . strtoupper($action), $this->lang_name($row['module_langname']), $move_module_name);
|
||||
add_log('admin', 'LOG_MODULE_' . strtoupper($action), phpbb::$user->lang($row['module_langname']), $move_module_name);
|
||||
$this->remove_cache_file();
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ class acp_modules
|
|||
{
|
||||
$this->remove_cache_file();
|
||||
|
||||
trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||
trigger_error(phpbb::$user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ class acp_modules
|
|||
|
||||
if (!$module_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$module_row = $this->get_module_row($module_id);
|
||||
|
@ -272,7 +272,7 @@ class acp_modules
|
|||
{
|
||||
if (!$module_data['module_langname'])
|
||||
{
|
||||
trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$module_type = request_var('module_type', 'category');
|
||||
|
@ -301,7 +301,7 @@ class acp_modules
|
|||
{
|
||||
$this->remove_cache_file();
|
||||
|
||||
trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||
trigger_error((($action == 'add') ? phpbb::$user->lang['MODULE_ADDED'] : phpbb::$user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ class acp_modules
|
|||
}
|
||||
|
||||
// Name options
|
||||
$s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_basename']) ? ' selected="selected"' : '') . '>' . $this->lang_name($values['title']) . ' [' . $this->module_class . '_' . $option . ']</option>';
|
||||
$s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_basename']) ? ' selected="selected"' : '') . '>' . phpbb::$user->lang($values['title']) . ' [' . $this->module_class . '_' . $option . ']</option>';
|
||||
|
||||
$template->assign_block_vars('m_names', array('NAME' => $option, 'A_NAME' => addslashes($option)));
|
||||
|
||||
|
@ -330,19 +330,19 @@ class acp_modules
|
|||
{
|
||||
if ($option == $module_data['module_basename'])
|
||||
{
|
||||
$s_mode_options .= '<option value="' . $m_mode . '"' . (($m_mode == $module_data['module_mode']) ? ' selected="selected"' : '') . '>' . $this->lang_name($m_values['title']) . '</option>';
|
||||
$s_mode_options .= '<option value="' . $m_mode . '"' . (($m_mode == $module_data['module_mode']) ? ' selected="selected"' : '') . '>' . phpbb::$user->lang($m_values['title']) . '</option>';
|
||||
}
|
||||
|
||||
$template->assign_block_vars('m_names.modes', array(
|
||||
'OPTION' => $m_mode,
|
||||
'VALUE' => $this->lang_name($m_values['title']),
|
||||
'VALUE' => phpbb::$user->lang($m_values['title']),
|
||||
'A_OPTION' => addslashes($m_mode),
|
||||
'A_VALUE' => addslashes($this->lang_name($m_values['title'])))
|
||||
'A_VALUE' => addslashes(phpbb::$user->lang($m_values['title'])))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$s_cat_option = '<option value="0"' . (($module_data['parent_id'] == 0) ? ' selected="selected"' : '') . '>' . $user->lang['NO_PARENT'] . '</option>';
|
||||
$s_cat_option = '<option value="0"' . (($module_data['parent_id'] == 0) ? ' selected="selected"' : '') . '>' . phpbb::$user->lang['NO_PARENT'] . '</option>';
|
||||
|
||||
$template->assign_vars(array_merge(array(
|
||||
'S_EDIT_MODULE' => true,
|
||||
|
@ -353,9 +353,9 @@ class acp_modules
|
|||
'U_BACK' => $this->u_action . '&parent_id=' . $this->parent_id,
|
||||
'U_EDIT_ACTION' => $this->u_action . '&parent_id=' . $this->parent_id,
|
||||
|
||||
'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'],
|
||||
'L_TITLE' => phpbb::$user->lang[strtoupper($action) . '_MODULE'],
|
||||
|
||||
'MODULENAME' => $this->lang_name($module_data['module_langname']),
|
||||
'MODULENAME' => phpbb::$user->lang($module_data['module_langname']),
|
||||
'ACTION' => $action,
|
||||
'MODULE_ID' => $module_id,
|
||||
|
||||
|
@ -397,7 +397,7 @@ class acp_modules
|
|||
|
||||
foreach ($modules_nav as $row)
|
||||
{
|
||||
$langname = $this->lang_name($row['module_langname']);
|
||||
$langname = phpbb::$user->lang($row['module_langname']);
|
||||
|
||||
if ($row['module_id'] == $this->parent_id)
|
||||
{
|
||||
|
@ -416,23 +416,23 @@ class acp_modules
|
|||
$sql = 'SELECT *
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE parent_id = {$this->parent_id}
|
||||
AND module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
AND module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
ORDER BY left_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
if ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$langname = $this->lang_name($row['module_langname']);
|
||||
$langname = phpbb::$user->lang($row['module_langname']);
|
||||
|
||||
if (!$row['module_enabled'])
|
||||
{
|
||||
$module_image = '<img src="images/icon_folder_lock.gif" alt="' . $user->lang['DEACTIVATED_MODULE'] .'" />';
|
||||
$module_image = '<img src="images/icon_folder_lock.gif" alt="' . phpbb::$user->lang['DEACTIVATED_MODULE'] .'" />';
|
||||
}
|
||||
else
|
||||
{
|
||||
$module_image = (!$row['module_basename'] || $row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . $user->lang['CATEGORY'] . '" />' : '<img src="images/icon_folder.gif" alt="' . $user->lang['MODULE'] . '" />';
|
||||
$module_image = (!$row['module_basename'] || $row['left_id'] + 1 != $row['right_id']) ? '<img src="images/icon_subfolder.gif" alt="' . phpbb::$user->lang['CATEGORY'] . '" />' : '<img src="images/icon_folder.gif" alt="' . phpbb::$user->lang['MODULE'] . '" />';
|
||||
}
|
||||
|
||||
$url = $this->u_action . '&parent_id=' . $this->parent_id . '&m=' . $row['module_id'];
|
||||
|
@ -455,7 +455,7 @@ class acp_modules
|
|||
'U_DISABLE' => $url . '&action=disable')
|
||||
);
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
while ($row = phpbb::$db->sql_fetchrow($result));
|
||||
}
|
||||
else if ($this->parent_id)
|
||||
{
|
||||
|
@ -475,7 +475,7 @@ class acp_modules
|
|||
'U_DISABLE' => $url . '&action=disable')
|
||||
);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
// Quick adding module
|
||||
$module_infos = $this->get_module_infos();
|
||||
|
@ -485,12 +485,12 @@ class acp_modules
|
|||
foreach ($module_infos as $option => $values)
|
||||
{
|
||||
// Name options
|
||||
$s_install_options .= '<optgroup label="' . $this->lang_name($values['title']) . ' [' . $this->module_class . '_' . $option . ']">';
|
||||
$s_install_options .= '<optgroup label="' . phpbb::$user->lang($values['title']) . ' [' . $this->module_class . '_' . $option . ']">';
|
||||
|
||||
// Build module modes
|
||||
foreach ($values['modes'] as $m_mode => $m_values)
|
||||
{
|
||||
$s_install_options .= '<option value="' . $option . '::' . $m_mode . '"> ' . $this->lang_name($m_values['title']) . '</option>';
|
||||
$s_install_options .= '<option value="' . $option . '::' . $m_mode . '"> ' . phpbb::$user->lang($m_values['title']) . '</option>';
|
||||
}
|
||||
|
||||
$s_install_options .= '</optgroup>';
|
||||
|
@ -512,19 +512,17 @@ class acp_modules
|
|||
*/
|
||||
function get_module_row($module_id)
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND module_id = $module_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if (!$row)
|
||||
{
|
||||
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
return $row;
|
||||
|
@ -537,7 +535,7 @@ class acp_modules
|
|||
{
|
||||
$module_class = ($module_class === false) ? $this->module_class : $module_class;
|
||||
|
||||
$directory = PHPBB_ROOT_PATH . 'includes/' . $module_class . '/info/';
|
||||
$directory = PHPBB_ROOT_PATH . 'modules/' . $module_class . '/info/';
|
||||
$fileinfo = array();
|
||||
|
||||
if (!$module)
|
||||
|
@ -601,19 +599,19 @@ class acp_modules
|
|||
*/
|
||||
function make_module_select($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $ignore_noncat = false)
|
||||
{
|
||||
global $db, $user, $auth;
|
||||
global $auth;
|
||||
|
||||
$sql = 'SELECT module_id, module_enabled, module_basename, parent_id, module_langname, left_id, right_id, module_auth
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
ORDER BY left_id ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
$right = $iteration = 0;
|
||||
$padding_store = array('0' => '');
|
||||
$module_list = $padding = '';
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
if ($row['left_id'] < $right)
|
||||
{
|
||||
|
@ -656,12 +654,12 @@ class acp_modules
|
|||
|
||||
$selected = (is_array($select_id)) ? ((in_array($row['module_id'], $select_id)) ? ' selected="selected"' : '') : (($row['module_id'] == $select_id) ? ' selected="selected"' : '');
|
||||
|
||||
$langname = $this->lang_name($row['module_langname']);
|
||||
$langname = phpbb::$user->lang($row['module_langname']);
|
||||
$module_list .= '<option value="' . $row['module_id'] . '"' . $selected . ((!$row['module_enabled']) ? ' class="disabled"' : '') . '>' . $padding . $langname . '</option>';
|
||||
|
||||
$iteration++;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
unset($padding_store);
|
||||
|
||||
|
@ -673,8 +671,6 @@ class acp_modules
|
|||
*/
|
||||
function get_module_branch($module_id, $type = 'all', $order = 'descending', $include_module = true)
|
||||
{
|
||||
global $db;
|
||||
|
||||
switch ($type)
|
||||
{
|
||||
case 'parents':
|
||||
|
@ -695,13 +691,13 @@ class acp_modules
|
|||
$sql = 'SELECT m2.*
|
||||
FROM ' . MODULES_TABLE . ' m1
|
||||
LEFT JOIN ' . MODULES_TABLE . " m2 ON ($condition)
|
||||
WHERE m1.module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
AND m2.module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE m1.module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND m2.module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND m1.module_id = $module_id
|
||||
ORDER BY m2.left_id " . (($order == 'descending') ? 'ASC' : 'DESC');
|
||||
$result = $db->sql_query($sql);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
if (!$include_module && $row['module_id'] == $module_id)
|
||||
{
|
||||
|
@ -710,7 +706,7 @@ class acp_modules
|
|||
|
||||
$rows[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
@ -729,16 +725,6 @@ class acp_modules
|
|||
phpbb::$acm->destroy_sql(MODULES_TABLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return correct language name
|
||||
*/
|
||||
function lang_name($module_langname)
|
||||
{
|
||||
global $user;
|
||||
|
||||
return (!empty($user->lang[$module_langname])) ? $user->lang[$module_langname] : $module_langname;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update/Add module
|
||||
*
|
||||
|
@ -746,8 +732,6 @@ class acp_modules
|
|||
*/
|
||||
function update_module_data(&$module_data, $run_inline = false)
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
if (!isset($module_data['module_id']))
|
||||
{
|
||||
// no module_id means we're creating a new category/module
|
||||
|
@ -755,11 +739,11 @@ class acp_modules
|
|||
{
|
||||
$sql = 'SELECT left_id, right_id
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($module_data['module_class']) . "'
|
||||
AND module_id = " . (int) $module_data['parent_id'];
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if (!$row)
|
||||
{
|
||||
|
@ -768,7 +752,7 @@ class acp_modules
|
|||
return 'PARENT_NO_EXIST';
|
||||
}
|
||||
|
||||
trigger_error($user->lang['PARENT_NO_EXIST'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
trigger_error(phpbb::$user->lang['PARENT_NO_EXIST'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
// Workaround
|
||||
|
@ -777,15 +761,15 @@ class acp_modules
|
|||
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . "
|
||||
SET left_id = left_id + 2, right_id = right_id + 2
|
||||
WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($module_data['module_class']) . "'
|
||||
AND left_id > {$row['right_id']}";
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . "
|
||||
SET right_id = right_id + 2
|
||||
WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($module_data['module_class']) . "'
|
||||
AND {$row['left_id']} BETWEEN left_id AND right_id";
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
$module_data['left_id'] = (int) $row['right_id'];
|
||||
$module_data['right_id'] = (int) $row['right_id'] + 1;
|
||||
|
@ -794,23 +778,23 @@ class acp_modules
|
|||
{
|
||||
$sql = 'SELECT MAX(right_id) AS right_id
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($module_data['module_class']) . "'";
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$module_data['left_id'] = (int) $row['right_id'] + 1;
|
||||
$module_data['right_id'] = (int) $row['right_id'] + 2;
|
||||
}
|
||||
|
||||
$sql = 'INSERT INTO ' . MODULES_TABLE . ' ' . $db->sql_build_array('INSERT', $module_data);
|
||||
$db->sql_query($sql);
|
||||
$sql = 'INSERT INTO ' . MODULES_TABLE . ' ' . phpbb::$db->sql_build_array('INSERT', $module_data);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
$module_data['module_id'] = $db->sql_nextid();
|
||||
$module_data['module_id'] = phpbb::$db->sql_nextid();
|
||||
|
||||
if (!$run_inline)
|
||||
{
|
||||
add_log('admin', 'LOG_MODULE_ADD', $this->lang_name($module_data['module_langname']));
|
||||
add_log('admin', 'LOG_MODULE_ADD', phpbb::$user->lang($module_data['module_langname']));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -824,7 +808,7 @@ class acp_modules
|
|||
|
||||
if (sizeof($branch))
|
||||
{
|
||||
return array($user->lang['NO_CATEGORY_TO_MODULE']);
|
||||
return array(phpbb::$user->lang['NO_CATEGORY_TO_MODULE']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -837,14 +821,14 @@ class acp_modules
|
|||
unset($update_ary['module_id']);
|
||||
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $update_ary) . "
|
||||
WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
|
||||
SET ' . phpbb::$db->sql_build_array('UPDATE', $update_ary) . "
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($module_data['module_class']) . "'
|
||||
AND module_id = " . (int) $module_data['module_id'];
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
if (!$run_inline)
|
||||
{
|
||||
add_log('admin', 'LOG_MODULE_EDIT', $this->lang_name($module_data['module_langname']));
|
||||
add_log('admin', 'LOG_MODULE_EDIT', phpbb::$user->lang($module_data['module_langname']));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -856,8 +840,6 @@ class acp_modules
|
|||
*/
|
||||
function move_module($from_module_id, $to_parent_id)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$moved_modules = $this->get_module_branch($from_module_id, 'children', 'descending');
|
||||
$from_data = $moved_modules[0];
|
||||
$diff = sizeof($moved_modules) * 2;
|
||||
|
@ -871,17 +853,17 @@ class acp_modules
|
|||
// Resync parents
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . "
|
||||
SET right_id = right_id - $diff
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND left_id < " . (int) $from_data['right_id'] . '
|
||||
AND right_id > ' . (int) $from_data['right_id'];
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
// Resync righthand side of tree
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . "
|
||||
SET left_id = left_id - $diff, right_id = right_id - $diff
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND left_id > " . (int) $from_data['right_id'];
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
if ($to_parent_id > 0)
|
||||
{
|
||||
|
@ -890,18 +872,18 @@ class acp_modules
|
|||
// Resync new parents
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . "
|
||||
SET right_id = right_id + $diff
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND " . (int) $to_data['right_id'] . ' BETWEEN left_id AND right_id
|
||||
AND ' . $db->sql_in_set('module_id', $moved_ids, true);
|
||||
$db->sql_query($sql);
|
||||
AND ' . phpbb::$db->sql_in_set('module_id', $moved_ids, true);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
// Resync the righthand side of the tree
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . "
|
||||
SET left_id = left_id + $diff, right_id = right_id + $diff
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND left_id > " . (int) $to_data['right_id'] . '
|
||||
AND ' . $db->sql_in_set('module_id', $moved_ids, true);
|
||||
$db->sql_query($sql);
|
||||
AND ' . phpbb::$db->sql_in_set('module_id', $moved_ids, true);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
// Resync moved branch
|
||||
$to_data['right_id'] += $diff;
|
||||
|
@ -918,20 +900,20 @@ class acp_modules
|
|||
{
|
||||
$sql = 'SELECT MAX(right_id) AS right_id
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
AND " . $db->sql_in_set('module_id', $moved_ids, true);
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND " . phpbb::$db->sql_in_set('module_id', $moved_ids, true);
|
||||
$result = phpbb::$db->sql_query($sql);
|
||||
$row = phpbb::$db->sql_fetchrow($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
$diff = '+ ' . (int) ($row['right_id'] - $from_data['left_id'] + 1);
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . "
|
||||
SET left_id = left_id $diff, right_id = right_id $diff
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
AND " . $db->sql_in_set('module_id', $moved_ids);
|
||||
$db->sql_query($sql);
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND " . phpbb::$db->sql_in_set('module_id', $moved_ids);
|
||||
phpbb::$db->sql_query($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -939,23 +921,21 @@ class acp_modules
|
|||
*/
|
||||
function delete_module($module_id)
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
$row = $this->get_module_row($module_id);
|
||||
|
||||
$branch = $this->get_module_branch($module_id, 'children', 'descending', false);
|
||||
|
||||
if (sizeof($branch))
|
||||
{
|
||||
return array($user->lang['CANNOT_REMOVE_MODULE']);
|
||||
return array(phpbb::$user->lang['CANNOT_REMOVE_MODULE']);
|
||||
}
|
||||
|
||||
// If not move
|
||||
$diff = 2;
|
||||
$sql = 'DELETE FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND module_id = $module_id";
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
$row['right_id'] = (int) $row['right_id'];
|
||||
$row['left_id'] = (int) $row['left_id'];
|
||||
|
@ -963,17 +943,17 @@ class acp_modules
|
|||
// Resync tree
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . "
|
||||
SET right_id = right_id - $diff
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND left_id < {$row['right_id']} AND right_id > {$row['right_id']}";
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . MODULES_TABLE . "
|
||||
SET left_id = left_id - $diff, right_id = right_id - $diff
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND left_id > {$row['right_id']}";
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
add_log('admin', 'LOG_MODULE_REMOVED', $this->lang_name($row['module_langname']));
|
||||
add_log('admin', 'LOG_MODULE_REMOVED', phpbb::$user->lang($row['module_langname']));
|
||||
|
||||
return array();
|
||||
|
||||
|
@ -984,8 +964,6 @@ class acp_modules
|
|||
*/
|
||||
function move_module_by($module_row, $action = 'move_up', $steps = 1)
|
||||
{
|
||||
global $db;
|
||||
|
||||
/**
|
||||
* Fetch all the siblings between the module's current spot
|
||||
* and where we want to move it to. If there are less than $steps
|
||||
|
@ -994,17 +972,17 @@ class acp_modules
|
|||
*/
|
||||
$sql = 'SELECT module_id, left_id, right_id, module_langname
|
||||
FROM ' . MODULES_TABLE . "
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND parent_id = " . (int) $module_row['parent_id'] . '
|
||||
AND ' . (($action == 'move_up') ? 'right_id < ' . (int) $module_row['right_id'] . ' ORDER BY right_id DESC' : 'left_id > ' . (int) $module_row['left_id'] . ' ORDER BY left_id ASC');
|
||||
$result = $db->sql_query_limit($sql, $steps);
|
||||
$result = phpbb::$db->sql_query_limit($sql, $steps);
|
||||
|
||||
$target = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
while ($row = phpbb::$db->sql_fetchrow($result))
|
||||
{
|
||||
$target = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
phpbb::$db->sql_freeresult($result);
|
||||
|
||||
if (!sizeof($target))
|
||||
{
|
||||
|
@ -1052,14 +1030,14 @@ class acp_modules
|
|||
WHEN right_id BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up}
|
||||
ELSE {$diff_down}
|
||||
END
|
||||
WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
|
||||
WHERE module_class = '" . phpbb::$db->sql_escape($this->module_class) . "'
|
||||
AND left_id BETWEEN {$left_id} AND {$right_id}
|
||||
AND right_id BETWEEN {$left_id} AND {$right_id}";
|
||||
$db->sql_query($sql);
|
||||
phpbb::$db->sql_query($sql);
|
||||
|
||||
$this->remove_cache_file();
|
||||
|
||||
return $this->lang_name($target['module_langname']);
|
||||
return phpbb::$user->lang($target['module_langname']);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -368,7 +368,7 @@ class acp_permissions
|
|||
|
||||
$template->assign_vars(array(
|
||||
'S_SELECT_GROUP' => true,
|
||||
'S_GROUP_OPTIONS' => group_select_options(false, false, (($user->data['user_type'] == phpbb::USER_FOUNDER) ? false : 0)))
|
||||
'S_GROUP_OPTIONS' => group_select_options(false, false, ((phpbb::$user->is_founder) ? false : 0)))
|
||||
);
|
||||
|
||||
break;
|
||||
|
@ -414,7 +414,7 @@ class acp_permissions
|
|||
'S_SELECT_USERGROUP_VIEW' => ($victim == 'usergroup_view') ? true : false,
|
||||
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
|
||||
'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'],
|
||||
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], (($user->data['user_type'] == phpbb::USER_FOUNDER) ? false : 0)),
|
||||
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], ((phpbb::$user->is_founder) ? false : 0)),
|
||||
'U_FIND_USERNAME' => append_sid('memberlist', 'mode=searchuser&form=add_user&field=username&select_single=true'),
|
||||
));
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
// Save CSS contents
|
||||
$sql_ary = array(
|
||||
'theme_mtime' => (int) filemtime(PHPBB_ROOT_PATH . "styles/{$theme_row['theme_path']}/theme/stylesheet.css"),
|
||||
'theme_data' => $this->db_theme_data($theme_row)
|
||||
'theme_data' => self::db_theme_data($theme_row)
|
||||
);
|
||||
|
||||
$sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
|
||||
|
@ -974,7 +974,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
$sql_ary = array(
|
||||
'theme_mtime' => time(),
|
||||
'theme_storedb' => 1,
|
||||
'theme_data' => $this->db_theme_data($theme_info, $theme_data),
|
||||
'theme_data' => self::db_theme_data($theme_info, $theme_data),
|
||||
);
|
||||
$sql = 'UPDATE ' . STYLES_THEME_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
|
@ -2123,7 +2123,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
/**
|
||||
* Load css file contents
|
||||
*/
|
||||
function load_css_file($path, $filename)
|
||||
static function load_css_file($path, $filename)
|
||||
{
|
||||
$file = PHPBB_ROOT_PATH . "styles/$path/theme/$filename";
|
||||
|
||||
|
@ -2149,7 +2149,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
*
|
||||
* @return string Stylesheet data for theme_data column in the theme table
|
||||
*/
|
||||
function db_theme_data($theme_row, $stylesheet = false, $root_path = '')
|
||||
static function db_theme_data($theme_row, $stylesheet = false, $root_path = '')
|
||||
{
|
||||
if (!$root_path)
|
||||
{
|
||||
|
@ -2173,7 +2173,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
{
|
||||
foreach ($matches[0] as $idx => $match)
|
||||
{
|
||||
$stylesheet = str_replace($match, acp_styles::load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet);
|
||||
$stylesheet = str_replace($match, self::load_css_file($theme_row['theme_path'], $matches[1][$idx]), $stylesheet);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2939,7 +2939,7 @@ parse_css_file = {PARSE_CSS_FILE}
|
|||
|
||||
$sql_ary += array(
|
||||
'theme_storedb' => $store_db,
|
||||
'theme_data' => ($store_db) ? $this->db_theme_data($sql_ary, false, $root_path) : '',
|
||||
'theme_data' => ($store_db) ? self::db_theme_data($sql_ary, false, $root_path) : '',
|
||||
'theme_mtime' => (int) filemtime(PHPBB_ROOT_PATH . "styles/$path/theme/stylesheet.css")
|
||||
);
|
||||
break;
|
||||
|
|
|
@ -152,7 +152,7 @@ class acp_users
|
|||
);
|
||||
|
||||
// Prevent normal users/admins change/view founders if they are not a founder by themselves
|
||||
if ($user->data['user_type'] != phpbb::USER_FOUNDER && $user_row['user_type'] == phpbb::USER_FOUNDER)
|
||||
if (!phpbb::$user->is_founder && $user_row['user_type'] == phpbb::USER_FOUNDER)
|
||||
{
|
||||
trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
@ -718,10 +718,10 @@ class acp_users
|
|||
{
|
||||
$sql_ary = array();
|
||||
|
||||
if ($user_row['user_type'] != phpbb::USER_FOUNDER || $user->data['user_type'] == phpbb::USER_FOUNDER)
|
||||
if ($user_row['user_type'] != phpbb::USER_FOUNDER || phpbb::$user->is_founder)
|
||||
{
|
||||
// Only allow founders updating the founder status...
|
||||
if ($user->data['user_type'] == phpbb::USER_FOUNDER)
|
||||
if (phpbb::$user->is_founder)
|
||||
{
|
||||
// Setting a normal member to be a founder
|
||||
if ($data['user_founder'] && $user_row['user_type'] != phpbb::USER_FOUNDER)
|
||||
|
@ -903,7 +903,7 @@ class acp_users
|
|||
'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[phpbb::$config['allow_name_chars'] . '_EXPLAIN'], phpbb::$config['min_name_chars'], phpbb::$config['max_name_chars']),
|
||||
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[phpbb::$config['pass_complex'] . '_EXPLAIN'], phpbb::$config['min_pass_chars'], phpbb::$config['max_pass_chars']),
|
||||
'L_POSTS_IN_QUEUE' => $user->lang('NUM_POSTS_IN_QUEUE', $user_row['posts_in_queue']),
|
||||
'S_FOUNDER' => ($user->data['user_type'] == phpbb::USER_FOUNDER) ? true : false,
|
||||
'S_FOUNDER' => phpbb::$user->is_founder,
|
||||
|
||||
'S_OVERVIEW' => true,
|
||||
'S_USER_IP' => ($user_row['user_ip']) ? true : false,
|
||||
|
@ -1801,7 +1801,7 @@ class acp_users
|
|||
$founder_manage = (int) $db->sql_fetchfield('group_founder_manage');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($user->data['user_type'] != phpbb::USER_FOUNDER && $founder_manage)
|
||||
if (!phpbb::$user->is_founder && $founder_manage)
|
||||
{
|
||||
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
|
@ -1921,7 +1921,7 @@ class acp_users
|
|||
}
|
||||
|
||||
// Do not display those groups not allowed to be managed
|
||||
if ($user->data['user_type'] != phpbb::USER_FOUNDER && $row['group_founder_manage'])
|
||||
if (!phpbb::$user->is_founder && $row['group_founder_manage'])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -429,7 +429,7 @@ class ucp_groups
|
|||
}
|
||||
|
||||
// Check if the user is allowed to manage this group if set to founder only.
|
||||
if ($user->data['user_type'] != phpbb::USER_FOUNDER && $group_row['group_founder_manage'])
|
||||
if (!phpbb::$user->is_founder && $group_row['group_founder_manage'])
|
||||
{
|
||||
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . $return_page, E_USER_WARNING);
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ class ucp_profile
|
|||
|
||||
$message = 'PROFILE_UPDATED';
|
||||
|
||||
if (phpbb::$config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != phpbb::USER_FOUNDER && (phpbb::$config['require_activation'] == USER_ACTIVATION_SELF || phpbb::$config['require_activation'] == USER_ACTIVATION_ADMIN))
|
||||
if (phpbb::$config['email_enable'] && $data['email'] != $user->data['user_email'] && !phpbb::$user->is_founder && (phpbb::$config['require_activation'] == USER_ACTIVATION_SELF || phpbb::$config['require_activation'] == USER_ACTIVATION_ADMIN))
|
||||
{
|
||||
$message = (phpbb::$config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN';
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ if ($recache)
|
|||
'theme_data' => $theme['theme_data']
|
||||
);
|
||||
|
||||
phpbb::$db->sql_handle_data('UPDATE', STYLES_THEME_TABLE, $sql_ary, 'theme_id = ' . $theme['theme_id']);
|
||||
phpbb::$db->sql_query('UPDATE ' . STYLES_THEME_TABLE . ' SET ' . phpbb::$db->sql_build_array('UPDATE', $sql_ary) . ' WHERE theme_id = ' . $theme['theme_id']);
|
||||
phpbb::$acm->destroy_sql(STYLES_THEME_TABLE);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
define('IN_PHPBB', true);
|
||||
if (!defined('PHPBB_ROOT_PATH')) define('PHPBB_ROOT_PATH', './');
|
||||
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
|
||||
include(PHPBB_ROOT_PATH . 'common.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT);
|
||||
require(PHPBB_ROOT_PATH . 'includes/functions_module.' . PHP_EXT);
|
||||
include PHPBB_ROOT_PATH . 'common.' . PHP_EXT;
|
||||
require PHPBB_ROOT_PATH . 'includes/functions_user.' . PHP_EXT;
|
||||
require PHPBB_ROOT_PATH . 'includes/functions_module.' . PHP_EXT;
|
||||
|
||||
// Basic parameter data
|
||||
$id = request_var('i', '');
|
||||
|
@ -28,12 +28,12 @@ if ($mode == 'login' || $mode == 'logout' || $mode == 'confirm')
|
|||
}
|
||||
|
||||
// Start session management
|
||||
$user->session_begin();
|
||||
$auth->acl($user->data);
|
||||
$user->setup('ucp');
|
||||
phpbb::$user->session_begin();
|
||||
phpbb::$acl->init(phpbb::$user->data);
|
||||
phpbb::$user->setup('ucp');
|
||||
|
||||
// Setting a variable to let the style designer know where he is...
|
||||
$template->assign_var('S_IN_UCP', true);
|
||||
phpbb::$template->assign_var('S_IN_UCP', true);
|
||||
|
||||
$module = new p_master();
|
||||
|
||||
|
@ -72,28 +72,28 @@ switch ($mode)
|
|||
break;
|
||||
|
||||
case 'login':
|
||||
if ($user->data['is_registered'])
|
||||
if (phpbb::$user->is_registered)
|
||||
{
|
||||
redirect(append_sid('index'));
|
||||
phpbb::$url->redirect(phpbb::$url->append_sid('index'));
|
||||
}
|
||||
|
||||
login_box(request_var('redirect', 'index'));
|
||||
break;
|
||||
|
||||
case 'logout':
|
||||
if ($user->data['user_id'] != ANONYMOUS && phpbb_request::variable('sid', '', false, phpbb_request::GET) === $user->session_id)
|
||||
if (phpbb::$user->data['user_id'] != ANONYMOUS && phpbb_request::variable('sid', '', false, phpbb_request::GET) === phpbb::$user->session_id)
|
||||
{
|
||||
$user->session_kill();
|
||||
$user->session_begin();
|
||||
$message = $user->lang['LOGOUT_REDIRECT'];
|
||||
phpbb::$user->session_kill();
|
||||
phpbb::$user->session_begin();
|
||||
$message = phpbb::$user->lang['LOGOUT_REDIRECT'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = ($user->data['user_id'] == ANONYMOUS) ? $user->lang['LOGOUT_REDIRECT'] : $user->lang['LOGOUT_FAILED'];
|
||||
$message = (phpbb::$user->data['user_id'] == ANONYMOUS) ? phpbb::$user->lang['LOGOUT_REDIRECT'] : phpbb::$user->lang['LOGOUT_FAILED'];
|
||||
}
|
||||
meta_refresh(3, append_sid('index'));
|
||||
phpbb::$url->meta_refresh(3, phpbb::$url->append_sid('index'));
|
||||
|
||||
$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid('index') . '">', '</a> ');
|
||||
$message = $message . '<br /><br />' . phpbb::$user->lang('RETURN_INDEX', '<a href="' . phpbb::$url->append_sid('index') . '">', '</a> ');
|
||||
trigger_error($message);
|
||||
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue