@@ -37,6 +37,9 @@ discard block |
||
37 | 37 | include_once($config['install_dir'] . "/includes/phpmailer/class.smtp.php"); |
38 | 38 | } |
39 | 39 | |
40 | +/** |
|
41 | + * @param string $on |
|
42 | + */ |
|
40 | 43 | function array_sort($array, $on, $order=SORT_ASC) { |
41 | 44 | $new_array = array(); |
42 | 45 | $sortable_array = array(); |
@@ -246,6 +249,9 @@ discard block |
||
246 | 249 | return $ret; |
247 | 250 | } |
248 | 251 | |
252 | +/** |
|
253 | + * @param string $snmpver |
|
254 | + */ |
|
249 | 255 | function addHost($host, $snmpver, $port = '161', $transport = 'udp', $quiet = '0', $poller_group = '0', $force_add = '0', $port_assoc_mode = 'ifIndex') { |
250 | 256 | global $config; |
251 | 257 | |
@@ -623,6 +629,9 @@ discard block |
||
623 | 629 | } |
624 | 630 | } |
625 | 631 | |
632 | +/** |
|
633 | + * @param string $domain |
|
634 | + */ |
|
626 | 635 | function isDomainResolves($domain) { |
627 | 636 | return (gethostbyname($domain) != $domain || count(dns_get_record($domain)) != 0); |
628 | 637 | } |
@@ -631,6 +640,9 @@ discard block |
||
631 | 640 | return dbFetchCell("SELECT `status` FROM `devices` WHERE `device_id` = ?", array($id)); |
632 | 641 | } |
633 | 642 | |
643 | +/** |
|
644 | + * @param string $ip |
|
645 | + */ |
|
634 | 646 | function match_network($nets, $ip, $first=false) { |
635 | 647 | $return = false; |
636 | 648 | if (!is_array ($nets)) $nets = array ($nets); |
@@ -751,6 +763,10 @@ discard block |
||
751 | 763 | return $result; |
752 | 764 | } |
753 | 765 | |
766 | +/** |
|
767 | + * @param string $subject |
|
768 | + * @param string $message |
|
769 | + */ |
|
754 | 770 | function send_mail($emails,$subject,$message,$html=false) { |
755 | 771 | global $config; |
756 | 772 | if( is_array($emails) || ($emails = parse_email($emails)) ) { |
@@ -986,6 +1002,9 @@ discard block |
||
986 | 1002 | } |
987 | 1003 | } |
988 | 1004 | |
1005 | +/** |
|
1006 | + * @param string $json |
|
1007 | + */ |
|
989 | 1008 | function _json_format($json, $options = 448) { |
990 | 1009 | $prettyPrint = (bool) ($options & JSON_PRETTY_PRINT); |
991 | 1010 | $unescapeUnicode = (bool) ($options & JSON_UNESCAPED_UNICODE); |
@@ -1026,6 +1045,10 @@ discard block |
||
1026 | 1045 | if ($unescapeUnicode && function_exists('mb_convert_encoding')) { |
1027 | 1046 | // http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha |
1028 | 1047 | $buffer = preg_replace_callback('/\\\\u([0-9a-f]{4})/i', |
1048 | + |
|
1049 | + /** |
|
1050 | + * @param string $match |
|
1051 | + */ |
|
1029 | 1052 | function ($match) { |
1030 | 1053 | return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE'); |
1031 | 1054 | }, $buffer); |
@@ -1086,6 +1109,9 @@ discard block |
||
1086 | 1109 | return $result; |
1087 | 1110 | } |
1088 | 1111 | |
1112 | +/** |
|
1113 | + * @param string $delay |
|
1114 | + */ |
|
1089 | 1115 | function convert_delay($delay) { |
1090 | 1116 | $delay = preg_replace('/\s/','',$delay); |
1091 | 1117 | if(strstr($delay, 'm',TRUE)) { |
@@ -1117,6 +1143,9 @@ discard block |
||
1117 | 1143 | return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); |
1118 | 1144 | } |
1119 | 1145 | |
1146 | +/** |
|
1147 | + * @param resource $post |
|
1148 | + */ |
|
1120 | 1149 | function set_curl_proxy($post) { |
1121 | 1150 | global $config; |
1122 | 1151 | if (isset($_ENV['https_proxy'])) { |
@@ -1204,6 +1233,11 @@ discard block |
||
1204 | 1233 | return true; |
1205 | 1234 | } |
1206 | 1235 | |
1236 | +/** |
|
1237 | + * @param string $host |
|
1238 | + * @param string $params |
|
1239 | + * @param integer $address_family |
|
1240 | + */ |
|
1207 | 1241 | function fping($host,$params,$address_family = AF_INET) { |
1208 | 1242 | |
1209 | 1243 | global $config; |
@@ -1248,6 +1282,9 @@ discard block |
||
1248 | 1282 | return $response; |
1249 | 1283 | } |
1250 | 1284 | |
1285 | +/** |
|
1286 | + * @param string $function |
|
1287 | + */ |
|
1251 | 1288 | function function_check($function) { |
1252 | 1289 | return function_exists($function); |
1253 | 1290 | } |