Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 832A3200D2E for ; Tue, 17 Oct 2017 02:40:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 81B05160BE9; Tue, 17 Oct 2017 00:40:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C91D61609EF for ; Tue, 17 Oct 2017 02:40:49 +0200 (CEST) Received: (qmail 16620 invoked by uid 500); 17 Oct 2017 00:40:48 -0000 Mailing-List: contact user-help@guacamole.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@guacamole.incubator.apache.org Delivered-To: mailing list user@guacamole.incubator.apache.org Received: (qmail 16611 invoked by uid 99); 17 Oct 2017 00:40:48 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Oct 2017 00:40:48 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 143BB1800FF for ; Tue, 17 Oct 2017 00:40:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.284 X-Spam-Level: ** X-Spam-Status: No, score=2.284 tagged_above=-999 required=6.31 tests=[SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.972, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id HsHGlJ6VOhQo for ; Tue, 17 Oct 2017 00:40:47 +0000 (UTC) Received: from n4.nabble.com (n4.nabble.com [162.253.133.72]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 37AF05F6CD for ; Tue, 17 Oct 2017 00:40:46 +0000 (UTC) Received: from mben.nabble.com (localhost [127.0.0.1]) by n4.nabble.com (Postfix) with ESMTP id 0A8F7150F64E1 for ; Mon, 16 Oct 2017 17:40:45 -0700 (MST) Date: Mon, 16 Oct 2017 17:40:45 -0700 (MST) From: vnick To: user@guacamole.incubator.apache.org Message-ID: <1508200845003-0.post@n4.nabble.com> In-Reply-To: References: Subject: Re: Passing current client to extension MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Tue, 17 Oct 2017 00:40:50 -0000 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 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/