Passing current client to extension

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Passing current client to extension

Cayetano
This post has NOT been accepted by the mailing list yet.
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
Reply | Threaded
Open this post in threaded view
|

Re: Passing current client to extension

vnick
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/