Merge remote-tracking branch 'origin/v3.5'

This commit is contained in:
Adolfo Gómez García 2022-06-13 11:25:25 +02:00
commit fefd53c84f
2 changed files with 20 additions and 14 deletions

View File

@ -193,7 +193,7 @@ class HTML5RDPTransport(transports.Transport):
{'id': 'disabled', 'text': _('Disable clipboard')},
{'id': 'dis-copy', 'text': _('Disable copy from remote')},
{'id': 'dis-paste', 'text': _('Disable paste to remote')},
{'id': 'enabled', 'text': _('Enable clipboard')}
{'id': 'enabled', 'text': _('Enable clipboard')},
],
tab=gui.PARAMETERS_TAB,
)
@ -315,7 +315,6 @@ class HTML5RDPTransport(transports.Transport):
tab=gui.ADVANCED_TAB,
)
def initialize(self, values: 'Module.ValuesType'):
if not values:
return
@ -354,7 +353,6 @@ class HTML5RDPTransport(transports.Transport):
v = self.getConnectionInfo(userService, user, '')
return v['username']
def getConnectionInfo(
self,
userService: typing.Union['models.UserService', 'models.ServicePool'],
@ -367,15 +365,15 @@ class HTML5RDPTransport(transports.Transport):
if isinstance(userService, models.UserService):
cdata = userService.getInstance().getConnectionData()
if cdata:
_, username, password = cdata # Host is unused
username = cdata[1] or username
password = cdata[2] or password
if self.fixedPassword.value != '':
if self.fixedPassword.value:
password = self.fixedPassword.value
if self.fixedName.value != '':
if self.fixedName.value:
username = self.fixedName.value
proc = username.split('@')
if len(proc) > 1:
domain = proc[1]
@ -383,7 +381,6 @@ class HTML5RDPTransport(transports.Transport):
domain = ''
username = proc[0]
azureAd = False
if self.fixedDomain.value != '':
@ -441,12 +438,20 @@ class HTML5RDPTransport(transports.Transport):
'resize-method': 'display-update',
'ignore-cert': 'true',
'security': self.security.value,
'enable-drive': as_txt(self.enableFileSharing.value in ('true', 'down', 'up')),
'disable-upload': as_txt(self.enableFileSharing.value not in ('true', 'up')),
'enable-drive': as_txt(
self.enableFileSharing.value in ('true', 'down', 'up')
),
'disable-upload': as_txt(
self.enableFileSharing.value not in ('true', 'up')
),
'drive-path': '/share/{}'.format(user.uuid),
'drive-name': 'UDSfs',
'disable-copy': as_txt(self.enableClipboard.value in ('dis-copy', 'disabled')),
'disable-paste': as_txt(self.enableClipboard.value in ('dis-paste', 'disabled')),
'disable-copy': as_txt(
self.enableClipboard.value in ('dis-copy', 'disabled')
),
'disable-paste': as_txt(
self.enableClipboard.value in ('dis-paste', 'disabled')
),
'create-drive-path': 'true',
'ticket-info': {
'userService': userService.uuid,

View File

@ -425,7 +425,8 @@ class BaseRDPTransport(transports.Transport):
if isinstance(userService, UserService):
cdata = userService.getInstance().getConnectionData()
if cdata:
_, username, password = cdata # Host is unused
username = cdata[1] or username
password = cdata[2] or password
return self.processUserPassword(
typing.cast('models.UserService', userService),