mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Move logging functions, change name, add mode + lang var case changes
git-svn-id: file:///svn/phpbb/trunk@3401 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
bcd4581f77
commit
bb93945423
14 changed files with 69 additions and 153 deletions
|
@ -299,7 +299,7 @@ if (isset($_POST['bansubmit']) || isset($_GET['bansubmit']))
|
||||||
|
|
||||||
// Update log
|
// Update log
|
||||||
$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'log_ban_';
|
$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'log_ban_';
|
||||||
add_admin_log($log_entry . $mode, $ban_reason, $ban_list_log);
|
add_log('admin', $log_entry . $mode, $ban_reason, $ban_list_log);
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
|
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
|
||||||
|
@ -319,7 +319,7 @@ else if (isset($_POST['unbansubmit']))
|
||||||
WHERE ban_id IN ($unban_sql)";
|
WHERE ban_id IN ($unban_sql)";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
add_admin_log('log_unban_' . $mode, sizeof($_POST['unban']));
|
add_log('admin', 'log_unban_' . $mode, sizeof($_POST['unban']));
|
||||||
}
|
}
|
||||||
|
|
||||||
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
|
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
|
||||||
|
|
|
@ -37,7 +37,6 @@ define('IN_PHPBB', 1);
|
||||||
$phpbb_root_path = '../';
|
$phpbb_root_path = '../';
|
||||||
require($phpbb_root_path . 'extension.inc');
|
require($phpbb_root_path . 'extension.inc');
|
||||||
require('pagestart.' . $phpEx);
|
require('pagestart.' . $phpEx);
|
||||||
require_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
|
||||||
|
|
||||||
// Get mode
|
// Get mode
|
||||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
|
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
|
||||||
|
@ -104,7 +103,7 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
|
|
||||||
if (isset($_POST['submit']))
|
if (isset($_POST['submit']))
|
||||||
{
|
{
|
||||||
add_admin_log('log_' . $mode . '_config');
|
add_log('admin', 'log_' . $mode . '_config');
|
||||||
trigger_error($user->lang['Config_updated']);
|
trigger_error($user->lang['Config_updated']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,6 @@ define('IN_PHPBB', 1);
|
||||||
$phpbb_root_path = '../';
|
$phpbb_root_path = '../';
|
||||||
require($phpbb_root_path . 'extension.inc');
|
require($phpbb_root_path . 'extension.inc');
|
||||||
require('pagestart.' . $phpEx);
|
require('pagestart.' . $phpEx);
|
||||||
require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
|
||||||
|
|
||||||
$mode = (isset($_GET['mode'])) ? $_GET['mode'] : '';
|
$mode = (isset($_GET['mode'])) ? $_GET['mode'] : '';
|
||||||
|
|
||||||
|
@ -260,7 +259,7 @@ switch($mode)
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
add_admin_log('log_db_backup');
|
add_log('admin', 'log_db_backup');
|
||||||
|
|
||||||
if (empty($store_path))
|
if (empty($store_path))
|
||||||
{
|
{
|
||||||
|
@ -373,7 +372,7 @@ switch($mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
add_admin_log('log_db_restore');
|
add_log('admin', 'log_db_restore');
|
||||||
|
|
||||||
trigger_error($user->lang['Restore_success']);
|
trigger_error($user->lang['Restore_success']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ if (isset($_POST['disallow']))
|
||||||
$message = $user->lang['Disallow_successful'];
|
$message = $user->lang['Disallow_successful'];
|
||||||
}
|
}
|
||||||
|
|
||||||
add_admin_log('log_disallow_add', str_replace('%', '*', $disallowed_user));
|
add_log('admin', 'log_disallow_add', str_replace('%', '*', $disallowed_user));
|
||||||
|
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ else if (isset($_POST['allow']))
|
||||||
WHERE disallow_id = $disallowed_id";
|
WHERE disallow_id = $disallowed_id";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
add_admin_log('log_disallow_delete');
|
add_log('admin', 'log_disallow_delete');
|
||||||
|
|
||||||
trigger_error($user->lang['Disallowed_deleted']);
|
trigger_error($user->lang['Disallowed_deleted']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@ define('IN_PHPBB', 1);
|
||||||
$phpbb_root_path = '../';
|
$phpbb_root_path = '../';
|
||||||
require($phpbb_root_path . 'extension.inc');
|
require($phpbb_root_path . 'extension.inc');
|
||||||
require('pagestart.' . $phpEx);
|
require('pagestart.' . $phpEx);
|
||||||
require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
|
||||||
|
|
||||||
// Get mode
|
// Get mode
|
||||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
|
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
|
||||||
|
|
|
@ -38,7 +38,6 @@ define('IN_PHPBB', 1);
|
||||||
$phpbb_root_path = '../';
|
$phpbb_root_path = '../';
|
||||||
require($phpbb_root_path . 'extension.inc');
|
require($phpbb_root_path . 'extension.inc');
|
||||||
require('pagestart.' . $phpEx);
|
require('pagestart.' . $phpEx);
|
||||||
require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
|
||||||
|
|
||||||
// Define some vars
|
// Define some vars
|
||||||
$forum_id = 0;
|
$forum_id = 0;
|
||||||
|
|
|
@ -36,7 +36,6 @@ define('IN_PHPBB', 1);
|
||||||
$phpbb_root_path = '../';
|
$phpbb_root_path = '../';
|
||||||
require($phpbb_root_path . 'extension.inc');
|
require($phpbb_root_path . 'extension.inc');
|
||||||
require('pagestart.' . $phpEx);
|
require('pagestart.' . $phpEx);
|
||||||
require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
|
||||||
|
|
||||||
// Do we have permission?
|
// Do we have permission?
|
||||||
if (!$auth->acl_get('a_prune'))
|
if (!$auth->acl_get('a_prune'))
|
||||||
|
@ -109,7 +108,7 @@ if (isset($_POST['doprune']))
|
||||||
}
|
}
|
||||||
while($row = $db->sql_fetchrow($result));
|
while($row = $db->sql_fetchrow($result));
|
||||||
|
|
||||||
add_admin_log('log_prune', $log_data);
|
add_log('admin', 'log_prune', $log_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -172,7 +172,7 @@ if (isset($_POST['prune']))
|
||||||
$where_sql";
|
$where_sql";
|
||||||
// $db->sql_query($sql);
|
// $db->sql_query($sql);
|
||||||
|
|
||||||
add_admin_log($l_admin_log, implode(', ', $usernames));
|
add_log('admin', $l_admin_log, implode(', ', $usernames));
|
||||||
|
|
||||||
unset($user_ids);
|
unset($user_ids);
|
||||||
unset($usernames);
|
unset($usernames);
|
||||||
|
|
|
@ -163,7 +163,7 @@ switch ($mode)
|
||||||
|
|
||||||
@chmod($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 0644);
|
@chmod($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 0644);
|
||||||
|
|
||||||
add_admin_log('log_template_edit', $tplname, $tplroot);
|
add_log('admin', 'log_template_edit', $tplname, $tplroot);
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ switch ($mode)
|
||||||
WHERE theme_id = $theme_id";
|
WHERE theme_id = $theme_id";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
add_admin_log('log_theme_edit', $theme_name);
|
add_log('admin', 'log_theme_edit', $theme_name);
|
||||||
|
|
||||||
message_die(MESSAGE, $user->lang['Success_theme_update']);
|
message_die(MESSAGE, $user->lang['Success_theme_update']);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,6 @@ define('IN_PHPBB', 1);
|
||||||
$phpbb_root_path = '../';
|
$phpbb_root_path = '../';
|
||||||
require($phpbb_root_path . 'extension.inc');
|
require($phpbb_root_path . 'extension.inc');
|
||||||
require('pagestart.' . $phpEx);
|
require('pagestart.' . $phpEx);
|
||||||
require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
|
||||||
|
|
||||||
// Set mode
|
// Set mode
|
||||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'main';
|
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'main';
|
||||||
|
|
|
@ -38,7 +38,6 @@ define('IN_PHPBB', 1);
|
||||||
$phpbb_root_path = '../';
|
$phpbb_root_path = '../';
|
||||||
require($phpbb_root_path . 'extension.inc');
|
require($phpbb_root_path . 'extension.inc');
|
||||||
require('pagestart.' . $phpEx);
|
require('pagestart.' . $phpEx);
|
||||||
require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
|
||||||
|
|
||||||
// Do we have styles admin permissions?
|
// Do we have styles admin permissions?
|
||||||
if (!$auth->acl_get('a_general'))
|
if (!$auth->acl_get('a_general'))
|
||||||
|
@ -73,7 +72,7 @@ if ((isset($_POST['delmarked']) || isset($_POST['delall'])) && $auth->acl_get('a
|
||||||
$where_sql";
|
$where_sql";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
add_admin_log('log_' . $mode . '_clear');
|
add_log('admin', 'log_' . $mode . '_clear');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sorting ... this could become a function
|
// Sorting ... this could become a function
|
||||||
|
@ -102,7 +101,7 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
$previous_days = array(0 => $user->lang['All_Entries'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']);
|
$previous_days = array(0 => $user->lang['All_Entries'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']);
|
||||||
$sort_by_text = array('u' => $user->lang['Sort_Username'], 't' => $user->lang['Sort_date'], 'i' => $user->lang['Sort_ip'], 'o' => $user->lang['Sort_action']);
|
$sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
|
||||||
$sort_by = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
|
$sort_by = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
|
||||||
|
|
||||||
$sort_day_options = '';
|
$sort_day_options = '';
|
||||||
|
@ -119,7 +118,7 @@ foreach ($sort_by_text as $key => $text)
|
||||||
$sort_key_options .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
|
$sort_key_options .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$sort_order_options = ($sort_dir == 'a') ? '<option value="a" selected="selected">' . $user->lang['Sort_Ascending'] . '</option><option value="d">' . $user->lang['Sort_Descending'] . '</option>' : '<option value="a">' . $user->lang['Sort_Ascending'] . '</option><option value="d" selected="selected">' . $user->lang['Sort_Descending'] . '</option>';
|
$sort_order_options = ($sort_dir == 'a') ? '<option value="a" selected="selected">' . $user->lang['SORT_ASCENDING'] . '</option><option value="d">' . $user->lang['SORT_DESCENDING'] . '</option>' : '<option value="a">' . $user->lang['SORT_ASCENDING'] . '</option><option value="d" selected="selected">' . $user->lang['SORT_DESCENDING'] . '</option>';
|
||||||
|
|
||||||
$sort_sql = $sort_by[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
|
$sort_sql = $sort_by[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
|
||||||
|
|
||||||
|
@ -138,13 +137,13 @@ page_header($l_title);
|
||||||
// Define forum list if we're looking @ mod logs
|
// Define forum list if we're looking @ mod logs
|
||||||
if ($mode == 'mod')
|
if ($mode == 'mod')
|
||||||
{
|
{
|
||||||
//include($phpbb_root_path . '/includes/functions_admin.'.$phpEx);
|
|
||||||
$forum_box = make_forum_select($forum_id);
|
$forum_box = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select($forum_id, false, false);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<table width="100%" cellpadding="1" cellspacing="1" border="0">
|
<table width="100%" cellpadding="1" cellspacing="1" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right"><?php echo $user->lang['SELECT_FORUM']; ?>: <select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ this.form.submit() }"><?php echo $forum_box; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['GO']; ?>" /></td>
|
<td align="right"><?php echo $user->lang['SELECT_FORUM']; ?>: <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit() }"><?php echo $forum_box; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['GO']; ?>" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
|
@ -155,14 +154,14 @@ if ($mode == 'mod')
|
||||||
|
|
||||||
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="5" height="28" align="center"><span class="gensmall"><?php echo $user->lang['Display_log']; ?>: <select name="sort_days"><?php echo $sort_day_options; ?></select> <?php echo $user->lang['Sort_by']; ?> <select name="sort_key"><?php echo $sort_key_options; ?></select> <select name="sort_dir"><?php echo $sort_order_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['GO']; ?>" name="sort" /></span></td>
|
<td class="cat" colspan="5" height="28" align="center"><span class="gensmall"><?php echo $user->lang['DISPLAY_LOG']; ?>: <select name="sort_days"><?php echo $sort_day_options; ?></select> <?php echo $user->lang['SORT_BY']; ?> <select name="sort_key"><?php echo $sort_key_options; ?></select> <select name="sort_dir"><?php echo $sort_order_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['GO']; ?>" name="sort" /></span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th width="15%" height="25" nowrap="nowrap"><?php echo $user->lang['Username']; ?></th>
|
<th width="15%" height="25" nowrap="nowrap"><?php echo $user->lang['USERNAME']; ?></th>
|
||||||
<th width="15%" nowrap="nowrap"><?php echo $user->lang['IP']; ?></th>
|
<th width="15%" nowrap="nowrap"><?php echo $user->lang['IP']; ?></th>
|
||||||
<th width="20%" nowrap="nowrap"><?php echo $user->lang['Time']; ?></th>
|
<th width="20%" nowrap="nowrap"><?php echo $user->lang['TIME']; ?></th>
|
||||||
<th width="45%" nowrap="nowrap"><?php echo $user->lang['Action']; ?></th>
|
<th width="45%" nowrap="nowrap"><?php echo $user->lang['ACTION']; ?></th>
|
||||||
<th nowrap="nowrap"><?php echo $user->lang['Mark']; ?></th>
|
<th nowrap="nowrap"><?php echo $user->lang['MARK']; ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -196,7 +195,7 @@ if ($log_count)
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="5" height="28" align="right"><input class="liteoption" type="submit" name="delmarked" value="<?php echo $user->lang['Delete_marked']; ?>" /> <input class="liteoption" type="submit" name="delall" value="<?php echo $user->lang['Delete_all']; ?>" /> </td>
|
<td class="cat" colspan="5" height="28" align="right"><input class="liteoption" type="submit" name="delmarked" value="<?php echo $user->lang['DELETE_MARKED']; ?>" /> <input class="liteoption" type="submit" name="delall" value="<?php echo $user->lang['DELETE_ALL']; ?>" /> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -206,7 +205,7 @@ else
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" colspan="5" align="center" nowrap="nowrap"><?php echo $user->lang['No_entries']; ?></td>
|
<td class="row1" colspan="5" align="center" nowrap="nowrap"><?php echo $user->lang['NO_ENTRIES']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -224,7 +223,7 @@ else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
?><b><span class="gensmall"><a href="javascript:marklist(true);" class="gensmall"><?php echo $user->lang['Mark_all']; ?></a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $user->lang['Unmark_all']; ?></a></span></b> <br /><br /><?php
|
?><b><span class="gensmall"><a href="javascript:marklist(true);" class="gensmall"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></span></b> <br /><br /><?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,6 @@ define('IN_PHPBB', 1);
|
||||||
$phpbb_root_path = '../';
|
$phpbb_root_path = '../';
|
||||||
require($phpbb_root_path . 'extension.inc');
|
require($phpbb_root_path . 'extension.inc');
|
||||||
require('pagestart.' . $phpEx);
|
require('pagestart.' . $phpEx);
|
||||||
require_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
|
||||||
|
|
||||||
// Do we have forum admin permissions?
|
// Do we have forum admin permissions?
|
||||||
if (!$auth->acl_get('a_words'))
|
if (!$auth->acl_get('a_words'))
|
||||||
|
@ -138,7 +137,7 @@ if ($mode != '')
|
||||||
$cache->destroy('word_censors');
|
$cache->destroy('word_censors');
|
||||||
|
|
||||||
$log_action = ($word_id) ? 'log_edit_word' : 'log_add_word';
|
$log_action = ($word_id) ? 'log_edit_word' : 'log_add_word';
|
||||||
add_admin_log($log_action, stripslashes($word));
|
add_log('admin', $log_action, stripslashes($word));
|
||||||
|
|
||||||
$message = ($word_id) ? $user->lang['WORD_UPDATED'] : $user->lang['WORD_ADDED'];
|
$message = ($word_id) ? $user->lang['WORD_UPDATED'] : $user->lang['WORD_ADDED'];
|
||||||
break;
|
break;
|
||||||
|
@ -160,7 +159,7 @@ if ($mode != '')
|
||||||
|
|
||||||
$cache->destroy('word_censors');
|
$cache->destroy('word_censors');
|
||||||
|
|
||||||
add_admin_log('log_delete_word');
|
add_log('admin', 'log_delete_word');
|
||||||
|
|
||||||
$message = $user->lang['WORD_REMOVE'];
|
$message = $user->lang['WORD_REMOVE'];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -19,12 +19,11 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
define('IN_PHPBB', 1);
|
|
||||||
|
|
||||||
// Define some vars
|
// Define some vars
|
||||||
$pane = (isset($_GET['pane'])) ? $_GET['pane'] : '';
|
$pane = (isset($_GET['pane'])) ? $_GET['pane'] : '';
|
||||||
$update = ($pane == 'right') ? true : false;
|
$update = ($pane == 'right') ? true : false;
|
||||||
|
|
||||||
|
define('IN_PHPBB', 1);
|
||||||
// Include files
|
// Include files
|
||||||
$phpbb_root_path = '../';
|
$phpbb_root_path = '../';
|
||||||
require($phpbb_root_path . 'extension.inc');
|
require($phpbb_root_path . 'extension.inc');
|
||||||
|
@ -46,7 +45,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'top')
|
||||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="../index.<?php echo $phpEx . $SID; ?>" target="_top"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td>
|
<td><a href="../index.<?php echo $phpEx . $SID; ?>" target="_top"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td>
|
||||||
<td width="100%" background="images/header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle"><?php echo $user->lang['Admin_title']; ?></span> </td>
|
<td width="100%" background="images/header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle"><?php echo $user->lang['ADMIN_TITLE']; ?></span> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -66,7 +65,7 @@ else if (isset($_GET['pane']) && $_GET['pane'] == 'left')
|
||||||
$setmodules = 1;
|
$setmodules = 1;
|
||||||
while ($file = @readdir($dir))
|
while ($file = @readdir($dir))
|
||||||
{
|
{
|
||||||
if (preg_match('/^admin_(.*?)\.' . $phpEx . '$/', $file))
|
if (preg_match('#^admin_(.*?)\.' . $phpEx . '$#', $file))
|
||||||
{
|
{
|
||||||
include($file);
|
include($file);
|
||||||
}
|
}
|
||||||
|
@ -260,9 +259,9 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
|
||||||
{
|
{
|
||||||
$version = $row['mysql_version'];
|
$version = $row['mysql_version'];
|
||||||
|
|
||||||
if (preg_match('/^(3\.23|4\.)/', $version))
|
if (preg_match('#^(3\.23|4\.)#', $version))
|
||||||
{
|
{
|
||||||
$db_name = (preg_match('/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)/', $version)) ? "`$dbname`" : $dbname;
|
$db_name = (preg_match('#^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)#', $version)) ? "`$dbname`" : $dbname;
|
||||||
|
|
||||||
$sql = "SHOW TABLE STATUS
|
$sql = "SHOW TABLE STATUS
|
||||||
FROM " . $db_name;
|
FROM " . $db_name;
|
||||||
|
@ -297,7 +296,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
|
||||||
$dbsize = $user->lang['Not_available'];
|
$dbsize = $user->lang['Not_available'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (preg_match('/^mssql/', SQL_LAYER))
|
else if (preg_match('#^mssql#', SQL_LAYER))
|
||||||
{
|
{
|
||||||
$sql = "SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
|
$sql = "SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
|
||||||
FROM sysfiles";
|
FROM sysfiles";
|
||||||
|
@ -315,7 +314,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
|
||||||
$dbsize = ($dbsize >= 1048576) ? sprintf('%.2f MB', ($dbsize / 1048576)) : (($dbsize >= 1024) ? sprintf('%.2f KB', ($dbsize / 1024)) : sprintf('%.2f Bytes', $dbsize));
|
$dbsize = ($dbsize >= 1048576) ? sprintf('%.2f MB', ($dbsize / 1048576)) : (($dbsize >= 1024) ? sprintf('%.2f KB', ($dbsize / 1024)) : sprintf('%.2f Bytes', $dbsize));
|
||||||
}
|
}
|
||||||
|
|
||||||
page_header($user->lang['Admin_Index']);
|
page_header($user->lang['ADMIN_INDEX']);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -331,47 +330,47 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h1><?php echo $user->lang['Welcome_phpBB']; ?></h1>
|
<h1><?php echo $user->lang['WELCOME_PHPBB']; ?></h1>
|
||||||
|
|
||||||
<p><?php echo $user->lang['Admin_intro']; ?></p>
|
<p><?php echo $user->lang['ADMIN_INTRO']; ?></p>
|
||||||
|
|
||||||
<h1><?php echo $user->lang['Forum_stats']; ?></h1>
|
<h1><?php echo $user->lang['FORUM_STATS']; ?></h1>
|
||||||
|
|
||||||
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<th width="25%" nowrap="nowrap" height="25"><?php echo $user->lang['Statistic']; ?></th>
|
<th width="25%" nowrap="nowrap" height="25"><?php echo $user->lang['STATISTIC']; ?></th>
|
||||||
<th width="25%"><?php echo $user->lang['Value']; ?></th>
|
<th width="25%"><?php echo $user->lang['VALUE']; ?></th>
|
||||||
<th width="25%" nowrap="nowrap"><?php echo $user->lang['Statistic']; ?></th>
|
<th width="25%" nowrap="nowrap"><?php echo $user->lang['STATISTIC']; ?></th>
|
||||||
<th width="25%"><?php echo $user->lang['Value']; ?></th>
|
<th width="25%"><?php echo $user->lang['VALUE']; ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Number_posts']; ?>:</td>
|
<td class="row1" nowrap="nowrap"><?php echo $user->lang['NUMBER_POSTS']; ?>:</td>
|
||||||
<td class="row2"><b><?php echo $total_posts; ?></b></td>
|
<td class="row2"><b><?php echo $total_posts; ?></b></td>
|
||||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Posts_per_day']; ?>:</td>
|
<td class="row1" nowrap="nowrap"><?php echo $user->lang['POSTS_PER_DAY']; ?>:</td>
|
||||||
<td class="row2"><b><?php echo $posts_per_day; ?></b></td>
|
<td class="row2"><b><?php echo $posts_per_day; ?></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Number_topics']; ?>:</td>
|
<td class="row1" nowrap="nowrap"><?php echo $user->lang['NUMBER_TOPICS']; ?>:</td>
|
||||||
<td class="row2"><b><?php echo $total_topics; ?></b></td>
|
<td class="row2"><b><?php echo $total_topics; ?></b></td>
|
||||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Topics_per_day']; ?>:</td>
|
<td class="row1" nowrap="nowrap"><?php echo $user->lang['TOPICS_PER_DAY']; ?>:</td>
|
||||||
<td class="row2"><b><?php echo $topics_per_day; ?></b></td>
|
<td class="row2"><b><?php echo $topics_per_day; ?></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Number_users']; ?>:</td>
|
<td class="row1" nowrap="nowrap"><?php echo $user->lang['NUMBER_USERS']; ?>:</td>
|
||||||
<td class="row2"><b><?php echo $total_users; ?></b></td>
|
<td class="row2"><b><?php echo $total_users; ?></b></td>
|
||||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Users_per_day']; ?>:</td>
|
<td class="row1" nowrap="nowrap"><?php echo $user->lang['USERS_PER_DAY']; ?>:</td>
|
||||||
<td class="row2"><b><?php echo $users_per_day; ?></b></td>
|
<td class="row2"><b><?php echo $users_per_day; ?></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Board_started']; ?>:</td>
|
<td class="row1" nowrap="nowrap"><?php echo $user->lang['BOARD_STARTED']; ?>:</td>
|
||||||
<td class="row2"><b><?php echo $start_date; ?></b></td>
|
<td class="row2"><b><?php echo $start_date; ?></b></td>
|
||||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Avatar_dir_size']; ?>:</td>
|
<td class="row1" nowrap="nowrap"><?php echo $user->lang['AVATAR_DIR_SIZE']; ?>:</td>
|
||||||
<td class="row2"><b><?php echo $avatar_dir_size; ?></b></td>
|
<td class="row2"><b><?php echo $avatar_dir_size; ?></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Database_size']; ?>:</td>
|
<td class="row1" nowrap="nowrap"><?php echo $user->lang['DATABASE_SIZE']; ?>:</td>
|
||||||
<td class="row2"><b><?php echo $dbsize; ?></b></td>
|
<td class="row2"><b><?php echo $dbsize; ?></b></td>
|
||||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['Gzip_compression']; ?>:</td>
|
<td class="row1" nowrap="nowrap"><?php echo $user->lang['GZIP_COMPRESSION']; ?>:</td>
|
||||||
<td class="row2"><b><?php echo ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF']; ?></b></td>
|
<td class="row2"><b><?php echo ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF']; ?></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- tr>
|
<!-- tr>
|
||||||
|
@ -379,16 +378,16 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
|
||||||
</tr -->
|
</tr -->
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h1><?php echo $user->lang['Admin_log']; ?></h1>
|
<h1><?php echo $user->lang['ADMIN_LOG']; ?></h1>
|
||||||
|
|
||||||
<p><?php echo $user->lang['Admin_log_index_explain']; ?></p>
|
<p><?php echo $user->lang['ADMIN_LOG_INDEX_EXPLAIN']; ?></p>
|
||||||
|
|
||||||
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<th width="15%" height="25" nowrap="nowrap"><?php echo $user->lang['Username']; ?></th>
|
<th width="15%" height="25" nowrap="nowrap"><?php echo $user->lang['USERNAME']; ?></th>
|
||||||
<th width="15%"><?php echo $user->lang['IP']; ?></th>
|
<th width="15%"><?php echo $user->lang['IP']; ?></th>
|
||||||
<th width="20%"><?php echo $user->lang['Time']; ?></th>
|
<th width="20%"><?php echo $user->lang['TIME']; ?></th>
|
||||||
<th width="45%" nowrap="nowrap"><?php echo $user->lang['Action']; ?></th>
|
<th width="45%" nowrap="nowrap"><?php echo $user->lang['ACTION']; ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -415,15 +414,15 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h1><?php echo $user->lang['Inactive_users']; ?></h1>
|
<h1><?php echo $user->lang['INACTIVE_USERS']; ?></h1>
|
||||||
|
|
||||||
<p><?php echo $user->lang['Inactive_users_explain']; ?></p>
|
<p><?php echo $user->lang['INACTIVE_USERS_EXPLAIN']; ?></p>
|
||||||
|
|
||||||
<form method="post" name="inactive" action="<?php echo "index.$phpEx$SID&pane=right"; ?>"><table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
<form method="post" name="inactive" action="<?php echo "index.$phpEx$SID&pane=right"; ?>"><table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<th width="45%" height="25" nowrap="nowrap"><?php echo $user->lang['Username']; ?></th>
|
<th width="45%" height="25" nowrap="nowrap"><?php echo $user->lang['USERNAME']; ?></th>
|
||||||
<th width="45%"><?php echo $user->lang['Joined']; ?></th>
|
<th width="45%"><?php echo $user->lang['JOINED']; ?></th>
|
||||||
<th width="5%" nowrap="nowrap"><?php echo $user->lang['Mark']; ?></th>
|
<th width="5%" nowrap="nowrap"><?php echo $user->lang['MARK']; ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -453,7 +452,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="cat" colspan="3" height="28" align="right"><input class="liteoption" type="submit" name="activate" value="Activate" /> <input class="liteoption" type="submit" name="remind" value="Remind" /> <input class="liteoption" type="submit" name="delete" value="Delete" /> </td>
|
<td class="cat" colspan="3" height="28" align="right"><input class="liteoption" type="submit" name="activate" value="<?php echo $user->lang['ACTIVATE']; ?>" /> <input class="liteoption" type="submit" name="remind" value="<?php echo $user->lang['REMIND']; ?>" /> <input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE']; ?>" /> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -463,7 +462,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" colspan="3" align="center"><?php echo $user->lang['No_inactive_users']; ?></td>
|
<td class="row1" colspan="3" align="center"><?php echo $user->lang['NO_INACTIVE_USERS']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
@ -474,7 +473,7 @@ elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
|
||||||
|
|
||||||
<table width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
<table width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="right" valign="top" nowrap="nowrap"><b><span class="gensmall"><a href="javascript:marklist(true);" class="gensmall"><?php echo $user->lang['Mark_all']; ?></a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $user->lang['Unmark_all']; ?></a></span></b></td>
|
<td align="right" valign="top" nowrap="nowrap"><b><span class="gensmall"><a href="javascript:marklist(true);" class="gensmall"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></span></b></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></form>
|
</table></form>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,8 @@ if (!defined('IN_PHPBB'))
|
||||||
|
|
||||||
define('IN_ADMIN', true);
|
define('IN_ADMIN', true);
|
||||||
define('NEED_SID', true);
|
define('NEED_SID', true);
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
require($phpbb_root_path . 'common.'.$phpEx);
|
||||||
|
require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||||
|
|
||||||
// Start session management
|
// Start session management
|
||||||
$user->start($update);
|
$user->start($update);
|
||||||
|
@ -45,7 +46,7 @@ function page_header($sub_title, $meta = '', $table_html = true)
|
||||||
// gzip_compression
|
// gzip_compression
|
||||||
if ($config['gzip_compress'])
|
if ($config['gzip_compress'])
|
||||||
{
|
{
|
||||||
if (extension_loaded('zlib') && strstr($HTTP_USER_AGENT,'compatible') && !headers_sent())
|
if (extension_loaded('zlib') && !headers_sent())
|
||||||
{
|
{
|
||||||
ob_start('ob_gzhandler');
|
ob_start('ob_gzhandler');
|
||||||
}
|
}
|
||||||
|
@ -105,6 +106,7 @@ function page_footer($copyright_html = true)
|
||||||
|
|
||||||
// Close our DB connection.
|
// Close our DB connection.
|
||||||
$db->sql_close();
|
$db->sql_close();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
@ -147,7 +149,7 @@ function page_message($title, $message, $show_header = false)
|
||||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="../index.<?php echo $phpEx . $SID; ?>"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td>
|
<td><a href="../index.<?php echo $phpEx . $SID; ?>"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td>
|
||||||
<td width="100%" background="images/header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle"><?php echo $user->lang['Admin_title']; ?></span> </td>
|
<td width="100%" background="images/header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle"><?php echo $user->lang['ADMIN_TITLE']; ?></span> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -173,83 +175,6 @@ function page_message($title, $message, $show_header = false)
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_admin_log()
|
|
||||||
{
|
|
||||||
global $db, $user;
|
|
||||||
|
|
||||||
$arguments = func_get_args();
|
|
||||||
|
|
||||||
$action = array_shift($arguments);
|
|
||||||
$data = (!sizeof($arguments)) ? '' : addslashes(serialize($arguments));
|
|
||||||
|
|
||||||
$sql = "INSERT INTO " . LOG_ADMIN_TABLE . " (user_id, log_ip, log_time, log_operation, log_data)
|
|
||||||
VALUES (" . $user->data['user_id'] . ", '$user->ip', " . time() . ", '$action', '$data')";
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
|
|
||||||
{
|
|
||||||
global $db, $user, $phpEx, $SID;
|
|
||||||
|
|
||||||
$table_sql = ($mode == 'admin') ? LOG_ADMIN_TABLE : LOG_MOD_TABLE;
|
|
||||||
$forum_sql = ($mode == 'mod' && $forum_id) ? "AND l.forum_id = $forum_id" : '';
|
|
||||||
$limit_sql = ($limit) ? (($offset) ? "LIMIT $offset, $limit" : "LIMIT $limit") : '';
|
|
||||||
|
|
||||||
$sql = "SELECT l.log_id, l.user_id, l.log_ip, l.log_time, l.log_operation, l.log_data, u.username
|
|
||||||
FROM $table_sql l, " . USERS_TABLE . " u
|
|
||||||
WHERE u.user_id = l.user_id
|
|
||||||
AND l.log_time >= $limit_days
|
|
||||||
$forum_sql
|
|
||||||
ORDER BY $sort_by
|
|
||||||
$limit_sql";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$log = array();
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$i = 0;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
$log[$i]['id'] = $row['log_id'];
|
|
||||||
$log[$i]['username'] = '<a href="admin_users.'.$phpEx . $SID . '&u=' . $row['user_id'] . '">' . $row['username'] . '</a>';
|
|
||||||
$log[$i]['ip'] = $row['log_ip'];
|
|
||||||
$log[$i]['time'] = $row['log_time'];
|
|
||||||
|
|
||||||
$log[$i]['action'] = (!empty($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : ucfirst(str_replace('_', ' ', $row['log_operation']));
|
|
||||||
|
|
||||||
if (!empty($row['log_data']))
|
|
||||||
{
|
|
||||||
$log_data_ary = unserialize(stripslashes($row['log_data']));
|
|
||||||
|
|
||||||
foreach ($log_data_ary as $log_data)
|
|
||||||
{
|
|
||||||
$log[$i]['action'] = preg_replace('#%s#', $log_data, $log[$i]['action'], 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$i++;
|
|
||||||
}
|
|
||||||
while ($row = $db->sql_fetchrow($result));
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$sql = "SELECT COUNT(*) AS total_entries
|
|
||||||
FROM $table_sql l
|
|
||||||
WHERE l.log_time >= $limit_days
|
|
||||||
$forum_sql";
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$row = $db->sql_fetchrow($result);
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$log_count = $row['total_entries'];
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// End Functions
|
// End Functions
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue