Commit afdd053c authored by Dietmar Maurer's avatar Dietmar Maurer

make password optional

parent 7d633d5f
...@@ -275,7 +275,7 @@ my $check_permissions = sub { ...@@ -275,7 +275,7 @@ my $check_permissions = sub {
return 1 if $perm->{user} && $perm->{user} eq 'all'; return 1 if $perm->{user} && $perm->{user} eq 'all';
return 1 if $perm->{user} && $perm->{user} eq 'arg' && return 1 if $perm->{user} && $perm->{user} eq 'arg' &&
$username eq $param->{username}; ($username eq $param->{username} || $username eq $param->{userid});
if ($perm->{path} && $perm->{privs}) { if ($perm->{path} && $perm->{privs}) {
my $path = PVE::Tools::template_replace($perm->{path}, $param); my $path = PVE::Tools::template_replace($perm->{path}, $param);
......
...@@ -17,7 +17,7 @@ Ext.define('PVE.dc.UserEdit', { ...@@ -17,7 +17,7 @@ Ext.define('PVE.dc.UserEdit', {
} else { } else {
url = '/api2/extjs/access/users/' + me.userid; url = '/api2/extjs/access/users/' + me.userid;
method = 'PUT'; method = 'PUT';
} }
var validate_pw = function() { var validate_pw = function() {
if (verifypw.getValue() !== pwfield.getValue()) { if (verifypw.getValue() !== pwfield.getValue()) {
...@@ -40,8 +40,7 @@ Ext.define('PVE.dc.UserEdit', { ...@@ -40,8 +40,7 @@ Ext.define('PVE.dc.UserEdit', {
inputType: 'password', inputType: 'password',
fieldLabel: gettext('Password'), fieldLabel: gettext('Password'),
minLength: 5, minLength: 5,
allowBlank: false, name: 'password',
name: 'password',
disabled: true, disabled: true,
hidden: true, hidden: true,
validator: validate_pw validator: validate_pw
...@@ -59,6 +58,7 @@ Ext.define('PVE.dc.UserEdit', { ...@@ -59,6 +58,7 @@ Ext.define('PVE.dc.UserEdit', {
verifypw.setVisible(false); verifypw.setVisible(false);
verifypw.setDisabled(true); verifypw.setDisabled(true);
} }
}; };
var column1 = [ var column1 = [
...@@ -136,7 +136,9 @@ Ext.define('PVE.dc.UserEdit', { ...@@ -136,7 +136,9 @@ Ext.define('PVE.dc.UserEdit', {
}, },
submitValue: false submitValue: false
}); });
} } else {
update_passwd_field(me.userid.match(/@([^@]+)$/)[1]);
}
var ipanel = Ext.create('PVE.panel.InputPanel', { var ipanel = Ext.create('PVE.panel.InputPanel', {
column1: column1, column1: column1,
...@@ -151,6 +153,10 @@ Ext.define('PVE.dc.UserEdit', { ...@@ -151,6 +153,10 @@ Ext.define('PVE.dc.UserEdit', {
values.userid = values.userid + '@' + realm; values.userid = values.userid + '@' + realm;
} }
if (!values.password) {
delete values.password;
}
return values; return values;
} }
}); });
...@@ -176,10 +182,7 @@ Ext.define('PVE.dc.UserEdit', { ...@@ -176,10 +182,7 @@ Ext.define('PVE.dc.UserEdit', {
data.expire = null; data.expire = null;
} }
} }
me.setValues(data);
update_passwd_field(data.realm);
me.setValues(data);
} }
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment