Commit afdd053c authored by Dietmar Maurer's avatar Dietmar Maurer

make password optional

parent 7d633d5f
......@@ -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 'arg' &&
$username eq $param->{username};
($username eq $param->{username} || $username eq $param->{userid});
if ($perm->{path} && $perm->{privs}) {
my $path = PVE::Tools::template_replace($perm->{path}, $param);
......
......@@ -17,7 +17,7 @@ Ext.define('PVE.dc.UserEdit', {
} else {
url = '/api2/extjs/access/users/' + me.userid;
method = 'PUT';
}
}
var validate_pw = function() {
if (verifypw.getValue() !== pwfield.getValue()) {
......@@ -40,8 +40,7 @@ Ext.define('PVE.dc.UserEdit', {
inputType: 'password',
fieldLabel: gettext('Password'),
minLength: 5,
allowBlank: false,
name: 'password',
name: 'password',
disabled: true,
hidden: true,
validator: validate_pw
......@@ -59,6 +58,7 @@ Ext.define('PVE.dc.UserEdit', {
verifypw.setVisible(false);
verifypw.setDisabled(true);
}
};
var column1 = [
......@@ -136,7 +136,9 @@ Ext.define('PVE.dc.UserEdit', {
},
submitValue: false
});
}
} else {
update_passwd_field(me.userid.match(/@([^@]+)$/)[1]);
}
var ipanel = Ext.create('PVE.panel.InputPanel', {
column1: column1,
......@@ -151,6 +153,10 @@ Ext.define('PVE.dc.UserEdit', {
values.userid = values.userid + '@' + realm;
}
if (!values.password) {
delete values.password;
}
return values;
}
});
......@@ -176,10 +182,7 @@ Ext.define('PVE.dc.UserEdit', {
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