improved consistence of plugin list for the webinterface

This commit is contained in:
lars 2007-01-08 02:25:11 +00:00
parent 2cbd564f09
commit 706a4b2b6f
1 changed files with 5 additions and 9 deletions

View File

@ -33,12 +33,12 @@ class WebInterfaceDataset(dict):
templates
"""
def __init__(self, cbox, prefs, plugins):
def __init__(self, cbox, prefs, plugin_manager):
super(WebInterfaceDataset, self).__init__()
self.prefs = prefs
self.cbox = cbox
self.__set_config_values()
self.plugins = plugins
self.plugin_manager = plugin_manager
self.set_crypto_box_state()
self.set_plugin_data()
self.set_containers_state()
@ -110,7 +110,8 @@ class WebInterfaceDataset(dict):
else:
self["Data.ScriptParams.%s" % key] = str(value)
if cherrypy.request.headers.has_key("CRYPTOBOX-Location"):
self.cbox.log.debug("ProxyLocation: %s" % cherrypy.request.headers["CRYPTOBOX-Location"])
self.cbox.log.debug("ProxyLocation: %s" % \
cherrypy.request.headers["CRYPTOBOX-Location"])
self["Data.Proxy.ScriptPath"] = \
cherrypy.request.headers["CRYPTOBOX-Location"]
if cherrypy.request.headers.has_key("X-Forwarded-Host"):
@ -193,13 +194,8 @@ class WebInterfaceDataset(dict):
for key in self.keys():
if key.startswith("Settings.PluginList."):
del self[key]
for plugin in self.plugins:
for plugin in self.plugin_manager.get_plugins():
entry_name = "Settings.PluginList." + plugin.get_name()
## first: remove all existing settings of this plugin
for key in self.keys():
if key.startswith(entry_name):
del self[key]
lang_data = plugin.get_language_data()
self[entry_name] = plugin.get_name()
self[entry_name + ".Rank"] = plugin.get_rank()
self[entry_name + ".RequestAuth"] = plugin.is_auth_required() and "1" or "0"