GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( e39801...b79b58 )
by Marco
03:51
created
result.php 2 patches
Braces   +25 added lines, -15 removed lines patch added patch discarded remove patch
@@ -5,31 +5,38 @@  discard block
 block discarded – undo
5 5
 $net = new \dautkom\ipv4\IPv4();
6 6
 
7 7
 $_ = $_POST['genere'];
8
-if ( ($tables["$_"]['field']=='email') AND ($_POST['Value']!='ALL') )
8
+if ( ($tables["$_"]['field']=='email') AND ($_POST['Value']!='ALL') ) {
9 9
 	if (!(filter_var($_POST['Value'], FILTER_VALIDATE_EMAIL)))
10 10
 		exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid email address.</pre>');
11
+}
11 12
 
12
-if ( ($tables["$_"]['field']=='domain') AND ($_POST['Value']!='ALL') )
13
+if ( ($tables["$_"]['field']=='domain') AND ($_POST['Value']!='ALL') ) {
13 14
         if (!(filter_var(gethostbyname($_POST['Value']), FILTER_VALIDATE_IP)))
14 15
 		exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid domain.</pre>');
16
+}
15 17
 
16
-if ( ($tables["$_"]['field']=='ip')  AND ($_POST['Value']!='ALL') )
18
+if ( ($tables["$_"]['field']=='ip')  AND ($_POST['Value']!='ALL') ) {
17 19
 	if (!(filter_var($_POST['Value'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)))
18 20
 		exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid IP address.</pre>');
21
+}
19 22
 	
20 23
 if ( ($tables["$_"]['field']=='network') AND ($_POST['Value']!='ALL') ) {
21 24
 	$value = explode('/',$_POST['Value']);
22
-	if (count($value) != 2)
23
-		exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid Network/Netmask pair.</pre>');
24
-	if (!$net->address($value[0])->mask($value[1])->isValid(1))
25
-		exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid Network/Netmask.</pre>');
26
-}
25
+	if (count($value) != 2) {
26
+			exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid Network/Netmask pair.</pre>');
27
+	}
28
+	if (!$net->address($value[0])->mask($value[1])->isValid(1)) {
29
+			exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid Network/Netmask.</pre>');
30
+	}
31
+	}
27 32
 
28 33
 if ( ($tables["$_"]['field']=='username') AND ($_POST['Value']!='ALL') ) {
29
-        if ( preg_match( '/[^\x20-\x7f]/', $_POST['Value']) )
30
-                exit('<pre>&lt;'.$_POST['Value'].'&gt; contains NON ASCII chars.</pre>');
31
-	if ( preg_match( '/[$~=#*+%,{}()\/\\<>;:\"`\[\]&?\s]/', $_POST['Value']) )
32
-		exit('<pre>&lt;'.$_POST['Value'].'&gt; contains invalid ASCII chars.</pre>');
34
+        if ( preg_match( '/[^\x20-\x7f]/', $_POST['Value']) ) {
35
+                        exit('<pre>&lt;'.$_POST['Value'].'&gt; contains NON ASCII chars.</pre>');
36
+        }
37
+	if ( preg_match( '/[$~=#*+%,{}()\/\\<>;:\"`\[\]&?\s]/', $_POST['Value']) ) {
38
+			exit('<pre>&lt;'.$_POST['Value'].'&gt; contains invalid ASCII chars.</pre>');
39
+	}
33 40
 	switch ( $_POST['Value'] ) {
34 41
 		case 'anonymous':
35 42
 		case 'anybody':
@@ -40,9 +47,12 @@  discard block
 block discarded – undo
40 47
 }	
41 48
 
42 49
 if (empty($_GET)) {
43
-	if ($tables["$_"]['bl']) print "<p><i>$_</i> is a blocklist of ".$tables["$_"]['field'].'.</p>';
44
-	else print "<p><i>$_</i> is a whitelist of ".$tables["$_"]['field'].'.</p>';
45
-}
50
+	if ($tables["$_"]['bl']) {
51
+		print "<p><i>$_</i> is a blocklist of ".$tables["$_"]['field'].'.</p>';
52
+	} else {
53
+		print "<p><i>$_</i> is a whitelist of ".$tables["$_"]['field'].'.</p>';
54
+	}
55
+	}
46 56
 
47 57
 openlog($tag, LOG_PID, $fac);
48 58
 $user = username();
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -5,36 +5,36 @@  discard block
 block discarded – undo
5 5
 $net = new \dautkom\ipv4\IPv4();
6 6
 
7 7
 $_ = $_POST['genere'];
8
-if ( ($tables["$_"]['field']=='email') AND ($_POST['Value']!='ALL') )
8
+if (($tables["$_"]['field'] == 'email') AND ($_POST['Value'] != 'ALL'))
9 9
 	if (!(filter_var($_POST['Value'], FILTER_VALIDATE_EMAIL)))
10 10
 		exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid email address.</pre>');
11 11
 
12
-if ( ($tables["$_"]['field']=='domain') AND ($_POST['Value']!='ALL') )
12
+if (($tables["$_"]['field'] == 'domain') AND ($_POST['Value'] != 'ALL'))
13 13
         if (!(filter_var(gethostbyname($_POST['Value']), FILTER_VALIDATE_IP)))
14 14
 		exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid domain.</pre>');
15 15
 
16
-if ( ($tables["$_"]['field']=='ip')  AND ($_POST['Value']!='ALL') )
16
+if (($tables["$_"]['field'] == 'ip') AND ($_POST['Value'] != 'ALL'))
17 17
 	if (!(filter_var($_POST['Value'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)))
18 18
 		exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid IP address.</pre>');
19 19
 	
20
-if ( ($tables["$_"]['field']=='network') AND ($_POST['Value']!='ALL') ) {
21
-	$value = explode('/',$_POST['Value']);
20
+if (($tables["$_"]['field'] == 'network') AND ($_POST['Value'] != 'ALL')) {
21
+	$value = explode('/', $_POST['Value']);
22 22
 	if (count($value) != 2)
23 23
 		exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid Network/Netmask pair.</pre>');
24 24
 	if (!$net->address($value[0])->mask($value[1])->isValid(1))
25 25
 		exit ('<pre>&lt;'.$_POST['Value'].'&gt; is NOT a valid Network/Netmask.</pre>');
26 26
 }
27 27
 
28
-if ( ($tables["$_"]['field']=='username') AND ($_POST['Value']!='ALL') ) {
29
-        if ( preg_match( '/[^\x20-\x7f]/', $_POST['Value']) )
28
+if (($tables["$_"]['field'] == 'username') AND ($_POST['Value'] != 'ALL')) {
29
+        if (preg_match('/[^\x20-\x7f]/', $_POST['Value']))
30 30
                 exit('<pre>&lt;'.$_POST['Value'].'&gt; contains NON ASCII chars.</pre>');
31
-	if ( preg_match( '/[$~=#*+%,{}()\/\\<>;:\"`\[\]&?\s]/', $_POST['Value']) )
31
+	if (preg_match('/[$~=#*+%,{}()\/\\<>;:\"`\[\]&?\s]/', $_POST['Value']))
32 32
 		exit('<pre>&lt;'.$_POST['Value'].'&gt; contains invalid ASCII chars.</pre>');
33
-	switch ( $_POST['Value'] ) {
33
+	switch ($_POST['Value']) {
34 34
 		case 'anonymous':
35 35
 		case 'anybody':
36 36
 		case 'anyone':
37
-		case ( preg_match( '/^anyone@/',$_POST['Value']) == TRUE ):
37
+		case (preg_match('/^anyone@/', $_POST['Value']) == TRUE):
38 38
 			exit('<pre>&lt;'.$_POST['Value'].'&gt; is not allowed.</pre>');
39 39
 	}
40 40
 }	
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
 
50 50
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
51 51
 if ($mysqli->connect_error) {
52
-            syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') '
52
+            syslog(LOG_EMERG, $user.': Connect Error ('.$mysqli->connect_errno.') '
53 53
                     . $mysqli->connect_error);
54
-            exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '
54
+            exit ($user.': Connect Error ('.$mysqli->connect_errno.') '
55 55
                     . $mysqli->connect_error);
56 56
 }
57 57
 
58
-syslog(LOG_INFO, $user.': Successfully mysql connected to ' . $mysqli->host_info) ;
59
-rlookup($mysqli,username(),$admins,$_POST['Value'],$_POST['genere'],$tables);
58
+syslog(LOG_INFO, $user.': Successfully mysql connected to '.$mysqli->host_info);
59
+rlookup($mysqli, username(), $admins, $_POST['Value'], $_POST['genere'], $tables);
60 60
 $mysqli->close();
61 61
 closelog();
62 62
 ?>
Please login to merge, or discard this patch.
index.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@  discard block
 block discarded – undo
14 14
 require_once('function.php');
15 15
 
16 16
 
17
-if ( $require_auth ) if ( username() == 'unknown' ) exit ("<p>You MUST configure your server to use authentication.</p>");
17
+if ($require_auth) if (username() == 'unknown') exit ("<p>You MUST configure your server to use authentication.</p>");
18 18
 
19 19
 
20
-if ( $imapListActive )
20
+if ($imapListActive)
21 21
 	print ' <p style="text-align: right"><a href="/spamreport" target="_new">SPAM Learn Observer</a></p>';
22 22
 
23 23
 print <<<END
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 END;
27 27
 
28 28
 
29
-$option=NULL;
29
+$option = NULL;
30 30
 $desc = array_keys($tables);
31 31
 foreach ($desc as $description) { 
32
-	$disabled = $tables["$description"]['active']==TRUE ? '' : ' disabled';  
32
+	$disabled = $tables["$description"]['active'] == TRUE ? '' : ' disabled';  
33 33
 	$option .= '<option value="'.$description."\"$disabled>$description</option>";
34 34
 	}
35 35
 
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,11 +14,14 @@
 block discarded – undo
14 14
 require_once('function.php');
15 15
 
16 16
 
17
-if ( $require_auth ) if ( username() == 'unknown' ) exit ("<p>You MUST configure your server to use authentication.</p>");
17
+if ( $require_auth ) {
18
+	if ( username() == 'unknown' ) exit ("<p>You MUST configure your server to use authentication.</p>");
19
+}
18 20
 
19 21
 
20
-if ( $imapListActive )
22
+if ( $imapListActive ) {
21 23
 	print ' <p style="text-align: right"><a href="/spamreport" target="_new">SPAM Learn Observer</a></p>';
24
+}
22 25
 
23 26
 print <<<END
24 27
 <form name="check" action="result.php" onSubmit="xmlhttpPost('result.php', 'check', 'Risultato', '<img src=\'/include/pleasewait.gif\'>'); return false;" enctype="text/plain" method="post" target="_self">
Please login to merge, or discard this patch.
list.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@
 block discarded – undo
1 1
 <?php
2 2
 require_once('config.php');
3 3
 require_once('function.php');
4
-$typedesc=$_POST['type'];
4
+$typedesc = $_POST['type'];
5 5
 $type = $tables["$typedesc"]['field'];
6 6
 $table = $tables["$typedesc"]['name'];
7 7
 
8 8
 openlog($tag, LOG_PID, $fac);
9 9
 if (empty($_POST['reason'])) die ("<p>Please, specify a reason!</p>");
10
-if (preg_match( '/[^\x20-\x7f]/', $_POST['reason']))
11
-	exit('<p>ERROR: &lt;'.htmlentities($_POST['reason'],ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'&gt; contains NON ASCII chars.</p>');
10
+if (preg_match('/[^\x20-\x7f]/', $_POST['reason']))
11
+	exit('<p>ERROR: &lt;'.htmlentities($_POST['reason'], ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'&gt; contains NON ASCII chars.</p>');
12 12
 $user = username();
13 13
 
14 14
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
15 15
         if ($mysqli->connect_error) {
16
-            syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') '
16
+            syslog(LOG_EMERG, $user.': Connect Error ('.$mysqli->connect_errno.') '
17 17
                     . $mysqli->connect_error);
18
-            die($user.': Connect Error (' . $mysqli->connect_errno . ') '
18
+            die($user.': Connect Error ('.$mysqli->connect_errno.') '
19 19
                     . $mysqli->connect_error);
20 20
         }
21
-syslog (LOG_INFO, $user.': Successfully connected to ' . $mysqli->host_info );
21
+syslog(LOG_INFO, $user.': Successfully connected to '.$mysqli->host_info);
22 22
 
23
-if (addtolist ($mysqli,username(),$_POST['value'],$type,$table,$_POST['unit'],$_POST['quantity'],$_POST['reason']))
23
+if (addtolist($mysqli, username(), $_POST['value'], $type, $table, $_POST['unit'], $_POST['quantity'], $_POST['reason']))
24 24
  print 'OK '.$_POST["type"].' &lt;'.$_POST['value'].'&gt; first time listed for '.$_POST['quantity'].$_POST['unit'].'.';
25 25
 else
26 26
  print 'List operation ERROR; check log.';
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,9 +6,12 @@  discard block
 block discarded – undo
6 6
 $table = $tables["$typedesc"]['name'];
7 7
 
8 8
 openlog($tag, LOG_PID, $fac);
9
-if (empty($_POST['reason'])) die ("<p>Please, specify a reason!</p>");
10
-if (preg_match( '/[^\x20-\x7f]/', $_POST['reason']))
9
+if (empty($_POST['reason'])) {
10
+	die ("<p>Please, specify a reason!</p>");
11
+}
12
+if (preg_match( '/[^\x20-\x7f]/', $_POST['reason'])) {
11 13
 	exit('<p>ERROR: &lt;'.htmlentities($_POST['reason'],ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'&gt; contains NON ASCII chars.</p>');
14
+}
12 15
 $user = username();
13 16
 
14 17
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
@@ -20,10 +23,11 @@  discard block
 block discarded – undo
20 23
         }
21 24
 syslog (LOG_INFO, $user.': Successfully connected to ' . $mysqli->host_info );
22 25
 
23
-if (addtolist ($mysqli,username(),$_POST['value'],$type,$table,$_POST['unit'],$_POST['quantity'],$_POST['reason']))
26
+if (addtolist ($mysqli,username(),$_POST['value'],$type,$table,$_POST['unit'],$_POST['quantity'],$_POST['reason'])) {
24 27
  print 'OK '.$_POST["type"].' &lt;'.$_POST['value'].'&gt; first time listed for '.$_POST['quantity'].$_POST['unit'].'.';
25
-else
28
+} else {
26 29
  print 'List operation ERROR; check log.';
30
+}
27 31
 $mysqli->close();
28 32
 closelog();
29 33
 ?>
Please login to merge, or discard this patch.
relist.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 require_once('config.php');
3 3
 require_once('function.php');
4
-$typedesc=$_POST['type'];
4
+$typedesc = $_POST['type'];
5 5
         $type = $tables["$typedesc"]['field'];
6 6
         $table = $tables["$typedesc"]['name'];
7 7
 ?>
@@ -9,21 +9,21 @@  discard block
 block discarded – undo
9 9
 <?php
10 10
 openlog($tag, LOG_PID, $fac);
11 11
 if (empty($_POST['reason'])) die ("Specify a reason, please!</td>");
12
-if (preg_match( '/[^\x20-\x7f]/', $_POST['reason']))
13
-        exit('ERROR: &lt;'.htmlentities($_POST['reason'],ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'&gt; contains NON ASCII chars.</td>');
12
+if (preg_match('/[^\x20-\x7f]/', $_POST['reason']))
13
+        exit('ERROR: &lt;'.htmlentities($_POST['reason'], ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'&gt; contains NON ASCII chars.</td>');
14 14
 $user = username();
15 15
 
16 16
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
17 17
 if ($mysqli->connect_error) {
18
-	syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') '
18
+	syslog(LOG_EMERG, $user.': Connect Error ('.$mysqli->connect_errno.') '
19 19
         	. $mysqli->connect_error);
20
-            exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '
20
+            exit ($user.': Connect Error ('.$mysqli->connect_errno.') '
21 21
                     . $mysqli->connect_error);
22 22
 }
23
-syslog(LOG_INFO, $user.': Successfully connected to ' . $mysqli->host_info) ;
23
+syslog(LOG_INFO, $user.': Successfully connected to '.$mysqli->host_info);
24 24
 
25
-if (isFull($mysqli,$typedesc,$tables)) die("ERROR in relist: ".htmlspecialchars("$typedesc has reached maximum value of ".$tables["$typedesc"]['limit'].' listed items.') );
26
-if (relist ($mysqli,username(),$_POST['value'],$type,$table,$_POST['unit'],$_POST['quantity'],$_POST['reason']))
25
+if (isFull($mysqli, $typedesc, $tables)) die("ERROR in relist: ".htmlspecialchars("$typedesc has reached maximum value of ".$tables["$typedesc"]['limit'].' listed items.'));
26
+if (relist($mysqli, username(), $_POST['value'], $type, $table, $_POST['unit'], $_POST['quantity'], $_POST['reason']))
27 27
  print 'OK '.$_POST["type"].' &lt;'.$_POST['value'].'&gt; relisted for '.$_POST['quantity'].$_POST['unit'];
28 28
 else
29 29
  print 'ERROR in relist; check log';
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,9 +8,12 @@  discard block
 block discarded – undo
8 8
 <td colspan="9" style="text-align: center">
9 9
 <?php
10 10
 openlog($tag, LOG_PID, $fac);
11
-if (empty($_POST['reason'])) die ("Specify a reason, please!</td>");
12
-if (preg_match( '/[^\x20-\x7f]/', $_POST['reason']))
11
+if (empty($_POST['reason'])) {
12
+	die ("Specify a reason, please!</td>");
13
+}
14
+if (preg_match( '/[^\x20-\x7f]/', $_POST['reason'])) {
13 15
         exit('ERROR: &lt;'.htmlentities($_POST['reason'],ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'&gt; contains NON ASCII chars.</td>');
16
+}
14 17
 $user = username();
15 18
 
16 19
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
@@ -22,11 +25,14 @@  discard block
 block discarded – undo
22 25
 }
23 26
 syslog(LOG_INFO, $user.': Successfully connected to ' . $mysqli->host_info) ;
24 27
 
25
-if (isFull($mysqli,$typedesc,$tables)) die("ERROR in relist: ".htmlspecialchars("$typedesc has reached maximum value of ".$tables["$typedesc"]['limit'].' listed items.') );
26
-if (relist ($mysqli,username(),$_POST['value'],$type,$table,$_POST['unit'],$_POST['quantity'],$_POST['reason']))
28
+if (isFull($mysqli,$typedesc,$tables)) {
29
+	die("ERROR in relist: ".htmlspecialchars("$typedesc has reached maximum value of ".$tables["$typedesc"]['limit'].' listed items.') );
30
+}
31
+if (relist ($mysqli,username(),$_POST['value'],$type,$table,$_POST['unit'],$_POST['quantity'],$_POST['reason'])) {
27 32
  print 'OK '.$_POST["type"].' &lt;'.$_POST['value'].'&gt; relisted for '.$_POST['quantity'].$_POST['unit'];
28
-else
33
+} else {
29 34
  print 'ERROR in relist; check log';
35
+}
30 36
 $mysqli->close();
31 37
 closelog();
32 38
 print '</td>';
Please login to merge, or discard this patch.
listForm.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2
-if (in_array($user,array_keys(array_filter($adm)))) $extopt = '<option value="MONTH">MONTHS</option><option value="YEAR">YEARS</option>';
2
+if (in_array($user, array_keys(array_filter($adm)))) $extopt = '<option value="MONTH">MONTHS</option><option value="YEAR">YEARS</option>';
3 3
 else $extopt = NULL;
4 4
 ?>
5 5
 <form style="margin:0; text-align: left;" name='ListButton<?php echo $type ?>' enctype="text/plain" method="post" target="_self" action="list.php"  onSubmit="xmlhttpPost('list.php', 'ListButton<?php echo $type ?>', 'Risultato', '<img src=\'/include/pleasewait.gif\'>'); return false;" />
6 6
 
7 7
 		List <?php  echo $typedesc.' &lt;'.$value.'&gt;'; ?> for <input name="type" type="hidden" value="<?php echo $typedesc; ?>" /><input name="value" type="hidden" class="input_text" value="<?php echo $value; ?>" />
8
-		<select name="quantity" class="input_text" size="1"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="20">20</option></select><select class="input_text" name="unit" size="1"><option value="DAY">DAYS</option><option value="WEEK">WEEKS</option><?php echo $extopt;?></select>  Reason:<input maxlength="128" name="reason" size="30" type="text" class="input_text" /><input name="List" class="button" id="bwarn" type="submit" value="List"/></form>
8
+		<select name="quantity" class="input_text" size="1"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="20">20</option></select><select class="input_text" name="unit" size="1"><option value="DAY">DAYS</option><option value="WEEK">WEEKS</option><?php echo $extopt; ?></select>  Reason:<input maxlength="128" name="reason" size="30" type="text" class="input_text" /><input name="List" class="button" id="bwarn" type="submit" value="List"/></form>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,9 @@
 block discarded – undo
1 1
 <?php
2
-if (in_array($user,array_keys(array_filter($adm)))) $extopt = '<option value="MONTH">MONTHS</option><option value="YEAR">YEARS</option>';
3
-else $extopt = NULL;
2
+if (in_array($user,array_keys(array_filter($adm)))) {
3
+	$extopt = '<option value="MONTH">MONTHS</option><option value="YEAR">YEARS</option>';
4
+} else {
5
+	$extopt = NULL;
6
+}
4 7
 ?>
5 8
 <form style="margin:0; text-align: left;" name='ListButton<?php echo $type ?>' enctype="text/plain" method="post" target="_self" action="list.php"  onSubmit="xmlhttpPost('list.php', 'ListButton<?php echo $type ?>', 'Risultato', '<img src=\'/include/pleasewait.gif\'>'); return false;" />
6 9
 
Please login to merge, or discard this patch.
contrib/splunk/listFromSplunk.php 2 patches
Braces   +21 added lines, -12 removed lines patch added patch discarded remove patch
@@ -12,8 +12,12 @@  discard block
 block discarded – undo
12 12
 
13 13
 $shortopts = "c:";  // Required value
14 14
 $options = getopt($shortopts);
15
-if ( !isset($options['c']) ) exit ("\n\nUSAGE: ${_SERVER['SCRIPT_NAME']} -c <file.conf>\n\n");
16
-if ( !file_exists(dirname(__FILE__) . '/' . $options['c']) ) exit ("\n\nThe file <".$options['c']."> doesn't exists.\nExiting...\n\n");
15
+if ( !isset($options['c']) ) {
16
+	exit ("\n\nUSAGE: ${_SERVER['SCRIPT_NAME']} -c <file.conf>\n\n");
17
+}
18
+if ( !file_exists(dirname(__FILE__) . '/' . $options['c']) ) {
19
+	exit ("\n\nThe file <".$options['c']."> doesn't exists.\nExiting...\n\n");
20
+}
17 21
 
18 22
 /************** Start of conf ************************/
19 23
 require_once('config.php');
@@ -77,14 +81,18 @@  discard block
 block discarded – undo
77 81
         $row = -1;
78 82
         while (($data = fgetcsv($handle, 500, ',')) !== FALSE) {
79 83
                 $row++;
80
-                if ($row == 0) continue; /* Skip heading line */
84
+                if ($row == 0) {
85
+                	continue;
86
+                }
87
+                /* Skip heading line */
81 88
                 $thisVal = $data[1];
82 89
                 unset($data[1]);
83 90
                 $data = array_values($data);
84
-                if ( !in_array($thisVal,array_keys($tolist))  )
85
-                        $tolist["$thisVal"] = $data;
86
-                else if ($data[3]>$tolist[$thisVal][3])
87
-                        $tolist["$thisVal"] = $data;
91
+                if ( !in_array($thisVal,array_keys($tolist))  ) {
92
+                                        $tolist["$thisVal"] = $data;
93
+                } else if ($data[3]>$tolist[$thisVal][3]) {
94
+                                        $tolist["$thisVal"] = $data;
95
+                }
88 96
         }
89 97
         fclose($handle);
90 98
 }
@@ -115,17 +123,18 @@  discard block
 block discarded – undo
115 123
                                 		$recip = emailToNotify($domainNotify_file,$domain);
116 124
                                 		$subject = sprintf('%s <%s> is now blocked because exceedes limits on outgoing emails',
117 125
 								$tables["$typedesc"]['field'], $value);
118
-                                		if (!empty($recip))
119
-                                        		if ( sendEmailWarn($tplfile,'[email protected]',$recip,
126
+                                		if (!empty($recip)) {
127
+                                		                                        		if ( sendEmailWarn($tplfile,'[email protected]',$recip,
120 128
 								$subject,$value,"$quantity $unit",$reason) )
121 129
                                                 		syslog(LOG_INFO, "$user: \"$recip\" was notified about the \"$value\" abuse.");
130
+                                		}
131
+					} else {
132
+						syslog(LOG_ERR,"$user: <$domain> contains the '@' char. Notification cannot be sent.");
122 133
 					}
123
-					else syslog(LOG_ERR,"$user: <$domain> contains the '@' char. Notification cannot be sent.");
124 134
 				}
125 135
                         }
126 136
                 }
127
-        }
128
-	else {
137
+        } else {
129 138
 		$reason .= " But it has NOT been listed because it doesn't apply to the trigger condition.";
130 139
 		syslog (LOG_INFO, "$user: ".$reason);
131 140
 	}
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -10,32 +10,32 @@  discard block
 block discarded – undo
10 10
 #
11 11
 */
12 12
 
13
-$shortopts = "c:";  // Required value
13
+$shortopts = "c:"; // Required value
14 14
 $options = getopt($shortopts);
15
-if ( !isset($options['c']) ) exit ("\n\nUSAGE: ${_SERVER['SCRIPT_NAME']} -c <file.conf>\n\n");
16
-if ( !file_exists(dirname(__FILE__) . '/' . $options['c']) ) exit ("\n\nThe file <".$options['c']."> doesn't exists.\nExiting...\n\n");
15
+if (!isset($options['c'])) exit ("\n\nUSAGE: ${_SERVER['SCRIPT_NAME']} -c <file.conf>\n\n");
16
+if (!file_exists(dirname(__FILE__).'/'.$options['c'])) exit ("\n\nThe file <".$options['c']."> doesn't exists.\nExiting...\n\n");
17 17
 
18 18
 /************** Start of conf ************************/
19 19
 require_once('config.php');
20 20
 
21 21
  /* Syslog */
22
-$tag            .= 'SplunkLister';
22
+$tag .= 'SplunkLister';
23 23
 
24
-$conf = parse_ini_file( dirname(__FILE__) . '/' . $options['c'] );
24
+$conf = parse_ini_file(dirname(__FILE__).'/'.$options['c']);
25 25
 
26 26
  /* Splunk inherited parameters */
27
-$threshold = $conf['threshold'];         /* Threshold value on trigger condition; the same which engage the alert */
28
-$splfile = $argv[10];    		/* Full path of result Splunk file, see at
27
+$threshold = $conf['threshold']; /* Threshold value on trigger condition; the same which engage the alert */
28
+$splfile = $argv[10]; /* Full path of result Splunk file, see at
29 29
                            		   http://docs.splunk.com/Documentation/Splunk/6.2.2/Alert/Configuringscriptedalerts
30 30
                            		   It is 8+2 because of -c <conf> */
31 31
  /* Blacklist name */
32
-$typedesc  = $conf['typedesc'];
32
+$typedesc = $conf['typedesc'];
33 33
 
34 34
  /* How long to list's parameters */
35
-$unit = $conf['unit'];          /* MySQL language ;) */
35
+$unit = $conf['unit']; /* MySQL language ;) */
36 36
 
37 37
  /* Syslog */
38
-$tag            .= $conf['tag'];
38
+$tag .= $conf['tag'];
39 39
 
40 40
 /************** End of conf *************************/
41 41
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 $user = 'Splunk';
47 47
 
48 48
 /* check you select a blocklist */
49
-if ( !$tables["$typedesc"]['bl'] ) {
50
-        syslog(LOG_EMERG,"$user: <$typedesc> is not a blocklist. Are you stupid? Do you want to whitelist a spammer? I refuse to continue.");
49
+if (!$tables["$typedesc"]['bl']) {
50
+        syslog(LOG_EMERG, "$user: <$typedesc> is not a blocklist. Are you stupid? Do you want to whitelist a spammer? I refuse to continue.");
51 51
         exit (254);
52 52
 }
53 53
 
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 
68 68
 $tolist = array();
69 69
 
70
-if ( !file_exists($splfile) ) {
71
-        syslog(LOG_ERR,"$user: File <$splfile> not found! Exit.");
70
+if (!file_exists($splfile)) {
71
+        syslog(LOG_ERR, "$user: File <$splfile> not found! Exit.");
72 72
         exit (254);
73 73
 }
74 74
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                 $thisVal = $data[1];
81 81
                 unset($data[1]);
82 82
                 $data = array_values($data);
83
-                if ( !in_array($thisVal,array_keys($tolist))  )
83
+                if (!in_array($thisVal, array_keys($tolist)))
84 84
                         $tolist["$thisVal"] = $data;
85 85
                 else if ($data[3]>$tolist[$thisVal][3])
86 86
                         $tolist["$thisVal"] = $data;
@@ -92,47 +92,47 @@  discard block
 block discarded – undo
92 92
 
93 93
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
94 94
 if ($mysqli->connect_error) {
95
-        syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') '
95
+        syslog(LOG_EMERG, $user.': Connect Error ('.$mysqli->connect_errno.') '
96 96
         . $mysqli->connect_error);
97 97
         exit (254);
98 98
 
99 99
 }
100 100
 
101
-syslog(LOG_INFO, $user.': Successfully mysql connected to ' . $mysqli->host_info) ;
101
+syslog(LOG_INFO, $user.': Successfully mysql connected to '.$mysqli->host_info);
102 102
 
103
-foreach ( array_keys($tolist) as $value) {
103
+foreach (array_keys($tolist) as $value) {
104 104
 	$quantity = $conf['quantity'];
105 105
 	$reason = 'On ['.$tolist["$value"][0]."] <$value> sent ".$tolist["$value"][1].' messages to '.$tolist["$value"][2].' recipients.';
106
-        if ( $tolist["$value"][3] >= $threshold ) {
107
-                if ( searchAndList ($mysqli,$user,$tables,$typedesc,$value,$unit,$quantity,$reason) ) {
108
-                        syslog (LOG_INFO, "$user: ".'Listing reason: '.$reason);
106
+        if ($tolist["$value"][3]>=$threshold) {
107
+                if (searchAndList($mysqli, $user, $tables, $typedesc, $value, $unit, $quantity, $reason)) {
108
+                        syslog(LOG_INFO, "$user: ".'Listing reason: '.$reason);
109 109
                         /* Send a email to domain admin if you list an email */
110
-                        if ( ( $tables["$typedesc"]['field'] == 'email' ) OR ( $tables["$typedesc"]['field'] == 'username' ) ) {
110
+                        if (($tables["$typedesc"]['field'] == 'email') OR ($tables["$typedesc"]['field'] == 'username')) {
111 111
 				/* Sometime uid are in the form of <user>@<domain> ... */
112
-				if ( strpos($value, '@') !== FALSE ) {
113
-                                	$domain = array_pop(explode('@',$value,2));
114
-					if ( strpos($domain, '@') === FALSE ) {
115
-                                		$recip = emailToNotify($domainNotify_file,$domain);
112
+				if (strpos($value, '@') !== FALSE) {
113
+                                	$domain = array_pop(explode('@', $value, 2));
114
+					if (strpos($domain, '@') === FALSE) {
115
+                                		$recip = emailToNotify($domainNotify_file, $domain);
116 116
                                 		$subject = sprintf('%s <%s> is now blocked because exceedes limits on outgoing emails',
117 117
 								$tables["$typedesc"]['field'], $value);
118 118
                                 		if (!empty($recip))
119
-                                        		if ( sendEmailWarn($tplfile,'[email protected]',$recip,
120
-								$subject,$value,"$quantity $unit",$reason) )
119
+                                        		if (sendEmailWarn($tplfile, '[email protected]', $recip,
120
+								$subject, $value, "$quantity $unit", $reason))
121 121
                                                 		syslog(LOG_INFO, "$user: \"$recip\" was notified about the \"$value\" abuse.");
122 122
 					}
123
-					else syslog(LOG_ERR,"$user: <$domain> contains the '@' char. Notification cannot be sent.");
123
+					else syslog(LOG_ERR, "$user: <$domain> contains the '@' char. Notification cannot be sent.");
124 124
 				}
125 125
                         }
126 126
                 }
127 127
         }
128 128
 	else {
129 129
 		$reason .= " But it has NOT been listed because it doesn't apply to the trigger condition.";
130
-		syslog (LOG_INFO, "$user: ".$reason);
130
+		syslog(LOG_INFO, "$user: ".$reason);
131 131
 	}
132 132
 }
133 133
 
134 134
 /* Close connection */
135
-syslog (LOG_INFO, "$user: ".'Successfully end of session.');
135
+syslog(LOG_INFO, "$user: ".'Successfully end of session.');
136 136
 $mysqli->close();
137 137
 closelog();
138 138
 
Please login to merge, or discard this patch.
contrib/rbldns/exportdns.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -19,74 +19,74 @@  discard block
 block discarded – undo
19 19
 $user = username();
20 20
 
21 21
 $opts = getopt('f:t:');
22
-if ( isset($opts['f']) ) {
22
+if (isset($opts['f'])) {
23 23
         $filetemplate = $opts['f'];
24
-} else {
24
+}else {
25 25
 	print "\nNo option for '-f' given.\n";
26
-        exit ( usage() );
26
+        exit (usage());
27 27
 }
28 28
 
29
-if ( isset($opts['t']) ) {
29
+if (isset($opts['t'])) {
30 30
         $tablename = $opts['t'];
31
-} else {
31
+}else {
32 32
 	print "\nNo option for '-t' given.\n";
33
-        exit ( usage() );
33
+        exit (usage());
34 34
 }
35 35
 
36
-if ( ($typedescN = array_search( $tablename, array_column($tables, 'name'))) === FALSE ) {
36
+if (($typedescN = array_search($tablename, array_column($tables, 'name'))) === FALSE) {
37 37
         print "\nDB <$tablename> doesn't exist!\n";
38
-        syslog (LOG_EMERG, "$user: DB <$tablename> doesn't exist!");
39
-        exit ( usage() );
38
+        syslog(LOG_EMERG, "$user: DB <$tablename> doesn't exist!");
39
+        exit (usage());
40 40
 }
41 41
 $typedesc = array_keys($tables)[$typedescN];
42 42
 
43
-if (! file_exists($filetemplate) ) {
43
+if (!file_exists($filetemplate)) {
44 44
         print "\nFile <$filetemplate> doesn't exists!\n";
45
-	syslog (LOG_EMERG, "$user: File <$filetemplate> doesn't exist!");
46
-        exit ( usage() );
45
+	syslog(LOG_EMERG, "$user: File <$filetemplate> doesn't exist!");
46
+        exit (usage());
47 47
 }
48 48
 
49
-if (! in_array( $typedesc, array_keys($tables) ) ) {
49
+if (!in_array($typedesc, array_keys($tables))) {
50 50
 	print "\nUnknown list <$typedesc>. Please provide an existent list name.\n";
51
-	exit ( usage() );
51
+	exit (usage());
52 52
 }
53 53
 
54
-if (! $tables["$typedesc"]['active'] ) {
54
+if (!$tables["$typedesc"]['active']) {
55 55
 	print "\nList <$typedesc> is not active. Please provide an active list name.\n";
56
-        exit ( usage() );
56
+        exit (usage());
57 57
 }
58 58
 
59 59
 
60 60
 
61
-$now=new DateTime('NOW');
61
+$now = new DateTime('NOW');
62 62
 $timeunix = $now->format('U');
63 63
 $dateRFC822 = $now->format('r');
64 64
 $year = $now->format('Y');
65
-$rbltype= ($tables["$typedesc"]['bl']) ? 'Blocklist' : 'Whitelist';
65
+$rbltype = ($tables["$typedesc"]['bl']) ? 'Blocklist' : 'Whitelist';
66 66
 
67 67
 
68 68
 $tmpl = file_get_contents($filetemplate);
69
-$arr_tpl_vars = array('{rblname}','{rbltype}','{date822}','{year}','{unixtimestamp}','{rblname64}','{hostname}');
70
-$arr_tpl_data = array($typedesc,$rbltype,$dateRFC822,$year,$timeunix,base64_encode($typedesc),gethostname());
69
+$arr_tpl_vars = array('{rblname}', '{rbltype}', '{date822}', '{year}', '{unixtimestamp}', '{rblname64}', '{hostname}');
70
+$arr_tpl_data = array($typedesc, $rbltype, $dateRFC822, $year, $timeunix, base64_encode($typedesc), gethostname());
71 71
 $headerList = str_replace($arr_tpl_vars, $arr_tpl_data, $tmpl);
72 72
 
73 73
 
74 74
 $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport);
75 75
 if ($mysqli->connect_error) {
76
-            syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') '
76
+            syslog(LOG_EMERG, $user.': Connect Error ('.$mysqli->connect_errno.') '
77 77
                     . $mysqli->connect_error);
78
-            exit ($user.': Connect Error (' . $mysqli->connect_errno . ') '
78
+            exit ($user.': Connect Error ('.$mysqli->connect_errno.') '
79 79
                     . $mysqli->connect_error);
80 80
 }
81 81
 
82
-syslog(LOG_INFO, $user.': Successfully mysql connected to ' . $mysqli->host_info) ;
82
+syslog(LOG_INFO, $user.': Successfully mysql connected to '.$mysqli->host_info);
83 83
 
84
-$result = searchentry ($mysqli,'ALL',$tables["$typedesc"]);
84
+$result = searchentry($mysqli, 'ALL', $tables["$typedesc"]);
85 85
 if ($result->num_rows) {
86 86
 	$element = array();
87 87
 	while ($riga = $result->fetch_array(MYSQLI_ASSOC)) {
88 88
 		if (isListed($riga)) {
89
-			switch ( $tables["$typedesc"]['field'] ) {
89
+			switch ($tables["$typedesc"]['field']) {
90 90
                                   case 'ip':
91 91
                                         $element[] = long2ip($riga['ip']);
92 92
                                         break;
@@ -104,6 +104,6 @@  discard block
 block discarded – undo
104 104
 $mysqli->close();
105 105
 
106 106
 /* Print to file */
107
-file_put_contents( $tables["$typedesc"]['name'], $headerList . implode("\n",$element) );
107
+file_put_contents($tables["$typedesc"]['name'], $headerList.implode("\n", $element));
108 108
 closelog();
109 109
 ?>
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,8 +1,9 @@
 block discarded – undo
1 1
 #!/usr/bin/php
2 2
 <?php
3 3
 
4
-if (PHP_SAPI != "cli")
4
+if (PHP_SAPI != "cli") {
5 5
     exit;
6
+}
6 7
 
7 8
 $home = '/var/www/html/RBL';
8 9
 require_once($home.'/config.php');
Please login to merge, or discard this patch.
contrib/ipImap/report/result.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@
 block discarded – undo
5 5
 
6 6
 
7 7
 print '<p>List of available Reports for '.date('l, d M Y', strtotime($theDate)).'</p><ul>';
8
-foreach($dir as $file)
8
+foreach ($dir as $file)
9 9
 {
10
-        if ( basename($file) != basename(__FILE__) ) {
10
+        if (basename($file) != basename(__FILE__)) {
11 11
 		$modalDiv = 'openModal'.basename($file);
12
-		echo '<li><a href="#'.$modalDiv.'">'.str_replace("-$theDate.html",'',basename($file)).'</a></li>';
12
+		echo '<li><a href="#'.$modalDiv.'">'.str_replace("-$theDate.html", '', basename($file)).'</a></li>';
13 13
 #                echo '<li><pre><a href="'.basename($file).'" title="'.str_replace("-$theDate.html",'',basename($file))." of $theDate".'" onClick="Modalbox.show(this.href, {title: this.title, height: 600}); return false;">'.str_replace("-$theDate.html",'',basename($file)).'</a></pre></li>';
14 14
 		print <<<MODAL
15 15
 <div id="$modalDiv" class="overlay">
Please login to merge, or discard this patch.
contrib/ipImap/report/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
 /* Write Calendar */
32 32
 	  $myCalendar = new tc_calendar("calSpam");
33 33
 	  $myCalendar->setIcon("calendar/images/iconCalendar.gif");
34
-	  $myCalendar->setDate(date('d',$newest), date('m',$newest), date('Y',$newest));
34
+	  $myCalendar->setDate(date('d', $newest), date('m', $newest), date('Y', $newest));
35 35
 	  $myCalendar->setPath("calendar/");
36
-	  $myCalendar->setYearInterval(date('Y',$oldest), date('Y', $newest));
36
+	  $myCalendar->setYearInterval(date('Y', $oldest), date('Y', $newest));
37 37
 	  $myCalendar->dateAllow(date('Y-m-d', $oldest), date('Y-m-d', $newest));
38 38
 	  $myCalendar->setDateFormat('j F Y');
39 39
 	  $myCalendar->startDate(1);
Please login to merge, or discard this patch.