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 ( 1bb178...d86b02 )
by Marco
01:55
created
contrib/splunk/webhook/readPost.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 
17 17
 /************** Conf *******************/
18 18
 $base = '/var/www/html/RBL';
19
-require_once($base . '/config.php');
19
+require_once($base.'/config.php');
20 20
 
21 21
  /* Syslog basic */
22
-$tag            .= 'SplunkLister';
23
-$user		 = 'Splunk';
22
+$tag .= 'SplunkLister';
23
+$user = 'Splunk';
24 24
 
25 25
 openlog($tag, LOG_PID, $fac);
26 26
 
@@ -28,43 +28,43 @@  discard block
 block discarded – undo
28 28
 if (!isset($_GET['conf'])) {
29 29
         syslog(LOG_ALERT,
30 30
         sprintf('%s: you must insert the config file name as a GET parameter, such as %s?conf=listEmail.conf',
31
-                $user, $_SERVER['SCRIPT_NAME']) );
31
+                $user, $_SERVER['SCRIPT_NAME']));
32 32
         exit(254);
33 33
 }
34 34
 $fileconf = $_GET['conf'];
35
-if ( !file_exists(dirname(__FILE__) . '/../' . $fileconf) ) {
35
+if (!file_exists(dirname(__FILE__).'/../'.$fileconf)) {
36 36
         syslog(LOG_ALERT,
37 37
         sprintf('%s: the configuration file <%s> doesn\'t exist.',
38
-                $user, $fileconf ));
38
+                $user, $fileconf));
39 39
         exit(254);
40 40
 }
41 41
 
42 42
 closelog();
43
-$conf = parse_ini_file( dirname(__FILE__) . '/../' . $fileconf );
43
+$conf = parse_ini_file(dirname(__FILE__).'/../'.$fileconf);
44 44
 
45 45
  /* Splunk inherited parameters */
46
-$threshold = $conf['threshold'];         /* Threshold value on trigger condition; the same which engage the alert */
46
+$threshold = $conf['threshold']; /* Threshold value on trigger condition; the same which engage the alert */
47 47
 
48 48
  /* Blacklist name */
49 49
 $typedesc  = $conf['typedesc'];
50 50
 
51 51
  /* How long to list's parameters */
52
-$unit = $conf['unit'];          /* MySQL language ;) */
52
+$unit = $conf['unit']; /* MySQL language ;) */
53 53
 
54 54
  /* Syslog extended info */
55
-$tag            .= $conf['tag'];
55
+$tag .= $conf['tag'];
56 56
 
57 57
  /* Splunk password of alert owner*/
58 58
 $splpwd = $conf['splunkpassword'];
59 59
 /************** End of conf *************************/
60 60
 
61 61
 openlog($tag, LOG_PID, $fac);
62
-require_once($base . '/function.php');
62
+require_once($base.'/function.php');
63 63
 
64 64
 
65 65
 /* check you select a blocklist */
66
-if ( !$tables["$typedesc"]['bl'] ) {
67
-        syslog(LOG_EMERG,"$user: <$typedesc> is not a blocklist. Are you stupid? Do you want to whitelist a spammer? I refuse to continue.");
66
+if (!$tables["$typedesc"]['bl']) {
67
+        syslog(LOG_EMERG, "$user: <$typedesc> is not a blocklist. Are you stupid? Do you want to whitelist a spammer? I refuse to continue.");
68 68
         exit (254);
69 69
 }
70 70
 
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
 	$webhook['results_link'], $out, PREG_PATTERN_ORDER) === FALSE) {
97 97
 	syslog(LOG_ALERT,
98 98
         	sprintf('%s: unexpected error: can\'t parse the results link returned by webhook (<%s>).',
99
-		$user, $webhook['results_link']) );
99
+		$user, $webhook['results_link']));
100 100
 	return 255;
101 101
 }
102 102
 
103
-if ( $webhook['app'] != $out['splunkapp'][0] ) {
103
+if ($webhook['app'] != $out['splunkapp'][0]) {
104 104
 	syslog(LOG_ALERT,
105 105
         	sprintf('%s: unexpected error: the APP returned by webhook (<%s>) doesn\'t match the app (<%s>) in result link.',
106
-                $user, $webhook['app'], $out['splunkapp'][0] ) );
106
+                $user, $webhook['app'], $out['splunkapp'][0]));
107 107
 	return 255;
108 108
 }
109 109
 
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
 
136 136
 $tolist = array();
137 137
 
138
-$nr = count ($results);
139
-for ($i=1; $i<$nr; $i++) {	/* We skip first header line (i=0) */
138
+$nr = count($results);
139
+for ($i = 1; $i<$nr; $i++) {	/* We skip first header line (i=0) */
140 140
         $data = str_getcsv($results[$i], ',');
141 141
         $thisVal = $data[1];
142 142
         unset($data[1]);
143 143
         $data = array_values($data);
144
-        if ( !in_array($thisVal,array_keys($tolist))  )
144
+        if (!in_array($thisVal, array_keys($tolist)))
145 145
 	        $tolist["$thisVal"] = $data;
146 146
         else if ($data[3]>$tolist[$thisVal][3])
147 147
 	        $tolist["$thisVal"] = $data;
@@ -150,42 +150,42 @@  discard block
 block discarded – undo
150 150
 /* Make MYSQL connection */
151 151
 
152 152
 $mysqli = myConnect($host, $userdb, $pwd, $db, $dbport, $tables, $typedesc, $user);
153
-if ( $mysqli === FALSE )
153
+if ($mysqli === FALSE)
154 154
 	exit (254);
155 155
 
156
-foreach ( array_keys($tolist) as $value) {
156
+foreach (array_keys($tolist) as $value) {
157 157
         $quantity = $conf['quantity'];
158 158
         $reason = 'On ['.$tolist["$value"][0]."] <$value> sent ".$tolist["$value"][1].' messages to '.$tolist["$value"][2].' recipients.';
159
-        if ( $tolist["$value"][3] >= $threshold ) {
160
-                if ( searchAndList ($mysqli,$user,$tables,$typedesc,$value,$unit,$quantity,$reason) ) {
161
-                        syslog (LOG_INFO, "$user: ".'Listing reason: '.$reason);
159
+        if ($tolist["$value"][3]>=$threshold) {
160
+                if (searchAndList($mysqli, $user, $tables, $typedesc, $value, $unit, $quantity, $reason)) {
161
+                        syslog(LOG_INFO, "$user: ".'Listing reason: '.$reason);
162 162
                         /* Send a email to domain admin if you list an email */
163
-                        if ( ( $tables["$typedesc"]['field'] == 'email' ) OR ( $tables["$typedesc"]['field'] == 'username' ) ) {
163
+                        if (($tables["$typedesc"]['field'] == 'email') OR ($tables["$typedesc"]['field'] == 'username')) {
164 164
                                 /* Sometime uid are in the form of <user>@<domain> ... */
165
-                                if ( strpos($value, '@') !== FALSE ) {
165
+                                if (strpos($value, '@') !== FALSE) {
166 166
                                         $domain = substr(strrchr($value, '@'), 1);
167
-                                        if ( strpos($domain, '@') === FALSE ) {
168
-                                                $recip = emailToNotify($domainNotify_file,$domain);
167
+                                        if (strpos($domain, '@') === FALSE) {
168
+                                                $recip = emailToNotify($domainNotify_file, $domain);
169 169
                                                 $subject = sprintf('%s <%s> is now blocked because exceedes limits on outgoing emails',
170 170
                                                                 $tables["$typedesc"]['field'], $value);
171 171
                                                 if (!empty($recip))
172
-                                                        if ( sendEmailWarn($tplfile,'[email protected]',$recip,
173
-                                                                $subject,$value,"$quantity $unit",$reason) )
172
+                                                        if (sendEmailWarn($tplfile, '[email protected]', $recip,
173
+                                                                $subject, $value, "$quantity $unit", $reason))
174 174
                                                                 syslog(LOG_INFO, "$user: \"$recip\" was notified about the \"$value\" abuse.");
175 175
                                         }
176
-                                        else syslog(LOG_ERR,"$user: <$domain> contains the '@' char. Notification cannot be sent.");
176
+                                        else syslog(LOG_ERR, "$user: <$domain> contains the '@' char. Notification cannot be sent.");
177 177
                                 }
178 178
                         }
179 179
                 }
180 180
         }
181 181
         else {
182 182
                 $reason .= " But it has NOT been listed because it doesn't apply to the trigger condition.";
183
-                syslog (LOG_INFO, "$user: ".$reason);
183
+                syslog(LOG_INFO, "$user: ".$reason);
184 184
         }
185 185
 }
186 186
 
187 187
 /* Close connection */
188
-syslog (LOG_INFO, "$user: ".'Successfully end of session.');
188
+syslog(LOG_INFO, "$user: ".'Successfully end of session.');
189 189
 $mysqli->close();
190 190
 closelog();
191 191
 
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@  discard block
 block discarded – undo
14 14
 require_once('function.php');
15 15
 
16 16
 checkSSL();
17
-if ( $require_auth )
18
-	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 19
 
20 20
 
21
-if ( $imapListActive )
21
+if ($imapListActive)
22 22
 	print ' <p style="text-align: right"><a href="/spamreport" target="_new">SPAM Learn Observer</a></p>';
23 23
 
24 24
 print <<<END
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 END;
28 28
 
29 29
 
30
-$option=NULL;
30
+$option = NULL;
31 31
 $desc = array_keys($tables);
32 32
 foreach ($desc as $description) { 
33
-	$disabled = $tables["$description"]['active']==TRUE ? '' : ' disabled';  
33
+	$disabled = $tables["$description"]['active'] == TRUE ? '' : ' disabled';  
34 34
 	$option .= '<option value="'.$description."\"$disabled>$description</option>";
35 35
 	}
36 36
 
Please login to merge, or discard this patch.
contrib/mailClassifier/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,24 +10,24 @@
 block discarded – undo
10 10
 <body>
11 11
 <h1> Mail Classifier</h1> 
12 12
 <?php
13
-$path='/var/www/html/RBL/';
13
+$path = '/var/www/html/RBL/';
14 14
 require_once($path.'config.php');
15 15
 require_once($path.'function.php');
16 16
 require_once('function.php');
17 17
 
18
-if ( !isset($version) ) {
18
+if (!isset($version)) {
19 19
         openlog('mailClassifierEmergency', LOG_PID, LOG_LOCAL0);
20
-        syslog (LOG_EMERG, sprintf('unknown: I can\'t read the config files. Do you have configured the $path in %s?', __FILE__));
20
+        syslog(LOG_EMERG, sprintf('unknown: I can\'t read the config files. Do you have configured the $path in %s?', __FILE__));
21 21
         closelog();
22 22
         exit(255);
23 23
 }
24 24
 
25 25
 checkSSL();
26 26
 $user = username();
27
-$isAdmin = in_array($user,array_keys($admins));
27
+$isAdmin = in_array($user, array_keys($admins));
28 28
 $canChange = ($isAdmin) ? '' : 'readonly';
29
-if ( $require_auth )
30
-	if ( $user == 'unknown' ) exit ("<p>You MUST configure your server to use authentication.</p>");
29
+if ($require_auth)
30
+	if ($user == 'unknown') exit ("<p>You MUST configure your server to use authentication.</p>");
31 31
 
32 32
 
33 33
 print <<<END
Please login to merge, or discard this patch.
contrib/mailClassifier/result.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-$path='/var/www/html/RBL/';
2
+$path = '/var/www/html/RBL/';
3 3
 include_once($path.'config.php');
4 4
 require_once($path.'function.php');
5 5
 
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
 $tag .= $conf['syslog']['tag'];
15 15
 openlog($tag, LOG_PID, $fac);
16 16
 
17
-if ( $confimap['learn']=='dspamc' ) {
17
+if ($confimap['learn'] == 'dspamc') {
18 18
 	$cmd = escapeshellcmd('which dspamc');
19 19
 	$cmd = escapeshellcmd('which ls');
20
-	exec ( $cmd, $out, $ret );
20
+	exec($cmd, $out, $ret);
21 21
 	if ($ret != 0) {
22 22
 		$err = 'No DSPAM Client found on your system. Please, force your sysadmin to install "dspamc".';
23 23
 		syslog(LOG_ERR, $username.': Error: '.$err);
24
-		exit (sprintf('<p>%s</p>',htmlentities($err)));
24
+		exit (sprintf('<p>%s</p>', htmlentities($err)));
25 25
 	}
26 26
 }
27 27
 
@@ -60,10 +60,10 @@  discard block
 block discarded – undo
60 60
 $headers = imapFind($confimap, $account, $folder);
61 61
 if (empty($headers)) exit (sprintf('<p>No suitable mail found in <b>%s</b> folder.</p>', htmlentities("<$folder>")));
62 62
 print '<table>';
63
-printTableHeader($folder,$data,TRUE,sprintf('Found %d suitable mails.',count($headers)));
63
+printTableHeader($folder, $data, TRUE, sprintf('Found %d suitable mails.', count($headers)));
64 64
 
65
-foreach ( $headers AS $header ) {
66
-	$values = imapInfo($username, $header,$conf['host']['ar'],$confimap['dspamtospamass'],$confimap['learn']);
65
+foreach ($headers AS $header) {
66
+	$values = imapInfo($username, $header, $conf['host']['ar'], $confimap['dspamtospamass'], $confimap['learn']);
67 67
 	print '<tr>';
68 68
 	printTableRow($values, $confimap['learn']);
69 69
 	print '</tr>';
Please login to merge, or discard this patch.
contrib/mailClassifier/list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <select name="folder" style="width:215px" onChange="xmlhttpPost('result.php', 'Classify', 'Result', '<img src=\'/include/pleasewait.gif\'>', true); return false;">
2 2
 <?php
3
-$path='/var/www/html/RBL/';
3
+$path = '/var/www/html/RBL/';
4 4
 require_once($path.'function.php');
5 5
 require_once($path.'config.php');
6 6
 require_once('function.php');
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
 openlog($tag, LOG_PID, $fac);
12 12
 
13 13
 $conf['imap']['user'] = username();
14
-$folders=imapFolder($conf['imap'], $_POST['username']);
14
+$folders = imapFolder($conf['imap'], $_POST['username']);
15 15
 if (is_array($folders)) {
16 16
 	print '<option  value="" selected disabled>Choose a folder</option>';
17
-	foreach ( $folders as $folder )
17
+	foreach ($folders as $folder)
18 18
         	printf('<option  value="%s">%s</option>',
19 19
 			$folder,
20 20
 			htmlspecialchars(mb_convert_encoding($folder, "UTF-8", "UTF7-IMAP")));
Please login to merge, or discard this patch.
contrib/mailClassifier/function.php 1 patch
Spacing   +86 added lines, -88 removed lines patch added patch discarded remove patch
@@ -2,56 +2,56 @@  discard block
 block discarded – undo
2 2
 
3 3
 function imapFolder($cf, $username) {
4 4
 	$return = array();
5
-	$open='{'.$cf['mailhost'].':143/imap/novalidate-cert/authuser='.$cf['authuser'].'}';
5
+	$open = '{'.$cf['mailhost'].':143/imap/novalidate-cert/authuser='.$cf['authuser'].'}';
6 6
         $m_mail = imap_open($open, $username, $cf['authpassword'], OP_READONLY)
7
-                or syslog (LOG_EMERG, $cf['user'].': Error in IMAP connection to <'.$cf['mailhost'].'>: ' . imap_last_error());
8
-        if ( !$m_mail ) exit(254);
7
+                or syslog(LOG_EMERG, $cf['user'].': Error in IMAP connection to <'.$cf['mailhost'].'>: '.imap_last_error());
8
+        if (!$m_mail) exit(254);
9 9
 
10 10
 
11
-        syslog (LOG_INFO,$cf['user'].': Successfully connected to <'.$cf['mailhost'].'>; Listing folders of account <'.$username.'>...');
11
+        syslog(LOG_INFO, $cf['user'].': Successfully connected to <'.$cf['mailhost'].'>; Listing folders of account <'.$username.'>...');
12 12
         //get all folder
13 13
 	$list = imap_list($m_mail, $open, "*");
14 14
 	imap_close($m_mail);
15 15
 	if (is_array($list))
16 16
 		foreach ($list as $mbox)
17
-			$return[] = explode($open,$mbox,2)[1];
17
+			$return[] = explode($open, $mbox, 2)[1];
18 18
 	else
19
-		syslog (LOG_INFO,$cf['user'] . ': imap_list failed: ' . imap_last_error() );
19
+		syslog(LOG_INFO, $cf['user'].': imap_list failed: '.imap_last_error());
20 20
 	return $return;
21 21
 }
22 22
 
23
-function imapFind ($cf, $username, $folder) {
24
-	$head=array();
25
-	$m_mail = imap_open('{'.$cf['mailhost'].':143/imap/novalidate-cert/authuser='.$cf['authuser'].'}'.$folder, $username,$cf['authpassword'], OP_READONLY)
26
-        	or syslog (LOG_EMERG, $cf['user'].': Error in IMAP connection to <'.$cf['mailhost'].'>: ' . imap_last_error());
27
-	if ( !$m_mail ) exit(254);
23
+function imapFind($cf, $username, $folder) {
24
+	$head = array();
25
+	$m_mail = imap_open('{'.$cf['mailhost'].':143/imap/novalidate-cert/authuser='.$cf['authuser'].'}'.$folder, $username, $cf['authpassword'], OP_READONLY)
26
+        	or syslog(LOG_EMERG, $cf['user'].': Error in IMAP connection to <'.$cf['mailhost'].'>: '.imap_last_error());
27
+	if (!$m_mail) exit(254);
28 28
 		
29 29
 
30
-	syslog (LOG_INFO,$cf['user'].': Successfully connected to <'.$cf['mailhost'].">; Reading <$folder> messages of last ".$cf['oldestday'].' days on account <'.$username.'>...');
30
+	syslog(LOG_INFO, $cf['user'].': Successfully connected to <'.$cf['mailhost'].">; Reading <$folder> messages of last ".$cf['oldestday'].' days on account <'.$username.'>...');
31 31
 	//get all messages
32
-	$dateTh = date ( "d-M-Y", strToTime ( '-'.$cf['oldestday'].' days' ) );
33
-	$m_search=imap_search ($m_mail, "SINCE \"$dateTh\" TEXT \"Authentication-Results: \"" );
32
+	$dateTh = date("d-M-Y", strToTime('-'.$cf['oldestday'].' days'));
33
+	$m_search = imap_search($m_mail, "SINCE \"$dateTh\" TEXT \"Authentication-Results: \"");
34 34
 
35 35
 
36 36
 	// Order results starting from newest message
37
-	if ( empty($m_search) ) {
38
-		syslog (LOG_INFO,$cf['user'].": No suitable mail found in <$folder> folder.");
39
-	        if ( $ierr = imap_errors() )
40
-	                foreach ( $ierr as $thiserr )
41
-	                        syslog (LOG_ERR, $cf['user'].": IMAP Error: $thiserr");
42
-	        if ( $ierr = imap_alerts() )
43
-	                foreach ( $ierr as $thiserr )
44
-	                        syslog (LOG_ALERT, $cf['user'].": IMAP Alert: $thiserr");
45
-		imap_close( $m_mail );
37
+	if (empty($m_search)) {
38
+		syslog(LOG_INFO, $cf['user'].": No suitable mail found in <$folder> folder.");
39
+	        if ($ierr = imap_errors())
40
+	                foreach ($ierr as $thiserr)
41
+	                        syslog(LOG_ERR, $cf['user'].": IMAP Error: $thiserr");
42
+	        if ($ierr = imap_alerts())
43
+	                foreach ($ierr as $thiserr)
44
+	                        syslog(LOG_ALERT, $cf['user'].": IMAP Alert: $thiserr");
45
+		imap_close($m_mail);
46 46
 		return FALSE;
47 47
 	}
48
-	$nmes = count ($m_search);
49
-	syslog (LOG_INFO,$cf['user'].": Found $nmes mail in <$folder> folder.");
48
+	$nmes = count($m_search);
49
+	syslog(LOG_INFO, $cf['user'].": Found $nmes mail in <$folder> folder.");
50 50
 	if ($nmes>0) rsort($m_search);
51 51
 
52 52
         // loop for each message
53 53
 	foreach ($m_search as $onem) 
54
-		$head[] = imap_fetchheader($m_mail, $onem );
54
+		$head[] = imap_fetchheader($m_mail, $onem);
55 55
 	imap_close($m_mail);
56 56
 	return $head;
57 57
 }
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
 function dspamLevel($prob, $conf) {
60 60
 /* Calculate DSPAM Level as the Spamassassin Plugin */
61 61
 	if (is_null($prob) or is_null($conf)) return '-';
62
-	$t_prob = abs((($prob - 0.5) * 2) * 100);
63
-	return round(($t_prob + ($conf*100)) / 2);
62
+	$t_prob = abs((($prob-0.5) * 2) * 100);
63
+	return round(($t_prob+($conf * 100)) / 2);
64 64
 }
65 65
 
66 66
 function dspamType($classSpam) {
67
-	switch($classSpam) {
67
+	switch ($classSpam) {
68 68
 		case 'HAM':
69 69
 			return 'Innocent';
70 70
 		case 'SPAM':
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	}
76 76
 }
77 77
 
78
-function imapInfo($user,$header,$ARhosts,$dpl=false, $learn=false) {
78
+function imapInfo($user, $header, $ARhosts, $dpl = false, $learn = false) {
79 79
 /* Get relevant Info from header's mail */
80 80
 /* Each line must end with /r/n         */
81 81
 
@@ -109,118 +109,118 @@  discard block
 block discarded – undo
109 109
         );
110 110
 		
111 111
 
112
-        if ( preg_match_all ('/^Authentication\-Results:\s+(?<host>[\w\.]+);(?:\s+|\r\n\s+)dmarc=(?<dmarc>\w+)\s+\(p=\w+\s+dis=\w+\)\s+header\.from=(?<DMARCfrom>[\w\.]+)/m',$header,$received) ) {
113
-		$k=0;
114
-                for ($i = count($received[0])-1;$i>=0;$i--) {
112
+        if (preg_match_all('/^Authentication\-Results:\s+(?<host>[\w\.]+);(?:\s+|\r\n\s+)dmarc=(?<dmarc>\w+)\s+\(p=\w+\s+dis=\w+\)\s+header\.from=(?<DMARCfrom>[\w\.]+)/m', $header, $received)) {
113
+		$k = 0;
114
+                for ($i = count($received[0])-1; $i>=0; $i--) {
115 115
 	                foreach ($ARhosts as $mx) {
116 116
 				if ($mx == $received['host'][$i]) {
117 117
 					/* This is a trusted AR result */
118
-					$result['dmarc']['result']=$received['dmarc'][$i];
118
+					$result['dmarc']['result'] = $received['dmarc'][$i];
119 119
 					$result['dmarc']['dom'] = $received['DMARCfrom'][$i];
120 120
 					$k++;
121 121
 				}
122 122
                 	}
123 123
 		}
124 124
         }
125
-	$received=NULL;
125
+	$received = NULL;
126 126
 	if ($k>1) $result['warn'][] = 'The trusted DMARC AR Headers are present more than once. Something wrong.';
127 127
 
128
-        if ( preg_match_all('/^Authentication\-Results:\s+(?<host>[\w\.]+);(?:\s+|\r\n\s+)spf=(?<spf>\w+)\s+smtp\.(?:mailfrom|helo)=(?<SPFfrom>[\w\.]+)/m',$header,$received) ) {
129
-		$k=0;
130
-		for ($i = count($received[0])-1;$i>=0;$i--) {
128
+        if (preg_match_all('/^Authentication\-Results:\s+(?<host>[\w\.]+);(?:\s+|\r\n\s+)spf=(?<spf>\w+)\s+smtp\.(?:mailfrom|helo)=(?<SPFfrom>[\w\.]+)/m', $header, $received)) {
129
+		$k = 0;
130
+		for ($i = count($received[0])-1; $i>=0; $i--) {
131 131
 			foreach ($ARhosts as $mx) {
132 132
 				if ($mx == $received['host'][$i]) {
133 133
 					/* This is a trusted AR result */
134
-					$result['spf']['result']=$received['spf'][$i];
134
+					$result['spf']['result'] = $received['spf'][$i];
135 135
 					$result['spf']['dom'] = $received['SPFfrom'][$i];
136 136
 					$k++;
137 137
                         	}
138 138
                 	}
139 139
         	}
140 140
 	}
141
-	$received=NULL;
141
+	$received = NULL;
142 142
 	if ($k>1) $result['warn'][] = 'The trusted SPF AR Headers are present more than once. Something wrong.';
143 143
 
144
-	$k=0;
145
-        if ( preg_match_all('/^Authentication\-Results:\s+(?<host>[\w\.]+);(?:\s+|\r\n\s+)dkim=(?<dkim>\w+)\s+[\w\s\(\)\-]+header\.d=(?<DKIMdom>[\w\.]+)/m',$header,$received) ) {
146
-		for ($i = count($received[0])-1;$i>=0;$i--) {
144
+	$k = 0;
145
+        if (preg_match_all('/^Authentication\-Results:\s+(?<host>[\w\.]+);(?:\s+|\r\n\s+)dkim=(?<dkim>\w+)\s+[\w\s\(\)\-]+header\.d=(?<DKIMdom>[\w\.]+)/m', $header, $received)) {
146
+		for ($i = count($received[0])-1; $i>=0; $i--) {
147 147
 	                foreach ($ARhosts as $mx) {
148 148
         	                if ($mx == $received['host'][$i]) {
149 149
                 	                /* This is a trusted AR result */
150
-                        	        $result['dkim']['result']=$received['dkim'][$i];
150
+                        	        $result['dkim']['result'] = $received['dkim'][$i];
151 151
                                 	$result['dkim']['dom'] = $received['DKIMdom'][$i];
152 152
 					$k++;
153 153
                         	}
154 154
                 	}
155 155
         	}
156 156
 	}
157
-	$received=NULL;
157
+	$received = NULL;
158 158
 	if ($k>1) $result['warn'][] = 'The trusted DKIM AR Headers are present more than once. Something wrong.';
159 159
 
160 160
 	if ($dpl) { /* Use Spamassassin Plugin */
161
-		if ( preg_match_all('/^X\-Spam\-Status:\s(?P<spamstatus>\w+)\,(?:\s+|\r\n\s+)score=(?P<score>[\-\.\d]+)(?:\s+|\r\n\s+)tagged_above=\-{0,1}\d+(?:\s+|\r\n\s+)required=(?P<th>[\-\.\d]+)(?:\s+|\r\n\s+)tests=\[(?:.|\r\n\s+)*DSPAM_(?P<dtype>SPAM|HAM)_(?P<dlevel>\d\d)(?:.|\r\n\s+)*\]/m',$header,$received) ) {
162
-			$result['spam']['status']=$received['spamstatus'][0];
161
+		if (preg_match_all('/^X\-Spam\-Status:\s(?P<spamstatus>\w+)\,(?:\s+|\r\n\s+)score=(?P<score>[\-\.\d]+)(?:\s+|\r\n\s+)tagged_above=\-{0,1}\d+(?:\s+|\r\n\s+)required=(?P<th>[\-\.\d]+)(?:\s+|\r\n\s+)tests=\[(?:.|\r\n\s+)*DSPAM_(?P<dtype>SPAM|HAM)_(?P<dlevel>\d\d)(?:.|\r\n\s+)*\]/m', $header, $received)) {
162
+			$result['spam']['status'] = $received['spamstatus'][0];
163 163
                 	$result['spam']['score'] = $received['score'][0];
164 164
 			$result['spam']['th'] = $received['th'][0];
165 165
 			$result['dspam']['type'] = dspamType($received['dtype'][0]);
166
-			$result['dspam']['level'] =$received['dlevel'][0];
166
+			$result['dspam']['level'] = $received['dlevel'][0];
167 167
         	}
168 168
         	if (count($received[0])>1) $result['warn'][] = 'The Spamassassin Headers are present more than once. I consider only the last one.';
169 169
 	}
170 170
 	else { /* Parse apart all DSPAM Header and calculate a level */
171
-		if ( preg_match_all('/^X\-Spam\-Status:\s(?P<spamstatus>\w+)\,(?:\s+|\r\n\s+)score=(?P<score>[\-\.\d]+)(?:\s+|\r\n\s+)tagged_above=\-{0,1}\d+(?:\s+|\r\n\s+)required=(?P<th>[\-\.\d]+)(?:\s+|\r\n\s+)tests=\[(?:.|\r\n\s+)*\]/m',$header,$received) ) {
172
-                        $result['spam']['status']=$received['spamstatus'][0];
171
+		if (preg_match_all('/^X\-Spam\-Status:\s(?P<spamstatus>\w+)\,(?:\s+|\r\n\s+)score=(?P<score>[\-\.\d]+)(?:\s+|\r\n\s+)tagged_above=\-{0,1}\d+(?:\s+|\r\n\s+)required=(?P<th>[\-\.\d]+)(?:\s+|\r\n\s+)tests=\[(?:.|\r\n\s+)*\]/m', $header, $received)) {
172
+                        $result['spam']['status'] = $received['spamstatus'][0];
173 173
                         $result['spam']['score'] = $received['score'][0];
174 174
                         $result['spam']['th'] = $received['th'][0];
175 175
 			if (count($received[0])>1)
176
-				$result['warn'][]= 'The Spamassassin Headers are present more than once. I consider only the last one.';
176
+				$result['warn'][] = 'The Spamassassin Headers are present more than once. I consider only the last one.';
177 177
 		}
178
-		if ( preg_match ('/\r\nX\-DSPAM\-Result:\s(?P<result>.*)\r\n/',$header,$received) != 1)
178
+		if (preg_match('/\r\nX\-DSPAM\-Result:\s(?P<result>.*)\r\n/', $header, $received) != 1)
179 179
 	                $result['warn'] = 'DSPAM Result invalid, not present or present more than once.';
180 180
 	        else
181
-                	$result['dspam']['type']=$received['result'];
181
+                	$result['dspam']['type'] = $received['result'];
182 182
 		$prob = NULL;
183 183
 		$conf = NULL;
184
-                if ( preg_match ('/\r\nX\-DSPAM\-Probability:\s(?P<prob>.*)\r\n/',$header,$received) != 1)
184
+                if (preg_match('/\r\nX\-DSPAM\-Probability:\s(?P<prob>.*)\r\n/', $header, $received) != 1)
185 185
                         $result['warn'][] = 'DSPAM Probability invalid, not present or present more than once.';
186 186
 		else
187 187
 			$prob = $received['prob'];
188
-		if ( preg_match ('/\r\nX\-DSPAM\-Confidence:\s(?P<conf>.*)\r\n/',$header,$received) != 1)
188
+		if (preg_match('/\r\nX\-DSPAM\-Confidence:\s(?P<conf>.*)\r\n/', $header, $received) != 1)
189 189
                         $result['warn'][] = 'DSPAM Confidence invalid, not present or present more than once.';
190 190
 		else
191 191
 			$conf = $received['conf'];
192
-		$result['dspam']['level'] = dspamLevel($prob,$conf);
192
+		$result['dspam']['level'] = dspamLevel($prob, $conf);
193 193
 	}
194
-	$received=NULL;
195
-	if ( preg_match ('/\r\nFrom:\s(?P<from>.*)\r\n/',$header,$received) != 1)
194
+	$received = NULL;
195
+	if (preg_match('/\r\nFrom:\s(?P<from>.*)\r\n/', $header, $received) != 1)
196 196
                 $result['warn'][] = 'From header invalid or not present';
197 197
         else
198 198
                 $result['from'] = $received['from'];
199 199
 
200
-        if ( preg_match ('/\r\nDate:\s(?P<date>.*)\r\n/',$header,$received) != 1)
200
+        if (preg_match('/\r\nDate:\s(?P<date>.*)\r\n/', $header, $received) != 1)
201 201
                 $result['warn'][] = 'Date header invalid or not present';
202 202
 	else
203 203
 		$result['date'] = $received['date'];
204 204
 
205
-	$received=NULL;
206
-        if ( preg_match ('/\r\nMessage\-I(?:D|d):\s(?P<mid>.*)\r\n/',$header,$received) != 1)
205
+	$received = NULL;
206
+        if (preg_match('/\r\nMessage\-I(?:D|d):\s(?P<mid>.*)\r\n/', $header, $received) != 1)
207 207
                 $result['warn'][] = 'Message-ID invalid, not present or present more than once.';
208 208
 	else
209
-		$result['messageid']=$received['mid'];
209
+		$result['messageid'] = $received['mid'];
210 210
 
211
-        $received=NULL;
211
+        $received = NULL;
212 212
 
213 213
         switch ($learn) {
214 214
 		case 'dspamc':
215
-        		if ( preg_match ('/\r\nX\-DSPAM\-Signature:\s(?P<sig>.*)\r\n/',$header,$received) != 1)
215
+        		if (preg_match('/\r\nX\-DSPAM\-Signature:\s(?P<sig>.*)\r\n/', $header, $received) != 1)
216 216
 				$result['warn'] = 'DSPAM Signature invalid, not present or present more than once.';
217 217
 			else
218
-				$result['dspam']['learn']=$received['sig'];			
218
+				$result['dspam']['learn'] = $received['sig'];			
219 219
 			break;
220 220
 		case false:
221 221
 			break;
222 222
 		default:
223
-			syslog (LOG_INFO,$user.': Error in "learn" imap configuration value. Please, set "dspamc" or "false".');
223
+			syslog(LOG_INFO, $user.': Error in "learn" imap configuration value. Please, set "dspamc" or "false".');
224 224
 	}
225 225
 	
226 226
         return $result;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
 
231 231
 
232
-function printTableHeader($title,$content,$footer=FALSE,$fcontent) {
232
+function printTableHeader($title, $content, $footer = FALSE, $fcontent) {
233 233
         print <<<END
234 234
 	<caption>$title</caption>
235 235
 	<thead>
@@ -237,21 +237,19 @@  discard block
 block discarded – undo
237 237
 END;
238 238
 	$kcontent = array_keys($content);
239 239
         $cols = count($kcontent);
240
-        for ($i=0; $i<$cols; $i++) {
240
+        for ($i = 0; $i<$cols; $i++) {
241 241
 		$key = $kcontent[$i];
242
-                printf ('<th colspan="%d" rowspan="%d">%s</th>',
243
-			!is_array($content[$key]) ?:
244
-			count(array_keys($content[$key])) ?: '1',
245
-			!is_array($content[$key]) ?:
246
-			empty(array_keys($content[$key])) ? '2' : '1',
242
+                printf('<th colspan="%d" rowspan="%d">%s</th>',
243
+			!is_array($content[$key]) ?: count(array_keys($content[$key])) ?: '1',
244
+			!is_array($content[$key]) ?: empty(array_keys($content[$key])) ? '2' : '1',
247 245
 			$kcontent[$i]);
248 246
 	}
249 247
 	print '</tr><tr>';
250
-	for ($i=0; $i<$cols; $i++) {
248
+	for ($i = 0; $i<$cols; $i++) {
251 249
 		$key = $kcontent[$i];
252
-		if (is_array($content[$key])&&($hs = array_keys($content[$key]))) {
250
+		if (is_array($content[$key]) && ($hs = array_keys($content[$key]))) {
253 251
 			foreach ($hs as $h)
254
-				printf('<th>%s</th>',$h);
252
+				printf('<th>%s</th>', $h);
255 253
 		}
256 254
 	}
257 255
 		
@@ -267,7 +265,7 @@  discard block
 block discarded – undo
267 265
 
268 266
 function formatVal($val, $learn) {
269 267
 	foreach (array_keys($val) as $key) {
270
-		if (is_array($val["$key"]) and ($key!='warn'))
268
+		if (is_array($val["$key"]) and ($key != 'warn'))
271 269
 			$val["$key"] = formatVal($val["$key"], $learn);
272 270
 		else {
273 271
 			switch ($key) {
@@ -275,7 +273,7 @@  discard block
 block discarded – undo
275 273
 					if (empty($val["$key"]))
276 274
 						$val["$key"] = '-';
277 275
 					else 
278
-						$val["$key"] = sprintf('<div title="%s">Y</div>',implode($val["$key"],"\n"));
276
+						$val["$key"] = sprintf('<div title="%s">Y</div>', implode($val["$key"], "\n"));
279 277
 					break;
280 278
 				case 'learn':
281 279
 					$val["$key"] = formLearn($learn, $val);
@@ -297,26 +295,26 @@  discard block
 block discarded – undo
297 295
 				$par['class'] = $class;
298 296
 				$val["$class"] = sprintf('dspamc --user dspam --deliver=summary --class=%s --source=error --signature=%s',
299 297
 							strtolower($class), $par['learn']);
300
-				if (($class != $par['type'])||($par['level']<99))
298
+				if (($class != $par['type']) || ($par['level']<99))
301 299
 					$return .= sprintf(file_get_contents('formLearnDSPAM.htm'),
302
-						$class,$class,$val["$class"],base64_encode(json_encode($par)),$class);
300
+						$class, $class, $val["$class"], base64_encode(json_encode($par)), $class);
303 301
 			}
304 302
 		default:
305 303
 			return $return;
306 304
 	}
307 305
 }
308 306
 
309
-function printTableRow($row, $learn, $init=true) {
307
+function printTableRow($row, $learn, $init = true) {
310 308
 	$color = 'inherit';
311 309
 	if ($init) 
312
-		$row=formatVal($row,$learn);
313
-	foreach( $row as $key => $val) {
310
+		$row = formatVal($row, $learn);
311
+	foreach ($row as $key => $val) {
314 312
 		if (is_array($val))
315 313
 			printTableRow($val, $learn, false);
316 314
 		else {
317 315
 			/* DSPAM format */
318 316
 			if (isset($row['type']))
319
-				switch($row['type']) {
317
+				switch ($row['type']) {
320 318
 					case 'Innocent':
321 319
 					case 'HAM':
322 320
 						$color = 'rgba(0,255,0, %.1f)';
@@ -327,7 +325,7 @@  discard block
 block discarded – undo
327 325
 			}
328 326
 			/* DMARC, DKIM, SPF format */
329 327
 			if (isset($row['result']))
330
-				switch($row['result']) {
328
+				switch ($row['result']) {
331 329
 					case 'pass':
332 330
 						$color = 'rgba(0,255,0, %.1f)';
333 331
 						break;
@@ -336,7 +334,7 @@  discard block
 block discarded – undo
336 334
 				}
337 335
 			/* Spamassassin format */
338 336
 			if (isset($row['status']))
339
-	                        switch($row['status']) {
337
+	                        switch ($row['status']) {
340 338
 					case 'No':
341 339
 						$color = 'rgba(0,255,0, %.1f)';
342 340
 						break;
@@ -344,9 +342,9 @@  discard block
 block discarded – undo
344 342
 						$color = 'rgba(255,0,0,%.1f)';
345 343
 				}	
346 344
 				
347
-			$alpha = (is_numeric($val)AND($key=='type')) ? round($val/100,1) : 1.0;
345
+			$alpha = (is_numeric($val) AND ($key == 'type')) ? round($val / 100, 1) : 1.0;
348 346
 			$bg = sprintf(" style=\"background-color: $color\"", $alpha);		
349
-			printf ('<td class="cellfix"%s>%s</td>',$bg, $val);
347
+			printf('<td class="cellfix"%s>%s</td>', $bg, $val);
350 348
 		}
351 349
 	}
352 350
 }
Please login to merge, or discard this patch.
contrib/mailClassifier/learn.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <div id="content">
2 2
 <h3>Log</h3>
3 3
 <?php
4
-$path='/var/www/html/RBL/';
4
+$path = '/var/www/html/RBL/';
5 5
 require_once($path.'function.php');
6 6
 require_once($path.'config.php');
7 7
 $conf = parse_ini_file('imap.conf', TRUE);
@@ -16,17 +16,17 @@  discard block
 block discarded – undo
16 16
 
17 17
 syslog(LOG_INFO, sprintf('%s: Learn as <%s> on signature: <%s>', $username, $par->class, $par->learn));
18 18
 $cmd = escapeshellcmd($_POST['cmd']);
19
-exec ( $cmd, $out, $ret );
19
+exec($cmd, $out, $ret);
20 20
 if ($ret != 0) {
21 21
 	$err = 'DSPAM Client returns a bad exit state. Sorry, probably the learn was successful, but I don\'t know...';
22 22
 	syslog(LOG_ERR, $username.': Learn Error: '.$err);	
23
-	exit (sprintf('<p>%s</p>',htmlentities($err)));
23
+	exit (sprintf('<p>%s</p>', htmlentities($err)));
24 24
 }
25
-syslog(LOG_INFO, sprintf('%s: Learn result: "%s"',$username, $out[0]));  
26
-if ( preg_match ('/^X-DSPAM-Result:\s+(?P<user>[\w\.\-\_\+\%\@]+);\s+result="(?P<result>\w+)";\s+class="(?P<class>\w+)";\s+probability=(?P<prob>[\d\.]+);\s+confidence=(?P<conf>[\d\.]+);\s+signature=(?P<sig>[\w\,]+)$/',$out[0],$received) != 1) {
25
+syslog(LOG_INFO, sprintf('%s: Learn result: "%s"', $username, $out[0]));  
26
+if (preg_match('/^X-DSPAM-Result:\s+(?P<user>[\w\.\-\_\+\%\@]+);\s+result="(?P<result>\w+)";\s+class="(?P<class>\w+)";\s+probability=(?P<prob>[\d\.]+);\s+confidence=(?P<conf>[\d\.]+);\s+signature=(?P<sig>[\w\,]+)$/', $out[0], $received) != 1) {
27 27
 		$err = 'DSPAM Client returned an unparseable result.';
28 28
 		syslog(LOG_ERR, $username.': Learn Error: '.$err);
29
-                exit (sprintf('<p>%s</p>',htmlentities($err)));
29
+                exit (sprintf('<p>%s</p>', htmlentities($err)));
30 30
 }
31 31
 
32 32
 printf('<p>Message learned successfully with following result:</p><ul><li>Owner: <b>%s</b></li><li>Result: <b>%s</b></li><li>Class: <b>%s</b></li></ul>',
Please login to merge, or discard this patch.
listForm.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  discard block
 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
-if ( $tables["$typedesc"]['milter'] ) {
6
-	if ( checkMilterConf($tables["$typedesc"]) ) 
5
+if ($tables["$typedesc"]['milter']) {
6
+	if (checkMilterConf($tables["$typedesc"])) 
7 7
 		print '<p>This is a milter table. Please, first add your item as usual. Then you will be able to customize the milter settings.</p>';
8 8
 	else {
9 9
 		$err = "Error in config about <$typedesc>. Check at your config.php.";
10
-		syslog (LOG_EMERG, $err);
11
-		printf ('<p>%s</p>', htmlspecialchars($err) );
10
+		syslog(LOG_EMERG, $err);
11
+		printf('<p>%s</p>', htmlspecialchars($err));
12 12
 	}	
13 13
 }
14 14
 
@@ -16,4 +16,4 @@  discard block
 block discarded – undo
16 16
 <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;" />
17 17
 
18 18
 		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; ?>" />
19
-		<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>
19
+		<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.
result.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -5,20 +5,20 @@  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 (!(isValid($_POST['Value'])))
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))
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
 	$_POST['Value'] = $value[0].'/'.$net->mask($value[1])->convertTo('dec');
27 27
 }
28 28
 
29
-if ( ($tables["$_"]['field']=='username') AND ($_POST['Value']!='ALL') ) {
30
-        if ( preg_match( '/[^\x20-\x7f]/', $_POST['Value']) )
29
+if (($tables["$_"]['field'] == 'username') AND ($_POST['Value'] != 'ALL')) {
30
+        if (preg_match('/[^\x20-\x7f]/', $_POST['Value']))
31 31
                 exit('<pre>&lt;'.$_POST['Value'].'&gt; contains NON ASCII chars.</pre>');
32
-	if ( preg_match( '/[$~=#*+%,{}()\/\\<>;:\"`\[\]&?\s]/', $_POST['Value']) )
32
+	if (preg_match('/[$~=#*+%,{}()\/\\<>;:\"`\[\]&?\s]/', $_POST['Value']))
33 33
 		exit('<pre>&lt;'.$_POST['Value'].'&gt; contains invalid ASCII chars.</pre>');
34
-	switch ( $_POST['Value'] ) {
34
+	switch ($_POST['Value']) {
35 35
 		case 'anonymous':
36 36
 		case 'anybody':
37 37
 		case 'anyone':
38
-		case ( preg_match( '/^anyone@/',$_POST['Value']) == TRUE ):
38
+		case (preg_match('/^anyone@/', $_POST['Value']) == TRUE):
39 39
 			exit('<pre>&lt;'.$_POST['Value'].'&gt; is not allowed.</pre>');
40 40
 	}
41 41
 }	
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
 openlog($tag, LOG_PID, $fac);
52 52
 $user = username();
53 53
 
54
-if ( ($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $_, $user)) === FALSE )
55
-	exit ('Connect Error (' . $mysqli->connect_errno . ') '. $mysqli->connect_error);
54
+if (($mysqli = myConnect($dbhost, $userdb, $pwd, $db, $dbport, $tables, $_, $user)) === FALSE)
55
+	exit ('Connect Error ('.$mysqli->connect_errno.') '.$mysqli->connect_error);
56 56
 	
57
-rlookup($mysqli,username(),$admins,$_POST['Value'],$_POST['genere'],$tables);
57
+rlookup($mysqli, username(), $admins, $_POST['Value'], $_POST['genere'], $tables);
58 58
 $mysqli->close();
59 59
 closelog();
60 60
 ?>
Please login to merge, or discard this patch.