diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-07-02 11:59:49 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-07-02 11:59:49 +0000 |
| commit | 8dffbd722749472d9704f6d5d5547f83f738198c (patch) | |
| tree | daa3d0f4378832810847317824eb6b42a7e1e047 /frontends/php/include/perm.inc.php | |
| parent | 9158473c0884eabb4877274af46d3991cb6ed854 (diff) | |
- [DEV-144] add possibility to force user groups to authenticate internally (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5810 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/perm.inc.php')
| -rw-r--r-- | frontends/php/include/perm.inc.php | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/frontends/php/include/perm.inc.php b/frontends/php/include/perm.inc.php index e8565471..e47d104c 100644 --- a/frontends/php/include/perm.inc.php +++ b/frontends/php/include/perm.inc.php @@ -173,7 +173,7 @@ function check_perm2system($userid){ ' WHERE ug.userid = '.zbx_dbstr($userid). ' AND g.usrgrpid = ug.usrgrpid '. ' AND g.users_status = '.GROUP_STATUS_DISABLED; - $res = DBFetch(DBSelect($sql)); + $res = DBfetch(DBSelect($sql)); return ($res['grp_count'] == 0)?true:false; } @@ -189,15 +189,34 @@ return ($res['grp_count'] == 0)?true:false; * Author: Aly */ -function check_perm2login($userid){ - $sql = 'SELECT COUNT(g.usrgrpid) as grp_count '. +function check_perm2login($userid){ + $res = get_user_auth($userid); + +return (GROUP_GUI_ACCESS_DISABLED == $res)?false:true; +} + +/* Function: get_user_auth() + * + * Description: + * Returns user authentication type + * + * Comments: + * default is SYSTEM auth + * + * Author: Aly + */ +function get_user_auth($userid){ + $result = GROUP_GUI_ACCESS_SYSTEM; + + $sql = 'SELECT MAX(g.gui_access) as gui_access '. ' FROM usrgrp g, users_groups ug '. - ' WHERE ug.userid = '.zbx_dbstr($userid). - ' AND g.usrgrpid = ug.usrgrpid '. - ' AND g.gui_access = '.GROUP_GUI_ACCESS_DISABLED; - $res = DBFetch(DBSelect($sql)); + ' WHERE ug.userid='.zbx_dbstr($userid). + ' AND g.usrgrpid=ug.usrgrpid '; + $acc = DBfetch(DBselect($sql)); -return ($res['grp_count'] == 0)?true:false; + if(!zbx_empty($acc['gui_access'])) $result=$acc['gui_access']; + +return $result; } /*********************************************** |
