summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/validate.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-12-05 12:15:43 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-12-05 12:15:43 +0000
commit3265938a7cd0ef277bfc550ff47b60ed71b417de (patch)
tree308a9561fd97e3a2b449d5a36ad33f9db3552fbd /frontends/php/include/validate.inc.php
parentf65cf979409619d9de7174926e51c995f145017a (diff)
downloadzabbix-3265938a7cd0ef277bfc550ff47b60ed71b417de.tar.gz
zabbix-3265938a7cd0ef277bfc550ff47b60ed71b417de.tar.xz
zabbix-3265938a7cd0ef277bfc550ff47b60ed71b417de.zip
- improved editing of graphs (Eugene)
- developed 'Color picker' (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@3567 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/validate.inc.php')
-rw-r--r--frontends/php/include/validate.inc.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/frontends/php/include/validate.inc.php b/frontends/php/include/validate.inc.php
index 95ba33d9..98ea357d 100644
--- a/frontends/php/include/validate.inc.php
+++ b/frontends/php/include/validate.inc.php
@@ -29,6 +29,11 @@
define('ZBX_VALID_ERROR', 1);
define('ZBX_VALID_WARNING', 2);
+ function is_hex_color($value)
+ {
+ return eregi('[0-9,A-F]{6}', $value);
+ }
+
function BETWEEN($min,$max,$var=NULL)
{
return "({".$var."}>=".$min."&&{".$var."}<=".$max.")&&";
@@ -219,6 +224,20 @@
return ZBX_VALID_WARNING;
}
}
+
+ if(($type == T_ZBX_CLR) && !is_hex_color($var)) {
+ $var = 'FFFFFF';
+ if($flags&P_SYS)
+ {
+ info("Critical error. Field [".$field."] is not color");
+ return ZBX_VALID_ERROR;
+ }
+ else
+ {
+ info("Warning. Field [".$field."] is not color");
+ return ZBX_VALID_WARNING;
+ }
+ }
return ZBX_VALID_OK;
}