[pbs-devel] [PATCH proxmox-backup] ui: add missing uri encoding in user edit and view

Dominik Csapak d.csapak at proxmox.com
Mon Jan 25 16:13:06 CET 2021


LGTM

Reviewed-by: Dominik Csapak <d.csapak at proxmox.com>

On 1/19/21 2:33 PM, Oguz Bektas wrote:
> userid parameter needs to be properly encoded when shown on the browser
> 
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
>   www/config/UserView.js | 2 ++
>   www/window/UserEdit.js | 2 +-
>   2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/www/config/UserView.js b/www/config/UserView.js
> index 4645737a..ae313776 100644
> --- a/www/config/UserView.js
> +++ b/www/config/UserView.js
> @@ -139,6 +139,8 @@ Ext.define('PBS.config.UserView', {
>   	    xtype: 'proxmoxStdRemoveButton',
>   	    baseurl: '/access/users/',
>   	    enableFn: (rec) => rec.data.userid !== 'root at pam',
> +	    getUrl: (rec) =>
> +		`/access/users/${encodeURIComponent(rec.getId())}`,
>   	    callback: 'reload',
>   	},
>   	'-',
> diff --git a/www/window/UserEdit.js b/www/window/UserEdit.js
> index aaae835f..06ec5377 100644
> --- a/www/window/UserEdit.js
> +++ b/www/window/UserEdit.js
> @@ -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;
>   
> 





More information about the pbs-devel mailing list