diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-05-12 07:01:06 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-05-12 07:01:06 +0000 |
| commit | 06f68476ff0a32ab823885118054595894016f06 (patch) | |
| tree | b0f18b6058f40b4daa8aafc0c4e6995372ccaf8d /frontends/php/include/users.inc.php | |
| parent | b327677b4e405ccc71f6292fad2ff08abe2f7c99 (diff) | |
- fixes to zabbix_sender and other changes (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2823 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/users.inc.php')
| -rw-r--r-- | frontends/php/include/users.inc.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/frontends/php/include/users.inc.php b/frontends/php/include/users.inc.php index 87a762ac..26ea84d1 100644 --- a/frontends/php/include/users.inc.php +++ b/frontends/php/include/users.inc.php @@ -36,7 +36,7 @@ $sql="select * from users where alias=".zbx_dbstr($alias); $result=DBexecute($sql); - if(DBnum_rows($result)>0) + if(DBfetch($result)) { error("User '$alias' already exists"); return 0; @@ -64,7 +64,7 @@ $sql="select * from users where alias=".zbx_dbstr($alias)." and userid<>$userid"; $result=DBexecute($sql); - if(DBnum_rows($result)>0) + if(DBfetch($result)) { error("User '$alias' already exists"); return 0; @@ -117,9 +117,10 @@ function get_usergroup_by_groupid($groupid) { $result=DBselect("select * from usrgrp where usrgrpid=".$groupid); - if(DBnum_rows($result) == 1) + $row=DBfetch($result); + if($row) { - return DBfetch($result); + return $row; } error("No user groups with usrgrpid=[$groupid]"); return FALSE; @@ -129,9 +130,10 @@ { $sql="select * from users where userid=$userid"; $result=DBselect($sql); - if(DBnum_rows($result) == 1) + $row=DBfetch($result); + if($row) { - return DBfetch($result); + return $row; } else { @@ -155,7 +157,7 @@ $sql="select * from usrgrp where name=".zbx_dbstr($name); $result=DBexecute($sql); - if(DBnum_rows($result)>0) + if(DBfetch($result)) { error("Group '$name' already exists"); return 0; @@ -190,7 +192,7 @@ $sql="select * from usrgrp where name=".zbx_dbstr($name)." and usrgrpid<>$usrgrpid"; $result=DBexecute($sql); - if(DBnum_rows($result)>0) + if(DBfetch($result)) { error("Group '$name' already exists"); return 0; |
