summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/validate.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-20 11:39:17 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-20 11:39:17 +0000
commita23c4de7f946b02f036315d319591ff5cfe08a93 (patch)
treef919d1e183903909f5d4220e9be574e2dd2b3351 /frontends/php/include/validate.inc.php
parent80e1c36d1b3ae7593d368ca1e4d7bee2ff8f40f7 (diff)
downloadzabbix-a23c4de7f946b02f036315d319591ff5cfe08a93.tar.gz
zabbix-a23c4de7f946b02f036315d319591ff5cfe08a93.tar.xz
zabbix-a23c4de7f946b02f036315d319591ff5cfe08a93.zip
- developed configuration interface for discovery (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3900 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/validate.inc.php')
-rw-r--r--frontends/php/include/validate.inc.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/frontends/php/include/validate.inc.php b/frontends/php/include/validate.inc.php
index e2f0726a..ea704e4b 100644
--- a/frontends/php/include/validate.inc.php
+++ b/frontends/php/include/validate.inc.php
@@ -46,6 +46,8 @@
function IN($array,$var='')
{
+ if(is_array($array)) $array = implode(',', $array);
+
return "in_array({".$var."},array(".$array."))&&";
}
function HEX($var=NULL)
@@ -189,6 +191,15 @@
foreach($var as $el) $err |= check_type($field, $flags, $el, T_ZBX_INT);
return $err;
}
+
+ if($type == T_ZBX_PORTS)
+ {
+ $err = ZBX_VALID_OK;
+ foreach(explode(',', $var) as $el)
+ foreach(explode('-', $el) as $p)
+ $err |= check_type($field, $flags, $p, T_ZBX_INT);
+ return $err;
+ }
if(($type == T_ZBX_INT) && !is_numeric($var)) {
if($flags&P_SYS)