From e34d69025ecee6921f2c4e2ef039a82c8f3c1c93 Mon Sep 17 00:00:00 2001 From: Luiz Costa Date: Tue, 4 Jun 2024 16:31:10 +0100 Subject: [PATCH] add extra parameters --- msp_remoteadmin/tools.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/msp_remoteadmin/tools.py b/msp_remoteadmin/tools.py index b206a4c..8d51d42 100644 --- a/msp_remoteadmin/tools.py +++ b/msp_remoteadmin/tools.py @@ -42,7 +42,17 @@ def create_session(name, protocol): uri = f"{protocol.lower()}://{ip_address}{':' + str(PROTOCOL_PORT[protocol])}" if protocol == 'RDP': - uri = f"{uri}/?ignore-cert=true&disable-audio=true{'&username=' + username if username else ''}{'&password=' + password if password else ''}{'&domain=' + domain if domain else ''}" + params = [] + if username: + params.append(f"username={username}") + if password: + params.append(f"password={password}") + if domain: + params.append(f"domain={domain}") + if guaca_config.keyboard_layout: + params.append(f"server-layout={guaca_config.keyboard_layout}") + if params: + uri = f"{uri}/?ignore-cert=true&disable-audio=true{'&'.join(params)}" elif protocol == 'SSH': params = [] if username: