forked from shaba/openuds
Added audio support selection
This commit is contained in:
parent
dbe7e5187b
commit
7e8fa876fa
@ -62,6 +62,7 @@ class HTML5RDPTransport(Transport):
|
||||
fixedName = gui.TextField(label=_('Username'), order = 3, tooltip = _('If not empty, this username will be always used as credential'))
|
||||
fixedPassword = gui.PasswordField(label=_('Password'), order = 4, tooltip = _('If not empty, this password will be always used as credential'))
|
||||
fixedDomain = gui.TextField(label=_('Domain'), order = 5, tooltip = _('If not empty, this domain will be always used as credential (used as DOMAIN\\user)'))
|
||||
enableAudio = gui.CheckBoxField(label = _('Enable Audio'), order = 6, tooltip = _('If checked, the audio will be redirected to client (if client browser supports it)'))
|
||||
|
||||
def initialize(self, values):
|
||||
if values is None:
|
||||
@ -94,9 +95,9 @@ class HTML5RDPTransport(Transport):
|
||||
|
||||
domain = ''
|
||||
if username.find('@') != -1:
|
||||
domain = username[username.find('@')+1:]
|
||||
username, domain = username.split('@')
|
||||
elif username.find('\\') != -1:
|
||||
domain = username[:username.find('\\')]
|
||||
domain, username = username.split('\\')
|
||||
|
||||
if self.fixedName.value is not '':
|
||||
username = self.fixedName.value
|
||||
@ -114,10 +115,17 @@ class HTML5RDPTransport(Transport):
|
||||
if domain.find('.') == -1:
|
||||
username = domain + '\\' + username
|
||||
else:
|
||||
username = username + '@' + username
|
||||
username = username + '@' + domain
|
||||
|
||||
|
||||
# Build params dict
|
||||
params = { 'protocol':'rdp', 'hostname':ip, 'username': username, 'password': password }
|
||||
params = { 'protocol':'rdp',
|
||||
'hostname':ip, 'username': username, 'password': password,
|
||||
'ignore-cert': 'true',
|
||||
}
|
||||
|
||||
if self.enableAudio.isTrue() is False:
|
||||
params['disable-audio'] = 'true'
|
||||
|
||||
logger.debug('RDP Params: {0}'.format(params))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user