diff --git a/server/src/uds/transports/NX/web.py b/server/src/uds/transports/NX/web.py index b1caa5ae..8e7890c4 100644 --- a/server/src/uds/transports/NX/web.py +++ b/server/src/uds/transports/NX/web.py @@ -76,10 +76,10 @@ def generateHtmlForNX(transport, idUserService, idTransport, ip, os, user, passw ])) if isMac is True: msg = '

' + _('In order to use this transport, you need to install first OpenNX Client for mac') + '

' - msg += '

' + _('You can oibtain it from ') + ''.format(Config.section('NX').value('downloadUrlMACOS', 'http://opennx.net/download.html').get()) + _('OpenNx Website') + '

' + msg += '

' + _('You can oibtain it from ') + ''.format(Config.section('NX').value('downloadUrlMACOS').get()) + _('OpenNx Website') + '

' else: msg = '

' + _('In order to use this transport, you need to install first Nomachine Nx Client version 3.5.x') + '

' - msg +='

' + _('you can obtain it for your platform from') + ''.format(Config.section('NX').value('downloadUrl', 'http://www.nomachine.com/download-3').get()) + _('nochamine web site') + '

' + msg +='

' + _('you can obtain it for your platform from') + ''.format(Config.section('NX').value('downloadUrl').get()) + _('nochamine web site') + '

' res = '
' % (codebase, '1', data ) res += '
' + msg + '
' return res diff --git a/server/src/uds/transports/TSNX/TSNXTransport.py b/server/src/uds/transports/TSNX/TSNXTransport.py index 571cd697..bb21ff02 100644 --- a/server/src/uds/transports/TSNX/TSNXTransport.py +++ b/server/src/uds/transports/TSNX/TSNXTransport.py @@ -196,7 +196,7 @@ class TSNXTransport(Transport): # Fix username/password acording to os manager username, password = userService.processUserPassword(username, password) - return generateHtmlForNX(self, idUserService, idTransport, username, password, extra) + return generateHtmlForNX(self, idUserService, idTransport, os, username, password, extra) def getHtmlComponent(self, theId, os, componentId): # We use helper to keep this clean diff --git a/server/src/uds/transports/TSNX/__init__.py b/server/src/uds/transports/TSNX/__init__.py index 5380e279..4d411a42 100644 --- a/server/src/uds/transports/TSNX/__init__.py +++ b/server/src/uds/transports/TSNX/__init__.py @@ -33,10 +33,14 @@ from uds.core.managers.UserPrefsManager import UserPrefsManager, CommonPrefs from uds.core.managers.DownloadsManager import DownloadsManager +from uds.core.util.Config import Config from TSNXTransport import TSNXTransport from django.utils.translation import ugettext_noop as _ import os.path, sys +Config.section('NX').value('downloadUrl', 'http://www.nomachine.com/download-3').get() +Config.section('NX').value('downloadUrlMACOS', 'http://opennx.net/download.html').get() + UserPrefsManager.manager().registerPrefs('nx', _('NX Protocol'), [ CommonPrefs.screenSizePref diff --git a/server/src/uds/transports/TSNX/web.py b/server/src/uds/transports/TSNX/web.py index 076b184b..59853361 100644 --- a/server/src/uds/transports/TSNX/web.py +++ b/server/src/uds/transports/TSNX/web.py @@ -32,6 +32,9 @@ ''' from django.core.urlresolvers import reverse +from uds.core.util.Config import Config +from uds.core.util import OsDetector + import logging, os, sys logger = logging.getLogger(__name__) @@ -52,7 +55,8 @@ def simpleScrambler(data): -def generateHtmlForNX(transport, idUserService, idTransport, user, password, extra): +def generateHtmlForNX(transport, idUserService, idTransport, os, user, password, extra): + isMac = os['OS'] == OsDetector.Macintosh applet = reverse('uds.web.views.transcomp', kwargs = { 'idTransport' : idTransport, 'componentId' : '1' }) # Gets the codebase, simply remove last char from applet codebase = applet[:-1] @@ -71,9 +75,15 @@ def generateHtmlForNX(transport, idUserService, idTransport, user, password, ext 'is:' + idUserService ] data = simpleScrambler( '\t'.join(data)) + if isMac is True: + msg = '

' + _('In order to use this transport, you need to install first OpenNX Client for mac') + '

' + msg += '

' + _('You can oibtain it from ') + ''.format(Config.section('NX').value('downloadUrlMACOS').get()) + _('OpenNx Website') + '

' + else: + msg = '

' + _('In order to use this transport, you need to install first Nomachine Nx Client version 3.5.x') + '

' + msg +='

' + _('you can obtain it for your platform from') + ''.format(Config.section('NX').value('downloadUrl').get()) + _('nochamine web site') + '

' + res = '
' % (codebase, '1', data ) - res += '

In order to use this transport, you need to install first nomachine nx client version 3.5.x

' - res += '

you can obtain it for your platform from nochamine web site

' + res += '
' + msg + '
' return res