@@ -1,4 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | +/** |
|
3 | + * @param string $header |
|
4 | + */ |
|
2 | 5 | function getIP($header,$mxserver,$msa) { |
3 | 6 | /* Get submission server's IP from header's mail */ |
4 | 7 | /* Each line must end with /r/n */ |
@@ -28,11 +31,24 @@ discard block |
||
28 | 31 | return array($ip,$host,$dateR,$dateC['date'],$mid['mid']); |
29 | 32 | } |
30 | 33 | |
34 | +/** |
|
35 | + * @param string|false $ip |
|
36 | + * @param string $hostname |
|
37 | + * @param string $dateC |
|
38 | + * @param string|null $msgid |
|
39 | + * @param string|false $dateL |
|
40 | + */ |
|
31 | 41 | function updateReport ($ip,$uid,$ipcount,$uidcount,$hostname,$dateC,$msgid,$dateL) { |
32 | 42 | |
33 | 43 | return sprintf ('<tr><td nowrap>%s</td><td nowrap>%s</td><td>%s</td><td>%s</td><td>%u</td><td>%u</td><td>%s</td><td>%s</td></tr>'."\n",$dateL,$dateC,$uid,$ip,$uidcount,$ipcount,$hostname,htmlentities($msgid) ); |
34 | 44 | } |
35 | 45 | |
46 | +/** |
|
47 | + * @param string $dateC |
|
48 | + * @param string|null $msgid |
|
49 | + * @param string|false $dateL |
|
50 | + * @param string $text |
|
51 | + */ |
|
36 | 52 | function updatebadReport ( $uid,$dateC,$msgid,$dateL,$text ) { |
37 | 53 | return sprintf ('<tr><td nowrap>%s</td><td nowrap>%s</td><td>%s</td><td>%s</td><td nowrap>%s</td></tr>'."\n",$dateL,$dateC,$uid,htmlentities($msgid),$text ); |
38 | 54 | } |
@@ -84,6 +100,9 @@ discard block |
||
84 | 100 | } |
85 | 101 | |
86 | 102 | |
103 | +/** |
|
104 | + * @param null|mysqli $myconn |
|
105 | + */ |
|
87 | 106 | function summaryReportAndList ($cf,$myconn,$tables,$category,$ipvet) { |
88 | 107 | $nips = $ipvet['count']; |
89 | 108 | |
@@ -154,6 +173,10 @@ discard block |
||
154 | 173 | } |
155 | 174 | |
156 | 175 | |
176 | +/** |
|
177 | + * @param string $message_id |
|
178 | + * @param string $date |
|
179 | + */ |
|
157 | 180 | function splunksearch ($service,$message_id,$date) { |
158 | 181 | |
159 | 182 | // Run a blocking search |
@@ -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); |
@@ -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); |
@@ -204,6 +204,11 @@ discard block |
||
204 | 204 | } |
205 | 205 | |
206 | 206 | |
207 | +/** |
|
208 | + * @param integer $id |
|
209 | + * @param string $what |
|
210 | + * @param boolean $lock |
|
211 | + */ |
|
207 | 212 | function ask($myconn,$id,$what,$alltables,$typedesc,$value,$lock,$user,$adm) { |
208 | 213 | |
209 | 214 | switch ($what) { |
@@ -404,6 +409,9 @@ discard block |
||
404 | 409 | } |
405 | 410 | |
406 | 411 | |
412 | +/** |
|
413 | + * @param string $reason |
|
414 | + */ |
|
407 | 415 | function searchAndList ($myconn,$loguser,$tables,$typedesc,$value,$unit,&$quantity,$reason) { |
408 | 416 | |
409 | 417 | /* Search and list value */ |