-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
70 lines (58 loc) · 2.55 KB
/
admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
if(isset($gxsecurity)) {
global $pth, $sl, $plugin;
$admin= isset($_POST['admin']) ? $_POST['admin'] : $_GET['admin'];
$action= isset($_POST['action']) ? $_POST['action'] : $_GET['action'];
//$plugin=basename(dirname(__FILE__),"/");
$gxsecurity_plugin=basename(dirname(__FILE__),"/");
$o.=print_plugin_admin('on');
if($admin<>'plugin_main'){$o.=plugin_admin_common($action,$admin,$gxsecurity_plugin);}
if($admin=='')$o.="<h4>GXSecurity</h4>Security plugin ver 1.8 by Gerd Xhonneux (<a href=\"http://xtc.xhonneux.com\" target=\"_blank\">http://xtc.xhonneux.com</a>)";
if ($admin == 'plugin_main') {
$pth['file']['plugin_main'] = $pth['folder']['plugins'].$gxsecurity_plugin."/config/".$plugin_cf['gxsecurity']['countryfile'];
$o.="<h4>".$plugin_tx['gxsecurity']['mnu_country_file']."</h4> (".$pth['folder']['plugins'].$gxsecurity_plugin."/config/".$plugin_cf['gxsecurity']['countryfile'].")";
$o .= plugin_admin_common($action,$admin,$gxsecurity_plugin);
}
if ($admin == 'plugin_main') {
$pth['file']['plugin_main'] = $pth['folder']['plugins'].$gxsecurity_plugin."/config/".$plugin_cf['gxsecurity']['crackfile'];
$o.="<h4>".$plugin_tx['gxsecurity']['mnu_crack_file']."</h4> (".$pth['folder']['plugins'].$gxsecurity_plugin."/config/".$plugin_cf['gxsecurity']['crackfile'].")";
$o .= plugin_admin_common($action,$admin,$gxsecurity_plugin);
}
if ($admin == 'plugin_main') {
$o.="<h4>Logfiles</h4>";
$dirname = $pth['folder']['plugins'].$gxsecurity_plugin."/log/";
if ($dir = @opendir($dirname)) {
while (($file = readdir($dir)) !== false)
{
if($file != ".." && $file != ".") {
if (substr($file,-4) == ".csv")
$filelist[] = substr($file,0,strlen($file)-4);
//else echo substr($file,-4);
}
}
closedir($dir);
}
$o.= "<form action='./' method='POST' target='_blank'>";
$o.= "<select name='csvfile'>";
arsort($filelist);
while (list ($key, $val) = each ($filelist)) {
$o.= "<option>$val</option>";
}
$o.= "</select>";
$o.= "<input type='hidden' name='delimiter' value='".$plugin_cf['gxsecurity']['logdelimiter']."'>";
$o.= "<input type='submit' value='".$plugin_tx['gxsecurity']['show_log']."'>";
$o.= "</form>";
}
}
/*
* Show a log file.
*/
if ($adm && $_POST['csvfile']) {
include($pth['folder']['plugin']."lib/csvhandler.php");
$csvfile=$pth['folder']['plugin']."log/".$_POST['csvfile'].'.csv';
echo "<strong>".$csvfile."</strong>";
$data=new CSVHandler($csvfile,$_POST['delimiter'],"");
$data->ListAll();
exit;
}
?>