summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-07-02 13:14:35 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-07-02 13:14:35 +0000
commit15b3431d068216bb134c64ff52af63bebc8f45f0 (patch)
tree71e8667413452be6de6a27de24e32f634131d8cd /frontends/php/include
parent9c1ce6fd1d7f4617f0796fa9eb9246e4e184813c (diff)
downloadzabbix-15b3431d068216bb134c64ff52af63bebc8f45f0.tar.gz
zabbix-15b3431d068216bb134c64ff52af63bebc8f45f0.tar.xz
zabbix-15b3431d068216bb134c64ff52af63bebc8f45f0.zip
- [DEV-144] improvements in users authentication methods (Artem)
- [ZBX-387] fixed issue with undefined function ctype_digit (Artem) git-svn-id: svn://svn.zabbix.com/trunk@5814 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/forms.inc.php8
-rw-r--r--frontends/php/include/func.inc.php6
-rw-r--r--frontends/php/include/perm.inc.php29
3 files changed, 40 insertions, 3 deletions
diff --git a/frontends/php/include/forms.inc.php b/frontends/php/include/forms.inc.php
index 4e8a8294..71f0c653 100644
--- a/frontends/php/include/forms.inc.php
+++ b/frontends/php/include/forms.inc.php
@@ -778,7 +778,9 @@
$frmUser->AddRow(S_SURNAME, new CTextBox("surname",$surname,40));
}
- if(ZBX_AUTH_INTERNAL == $config['authentication_type']){
+ $auth_type = (isset($userid))?get_user_system_auth($userid):$config['authentication_type'];
+
+ if(ZBX_AUTH_INTERNAL == $auth_type){
if(!isset($userid) || isset($change_password)){
$frmUser->AddRow(S_PASSWORD, new CPassBox("password1",$password1,20));
$frmUser->AddRow(S_PASSWORD_ONCE_AGAIN, new CPassBox("password2",$password2,20));
@@ -795,8 +797,8 @@
}
else{
if(!isset($userid) || isset($change_password)){
- $frmUser->addVar('password1','zabbix');
- $frmUser->addVar('password2','zabbix');
+ $frmUser->addVar('password1','');
+ $frmUser->addVar('password2','');
}
}
diff --git a/frontends/php/include/func.inc.php b/frontends/php/include/func.inc.php
index 2e67e260..299ae747 100644
--- a/frontends/php/include/func.inc.php
+++ b/frontends/php/include/func.inc.php
@@ -223,6 +223,12 @@ function zbx_rksort(&$array, $flags=NULL){
/************* END SORT *************/
/************* ZBX MISC *************/
+if(!function_exists('ctype_digit')){
+ function ctype_digit($x){
+ return preg_match('/^\\d+$/',$x);
+ }
+}
+
function zbx_numeric($value){
if(is_array($value)) return false;
if(zbx_empty($value)) return false;
diff --git a/frontends/php/include/perm.inc.php b/frontends/php/include/perm.inc.php
index e47d104c..5fd080c3 100644
--- a/frontends/php/include/perm.inc.php
+++ b/frontends/php/include/perm.inc.php
@@ -219,6 +219,35 @@ function get_user_auth($userid){
return $result;
}
+/* Function: get_user_system_auth()
+ *
+ * Description:
+ * Returns overal user authentication type in system
+ *
+ * Comments:
+ * default is INTERNAL auth
+ *
+ * Author: Aly
+ */
+function get_user_system_auth($userid){
+ $result = ZBX_AUTH_INTERNAL;
+
+ $user_auth = get_user_auth($userid);
+
+ switch($user_auth){
+ case GROUP_GUI_ACCESS_SYSTEM:
+ $config = select_config();
+ $result = $config['authentication_type'];
+ break;
+ case GROUP_GUI_ACCESS_INTERNAL:
+ case GROUP_GUI_ACCESS_DISABLED:
+ default:
+ break;
+ }
+
+return $result;
+}
+
/***********************************************
GET ACCESSIBLE RESOURCES BY USERID
************************************************/