Updated NX download urls to new locations

Added configuration parameters to allow change these urls
This commit is contained in:
Adolfo Gómez 2013-10-18 08:23:07 +00:00
parent 158ac77727
commit 646f4fadfb
4 changed files with 20 additions and 6 deletions

View File

@ -76,10 +76,10 @@ def generateHtmlForNX(transport, idUserService, idTransport, ip, os, user, passw
]))
if isMac is True:
msg = '<p>' + _('In order to use this transport, you need to install first OpenNX Client for mac') + '</p>'
msg += '<p>' + _('You can oibtain it from ') + '<a href="{0}">'.format(Config.section('NX').value('downloadUrlMACOS', 'http://opennx.net/download.html').get()) + _('OpenNx Website') + '</a></p>'
msg += '<p>' + _('You can oibtain it from ') + '<a href="{0}">'.format(Config.section('NX').value('downloadUrlMACOS').get()) + _('OpenNx Website') + '</a></p>'
else:
msg = '<p>' + _('In order to use this transport, you need to install first Nomachine Nx Client version 3.5.x') + '</p>'
msg +='<p>' + _('you can obtain it for your platform from') + '<a href="{0}">'.format(Config.section('NX').value('downloadUrl', 'http://www.nomachine.com/download-3').get()) + _('nochamine web site') + '</a></p>'
msg +='<p>' + _('you can obtain it for your platform from') + '<a href="{0}">'.format(Config.section('NX').value('downloadUrl').get()) + _('nochamine web site') + '</a></p>'
res = '<div idTransport="applet"><applet code="NxTransportApplet.class" codebase="%s" archive="%s" width="140" height="22"><param name="data" value="%s"/><param name="permissions" value="all-permissions"/></applet></div>' % (codebase, '1', data )
res += '<div>' + msg + '</div>'
return res

View File

@ -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

View File

@ -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

View File

@ -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 = '<p>' + _('In order to use this transport, you need to install first OpenNX Client for mac') + '</p>'
msg += '<p>' + _('You can oibtain it from ') + '<a href="{0}">'.format(Config.section('NX').value('downloadUrlMACOS').get()) + _('OpenNx Website') + '</a></p>'
else:
msg = '<p>' + _('In order to use this transport, you need to install first Nomachine Nx Client version 3.5.x') + '</p>'
msg +='<p>' + _('you can obtain it for your platform from') + '<a href="{0}">'.format(Config.section('NX').value('downloadUrl').get()) + _('nochamine web site') + '</a></p>'
res = '<div idTransport="applet"><applet code="NxTunTransportApplet.class" codebase="%s" archive="%s" width="165" height="22"><param name="data" value="%s"/><param name="permissions" value="all-permissions"/></applet></div>' % (codebase, '1', data )
res += '<div><p>In order to use this transport, you need to install first nomachine nx client version 3.5.x</p>'
res += '<p>you can obtain it for your platform from <a href="http://www.nomachine.com/download.php">nochamine web site </a></p></div>'
res += '<div>' + msg + '</div>'
return res