mirror of
https://github.com/itsdave-de/msp_remoteadmin.git
synced 2025-06-28 05:04:05 +02:00
add domain parameters when exists with RDP
This commit is contained in:
parent
9ebe41fd66
commit
c026d95060
@ -35,12 +35,13 @@ def create_session(name, protocol):
|
|||||||
acc_doc = frappe.get_doc('IT User Account', doc.get('link'))
|
acc_doc = frappe.get_doc('IT User Account', doc.get('link'))
|
||||||
username = acc_doc.username
|
username = acc_doc.username
|
||||||
password = acc_doc.get_password('password')
|
password = acc_doc.get_password('password')
|
||||||
|
domain = acc_doc.get('domain') if acc_doc.get('domain') else None
|
||||||
# Get IP
|
# Get IP
|
||||||
ip_doc = frappe.get_doc('IP Address', doc.get('main_ip'))
|
ip_doc = frappe.get_doc('IP Address', doc.get('main_ip'))
|
||||||
ip_address = ip_doc.ip_address
|
ip_address = ip_doc.ip_address
|
||||||
|
|
||||||
uri = urllib.parse.quote_plus(f"{protocol}://{username if username else ''}{':' + password if password else ''}@{ip_address}{':' + str(PROTOCOL_PORT[protocol])}").lower()
|
uri = f"{protocol}://{username if username else ''}{':' + password if password else ''}@{ip_address}{':' + str(PROTOCOL_PORT[protocol])}"
|
||||||
if protocol == 'RDP':
|
if protocol == 'RDP':
|
||||||
uri = f"{uri}/?ignore-cert=true&disable-audio=true"
|
uri = f"{uri}/?ignore-cert=true&disable-audio=true{'&domain=' + domain if domain else ''}"
|
||||||
url = f'{guaca_config.guacamole_server}/?#/?token={token}&quickconnect={uri}'
|
url = f'{guaca_config.guacamole_server}/?#/?token={token}&quickconnect={urllib.parse.quote_plus(uri).lower()}'
|
||||||
return url
|
return url
|
||||||
|
Loading…
x
Reference in New Issue
Block a user