Commit 05c20127 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update Dbui to add protection.

parent 23008829
...@@ -12,7 +12,6 @@ from gluon.storage import Storage ...@@ -12,7 +12,6 @@ from gluon.storage import Storage
from gluon.tools import PluginManager from gluon.tools import PluginManager
from helper import get_language from helper import get_language
myapp = current.request.application
defaults = Storage( defaults = Storage(
...@@ -32,13 +31,13 @@ defaults = Storage( ...@@ -32,13 +31,13 @@ defaults = Storage(
app_html_jsduck="static/docs/jsduck/index.html", app_html_jsduck="static/docs/jsduck/index.html",
app_html_user="static/docs/user/index.html", app_html_user="static/docs/user/index.html",
app_html_reference="static/docs/reference/index.html", app_html_reference="static/docs/reference/index.html",
app_pdf_api="static/docs/pdf/%s_api.pdf" % myapp, app_pdf_api="static/docs/pdf/%s_api.pdf",
app_pdf_reference="static/docs/pdf/%s_reference.pdf" % myapp, app_pdf_reference="static/docs/pdf/%s_reference.pdf",
app_pdf_user="static/docs/pdf/%s_user.pdf" % myapp, app_pdf_user="static/docs/pdf/%s_user.pdf",
# dbui URL # dbui URL
dbui_conf="/%s/plugin_dbui/dbui_conf" % myapp, dbui_conf="/%s/plugin_dbui/dbui_conf",
dbui_conf_debug="/%s/plugin_dbui/dbui_conf?debug" % myapp, dbui_conf_debug="/%s/plugin_dbui/dbui_conf?debug",
dbui_script="static/plugin_dbui/main.js", dbui_script="static/plugin_dbui/main.js",
# dbui documentation and license # dbui documentation and license
...@@ -274,13 +273,23 @@ class Dbui(object): ...@@ -274,13 +273,23 @@ class Dbui(object):
# update values depending on language # update values depending on language
lg = get_language() lg = get_language()
f = lambda x: (x % lg if "%s" in x else x)
plugins_paths = plugin.plugins_paths plugins_paths = plugin.plugins_paths
paths_dbui = plugins_paths["dbui"] plugins_paths["dbui"]["lg"] = f(plugins_paths["dbui"]["lg"])
paths_dbui["lg"] = paths_dbui["lg"] % lg plugins_paths["extjs"]["lg"] = f(plugins_paths["extjs"]["lg"])
# update values depending on the application
myapp = current.request.application
f = lambda x: (x % myapp if "%s" in x else x)
plugin.app_pdf_api = f(plugin.app_pdf_api)
plugin.app_pdf_reference = f(plugin.app_pdf_reference)
plugin.app_pdf_user = f(plugin.app_pdf_user)
paths_extjs = plugins_paths["extjs"] plugin.dbui_conf = f(plugin.dbui_conf)
paths_extjs["lg"] = paths_extjs["lg"] % lg plugin.dbui_conf_debug = f(plugin.dbui_conf_debug)
@staticmethod @staticmethod
def initialise_ui(): def initialise_ui():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment