No changes

This commit is contained in:
Frank Harris 2025-09-11 13:29:15 -04:00
parent 8680a02b13
commit b6b398f5bf
17374 changed files with 2475441 additions and 0 deletions

View file

@ -0,0 +1,245 @@
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
function exec_ogp_module()
{
global $db,$view;
echo "<h2>".get_lang('administration')."</h2>";
echo "<table class='administration-table'>";
### MAIN ICONS
echo "<tr>\n";
$menus = $db->getMenusForGroup('admin');
foreach ($menus as $key => $row) {
if ( !empty( $row['subpage'] ) )
$name[$key] = $row['subpage'];
else
$name[$key] = $row['module'];
$translation[$key] = get_lang($name[$key]);
}
array_multisort($translation, $name, SORT_DESC, $menus);
$td = 0;
foreach ( $menus as $menu )
{
$module = $menu['module'];
if ( !empty( $menu['subpage'] ) )
{
$subpage = "&amp;p=".$menu['subpage'];
$button = $menu['subpage'];
}
else
{
$subpage = "";
$button = $menu['module'];
}
$button_url = "?m=".$module.$subpage;
if ( preg_match( '/\\_?\\_/', get_lang("$button") ) )
{
$button_name = $menu['menu_name'];
}
else
{
$button_name = get_lang("$button");
}
echo "<td><a class='administration-buttons' href='".$button_url."' /><div><img src='modules/administration/images/$button.png' /><br>$button_name</div></a></td><td class='administration-buttons-hmargin' ></td>\n";
$td++;
if($td == 4)
{
echo "</tr><tr class='administration-buttons-vmargin' ><td></td></tr><tr>\n";
$td = 0;
}
}
echo "<td><a class='administration-buttons' href='?m=administration&p=banlist' />".
"<div><img src='modules/administration/images/banlist.png' /><br>".get_lang('ban_list')."</div></a></td>".
"<td class='administration-buttons-hmargin' ></td>\n";
echo "</tr>\n";
echo "</table>\n";
### END MAIN ICONS
### DB BACKUP
echo "<h2>".get_lang('db_backup')."</h2>";
?>
<table class='administration-table'>
<tr>
<td>
<form method="POST">
<button name="download"><?php print_lang('download_db_backup'); ?></button>
</form>
<br>
<form method="POST" enctype="multipart/form-data">
<label for="file"><?php print_lang('sql_file'); ?>:</label>
<input type="file" name="file" id="file" />
<button name="restore"><?php print_lang('restore_db_backup'); ?></button>
</form>
</td>
</tr>
</table>
<?php
if(isset($_POST['download']))
{
require('includes/config.inc.php');
$randomdir = genRandomString('20');
@mkdir($randomdir);
@chmod($randomdir, 0700);
$file = $db_name . "_" . date("Y-m-d-H-i-s") . '.sql';
$backupFile = $randomdir."/".$file;
$command = "mysqldump --skip-opt --single-transaction --add-drop-table --create-options --extended-insert --quick --set-charset -u $db_user -p$db_pass $db_name > $backupFile";
@system($command);
$view->refresh('?m=administration&p=backupdwl&randir='.$randomdir.'&dwfile='.$file.'&type=cleared', 0);
}
if(isset($_POST['restore']))
{
require('includes/config.inc.php');
$command = "mysql --user=$db_user --password=$db_pass $db_name < ".$_FILES["file"]["tmp_name"];
@system($command);
}
### END OF DB BACKUP
### ADD ICONS TO IFRAME FORM.
echo "<h2>".get_lang('external_links')."</h2>";
?>
<table class='center'>
<td>
<form action="" method=POST ><b><?php print_lang('name'); ?>:</b><input name="name" type=text size=10> <b><?php print_lang('url'); ?>:</b>
<input name="url" type=text size=40>
<input type=submit value='<?php print_lang('add_it'); ?>'>
</form>
</td>
</tr>
</table>
<table class='administration-table'>
<tr>
<?php
if(isset($_POST['url']))
{
$add_link = $db->addAdminExternalLink($_POST['name'],$_POST['url'],$_SESSION['user_id']);
if($add_link == FALSE) print_failure(get_lang('imposible_add_link_this_to_databse'));
}
### END FOR ADD ICONS TO IFRAME FORM.
### ICONS TO FRAMES
if(isset($_POST['link_id']))
{
$external_links = $db->delAdminExternalLink($_POST['link_id'],$_SESSION['user_id']);
if($external_links == TRUE)
echo get_lang_f('link_has_been_removed', $_POST['name']);
else
print_failure(get_lang('link_does_not_exist'));
}
echo "<tr>\n";
$external_links = $db->getAdminExternalLinks($_SESSION['user_id']);
$td2 = 0;
if($external_links != 0)
{
foreach ( $external_links as $external_link )
{
$url = $external_link['url'];
$name = $external_link['name'];
$link_id = $external_link['link_id'];
echo "<td>";
echo "<a href='?m=administration&amp;p=iframe&amp;external_link=".$url."' ><img class='administration-buttons' src='modules/administration/images/link.png' /><br>".$name."</a>\n";
echo "<form action='' method='POST' ><input type='hidden' name='name' value='".$name."'><input type='hidden' name='link_id' value='".$link_id."'><input type='image' src='modules/administration/images/remove.gif' class='remove-button' onsubmit=".'"submit-form();"'."></form>";
echo "</td>";
$td2++;
if($td2 == 4)
{
echo "</tr><tr>\n";
$td2 = 0;
}
}
}
echo "</tr>\n".
"</table>\n";
### END ICONS TO FRAMES
### CHANGE MENU ORDER
if ( isset( $_POST['changeOrder'] ) )
{
foreach($_POST as $key => $value)
{
if( preg_match( "/^change_button/", $key ) )
{
list($trash,$module_id) = explode("-", $key);
$new_pos = $value;
$db->changeMenuPosition( $module_id, $new_pos );
}
}
}
echo "<h2>".get_lang('change_buttons_order')."</h2>";
echo "<table class='center'>".
"<tr>".
"<form method=POST >";
$menus = $db->getMenusForGroup('user');
$pos = 0;
foreach ( $menus as $menu )
{
$module = $menu['module'];
if ( !empty( $menu['subpage'] ) )
{
$subpage = "&amp;p=".$menu['subpage'];
$button = $menu['subpage'];
if (isset($_GET['p']) AND $_GET['p'] == $menu['subpage'] ) $menu_link_class = 'user_menu_link_selected'; else $menu_link_class = 'user_menu_link';
}
else
{
$subpage = "";
$button = $menu['module'];
if (isset($_GET['m']) AND $_GET['m'] == $menu['module'] ) $menu_link_class = 'user_menu_link_selected'; else $menu_link_class = 'user_menu_link';
}
$button_url = "?m=".$module.$subpage;
if ( preg_match( '/\\_?\\_/', get_lang("$button") ) )
{
$button_name = $menu['menu_name'];
}
else
{
$button_name = get_lang("$button");
}
echo "<td><input type=text name='change_button-".$menu['module_id']."' value=".$menu['pos']." style='text-align:right;width:20px;' > $button_name</input></td>\n";
$pos++;
}
echo "</tr>\n".
"<tr>\n".
"<td colspan=$pos ><input type=submit name=changeOrder value='".get_lang('change_buttons_order')."' />\n".
"</form>\n".
"</td>\n".
"</tr>\n".
"</table>\n";
}
?>

View file

@ -0,0 +1,43 @@
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
function exec_ogp_module()
{
$path = getcwd()."/".$_GET['randir']."/"; // change the path to fit your websites document structure
$fullPath = $path.$_GET['dwfile'];
if ($fd = fopen ($fullPath, "r")) {
header("Content-Disposition: attachment; filename=\"".$_GET['dwfile']."\"");
header("Content-length: ".filesize($fullPath));
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
fclose($fd);
}
unlink($fullPath);
rmdir($path);
exit;
}
?>

View file

@ -0,0 +1,70 @@
<script type="text/javascript" src="js/modules/administration.js"></script>
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
function exec_ogp_module()
{
echo "<h2>".get_lang('ban_list')."</h2>";
global $db, $settings;
if(isset($_POST['unban']))
{
unset($_POST['unban']);
foreach($_POST as $name => $ip)
{
$ip = $db->real_escape_string($ip);
$db->query("DELETE FROM `OGP_DB_PREFIXban_list` WHERE client_ip = '$ip';");
}
}
$ban_list = $db->resultQuery("SELECT logging_attempts, banned_until, client_ip FROM `OGP_DB_PREFIXban_list`;");
$ban_qty = 0;
$ban_table = '';
if($ban_list)
{
foreach($ban_list as $ban)
{
if($ban['logging_attempts'] >= $settings["login_attempts_before_banned"])
{
$ban_table .= "<tr><td><input type=checkbox name='".$ban_qty."' value='".$ban['client_ip']."' /></td><td>".$ban['client_ip']."</td><td>".date("r",$ban['banned_until'])."</td></tr>\n";
$ban_qty++;
}
else
{
continue;
}
}
}
if($ban_qty == 0)
{
print_failure(get_lang('no_banned_ips'));
}
else
{
echo "<form method=post >\n".
"<table><tr><th><span id=check >".get_lang('unban')."</span></th><th>".get_lang('client_ip')."</th><th>".get_lang('banned_until')."</th></tr>\n".$ban_table."</table>\n".
"<input type=submit name=unban value='".get_lang('unban_selected_ips')."' /></form>";
}
echo create_back_button($_GET['m'],"main");
}
?>

View file

@ -0,0 +1,97 @@
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
function exec_ogp_module()
{
if(isset($_POST['default']))
{
unset($_SESSION['height']);
unset($_SESSION['width']);
}
if(isset($_SESSION['height']))$height = $_SESSION['height'];
else
{
$height = 420;
$_SESSION['height'] = $height;
}
if(isset($_SESSION['width']))$width = $_SESSION['width'];
else
{
$width = 770;
$_SESSION['width'] = $width;
}
if(isset($_POST['h_bigger']))
{
$_SESSION['height'] = $_SESSION['height'] + 50;
$height = $_SESSION['height'];
}
if(isset($_POST['h_smaller']))
{
$_SESSION['height'] = $_SESSION['height'] - 50;
$height = $_SESSION['height'];
}
if(isset($_POST['w_bigger']))
{
$_SESSION['width'] = $_SESSION['width'] + 50;
$width = $_SESSION['width'];
}
if(isset($_POST['w_smaller']))
{
$_SESSION['width'] = $_SESSION['width'] - 50;
$width = $_SESSION['width'];
}
?>
<IFRAME SRC="<?php echo $_GET['external_link']; ?>" WIDTH=<?php echo $width; ?> HEIGHT=<?php echo $height; ?> style="border:1px solid transparent;background-color:white" ></IFRAME>
<br>
<table style='text-align:center;'>
<tr>
<td colspan=3><form action="" method=POST><input type='submit' value='-H' name='h_smaller'/></form></td>
</tr>
<tr>
<td><form action="" method=POST><input type='submit' value='-W' name='w_smaller'/></form></td>
<td><form action="" method=POST><input type='submit' value='0' name='default'/></form></td>
<td><form action="" method=POST><input type='submit' value='+W' name='w_bigger'/></form></td>
</tr>
<tr>
<td colspan=3><form action="" method=POST><input type='submit' value='+H' name='h_bigger'/></form></td>
</tr>
<tr>
</tr></table>
<a href="?m=administration&p=main"><?php print_lang('back'); ?></a>
<?php
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View file

@ -0,0 +1,41 @@
.administration-buttons div{
padding: 8px 8px 0px;
transition: all 0.5s;
-webkit-transition: all 0.5s;
min-width:125px;
min-height:100px;
}
.administration-buttons div:hover {
transition: all 0.1s;
-webkit-transition: all 0.1s;
background-color: #0F3;
border-radius: 10px;
text-decoration:none;
cursor:pointer;
box-shadow: 3px 3px 3px 3px #999, inset 1px 1px 1px 1px #0F7;
-webkit-box-shadow: 3px 3px 3px 3px #999, inset 1px 1px 1px 1px #0F7;
}
.administration-buttons div:active {
background-color: #0F3;
box-shadow: 1px 1px 1px 1px #999, inset 0px 0px 0px 0px #0F5;
-webkit-box-shadow: 1px 1px 1px 1px #999, inset 0px 0px 0px 0px #0F5;
border-radius: 8px;
-webkit-border-radius: 8px;
color:#555;
text-shadow:0.1em 0.1em #FFF;
}
.administration-buttons div:active img{
position:relative;
top:0.5px;
left:0.5px;
}
.administration-buttons, .administration-buttons:hover, .administration-buttons :active {
color:black !important;
text-decoration:none;
}
.administration-buttons-hmargin{
width:40px;
}
.administration-buttons-vmargin{
height:40px;
}

View file

@ -0,0 +1,53 @@
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
// Module general information
$module_title = "Administration";
$module_version = "1.1";
$db_version = 1;
$module_required = TRUE;
$module_menus = array( array( 'subpage' => 'watch_logger', 'name'=>'Watch Logger', 'group'=>'admin' ) );
$install_queries = array();
$install_queries[0] = array(
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."adminExternalLinks`;",
"CREATE TABLE IF NOT EXISTS ".OGP_DB_PREFIX."adminExternalLinks
(
link_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(80) NOT NULL,
url VARCHAR(200) NOT NULL,
user_id VARCHAR(7) NOT NULL
) ENGINE=MyISAM;");
$install_queries[1] = array(
"DROP TABLE IF EXISTS `".OGP_DB_PREFIX."logger`;",
"CREATE TABLE IF NOT EXISTS `".OGP_DB_PREFIX."logger`
(
`log_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`date` varchar(20) NOT NULL,
`user_id` int(11) NOT NULL,
`ip` varchar(15) NOT NULL,
`message` varchar(250) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
?>

View file

@ -0,0 +1,7 @@
<navigation>
<page key="main" file="administration.php" access="admin" />
<page key="iframe" file="iframe.php" access="admin" />
<page key="backupdwl" file="backupdwl.php" access="admin" />
<page key="watch_logger" file="watch_logger.php" access="admin" />
<page key="banlist" file="banlist.php" access="admin" />
</navigation>

View file

@ -0,0 +1,152 @@
<script type="text/javascript" src="js/modules/administration.js"></script>
<?php
/*
*
* OGP - Open Game Panel
* Copyright (C) 2008 - 2018 The OGP Development Team
*
* http://www.opengamepanel.org/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
function exec_ogp_module() {
global $db, $view, $loggedInUserInfo;
$search_field = (isset($_GET['search']) && !empty($_GET['search'])) ? $_GET['search'] : false;
$p = (isset($_GET['page']) && (int)$_GET['page'] > 0) ? (int)$_GET['page'] : 1;
$l = (isset($_GET['limit']) && (int)$_GET['limit'] > 0) ? (int)$_GET['limit'] : 10;
if(hasValue($loggedInUserInfo) && is_array($loggedInUserInfo) && $loggedInUserInfo["users_page_limit"] && !(isset($_GET['limit']) and !empty($_GET['limit']))){
$l = $loggedInUserInfo["users_page_limit"];
}
echo "<h2>".get_lang('watch_logger')."</h2>";
$logs = $db->read_logger($p, $l, $search_field);
if (empty($logs) && !empty($search_field)) {
print_failure(get_lang_f('no_results_found', htmlentities($search_field)));
$view->refresh("?m=administration&p=watch_logger", 5);
return;
}
?>
<!-- Search, Empty Logger, and Paging Options Table -->
<table style="width: 100%;">
<tr>
<td style="width: 50%; vertical-align: middle; text-align: left;">
<form action="home.php" method="GET" style="display: inline;">
<input type ="hidden" name="m" value="administration" />
<input type ="hidden" name="p" value="watch_logger" />
<input name="search" type="text" id="search" value="<?php if(hasValue($search_field)){ echo $search_field; } ?>" />
<input type="submit" value="<?php echo get_lang('search'); ?>" />
</form>
<form method=POST style="display: inline;">
<input type="submit" name="empty_logger" value="<?php print_lang('empty_logger'); ?>" >
</form>
</td>
<td style="width: 50%; vertical-align: middle; text-align: right;">
<?php echo print_lang('view'); ?> <a href='?m=administration&p=watch_logger&limit=10'>10</a> / <a href='?m=administration&p=watch_logger&limit=20'>20</a> / <a href='?m=administration&p=watch_logger&limit=50'>50</a> / <a href='?m=administration&p=watch_logger&limit=100'>100</a> <?php echo print_lang('per_page'); ?>
</td>
</tr>
</table>
<!-- END Search, Empty Logger, and Paging Options Table -->
<table id="servermonitor" class="tablesorter" data-sortlist="[[1,1]]">
<thead>
<tr>
<th style="width:16px;background-position: center;" class="sorter-false"></th>
<th class="dateFormat-ddmmyyyy"><?php print_lang('when'); ?></th>
<th><?php print_lang('who'); ?></th>
<th><?php print_lang('where'); ?></th>
<th><?php print_lang('what'); ?></th>
</tr>
</thead>
<tbody>
<?php
if( isset( $_POST['log_id'] ) ){
$db->del_logger_log($_POST['log_id']);
$newLogs = array();
foreach($logs as $log){
if($log['log_id'] != $_POST['log_id']){
$newLogs[] = $log;
}
}
$logs = $newLogs;
}
if( isset( $_POST['empty_logger'] ) ){
$db->empty_logger();
$logs = false;
}
if($logs)
{
foreach($logs as $log)
{
$user = $db->getUserById($log['user_id']);
$when = $log['date'];
$who = $user['users_login'];
$where = $log['ip'];
$what = $log['message'];
$log_id = $log['log_id'];
// Template
echo "<tr class='maintr'>\n".
"<td class='collapsible'>\n".
"<center>\n".
"<form method=POST>\n".
"<input type='hidden' name='log_id' value='$log_id' />\n".
"<input type='image' name='remove_log' onclick=\"this.form.submit();\" src='modules/administration/images/remove.gif' />\n".
"</form>\n".
"</center>\n".
"</td>\n".
"<td class='collapsible'>$when</td>\n".
"<td class='collapsible'>$who</td>\n".
"<td class='collapsible'>$where</td>\n".
"<td class='collapsible'>$what</td>\n".
"</tr>\n";
echo "<tr class='expand-child'>\n".
"<td colspan='5' >\n".
"<table>\n";
$show_values = array( "users_login", "users_lang", "users_role", "users_email", "user_expires");
foreach($user as $key => $value)
{
if( in_array( $key, $show_values ) )
echo "<tr><td>".str_replace("_", "", substr($key,5))."</td><td>$value</td></tr>\n";
}
echo "</tr>\n".
"</td>\n".
"</table>\n";
}
}
echo "</tbody>\n";
echo "<tfoot style='border:1px solid grey;'></tfoot>\n";
echo "</table>\n";
$count_logs = $db->get_logger_count($search_field);
if (isset($_GET['search']) && !empty($_GET['search'])) {
$uri = '?m=administration&p=watch_logger&search='.$_GET['search'].'&limit='.$l.'&page=';
} else {
$uri = '?m=administration&p=watch_logger&limit='.$l.'&page=';
}
echo paginationPages($count_logs[0]['total'], $p, $l, $uri, 3, 'watchLogger');
}
?>