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

This commit is contained in:
Adolfo Gómez García 2018-05-18 12:03:50 +02:00
commit 9f98fc6f6d
4 changed files with 25 additions and 13 deletions

View File

@ -40,7 +40,7 @@ from uds.core.transports import protocols
import logging import logging
import os import os
__updated__ = '2018-03-21' __updated__ = '2018-05-18'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -63,7 +63,17 @@ class BaseRDPTransport(Transport):
allowSmartcards = gui.CheckBoxField(label=_('Allow Smartcards'), order=20, tooltip=_('If checked, this transport will allow the use of smartcards'), tab=gui.PARAMETERS_TAB) allowSmartcards = gui.CheckBoxField(label=_('Allow Smartcards'), order=20, tooltip=_('If checked, this transport will allow the use of smartcards'), tab=gui.PARAMETERS_TAB)
allowPrinters = gui.CheckBoxField(label=_('Allow Printers'), order=21, tooltip=_('If checked, this transport will allow the use of user printers'), tab=gui.PARAMETERS_TAB) allowPrinters = gui.CheckBoxField(label=_('Allow Printers'), order=21, tooltip=_('If checked, this transport will allow the use of user printers'), tab=gui.PARAMETERS_TAB)
allowDrives = gui.CheckBoxField(label=_('Allow Drives'), order=22, tooltip=_('If checked, this transport will allow the use of user drives'), tab=gui.PARAMETERS_TAB) allowDrives = gui.ChoiceField(
label=_('Allow Drives'),
order=22,
tooltip=_('Local drives redirection allowed'),
defvalue='false',
values=[
{'id': 'false', 'text': 'None' },
{'id': 'dynamic', 'text': 'Only PnP drives' },
{'id': 'true', 'text': 'All drives' },
], tab=gui.PARAMETERS_TAB)
allowSerials = gui.CheckBoxField(label=_('Allow Serials'), order=23, tooltip=_('If checked, this transport will allow the use of user serial ports'), tab=gui.PARAMETERS_TAB) allowSerials = gui.CheckBoxField(label=_('Allow Serials'), order=23, tooltip=_('If checked, this transport will allow the use of user serial ports'), tab=gui.PARAMETERS_TAB)
allowClipboard = gui.CheckBoxField(label=_('Enable clipboard'), order=24, tooltip=_('If checked, copy-paste functions will be allowed'), tab=gui.PARAMETERS_TAB, defvalue=gui.TRUE) allowClipboard = gui.CheckBoxField(label=_('Enable clipboard'), order=24, tooltip=_('If checked, copy-paste functions will be allowed'), tab=gui.PARAMETERS_TAB, defvalue=gui.TRUE)
allowAudio = gui.CheckBoxField(label=_('Enable sound'), order=25, tooltip=_('If checked, sound will be redirected.'), tab=gui.PARAMETERS_TAB, defvalue=gui.TRUE) allowAudio = gui.CheckBoxField(label=_('Enable sound'), order=25, tooltip=_('If checked, sound will be redirected.'), tab=gui.PARAMETERS_TAB, defvalue=gui.TRUE)

View File

@ -39,7 +39,7 @@ from uds.core.util import OsDetector
import six import six
import shlex import shlex
__updated__ = '2018-03-21' __updated__ = '2018-05-18'
class RDPFile(object): class RDPFile(object):
@ -53,7 +53,7 @@ class RDPFile(object):
password = '' password = ''
redirectSerials = False redirectSerials = False
redirectPrinters = False redirectPrinters = False
redirectDrives = False redirectDrives = "false" # Can have "true", "false" or "dynamic"
redirectHome = False redirectHome = False
redirectSmartcards = False redirectSmartcards = False
redirectAudio = True redirectAudio = True
@ -119,7 +119,7 @@ class RDPFile(object):
if self.multimedia: if self.multimedia:
params.append('/multimedia') params.append('/multimedia')
if self.redirectDrives is True: if self.redirectDrives != 'false':
params.append('/drive:media,/media') params.append('/drive:media,/media')
# params.append('/home-drive') # params.append('/home-drive')
@ -198,7 +198,7 @@ class RDPFile(object):
else: else:
params.append('-rsound:off') params.append('-rsound:off')
if self.redirectDrives is True: if self.redirectDrives != 'false':
params.append('-rdisk:media=/media') params.append('-rdisk:media=/media')
if self.redirectSerials is True: if self.redirectSerials is True:
@ -270,7 +270,6 @@ class RDPFile(object):
screenMode = self.fullScreen and "2" or "1" screenMode = self.fullScreen and "2" or "1"
audioMode = self.redirectAudio and "0" or "2" audioMode = self.redirectAudio and "0" or "2"
serials = self.redirectSerials and "1" or "0" serials = self.redirectSerials and "1" or "0"
drives = self.redirectDrives and "1" or "0"
scards = self.redirectSmartcards and "1" or "0" scards = self.redirectSmartcards and "1" or "0"
printers = self.redirectPrinters and "1" or "0" printers = self.redirectPrinters and "1" or "0"
compression = self.compression and "1" or "0" compression = self.compression and "1" or "0"
@ -322,8 +321,11 @@ class RDPFile(object):
if self.redirectAudio is True: if self.redirectAudio is True:
res += 'audiocapturemode:i:1\n' res += 'audiocapturemode:i:1\n'
if self.redirectDrives is True: if self.redirectDrives != 'false':
if self.redirectDrives == 'true':
res += 'drivestoredirect:s:*\n' res += 'drivestoredirect:s:*\n'
else: # Dynamic
res += 'drivestoredirect:s:DynamicDrives\n'
res += 'devicestoredirect:s:*\n' res += 'devicestoredirect:s:*\n'
res += 'enablecredsspsupport:i:{}\n'.format(0 if self.enablecredsspsupport is False else 1) res += 'enablecredsspsupport:i:{}\n'.format(0 if self.enablecredsspsupport is False else 1)
@ -344,7 +346,7 @@ class RDPFile(object):
<integer>{}</integer> <integer>{}</integer>
</dict>'''.format(self.width, self.height) </dict>'''.format(self.width, self.height)
drives = self.redirectDrives and "1" or "0" drives = self.redirectDrives != 'false' and "1" or "0"
audioMode = self.redirectAudio and "0" or "2" audioMode = self.redirectAudio and "0" or "2"
wallpaper = self.showWallpaper and 'true' or 'false' wallpaper = self.showWallpaper and 'true' or 'false'

View File

@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
READY_CACHE_TIMEOUT = 30 READY_CACHE_TIMEOUT = 30
__updated__ = '2017-12-21' __updated__ = '2018-05-18'
class RDPTransport(BaseRDPTransport): class RDPTransport(BaseRDPTransport):

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright (c) 2012 Virtual Cable S.L. # Copyright (c) 2012-2018 Virtual Cable S.L.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without modification, # Redistribution and use in source and binary forms, with or without modification,
@ -48,7 +48,7 @@ import logging
import random import random
import string import string
__updated__ = '2017-12-21' __updated__ = '2018-05-18'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)