Merge remote-tracking branch 'origin/v2.2'

This commit is contained in:
Adolfo Gómez García 2017-12-21 19:05:33 +01:00
commit 3694f10fff
4 changed files with 24 additions and 12 deletions

View File

@ -40,7 +40,7 @@ from uds.core.transports import protocols
import logging
import os
__updated__ = '2017-12-18'
__updated__ = '2017-12-21'
logger = logging.getLogger(__name__)
@ -102,9 +102,10 @@ class BaseRDPTransport(Transport):
multimedia = gui.CheckBoxField(label=_('Multimedia sync'), order=40, tooltip=_('If checked. Linux client will use multimedia parameter for xfreerdp'), tab='Linux Client')
alsa = gui.CheckBoxField(label=_('Use Alsa'), order=41, 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=42, tooltip=_('If printer is checked, the printer string used with xfreerdp client'), tab='Linux Client')
smartcardString = gui.TextField(label=_('Smartcard string'), order=43, tooltip=_('If smartcard is checked, the smartcard string used with xfreerdp client'), tab='Linux Client')
customParameters = gui.TextField(label=_('Custom parameters'), order=44, 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')
redirectHome = gui.CheckBoxField(label=_('Redirect home folder'), order=42, tooltip=_('If checked, Linux client will try to redirect /home local folder'), tab='Linux Client', defvalue=gui.FALSE)
printerString = gui.TextField(label=_('Printer string'), order=43, tooltip=_('If printer is checked, the printer string used with xfreerdp client'), tab='Linux Client')
smartcardString = gui.TextField(label=_('Smartcard string'), order=44, tooltip=_('If smartcard is checked, the smartcard string used with xfreerdp client'), tab='Linux Client')
customParameters = gui.TextField(label=_('Custom parameters'), order=45, 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):
"""

View File

@ -39,7 +39,7 @@ from uds.core.util import OsDetector
import six
import shlex
__updated__ = '2017-12-19'
__updated__ = '2017-12-21'
class RDPFile(object):
@ -54,6 +54,7 @@ class RDPFile(object):
redirectSerials = False
redirectPrinters = False
redirectDrives = False
redirectHome = False
redirectSmartcards = False
redirectAudio = True
compression = True
@ -120,13 +121,19 @@ class RDPFile(object):
if self.redirectDrives is True:
params.append('/drive:media,/media')
params.append('/home-drive')
# params.append('/home-drive')
if self.redirectHome is True:
params.append('/drive:home,/home')
if self.redirectSerials is True:
params.append('/serial:/dev/ttyS0')
if self.redirectPrinters and self.printerString not in (None, ''):
params.append('/printer:{}'.format(self.printerString))
if self.redirectPrinters:
if self.printerString not in (None, ''):
params.append('/printer:{}'.format(self.printerString))
else:
params.append('/printer')
if self.compression:
params.append('/compression:on')

View File

@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
READY_CACHE_TIMEOUT = 30
__updated__ = '2017-12-20'
__updated__ = '2017-12-21'
class RDPTransport(BaseRDPTransport):
@ -73,12 +73,13 @@ class RDPTransport(BaseRDPTransport):
aero = BaseRDPTransport.aero
smooth = BaseRDPTransport.smooth
credssp = BaseRDPTransport.credssp
multimedia = BaseRDPTransport.multimedia
screenSize = BaseRDPTransport.screenSize
colorDepth = BaseRDPTransport.colorDepth
alsa = BaseRDPTransport.alsa
multimedia = BaseRDPTransport.multimedia
redirectHome = BaseRDPTransport.redirectHome
printerString = BaseRDPTransport.printerString
smartcardString = BaseRDPTransport.smartcardString
customParameters = BaseRDPTransport.customParameters
@ -104,6 +105,7 @@ class RDPTransport(BaseRDPTransport):
r.redirectPrinters = self.allowPrinters.isTrue()
r.redirectSmartcards = self.allowSmartcards.isTrue()
r.redirectDrives = self.allowDrives.isTrue()
r.redirectHome = self.redirectHome.isTrue()
r.redirectSerials = self.allowSerials.isTrue()
r.enableClipboard = self.allowClipboard.isTrue()
r.redirectAudio = self.allowAudio.isTrue()

View File

@ -48,7 +48,7 @@ import logging
import random
import string
__updated__ = '2017-12-20'
__updated__ = '2017-12-21'
logger = logging.getLogger(__name__)
@ -89,12 +89,13 @@ class TRDPTransport(BaseRDPTransport):
aero = BaseRDPTransport.aero
smooth = BaseRDPTransport.smooth
credssp = BaseRDPTransport.credssp
multimedia = BaseRDPTransport.multimedia
screenSize = BaseRDPTransport.screenSize
colorDepth = BaseRDPTransport.colorDepth
alsa = BaseRDPTransport.alsa
multimedia = BaseRDPTransport.multimedia
redirectHome = BaseRDPTransport.redirectHome
printerString = BaseRDPTransport.printerString
smartcardString = BaseRDPTransport.smartcardString
customParameters = BaseRDPTransport.customParameters
@ -132,6 +133,7 @@ class TRDPTransport(BaseRDPTransport):
r.redirectPrinters = self.allowPrinters.isTrue()
r.redirectSmartcards = self.allowSmartcards.isTrue()
r.redirectDrives = self.allowDrives.isTrue()
r.redirectHome = self.redirectHome.isTrue()
r.redirectSerials = self.allowSerials.isTrue()
r.enableClipboard = self.allowClipboard.isTrue()
r.redirectAudio = self.allowAudio.isTrue()