summaryrefslogtreecommitdiffstats
path: root/frontends/php
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-07-18 07:47:47 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-07-18 07:47:47 +0000
commitac9f1249cfe9a03b56ad1e58dbb0e227975c0f54 (patch)
treeaf2016df2e0d5d7884f43a010fdf203fb6d6a5b5 /frontends/php
parent0b72e200a1a74a5808e6d8efa5423babd701f658 (diff)
downloadzabbix-ac9f1249cfe9a03b56ad1e58dbb0e227975c0f54.tar.gz
zabbix-ac9f1249cfe9a03b56ad1e58dbb0e227975c0f54.tar.xz
zabbix-ac9f1249cfe9a03b56ad1e58dbb0e227975c0f54.zip
- [DEV-137] fixes to user update form (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5833 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
-rw-r--r--frontends/php/include/locales/en_gb.inc.php7
-rw-r--r--frontends/php/include/users.inc.php2
-rw-r--r--frontends/php/users.php9
3 files changed, 11 insertions, 7 deletions
diff --git a/frontends/php/include/locales/en_gb.inc.php b/frontends/php/include/locales/en_gb.inc.php
index e4e9bcab..39a07f5f 100644
--- a/frontends/php/include/locales/en_gb.inc.php
+++ b/frontends/php/include/locales/en_gb.inc.php
@@ -1412,14 +1412,15 @@
'S_CANNOT'=> 'Cannot',
'S_CANNOT_ADD_USER'=> 'Cannot add user',
'S_CANNOT_ADD_USER_BOTH_PASSWORDS_MUST'=>'Cannot add user. Both passwords must be equal.',
- 'S_USER_DELETED'=> 'User deleted',
+ 'S_USER_DELETED'=> 'User deleted',
'S_CANNOT_DELETE_USER'=> 'Cannot delete user',
+ 'S_PASSWORD_SHOULD_NOT_BE_EMPTY'=> 'Password should not be empty',
'S_FOR_GUEST_PASSWORD_MUST_BE_EMPTY'=> 'For guest, password must be empty',
- 'S_PERMISSION_DELETED'=> 'Permission deleted',
+ 'S_PERMISSION_DELETED'=> 'Permission deleted',
'S_CANNOT_DELETE_PERMISSION'=> 'Cannot delete permission',
'S_PERMISSION_ADDED'=> 'Permission added',
'S_CANNOT_ADD_PERMISSION'=> 'Cannot add permission',
- 'S_USER_UPDATED'=> 'User updated',
+ 'S_USER_UPDATED'=> 'User updated',
'S_ONLY_FOR_GUEST_ALLOWED_EMPTY_PASSWORD'=> 'Only user \'guest\' may have an empty password.',
'S_CANNOT_UPDATE_USER'=> 'Cannot update user',
'S_CANNOT_UPDATE_USER_BOTH_PASSWORDS'=> 'Cannot update user. Both passwords must be equal.',
diff --git a/frontends/php/include/users.inc.php b/frontends/php/include/users.inc.php
index 2cf72f69..bfcde145 100644
--- a/frontends/php/include/users.inc.php
+++ b/frontends/php/include/users.inc.php
@@ -107,7 +107,7 @@
' name='.zbx_dbstr($name).
' ,surname='.zbx_dbstr($surname).
' ,alias='.zbx_dbstr($alias).
- (isset($passwd) ? (',passwd='.zbx_dbstr(md5($passwd))) : '').
+ (isset($passwd)?(',passwd='.zbx_dbstr(md5($passwd))):'').
' ,url='.zbx_dbstr($url).
' ,autologin='.$autologin.
' ,autologout='.$autologout.
diff --git a/frontends/php/users.php b/frontends/php/users.php
index 5c9db6bd..58e254d3 100644
--- a/frontends/php/users.php
+++ b/frontends/php/users.php
@@ -147,8 +147,8 @@ include_once 'include/page_header.php';
$user_groups = get_request('user_groups', array());
$user_medias = get_request('user_medias', array());
- $_REQUEST['password1'] = get_request('password1', '');
- $_REQUEST['password2'] = get_request('password2', '');
+ $_REQUEST['password1'] = get_request('password1', null);
+ $_REQUEST['password2'] = get_request('password2', null);
if($_REQUEST['password1']!=$_REQUEST['password2']){
if(isset($_REQUEST['userid']))
@@ -156,9 +156,12 @@ include_once 'include/page_header.php';
else
show_error_message(S_CANNOT_ADD_USER_BOTH_PASSWORDS_MUST);
}
- else if(isset($_REQUEST['password1']) && $_REQUEST['password1'] != '' && $_REQUEST['alias']==ZBX_GUEST_USER){
+ else if(isset($_REQUEST['password1']) && ($_REQUEST['alias']==ZBX_GUEST_USER) && !zbx_empty($_REQUEST['password1'])){
show_error_message(S_FOR_GUEST_PASSWORD_MUST_BE_EMPTY);
}
+ else if(isset($_REQUEST['password1']) && ($_REQUEST['alias']!=ZBX_GUEST_USER) && zbx_empty($_REQUEST['password1'])){
+ show_error_message(S_PASSWORD_SHOULD_NOT_BE_EMPTY);
+ }
else {
if(isset($_REQUEST['userid'])){
$action = AUDIT_ACTION_UPDATE;