guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vnick <vn...@apache.org>
Subject Re: UserName in Guacamole Extension
Date Tue, 03 Oct 2017 14:41:05 GMT
Cayetano wrote
> In an extension for guacamole neesito obtain the name or the ID of the
> current user. The idea is to add a link to other functions and pass the
> user and the connection
> To get the connection ID I use a page like this:
> ---
> <meta name="after-children" content=".home-connection">
> <spam class="vm-manager">
> &lt;a href =
> http://&lt;someserver&gt;/manager?vm={{context.getClientIdentifier(item)}}
> target=\"_blank\"> 
<images/gear.png>  
> 
> </spam>
> ---
> Can you do the same to get the user ID?
> I have tried using {{username}}, {{context: getusername ()}} and others,
> but they do not provide the user name or ID value.
> 
> Regards
> 
> Cayetano

I'm not sure how your controller looks for your extension, but you'll
probably need to use the $injector object to get the correct service to grab
the username.  The authenticationService might be what you want - there's a
getCurrentUsername() method that probably does what you want:

https://github.com/apache/incubator-guacamole-client/blob/d808f7fbbdef9a0e14b139ac31e9fa225354efc6/guacamole/src/main/webapp/app/auth/service/authenticationService.js#L347


-Nick



--
Sent from: http://apache-guacamole-incubating-users.2363388.n4.nabble.com/

Mime
View raw message