diff --git a/server/src/uds/core/util/Config.py b/server/src/uds/core/util/Config.py index 2e92edb3e..5e360a80b 100644 --- a/server/src/uds/core/util/Config.py +++ b/server/src/uds/core/util/Config.py @@ -65,6 +65,7 @@ class Config: readed = dbConfig.objects.filter(section=self._section.name(), key=self._key)[0] self._data = readed.value self._crypt = [self._crypt, True][readed.crypt] # True has "higher" precedende than False + self._longText = readed.long except Exception: # Not found if self._default != '' and self._crypt: @@ -108,11 +109,11 @@ class Config: ''' logger.debug('Saving config {0}.{1} as {2}'.format(self._section.name(), self._key, value)) try: - if dbConfig.objects.filter(section=self._section.name(), key=self._key).update(value=value, crypt=self._crypt) == 0: + if dbConfig.objects.filter(section=self._section.name(), key=self._key).update(value=value, crypt=self._crypt, long=self._longText) == 0: raise Exception() # Do not exists, create a new one except Exception: try: - dbConfig.objects.create(section=self._section.name(), key=self._key, value=value, crypt=self._crypt) + dbConfig.objects.create(section=self._section.name(), key=self._key, value=value, crypt=self._crypt, long=self._longText) except Exception: # Probably a migration issue, just ignore it logger.info("Could not save configuration key {0}.{1}".format(self._section.name(), self._key)) @@ -217,7 +218,6 @@ class GlobalConfig: # Custom HTML for login page CUSTOM_HTML_LOGIN = Config.section(GLOBAL_SECTION).valueLong('customHtmlLogin', '') - initDone = False @staticmethod diff --git a/server/src/uds/static/css/uds.css b/server/src/uds/static/css/uds.css index 2a7825c12..bdf458b0b 100644 --- a/server/src/uds/static/css/uds.css +++ b/server/src/uds/static/css/uds.css @@ -200,6 +200,10 @@ input[type=submit]{ width: auto; } +#customHtml { + margin-top: 4em; +}; + #adminmsgs{ text-align:left; margin:auto; @@ -226,3 +230,8 @@ input[type=submit]{ #applet { margin:20px 0; } + +/* Sample "info" (footer) text, to be placed after (c) Virtualcable */ +/*#vcable:after { + content: "Testing text"; +}*/ diff --git a/server/src/uds/templates/uds/base.html b/server/src/uds/templates/uds/base.html index a8ffe21f8..f7ebe2199 100644 --- a/server/src/uds/templates/uds/base.html +++ b/server/src/uds/templates/uds/base.html @@ -41,7 +41,7 @@ diff --git a/server/src/uds/templates/uds/login.html b/server/src/uds/templates/uds/login.html index 5d65d855a..618ec28d3 100644 --- a/server/src/uds/templates/uds/login.html +++ b/server/src/uds/templates/uds/login.html @@ -95,4 +95,9 @@ +
+ {% autoescape off %} + {{ customHtml }} + {% endautoescape %} +
{% endblock %} \ No newline at end of file diff --git a/server/src/uds/web/views.py b/server/src/uds/web/views.py index cb064c8de..b8fc340f2 100644 --- a/server/src/uds/web/views.py +++ b/server/src/uds/web/views.py @@ -103,7 +103,8 @@ def login(request): else: form = LoginForm() - response = render_to_response('uds/login.html', { 'form' : form, }, context_instance=RequestContext(request)) + response = render_to_response('uds/login.html', { 'form' : form, 'customHtml' : GlobalConfig.CUSTOM_HTML_LOGIN.get(True) }, + context_instance=RequestContext(request)) if request.COOKIES.has_key('uds') is False: response.set_cookie('uds', ''.join(random.choice(string.letters + string.digits) for _ in xrange(32))) return response diff --git a/server/src/uds/xmlrpc/auths/AdminAuth.py b/server/src/uds/xmlrpc/auths/AdminAuth.py index b9eae3344..90e6f44dd 100644 --- a/server/src/uds/xmlrpc/auths/AdminAuth.py +++ b/server/src/uds/xmlrpc/auths/AdminAuth.py @@ -45,7 +45,7 @@ logger = logging.getLogger(__name__) ADMIN_AUTH = '#' -CLIENT_VERSION_REQUIRED = '1.0.7' +CLIENT_VERSION_REQUIRED = '1.0.8' class Credentials(object): ''' diff --git a/server/src/uds/xmlrpc/tools/Config.py b/server/src/uds/xmlrpc/tools/Config.py index 2d22285f5..315bb4fb5 100644 --- a/server/src/uds/xmlrpc/tools/Config.py +++ b/server/src/uds/xmlrpc/tools/Config.py @@ -45,7 +45,7 @@ def getConfiguration(credentials): for cfg in Config.enumerate(): if cfg.isCrypted() is True and addCrypt is False: continue - res.append( {'section': cfg.section(), 'key' : cfg.key(), 'value' : cfg.get(), 'crypt': cfg.isCrypted() } ) + res.append( {'section': cfg.section(), 'key' : cfg.key(), 'value' : cfg.get(), 'crypt': cfg.isCrypted(), 'longText': cfg.isLongText() } ) logger.debug('Configuration: {0}'.format(res)) return res