@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -include_once __DIR__ . '/header.php'; |
|
22 | +include_once __DIR__.'/header.php'; |
|
23 | 23 | |
24 | -require_once dirname(__DIR__) . '/class/gtickets.php'; |
|
24 | +require_once dirname(__DIR__).'/class/gtickets.php'; |
|
25 | 25 | |
26 | 26 | $xoops->db(); |
27 | 27 | global $xoopsDB; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $log_table = $db->prefix('protector_log'); |
36 | 36 | |
37 | 37 | // Protector object |
38 | -require_once dirname(__DIR__) . '/class/protector.php'; |
|
38 | +require_once dirname(__DIR__).'/class/protector.php'; |
|
39 | 39 | $protector = Protector::getInstance($db->conn); |
40 | 40 | $conf = $protector->getConf(); |
41 | 41 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // Ticket check |
49 | 49 | if (!$xoopsGTicket->check(true, 'protector_admin')) { |
50 | - $xoops->redirect(\XoopsBaseConfig::get('url') . '/', 3, $xoopsGTicket->getErrors()); |
|
50 | + $xoops->redirect(\XoopsBaseConfig::get('url').'/', 3, $xoopsGTicket->getErrors()); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if ($_POST['action'] === 'update_ips') { |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $fp = @fopen($protector->get_filepath4group1ips(), 'w'); |
71 | 71 | if ($fp) { |
72 | 72 | @flock($fp, LOCK_EX); |
73 | - fwrite($fp, serialize(array_unique($group1_ips)) . "\n"); |
|
73 | + fwrite($fp, serialize(array_unique($group1_ips))."\n"); |
|
74 | 74 | @flock($fp, LOCK_UN); |
75 | 75 | fclose($fp); |
76 | 76 | } else { |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | $buf = array(); |
100 | 100 | $ids = array(); |
101 | 101 | while (false !== (list($lid, $ip, $type) = $db->fetchRow($result))) { |
102 | - if (isset($buf[$ip . $type])) { |
|
102 | + if (isset($buf[$ip.$type])) { |
|
103 | 103 | $ids[] = $lid; |
104 | 104 | } else { |
105 | - $buf[$ip . $type] = true; |
|
105 | + $buf[$ip.$type] = true; |
|
106 | 106 | } |
107 | 107 | } |
108 | - $db->query("DELETE FROM $log_table WHERE lid IN (" . implode(',', $ids) . ")"); |
|
108 | + $db->query("DELETE FROM $log_table WHERE lid IN (".implode(',', $ids).")"); |
|
109 | 109 | $xoops->redirect("center.php", 2, _AM_MSG_REMOVED); |
110 | 110 | } |
111 | 111 | } |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | uksort($bad_ips, 'protector_ip_cmp'); |
124 | 124 | $bad_ips4disp = ''; |
125 | 125 | foreach ($bad_ips as $bad_ip => $jailed_time) { |
126 | - $line = $jailed_time ? $bad_ip . ':' . $jailed_time : $bad_ip; |
|
126 | + $line = $jailed_time ? $bad_ip.':'.$jailed_time : $bad_ip; |
|
127 | 127 | $line = str_replace(':2147483647', '', $line); // remove :0x7fffffff |
128 | - $bad_ips4disp .= htmlspecialchars($line, ENT_QUOTES) . "\n"; |
|
128 | + $bad_ips4disp .= htmlspecialchars($line, ENT_QUOTES)."\n"; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | // group1_ips |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | // query for listing |
143 | 143 | $rs = $db->query("SELECT count(lid) FROM $log_table"); |
144 | 144 | list($numrows) = $db->fetchRow($rs); |
145 | -$prs = $db->query("SELECT l.lid, l.uid, l.ip, l.agent, l.type, l.description, UNIX_TIMESTAMP(l.timestamp), u.uname FROM $log_table l LEFT JOIN " . $db->prefix("system_user") . " u ON l.uid=u.uid ORDER BY timestamp DESC LIMIT $pos,$num"); |
|
145 | +$prs = $db->query("SELECT l.lid, l.uid, l.ip, l.agent, l.type, l.description, UNIX_TIMESTAMP(l.timestamp), u.uname FROM $log_table l LEFT JOIN ".$db->prefix("system_user")." u ON l.uid=u.uid ORDER BY timestamp DESC LIMIT $pos,$num"); |
|
146 | 146 | // Number selection |
147 | 147 | $num_options = ''; |
148 | 148 | $num_array = array(20, 100, 500, 2000); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | // make agents shorter |
172 | 172 | if (preg_match('/MSIE\s+([0-9.]+)/', $agent, $regs)) { |
173 | - $agent_short = 'IE ' . $regs[1]; |
|
173 | + $agent_short = 'IE '.$regs[1]; |
|
174 | 174 | } else { |
175 | 175 | if (stristr($agent, 'Gecko') !== false) { |
176 | 176 | $agent_short = strrchr($agent, ' '); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | } |
180 | 180 | } |
181 | 181 | $agent4disp = htmlspecialchars($agent, ENT_QUOTES); |
182 | - $agent_desc = $agent == $agent_short ? $agent4disp : htmlspecialchars($agent_short, ENT_QUOTES) . "<img src='../images/dotdotdot.gif' alt='$agent4disp' title='$agent4disp' />"; |
|
182 | + $agent_desc = $agent == $agent_short ? $agent4disp : htmlspecialchars($agent_short, ENT_QUOTES)."<img src='../images/dotdotdot.gif' alt='$agent4disp' title='$agent4disp' />"; |
|
183 | 183 | |
184 | 184 | $log_arr['lid'] = $lid; |
185 | 185 | $log_arr['date'] = XoopsLocale::formatTimestamp($timestamp); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -include_once __DIR__ . '/header.php'; |
|
22 | +include_once __DIR__.'/header.php'; |
|
23 | 23 | |
24 | 24 | $xoops = Xoops::getInstance(); |
25 | 25 | $xoops->header(); |
@@ -27,14 +27,14 @@ discard block |
||
27 | 27 | global $xoopsDB; |
28 | 28 | $db = $xoopsDB; |
29 | 29 | $db->prefix('protector_log'); |
30 | -$rs = $db->query("SELECT count(lid) FROM " . $db->prefix('protector_log')); |
|
30 | +$rs = $db->query("SELECT count(lid) FROM ".$db->prefix('protector_log')); |
|
31 | 31 | list($numrows) = $db->fetchRow($rs); |
32 | 32 | |
33 | 33 | $indexAdmin = new \Xoops\Module\Admin(); |
34 | 34 | $indexAdmin->displayNavigation('index.php'); |
35 | 35 | |
36 | 36 | $indexAdmin->addInfoBox(_MI_PROTECTOR_ADMININDEX, 'off'); |
37 | -$indexAdmin->addInfoBoxLine(sprintf(_AM_PROTECTOR_NBALERT, '<span class="red">' . $numrows . '</span>'), 'off'); |
|
37 | +$indexAdmin->addInfoBoxLine(sprintf(_AM_PROTECTOR_NBALERT, '<span class="red">'.$numrows.'</span>'), 'off'); |
|
38 | 38 | |
39 | 39 | $indexAdmin->displayIndex(); |
40 | 40 |
@@ -19,6 +19,6 @@ |
||
19 | 19 | * @version $Id$ |
20 | 20 | */ |
21 | 21 | |
22 | -require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; |
|
22 | +require_once dirname(dirname(dirname(__DIR__))).'/include/cp_header.php'; |
|
23 | 23 | |
24 | 24 | $xoops = Xoops::getInstance(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | $modversion['name'] = _MI_PROTECTOR_NAME; |
27 | 27 | $modversion['description'] = constant('_MI_PROTECTOR_DESC'); |
28 | -$modversion['version'] = file_get_contents(__DIR__ . '/include/version.txt'); |
|
28 | +$modversion['version'] = file_get_contents(__DIR__.'/include/version.txt'); |
|
29 | 29 | $modversion['credits'] = "PEAK Corp."; |
30 | 30 | $modversion['author'] = "GIJ=CHECKMATE PEAK Corp.(http://www.peak.ne.jp/)"; |
31 | 31 | $modversion['help'] = 'page=help'; |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | |
78 | 78 | // Admin Templates |
79 | 79 | $modversion['templates'] = array( |
80 | - array( 'file' => 'protector_advisory.tpl', 'description' => '', 'type' => 'admin' ), |
|
81 | - array( 'file' => 'protector_prefix.tpl', 'description' => '', 'type' => 'admin' ), |
|
82 | - array( 'file' => 'protector_center.tpl', 'description' => '', 'type' => 'admin' ), |
|
80 | + array('file' => 'protector_advisory.tpl', 'description' => '', 'type' => 'admin'), |
|
81 | + array('file' => 'protector_prefix.tpl', 'description' => '', 'type' => 'admin'), |
|
82 | + array('file' => 'protector_center.tpl', 'description' => '', 'type' => 'admin'), |
|
83 | 83 | ); |
84 | 84 | |
85 | 85 | /* |
@@ -28,7 +28,7 @@ |
||
28 | 28 | if ($protector->ip_matched_info) { |
29 | 29 | printf(_MD_PROTECTOR_FMT_JAILINFO, date(_MD_PROTECTOR_FMT_JAILTIME, $protector->ip_matched_info)); |
30 | 30 | } |
31 | - error_log('Protector: badip ' . @$_SERVER['REMOTE_ADDR'], 0); |
|
31 | + error_log('Protector: badip '.@$_SERVER['REMOTE_ADDR'], 0); |
|
32 | 32 | exit; |
33 | 33 | } |
34 | 34 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | { |
28 | 28 | function execute() |
29 | 29 | { |
30 | - header('Location: ' . PROTECTOR_BADIP_REDIRECTION_URI); |
|
30 | + header('Location: '.PROTECTOR_BADIP_REDIRECTION_URI); |
|
31 | 31 | exit; |
32 | 32 | } |
33 | 33 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | header('Retry-After: 600'); |
28 | 28 | |
29 | 29 | echo _MD_PROTECTOR_BANDWIDTHLIMITED; |
30 | - error_log('Protector: bwlimit ' . @$_SERVER['REMOTE_ADDR'], 0); |
|
30 | + error_log('Protector: bwlimit '.@$_SERVER['REMOTE_ADDR'], 0); |
|
31 | 31 | exit; |
32 | 32 | } |
33 | 33 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $rev_ip = implode('.', array_reverse(explode('.', @$_SERVER['REMOTE_ADDR']))); |
40 | 40 | |
41 | 41 | foreach ($rbls as $rbl) { |
42 | - $host = $rev_ip . '.' . $rbl; |
|
42 | + $host = $rev_ip.'.'.$rbl; |
|
43 | 43 | if (gethostbyname($host) != $host) { |
44 | 44 | $this->protector->message .= "DENY by $rbl\n"; |
45 | 45 | $uid = $xoops->isUser() ? $xoops->user->getVar('uid') : 0; |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | // http:bl servers (don't enable too many servers) |
32 | 32 | $rbls = array( |
33 | - 'http:BL' => PROTECTOR_HTTPBL_KEY . '.%s.dnsbl.httpbl.org', |
|
33 | + 'http:BL' => PROTECTOR_HTTPBL_KEY.'.%s.dnsbl.httpbl.org', |
|
34 | 34 | ); |
35 | 35 | |
36 | 36 | $rev_ip = implode('.', array_reverse(explode('.', @$_SERVER['REMOTE_ADDR']))); |