guacamole-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vnick <vn...@apache.org>
Subject Re: Passing current client to extension
Date Tue, 17 Oct 2017 00:40:45 GMT
Cayetano wrote
> I am writing an extension that adds a few "buttons" to each connection.
> 
> It works fine by passing "{{context.getClientIdentifier (item)}}" for
> connection data.
> I need to also pass the name or the identifier of the user that is logged
> in. Something similar to:
> 
> http: //someserver/page.php? connection = {{context.getClientIdentifier
> (item)}} & user = .....
> 
> Can you help me with this?
> 
> I've tried using {item.currenUserName} and others, with no result.
> 
> Thank you

I don't think you'll find it in the context object where you're getting the
connection name.  Take a look at the authenticationService module, and the
getCurrentUsername() method, in particular:

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

You'll need to inject the authenticationService module into your javascript
code, and make sure you make it available to whatever template you're
constructing, but it should be relatively straight-forward to get the
username.

-Nick



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

Mime
View raw message