RE: Re: UserName in Guacamole Extension

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

RE: Re: UserName in Guacamole Extension

@eve0s

·         Replace content of menu-dropdown to add an ID on the username DIV

 

------------------------

 

<meta name="replace" content=".menu-dropdown">

<div class="menu-dropdown" ng-class="{open: menuShown}" ng-click="toggleMenu()">

    <div id=" USERNAMEDIV'" class="menu-title">{{menuTitle}}</div>

    <div class="menu-indicator"></div>

 

    <!-- Menu contents -->

    <div class="menu-contents" ng-transclude></div>

</div>

------------------------

 

·         Then you can access this variable by jquery.

 

------------------------

 

$('#USERNAMEDIV').html()

------------------------

 

 

·         Don’t forget that all variable used on the client side can be hack.  You shouldn't use those variable for security.

 

 

Reply | Threaded
Open this post in threaded view
|

RE: Re: UserName in Guacamole Extension

@eve0s
Oups. There were a space and a quote from a bad paste…
 
The corrected line.
 
--------
 
<div id="USERNAMEDIV" class="menu-title">{{menuTitle}}</div>

 

 

De : @eve0s [mailto:[hidden email]]
Envoyé : 16 octobre 2017 16:44
À : [hidden email]
Objet : RE: Re: UserName in Guacamole Extension

 

·         Replace content of menu-dropdown to add an ID on the username DIV

 

------------------------

 

<meta name="replace" content=".menu-dropdown">

<div class="menu-dropdown" ng-class="{open: menuShown}" ng-click="toggleMenu()">

    <div id=" USERNAMEDIV'" class="menu-title">{{menuTitle}}</div>

    <div class="menu-indicator"></div>

 

    <!-- Menu contents -->

    <div class="menu-contents" ng-transclude></div>

</div>

------------------------

 

·         Then you can access this variable by jquery.

 

------------------------

 

$('#USERNAMEDIV').html()

------------------------

 

 

·         Don’t forget that all variable used on the client side can be hack.  You shouldn't use those variable for security.

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Re: UserName in Guacamole Extension

Nick Couchman
In reply to this post by @eve0s
On Mon, Oct 16, 2017 at 4:44 PM, @eve0s <[hidden email]> wrote:

·         Replace content of menu-dropdown to add an ID on the username DIV

 

------------------------

 

<meta name="replace" content=".menu-dropdown">

<div class="menu-dropdown" ng-class="{open: menuShown}" ng-click="toggleMenu()">

    <div id=" USERNAMEDIV'" class="menu-title">{{menuTitle}}</div>

    <div class="menu-indicator"></div>

 

    <!-- Menu contents -->

    <div class="menu-contents" ng-transclude></div>

</div>

------------------------

 

·         Then you can access this variable by jquery.

 

------------------------

 

$('#USERNAMEDIV').html()

------------------------

 

 

·         Don’t forget that all variable used on the client side can be hack.  You shouldn't use those variable for security.

I'm not entirely sure what this thread is about, as its missing some context, but its similar to another thread I responded to earlier.  The username of the currently logged in user should be available using the authenticationService service and the getCurrentUsername() method.  You should be able to inject that module into your AngularJS code and retrieve the username for the extension.

-Nick