diff --git a/paramecio/citoplasma/plugins.py b/paramecio/citoplasma/plugins.py index f809364..8573ace 100644 --- a/paramecio/citoplasma/plugins.py +++ b/paramecio/citoplasma/plugins.py @@ -9,12 +9,13 @@ class LoginPlugin(object): name = 'login' api = 2 - login_url='login' - def __init__(self, keyword='login'): + def __init__(self, keyword='login', login_var='login', login_url='login'): self.keyword=keyword - + self.login_var=login_var + self.login_url=login_url + def setup(self, app): ''' Make sure that other installed plugins don't affect the same keyword argument.''' @@ -26,10 +27,10 @@ class LoginPlugin(object): def apply(self, callback, context): - # Test if the original callback accepts a 'db' keyword. + # Test if the original callback accepts a 'login' keyword. # Ignore it if it does not need a login handle. - conf = context.config.get('login') or {} + conf = context.config.get(self.keyword) or {} keyword = conf.get('keyword', self.keyword) @@ -42,7 +43,7 @@ class LoginPlugin(object): s=get_session() - if 'login' in s: + if self.login_var in s: rv = callback(*args, **kwargs) diff --git a/paramecio/modules/admin/templates/admin/home.html b/paramecio/modules/admin/templates/admin/home.html index 623ac11..99dff6f 100644 --- a/paramecio/modules/admin/templates/admin/home.html +++ b/paramecio/modules/admin/templates/admin/home.html @@ -11,18 +11,18 @@ ${make_url('admin/'+module)}\