summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/config.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-07 09:18:28 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-03-07 09:18:28 +0000
commitb9a000e8a8ecf3534478ecb04e6e5cc9a18cc3bf (patch)
treeb200e1d3ed10b1094d31dcc180a4473a1f4b481d /frontends/php/include/config.inc.php
parent78742376ffa7f0d503885646b130d1238761b94b (diff)
downloadzabbix-b9a000e8a8ecf3534478ecb04e6e5cc9a18cc3bf.tar.gz
zabbix-b9a000e8a8ecf3534478ecb04e6e5cc9a18cc3bf.tar.xz
zabbix-b9a000e8a8ecf3534478ecb04e6e5cc9a18cc3bf.zip
added user group for database down messages [GUI]
git-svn-id: svn://svn.zabbix.com/trunk@3878 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/config.inc.php')
-rw-r--r--frontends/php/include/config.inc.php46
1 files changed, 40 insertions, 6 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index b8c2b0ac..fd1ee764 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1011,17 +1011,51 @@ else
# Update configuration
- function update_config($event_history,$alert_history,$refresh_unsupported,$work_period)
+ function update_config($event_history,$alert_history,$refresh_unsupported,$work_period,$alert_usrgrpid)
{
- if(validate_period($work_period) != 0)
+ global $ZBX_CURNODEID;
+
+ $update = array();
+
+ if(!is_null($event_history))
+ {
+ $update[] = 'event_history='.$event_history;
+ }
+ if(!is_null($alert_history))
+ {
+ $update[] = 'alert_history='.$alert_history;
+ }
+ if(!is_null($refresh_unsupported))
+ {
+ $update[] = 'refresh_unsupported='.$refresh_unsupported;
+ }
+ if(!is_null($work_period))
+ {
+ if(validate_period($work_period) != 0)
+ {
+ error(S_ICORRECT_WORK_PERIOD);
+ return NULL;
+ }
+ $update[] = 'work_period='.zbx_dbstr($work_period);
+ }
+ if(!is_null($alert_usrgrpid))
+ {
+ if($alert_usrgrpid != 0 && !DBfetch(DBselect('select usrgrpid from usrgrp where usrgrpid='.$alert_usrgrpid)))
+ {
+ error(S_INCORRECT_GROUP);;
+ return NULL;
+ }
+ $update[] = 'alert_usrgrpid='.$alert_usrgrpid;
+ }
+ if(count($update) == 0)
{
- error("Icorrect work period");
+ error(S_NOTHING_TO_DO);
return NULL;
}
- return DBexecute("update config set event_history=$event_history,alert_history=$alert_history,".
- " refresh_unsupported=$refresh_unsupported,".
- " work_period=".zbx_dbstr($work_period));
+ return DBexecute('update config set '.implode(',',$update).
+ ' where '.DBid2nodeid('configid')."=".$ZBX_CURNODEID);
+
}
function &get_table_header($col1, $col2=SPACE)