[pve-devel] [PATCH proxmox-widget-toolkit v1 2/2] fix #4546: utils: save expiring date of user account for UI

Lukas Wagner l.wagner at proxmox.com
Fri Oct 6 15:16:31 CEST 2023


Comments inline.

On 9/22/23 16:36, Philipp Hufnagl wrote:
> When an user experation date is send with the /accesss/tickets POST API
                     ^                   ^               ^
some minor typos: expiration          sent             access
> call, it will be stored in a global variable like the username
> 
> Signed-off-by: Philipp Hufnagl <p.hufnagl at proxmox.com>
> ---
(...)
> diff --git a/src/Utils.js b/src/Utils.js
> index a7ded2a..5481a32 100644
> --- a/src/Utils.js
> +++ b/src/Utils.js
> @@ -309,6 +309,9 @@ utilities: {
>   
>       setAuthData: function(data) {
>   	Proxmox.UserName = data.username;
> +	if (data.user_expieres !== '') {
Shouldn't this be !== null?

So maybe just do a
if (data['account-expiry-date']) {
     ...
}

> +	    Proxmox.UserExpires = data.user_expieres;
typo, and same general remark regarding the naming as in the
`access-control` patch.> +	}
>   	Proxmox.LoggedOut = data.LoggedOut;
>   	// creates a session cookie (expire = null)
>   	// that way the cookie gets deleted after the browser window is closed

Also, the CSS changes found in this commit should probably be in another 
commit.

Furthermore, I'd probably send the widget-toolkit patches before the
pve-manager patches, since you require the `Proxmox.UserExpires`
variable to be set in your changes for `pve-manager`.

-- 
- Lukas





More information about the pve-devel mailing list