@@ -1,4 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | +/** |
|
| 3 | + * @param string $str |
|
| 4 | + */ |
|
| 2 | 5 | function filterInput($str, $type = "text"){
|
| 3 | 6 | switch(strtolower($type)){
|
| 4 | 7 | case "number": |
@@ -122,6 +122,11 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | //get the total day of each month in year |
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * @param integer $month |
|
| 128 | + * @param integer $year |
|
| 129 | + */ |
|
| 125 | 130 | function total_days($month,$year){
|
| 126 | 131 | $days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); |
| 127 | 132 | if($month > 0 && $year > 0){
|
@@ -170,6 +175,12 @@ discard block |
||
| 170 | 175 | } |
| 171 | 176 | |
| 172 | 177 | //set default selected date |
| 178 | + |
|
| 179 | + /** |
|
| 180 | + * @param integer $day |
|
| 181 | + * @param integer $month |
|
| 182 | + * @param integer $year |
|
| 183 | + */ |
|
| 173 | 184 | function setDate($day, $month, $year){
|
| 174 | 185 | //get system timezone before set the date |
| 175 | 186 | $this->system_timezone = date_default_timezone_get(); |
@@ -516,6 +527,9 @@ discard block |
||
| 516 | 527 | return $str; |
| 517 | 528 | } |
| 518 | 529 | |
| 530 | + /** |
|
| 531 | + * @param string $suffix |
|
| 532 | + */ |
|
| 519 | 533 | function eHidden($suffix, $value) {
|
| 520 | 534 | if(trim($value) != ""){
|
| 521 | 535 | if($suffix) $suffix = "_".$suffix; |
@@ -849,6 +863,9 @@ discard block |
||
| 849 | 863 | return true; |
| 850 | 864 | } |
| 851 | 865 | |
| 866 | + /** |
|
| 867 | + * @return string |
|
| 868 | + */ |
|
| 852 | 869 | function check_json_encode($obj){
|
| 853 | 870 | //try customize to get it work, should replace with better solution in the future |
| 854 | 871 | if(is_array($obj)){
|
@@ -997,6 +1014,9 @@ discard block |
||
| 997 | 1014 | } |
| 998 | 1015 | } |
| 999 | 1016 | |
| 1017 | + /** |
|
| 1018 | + * @param string $tz |
|
| 1019 | + */ |
|
| 1000 | 1020 | function setTimezone($tz){
|
| 1001 | 1021 | $this->timezone = $tz; |
| 1002 | 1022 | @date_default_timezone_set($tz); |
@@ -117,17 +117,17 @@ |
||
| 117 | 117 | |
| 118 | 118 | //check for leapyear |
| 119 | 119 | function is_leapyear($year){
|
| 120 | - return ($year % 4 == 0) ? |
|
| 121 | - !($year % 100 == 0 && $year % 400 <> 0) : false; |
|
| 122 | - } |
|
| 120 | + return ($year % 4 == 0) ? |
|
| 121 | + !($year % 100 == 0 && $year % 400 <> 0) : false; |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | 124 | //get the total day of each month in year |
| 125 | - function total_days($month,$year){
|
|
| 126 | - $days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); |
|
| 125 | + function total_days($month,$year){
|
|
| 126 | + $days = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); |
|
| 127 | 127 | if($month > 0 && $year > 0){
|
| 128 | - return ($month == 2 && $this->is_leapYear($year)) ? 29 : $days[$month-1]; |
|
| 128 | + return ($month == 2 && $this->is_leapYear($year)) ? 29 : $days[$month-1]; |
|
| 129 | 129 | }else return 31; |
| 130 | - } |
|
| 130 | + } |
|
| 131 | 131 | |
| 132 | 132 | //Deprecate since v1.6 |
| 133 | 133 | function getDayNum($day){
|
@@ -54,6 +54,9 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + /** |
|
| 58 | + * @return string |
|
| 59 | + */ |
|
| 57 | 60 | function getDate($format = "Y-m-d", $cdate = ""){
|
| 58 | 61 | if(!$this->compatible){
|
| 59 | 62 | return tc_date_main::getDate($format, $cdate); |
@@ -123,6 +126,9 @@ discard block |
||
| 123 | 126 | } |
| 124 | 127 | } |
| 125 | 128 | |
| 129 | + /** |
|
| 130 | + * @param string $timespan |
|
| 131 | + */ |
|
| 126 | 132 | function addDate($format = "Y-m-d", $timespan, $cdate = ""){
|
| 127 | 133 | if($this->compatible){
|
| 128 | 134 | $tmp_date = ($cdate != "") ? new DateTime($cdate) : $this->mydate; |
@@ -148,6 +154,10 @@ discard block |
||
| 148 | 154 | |
| 149 | 155 | //check if date1 is before date2 |
| 150 | 156 | //if date1 omitted use set date |
| 157 | + |
|
| 158 | + /** |
|
| 159 | + * @param string|boolean $date2 |
|
| 160 | + */ |
|
| 151 | 161 | function dateBefore($date2, $date1 = "", $equal = true){
|
| 152 | 162 | if(!$this->compatible){
|
| 153 | 163 | return tc_date_main::dateBefore($date2, $date1, $equal); |
@@ -162,6 +172,10 @@ discard block |
||
| 162 | 172 | |
| 163 | 173 | //check if date1 is after date2 |
| 164 | 174 | //if date1 omitted use set date |
| 175 | + |
|
| 176 | + /** |
|
| 177 | + * @param string|boolean $date2 |
|
| 178 | + */ |
|
| 165 | 179 | function dateAfter($date2, $date1 = "", $equal = true){
|
| 166 | 180 | if(!$this->compatible){
|
| 167 | 181 | return tc_date_main::dateAfter($date2, $date1, $equal); |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | exit ('<pre><'.$_POST['Value'].'> is NOT a valid email address.</pre>'); |
| 11 | 11 | |
| 12 | 12 | if ( ($tables["$_"]['field']=='domain') AND ($_POST['Value']!='ALL') ) |
| 13 | - if (!(filter_var(gethostbyname($_POST['Value']), FILTER_VALIDATE_IP))) |
|
| 13 | + if (!(filter_var(gethostbyname($_POST['Value']), FILTER_VALIDATE_IP))) |
|
| 14 | 14 | exit ('<pre><'.$_POST['Value'].'> is NOT a valid domain.</pre>'); |
| 15 | 15 | |
| 16 | 16 | if ( ($tables["$_"]['field']=='ip') AND ($_POST['Value']!='ALL') ) |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | if ( ($tables["$_"]['field']=='username') AND ($_POST['Value']!='ALL') ) { |
| 29 | - if ( preg_match( '/[^\x20-\x7f]/', $_POST['Value']) ) |
|
| 30 | - exit('<pre><'.$_POST['Value'].'> contains NON ASCII chars.</pre>'); |
|
| 29 | + if ( preg_match( '/[^\x20-\x7f]/', $_POST['Value']) ) |
|
| 30 | + exit('<pre><'.$_POST['Value'].'> contains NON ASCII chars.</pre>'); |
|
| 31 | 31 | if ( preg_match( '/[$~=#*+%,{}()\/\\<>;:\"`\[\]&?\s]/', $_POST['Value']) ) |
| 32 | 32 | exit('<pre><'.$_POST['Value'].'> contains invalid ASCII chars.</pre>'); |
| 33 | 33 | switch ( $_POST['Value'] ) { |
@@ -49,10 +49,10 @@ discard block |
||
| 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 . ') ' |
|
| 53 | - . $mysqli->connect_error); |
|
| 54 | - exit ($user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 55 | - . $mysqli->connect_error); |
|
| 52 | + syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 53 | + . $mysqli->connect_error); |
|
| 54 | + exit ($user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 55 | + . $mysqli->connect_error); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | syslog(LOG_INFO, $user.': Successfully mysql connected to ' . $mysqli->host_info) ; |
@@ -10,9 +10,9 @@ |
||
| 10 | 10 | $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport); |
| 11 | 11 | if ($mysqli->connect_error) { |
| 12 | 12 | syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') ' |
| 13 | - . $mysqli->connect_error); |
|
| 14 | - die($user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 15 | - . $mysqli->connect_error); |
|
| 13 | + . $mysqli->connect_error); |
|
| 14 | + die($user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 15 | + . $mysqli->connect_error); |
|
| 16 | 16 | } |
| 17 | 17 | syslog (LOG_INFO, $user.': Successfully connected to ' . $mysqli->host_info ); |
| 18 | 18 | |
@@ -12,12 +12,12 @@ |
||
| 12 | 12 | $user = username(); |
| 13 | 13 | |
| 14 | 14 | $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport); |
| 15 | - if ($mysqli->connect_error) { |
|
| 16 | - syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 17 | - . $mysqli->connect_error); |
|
| 18 | - die($user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 19 | - . $mysqli->connect_error); |
|
| 20 | - } |
|
| 15 | + if ($mysqli->connect_error) { |
|
| 16 | + syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 17 | + . $mysqli->connect_error); |
|
| 18 | + die($user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 19 | + . $mysqli->connect_error); |
|
| 20 | + } |
|
| 21 | 21 | syslog (LOG_INFO, $user.': Successfully connected to ' . $mysqli->host_info ); |
| 22 | 22 | |
| 23 | 23 | if (addtolist ($mysqli,username(),$_POST['value'],$type,$table,$_POST['unit'],$_POST['quantity'],$_POST['reason'])) |
@@ -2,23 +2,23 @@ |
||
| 2 | 2 | require_once('config.php'); |
| 3 | 3 | require_once('function.php'); |
| 4 | 4 | $typedesc=$_POST['type']; |
| 5 | - $type = $tables["$typedesc"]['field']; |
|
| 6 | - $table = $tables["$typedesc"]['name']; |
|
| 5 | + $type = $tables["$typedesc"]['field']; |
|
| 6 | + $table = $tables["$typedesc"]['name']; |
|
| 7 | 7 | ?> |
| 8 | 8 | <td colspan="9" style="text-align: center"> |
| 9 | 9 | <?php |
| 10 | 10 | openlog($tag, LOG_PID, $fac); |
| 11 | 11 | if (empty($_POST['reason'])) die ("Specify a reason, please!</td>"); |
| 12 | 12 | if (preg_match( '/[^\x20-\x7f]/', $_POST['reason'])) |
| 13 | - exit('ERROR: <'.htmlentities($_POST['reason'],ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'> contains NON ASCII chars.</td>'); |
|
| 13 | + exit('ERROR: <'.htmlentities($_POST['reason'],ENT_COMPAT | ENT_HTML401, 'ISO-8859-1').'> 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 | 18 | syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') ' |
| 19 | - . $mysqli->connect_error); |
|
| 20 | - exit ($user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 21 | - . $mysqli->connect_error); |
|
| 19 | + . $mysqli->connect_error); |
|
| 20 | + exit ($user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 21 | + . $mysqli->connect_error); |
|
| 22 | 22 | } |
| 23 | 23 | syslog(LOG_INFO, $user.': Successfully connected to ' . $mysqli->host_info) ; |
| 24 | 24 | |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | /* check you select a blocklist */ |
| 50 | 50 | if ( !$tables["$typedesc"]['bl'] ) { |
| 51 | - syslog(LOG_EMERG,"$user: <$typedesc> is not a blocklist. Are you stupid? Do you want to whitelist a spammer? I refuse to continue."); |
|
| 52 | - exit (254); |
|
| 51 | + syslog(LOG_EMERG,"$user: <$typedesc> is not a blocklist. Are you stupid? Do you want to whitelist a spammer? I refuse to continue."); |
|
| 52 | + exit (254); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
@@ -69,33 +69,33 @@ discard block |
||
| 69 | 69 | $tolist = array(); |
| 70 | 70 | |
| 71 | 71 | if ( !file_exists($splfile) ) { |
| 72 | - syslog(LOG_ERR,"$user: File <$splfile> not found! Exit."); |
|
| 73 | - exit (254); |
|
| 72 | + syslog(LOG_ERR,"$user: File <$splfile> not found! Exit."); |
|
| 73 | + exit (254); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | if (($handle = gzopen($splfile, 'r')) !== FALSE) { |
| 77 | - $row = -1; |
|
| 78 | - while (($data = fgetcsv($handle, 500, ',')) !== FALSE) { |
|
| 79 | - $row++; |
|
| 80 | - if ($row == 0) continue; /* Skip heading line */ |
|
| 81 | - $thisVal = $data[1]; |
|
| 82 | - unset($data[1]); |
|
| 83 | - $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; |
|
| 88 | - } |
|
| 89 | - fclose($handle); |
|
| 77 | + $row = -1; |
|
| 78 | + while (($data = fgetcsv($handle, 500, ',')) !== FALSE) { |
|
| 79 | + $row++; |
|
| 80 | + if ($row == 0) continue; /* Skip heading line */ |
|
| 81 | + $thisVal = $data[1]; |
|
| 82 | + unset($data[1]); |
|
| 83 | + $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; |
|
| 88 | + } |
|
| 89 | + fclose($handle); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /* Make MYSQL connection */ |
| 93 | 93 | |
| 94 | 94 | $mysqli = new mysqli($dbhost, $userdb, $pwd, $db, $dbport); |
| 95 | 95 | if ($mysqli->connect_error) { |
| 96 | - syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 97 | - . $mysqli->connect_error); |
|
| 98 | - exit (254); |
|
| 96 | + syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 97 | + . $mysqli->connect_error); |
|
| 98 | + exit (254); |
|
| 99 | 99 | |
| 100 | 100 | } |
| 101 | 101 | |
@@ -103,28 +103,28 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | foreach ( array_keys($tolist) as $value) { |
| 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); |
|
| 109 | - /* Send a email to domain admin if you list an email */ |
|
| 110 | - if ( ( $tables["$typedesc"]['field'] == 'email' ) OR ( $tables["$typedesc"]['field'] == 'username' ) ) { |
|
| 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 | + /* Send a email to domain admin if you list an email */ |
|
| 110 | + if ( ( $tables["$typedesc"]['field'] == 'email' ) OR ( $tables["$typedesc"]['field'] == 'username' ) ) { |
|
| 111 | 111 | /* Sometime uid are in the form of <user>@<domain> ... */ |
| 112 | 112 | if ( strpos($value, '@') !== FALSE ) { |
| 113 | - $domain = array_pop(explode('@',$value,2)); |
|
| 113 | + $domain = array_pop(explode('@',$value,2)); |
|
| 114 | 114 | if ( strpos($domain, '@') === FALSE ) { |
| 115 | - $recip = emailToNotify($domainNotify_file,$domain); |
|
| 116 | - $subject = sprintf('%s <%s> is now blocked because exceedes limits on outgoing emails', |
|
| 115 | + $recip = emailToNotify($domainNotify_file,$domain); |
|
| 116 | + $subject = sprintf('%s <%s> is now blocked because exceedes limits on outgoing emails', |
|
| 117 | 117 | $tables["$typedesc"]['field'], $value); |
| 118 | - if (!empty($recip)) |
|
| 119 | - if ( sendEmailWarn($tplfile,'[email protected]',$recip, |
|
| 118 | + if (!empty($recip)) |
|
| 119 | + if ( sendEmailWarn($tplfile,'[email protected]',$recip, |
|
| 120 | 120 | $subject,$value,"$quantity $unit",$reason) ) |
| 121 | - syslog(LOG_INFO, "$user: \"$recip\" was notified about the \"$value\" abuse."); |
|
| 121 | + syslog(LOG_INFO, "$user: \"$recip\" was notified about the \"$value\" abuse."); |
|
| 122 | 122 | } |
| 123 | 123 | else syslog(LOG_ERR,"$user: <$domain> contains the '@' char. Notification cannot be sent."); |
| 124 | 124 | } |
| 125 | - } |
|
| 126 | - } |
|
| 127 | - } |
|
| 125 | + } |
|
| 126 | + } |
|
| 127 | + } |
|
| 128 | 128 | else { |
| 129 | 129 | $reason .= " But it has NOT been listed because it doesn't apply to the trigger condition."; |
| 130 | 130 | syslog (LOG_INFO, "$user: ".$reason); |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | <?php |
| 3 | 3 | |
| 4 | 4 | if (PHP_SAPI != "cli") |
| 5 | - exit; |
|
| 5 | + exit; |
|
| 6 | 6 | |
| 7 | 7 | $home = '/var/www/html/RBL'; |
| 8 | 8 | require_once($home.'/config.php'); |
@@ -20,30 +20,30 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $opts = getopt('f:t:'); |
| 22 | 22 | if ( isset($opts['f']) ) { |
| 23 | - $filetemplate = $opts['f']; |
|
| 23 | + $filetemplate = $opts['f']; |
|
| 24 | 24 | } else { |
| 25 | 25 | print "\nNo option for '-f' given.\n"; |
| 26 | - exit ( usage() ); |
|
| 26 | + exit ( usage() ); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | if ( isset($opts['t']) ) { |
| 30 | - $tablename = $opts['t']; |
|
| 30 | + $tablename = $opts['t']; |
|
| 31 | 31 | } else { |
| 32 | 32 | print "\nNo option for '-t' given.\n"; |
| 33 | - exit ( usage() ); |
|
| 33 | + exit ( usage() ); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | if ( ($typedescN = array_search( $tablename, array_column($tables, 'name'))) === FALSE ) { |
| 37 | - print "\nDB <$tablename> doesn't exist!\n"; |
|
| 38 | - syslog (LOG_EMERG, "$user: DB <$tablename> doesn't exist!"); |
|
| 39 | - exit ( usage() ); |
|
| 37 | + print "\nDB <$tablename> doesn't exist!\n"; |
|
| 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 | 43 | if (! file_exists($filetemplate) ) { |
| 44 | - print "\nFile <$filetemplate> doesn't exists!\n"; |
|
| 44 | + print "\nFile <$filetemplate> doesn't exists!\n"; |
|
| 45 | 45 | syslog (LOG_EMERG, "$user: File <$filetemplate> doesn't exist!"); |
| 46 | - exit ( usage() ); |
|
| 46 | + exit ( usage() ); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | if (! in_array( $typedesc, array_keys($tables) ) ) { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 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 | |
@@ -73,10 +73,10 @@ discard block |
||
| 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 . ') ' |
|
| 77 | - . $mysqli->connect_error); |
|
| 78 | - exit ($user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 79 | - . $mysqli->connect_error); |
|
| 76 | + syslog (LOG_EMERG, $user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 77 | + . $mysqli->connect_error); |
|
| 78 | + exit ($user.': Connect Error (' . $mysqli->connect_errno . ') ' |
|
| 79 | + . $mysqli->connect_error); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | syslog(LOG_INFO, $user.': Successfully mysql connected to ' . $mysqli->host_info) ; |
@@ -87,14 +87,14 @@ discard block |
||
| 87 | 87 | while ($riga = $result->fetch_array(MYSQLI_ASSOC)) { |
| 88 | 88 | if (isListed($riga)) { |
| 89 | 89 | switch ( $tables["$typedesc"]['field'] ) { |
| 90 | - case 'ip': |
|
| 91 | - $element[] = long2ip($riga['ip']); |
|
| 92 | - break; |
|
| 93 | - case 'network': |
|
| 94 | - $element[] = long2ip($riga['network']).'/'.long2ip($riga['netmask']); |
|
| 95 | - break; |
|
| 96 | - default: |
|
| 97 | - $element[] = $riga["$type"]; |
|
| 90 | + case 'ip': |
|
| 91 | + $element[] = long2ip($riga['ip']); |
|
| 92 | + break; |
|
| 93 | + case 'network': |
|
| 94 | + $element[] = long2ip($riga['network']).'/'.long2ip($riga['netmask']); |
|
| 95 | + break; |
|
| 96 | + default: |
|
| 97 | + $element[] = $riga["$type"]; |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | } |