ui: add missing uri encoding in user edit and view

userid parameter needs to be properly encoded when shown on the browser

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Oguz Bektas 2021-01-19 14:33:23 +01:00 committed by Wolfgang Bumiller
parent 6864fd0149
commit d43265b7f1
2 changed files with 3 additions and 1 deletions

View File

@ -139,6 +139,8 @@ Ext.define('PBS.config.UserView', {
xtype: 'proxmoxStdRemoveButton',
baseurl: '/access/users/',
enableFn: (rec) => rec.data.userid !== 'root@pam',
getUrl: (rec) =>
`/access/users/${encodeURIComponent(rec.getId())}`,
callback: 'reload',
},
'-',

View File

@ -20,7 +20,7 @@ Ext.define('PBS.window.UserEdit', {
var baseurl = '/api2/extjs/access/users';
me.isCreate = !userid;
me.url = userid ? baseurl + '/' + userid : baseurl;
me.url = userid ? baseurl + '/' + encodeURIComponent(userid) : baseurl;
me.method = userid ? 'PUT' : 'POST';
me.autoLoad = !!userid;