diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-11-19 14:44:33 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-11-19 14:44:33 +0000 |
| commit | 80d32dfa60b345daf26d55b6f8fae691f74ab701 (patch) | |
| tree | 09ee997fc6af74087e39e9cc6627bc9cc45624ce /frontends/php/include | |
| parent | ee77386acef0d6b3196080692c8013b54be1e072 (diff) | |
Support for Update User Group.
git-svn-id: svn://svn.zabbix.com/trunk@1041 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
| -rw-r--r-- | frontends/php/include/config.inc.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php index 911afc0c..e51d3a1d 100644 --- a/frontends/php/include/config.inc.php +++ b/frontends/php/include/config.inc.php @@ -2732,6 +2732,37 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid"; return $result; } + + function update_user_group($usrgrpid,$name,$users) + { + global $ERROR_MSG; + + if(!check_right("Host","U",0)) + { + $ERROR_MSG="Insufficient permissions"; + return 0; + } + + $sql="select * from usrgrp where name='$name' and usrgrpid<>$usrgrpid"; + $result=DBexecute($sql); + if(DBnum_rows($result)>0) + { + $ERROR_MSG="Group '$name' already exists"; + return 0; + } + + $sql="update usrgrp set name='$name' where usrgrpid=$usrgrpid"; + $result=DBexecute($sql); + if(!$result) + { + return $result; + } + + update_user_groups($usrgrpid,$users); + + return $result; + } + # Add Host definition |
