Merged 3.0 HTML5 RDP changes

This commit is contained in:
Adolfo Gómez García 2021-02-17 15:40:07 +01:00
parent af52727862
commit 328d35a289
2 changed files with 23 additions and 10 deletions

View File

@ -246,11 +246,16 @@ class HTML5RDPTransport(transports.Transport):
forceNewWindow = gui.ChoiceField(
order=91,
tooltip=_(
'If checked, every connection will try to open its own window instead of reusing the "global" one.'
),
label=_('Force new HTML Window'),
tooltip=_('Select windows behavior for new connections on HTML5'),
required=True,
values=[
gui.choiceItem(gui.FALSE, _('Open every connection on the same window, but keeps UDS window.')),
gui.choiceItem(gui.TRUE, _('Force every connection to be opened on a new window.')),
gui.choiceItem('overwrite', _('Override UDS window and replace it with the connection.')),
],
defvalue=gui.FALSE,
tab=gui.ADVANCED_TAB,
tab=gui.ADVANCED_TAB
)
def initialize(self, values: 'Module.ValuesType'):
@ -412,11 +417,13 @@ class HTML5RDPTransport(transports.Transport):
ticket = models.TicketStore.create(params, validity=self.ticketValidity.num())
onw = (
'&o_n_w={};'.format(hash(transport.name))
if self.forceNewWindow.isTrue()
else ''
)
onw = ''
if self.forceNewWindow.value == gui.TRUE:
onw = 'o_n_w={}'
elif self.forceNewWindow.value == 'overwrite':
onw = 'o_s_w=yes'
onw = onw.format(hash(transport.name))
return str(
"{}/guacamole/#/?data={}.{}{}".format(
self.guacamoleServer.value, ticket, scrambler, onw

View File

@ -191,7 +191,13 @@ class HTML5VNCTransport(transports.Transport):
scrambler = cryptoManager().randomString(32)
ticket = models.TicketStore.create(params, validity=self.ticketValidity.num())
onw = '&o_n_w={};'.format(hash(transport.name)) if self.forceNewWindow.isTrue() else ''
onw = ''
if self.forceNewWindow.value == gui.TRUE:
onw = 'o_n_w={}'
elif self.forceNewWindow.value == 'overwrite':
onw = 'o_s_w=yes'
onw = onw.format(hash(transport.name))
return str(
"{}/guacamole/#/?data={}.{}{}".format(
self.guacamoleServer.value,