mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-11 05:17:55 +03:00
Added "custom parameter" for xfreerdp
This commit is contained in:
parent
fe18faa863
commit
0bda00e43d
server/src/uds/transports
@ -79,6 +79,7 @@ class HTML5RDPTransport(Transport):
|
||||
smooth = gui.CheckBoxField(label=_('Font Smoothing'), order=23, tooltip=_('If checked, fonts smoothing will be allowed (windows clients only)'), tab=gui.PARAMETERS_TAB)
|
||||
enableAudio = gui.CheckBoxField(label=_('Enable Audio'), order=7, tooltip=_('If checked, the audio will be redirected to client (if client browser supports it)'), tab=gui.PARAMETERS_TAB)
|
||||
enablePrinting = gui.CheckBoxField(label=_('Enable Printing'), order=8, tooltip=_('If checked, the printing will be redirected to client (if client browser supports it)'), tab=gui.PARAMETERS_TAB)
|
||||
# enableFileShare = gui.CheckBoxField(label=_('Enable File Sharing'), order=8, tooltip=_('If checked, the user will be able to upload/download files (if client browser supports it)'), tab=gui.PARAMETERS_TAB)
|
||||
serverLayout = gui.ChoiceField(order=9,
|
||||
label=_('Layout'),
|
||||
tooltip=_('Keyboards Layout of server'),
|
||||
@ -169,9 +170,15 @@ class HTML5RDPTransport(Transport):
|
||||
'hostname': ip,
|
||||
'username': username,
|
||||
'password': password,
|
||||
'ignore-cert': 'true'
|
||||
|
||||
'ignore-cert': 'true',
|
||||
'security': 'any',
|
||||
'drive-path': '/share/{}'.format(user.uuid),
|
||||
'create-drive-path': 'true'
|
||||
}
|
||||
|
||||
# if self.enableFileSharing.isTrue():
|
||||
# params['enable-drive'] = self.serverLayout.value
|
||||
|
||||
if self.serverLayout.value != '-':
|
||||
params['server-layout'] = self.serverLayout.value
|
||||
|
||||
|
@ -42,7 +42,7 @@ from uds.core.util import connection
|
||||
import logging
|
||||
import os
|
||||
|
||||
__updated__ = '2017-03-31'
|
||||
__updated__ = '2017-06-05'
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -76,6 +76,7 @@ class BaseRDPTransport(Transport):
|
||||
alsa = gui.CheckBoxField(label=_('Use Alsa'), order=26, tooltip=_('If checked, Linux client will try to use ALSA, otherwise Pulse will be used'), tab='Linux Client')
|
||||
printerString = gui.TextField(label=_('Printer string'), order=27, tooltip=_('If printer is checked, the printer string used with xfreerdp client'), tab='Linux Client')
|
||||
smartcardString = gui.TextField(label=_('Smartcard string'), order=28, tooltip=_('If smartcard is checked, the smartcard string used with xfreerdp client'), tab='Linux Client')
|
||||
customParameters = gui.TextField(label=_('Custom parameters'), order=29, tooltip=_('If not empty, extra parameter to include for Linux Client (for example /usb:id,dev:054c:0268, or aything compatible with your xfreerdp client)'), tab='Linux Client')
|
||||
|
||||
def isAvailableFor(self, userService, ip):
|
||||
'''
|
||||
|
@ -40,7 +40,7 @@ from uds.core.util import OsDetector
|
||||
import six
|
||||
import os
|
||||
|
||||
__updated__ = '2017-03-20'
|
||||
__updated__ = '2017-06-05'
|
||||
|
||||
|
||||
class RDPFile(object):
|
||||
@ -68,6 +68,7 @@ class RDPFile(object):
|
||||
printerString = None
|
||||
smartcardString = None
|
||||
enablecredsspsupport = False
|
||||
linuxCustomParameters = None
|
||||
|
||||
def __init__(self, fullScreen, width, height, bpp, target=OsDetector.Windows):
|
||||
self.width = six.text_type(width)
|
||||
@ -145,6 +146,9 @@ class RDPFile(object):
|
||||
if self.domain != '':
|
||||
params.append('/d:{}'.format(self.domain))
|
||||
|
||||
if self.linuxCustomParameters is not None and self.linuxCustomParameters.strip() != '':
|
||||
params.append(self.linuxCustomParameters.strip())
|
||||
|
||||
return params
|
||||
|
||||
@property
|
||||
|
@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
READY_CACHE_TIMEOUT = 30
|
||||
|
||||
__updated__ = '2017-03-20'
|
||||
__updated__ = '2017-06-05'
|
||||
|
||||
|
||||
class RDPTransport(BaseRDPTransport):
|
||||
@ -74,6 +74,7 @@ class RDPTransport(BaseRDPTransport):
|
||||
alsa = BaseRDPTransport.alsa
|
||||
printerString = BaseRDPTransport.printerString
|
||||
smartcardString = BaseRDPTransport.smartcardString
|
||||
customParameters = BaseRDPTransport.customParameters
|
||||
|
||||
def getUDSTransportScript(self, userService, transport, ip, os, user, password, request):
|
||||
# We use helper to keep this clean
|
||||
@ -103,6 +104,7 @@ class RDPTransport(BaseRDPTransport):
|
||||
r.alsa = self.alsa.isTrue()
|
||||
r.smartcardString = self.smartcardString.value
|
||||
r.printerString = self.printerString.value
|
||||
r.linuxCustomParameters = self.customParameters.value
|
||||
|
||||
# data
|
||||
data = {
|
||||
|
@ -48,7 +48,7 @@ import logging
|
||||
import random
|
||||
import string
|
||||
|
||||
__updated__ = '2017-03-20'
|
||||
__updated__ = '2017-06-05'
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -92,6 +92,7 @@ class TRDPTransport(BaseRDPTransport):
|
||||
alsa = BaseRDPTransport.alsa
|
||||
printerString = BaseRDPTransport.printerString
|
||||
smartcardString = BaseRDPTransport.smartcardString
|
||||
customParameters = BaseRDPTransport.customParameters
|
||||
|
||||
def initialize(self, values):
|
||||
if values is not None:
|
||||
@ -133,6 +134,7 @@ class TRDPTransport(BaseRDPTransport):
|
||||
r.alsa = self.alsa.isTrue()
|
||||
r.smartcardString = self.smartcardString.value
|
||||
r.printerString = self.printerString.value
|
||||
r.linuxCustomParameters = self.customParameters.value
|
||||
|
||||
# data
|
||||
data = {
|
||||
|
Loading…
Reference in New Issue
Block a user