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);
......
...@@ -40,7 +40,6 @@ Ext.define('PVE.dc.UserEdit', { ...@@ -40,7 +40,6 @@ 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,
...@@ -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,6 +136,8 @@ Ext.define('PVE.dc.UserEdit', { ...@@ -136,6 +136,8 @@ 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', {
...@@ -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,9 +182,6 @@ Ext.define('PVE.dc.UserEdit', { ...@@ -176,9 +182,6 @@ Ext.define('PVE.dc.UserEdit', {
data.expire = null; data.expire = null;
} }
} }
update_passwd_field(data.realm);
me.setValues(data); 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