summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2014-10-06 23:22:10 -0400
committerPatrick Uiterwijk <puiterwijk@redhat.com>2014-10-07 16:48:22 +0200
commit3f7e6358c02d0822c5fe1c2da72a3b32ffe12ec6 (patch)
tree197bfdcce9da276be5f6d6a125ad17836f49d406
parent5fd2b52a5518864571afb9139074e4d314ec688c (diff)
downloadipsilon-3f7e6358c02d0822c5fe1c2da72a3b32ffe12ec6.tar.gz
ipsilon-3f7e6358c02d0822c5fe1c2da72a3b32ffe12ec6.tar.xz
ipsilon-3f7e6358c02d0822c5fe1c2da72a3b32ffe12ec6.zip
Fix exposed functions
The Page util is supposed to intercept and enable exposed pages on its own so that additional functions can be run in the generic __call__ Fix the code to check for the function argument correctly and use a different argument than the standard cherrypy one for admin pages so that we do actually land in the Page.__call__ all the time for those pages. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
-rwxr-xr-xipsilon/admin/info.py4
-rwxr-xr-xipsilon/admin/login.py4
-rwxr-xr-xipsilon/admin/providers.py4
-rwxr-xr-xipsilon/providers/saml2/admin.py2
-rwxr-xr-xipsilon/util/page.py2
5 files changed, 8 insertions, 8 deletions
diff --git a/ipsilon/admin/info.py b/ipsilon/admin/info.py
index 8e910c7..4a8aaba 100755
--- a/ipsilon/admin/info.py
+++ b/ipsilon/admin/info.py
@@ -128,7 +128,7 @@ class InfoPlugins(Page):
obj.enable(self._site)
msg = "Plugin %s enabled" % obj.name
return self.root_with_msg(msg, "success")
- enable.exposed = True
+ enable.public_function = True
@admin_protect
def disable(self, plugin):
@@ -142,4 +142,4 @@ class InfoPlugins(Page):
obj.disable(self._site)
msg = "Plugin %s disabled" % obj.name
return self.root_with_msg(msg, "success")
- disable.exposed = True
+ disable.public_function = True
diff --git a/ipsilon/admin/login.py b/ipsilon/admin/login.py
index 16489f1..165b4ab 100755
--- a/ipsilon/admin/login.py
+++ b/ipsilon/admin/login.py
@@ -161,7 +161,7 @@ class LoginPlugins(Page):
save_enabled_plugins(list(x.name for x in plugins['enabled']))
msg = "Plugin %s enabled" % obj.name
return self.root_with_msg(msg, "success")
- enable.exposed = True
+ enable.public_function = True
@admin_protect
def disable(self, plugin):
@@ -176,4 +176,4 @@ class LoginPlugins(Page):
save_enabled_plugins(list(x.name for x in plugins['enabled']))
msg = "Plugin %s disabled" % obj.name
return self.root_with_msg(msg, "success")
- disable.exposed = True
+ disable.public_function = True
diff --git a/ipsilon/admin/providers.py b/ipsilon/admin/providers.py
index 8219880..31e11ef 100755
--- a/ipsilon/admin/providers.py
+++ b/ipsilon/admin/providers.py
@@ -73,7 +73,7 @@ class ProviderPlugins(Page):
obj.enable(self._site)
msg = "Plugin %s enabled" % obj.name
return self.root_with_msg(msg, "success")
- enable.exposed = True
+ enable.public_function = True
@admin_protect
def disable(self, plugin):
@@ -87,4 +87,4 @@ class ProviderPlugins(Page):
obj.disable(self._site)
msg = "Plugin %s disabled" % obj.name
return self.root_with_msg(msg, "success")
- disable.exposed = True
+ disable.public_function = True
diff --git a/ipsilon/providers/saml2/admin.py b/ipsilon/providers/saml2/admin.py
index b8c8223..7e14312 100755
--- a/ipsilon/providers/saml2/admin.py
+++ b/ipsilon/providers/saml2/admin.py
@@ -274,7 +274,7 @@ class SPAdminPage(Page):
self.parent.del_sp(self.sp.name)
self.sp.permanently_delete()
return self.parent.root()
- delete.exposed = True
+ delete.public_function = True
class AdminPage(Page):
diff --git a/ipsilon/util/page.py b/ipsilon/util/page.py
index aa075de..1548d47 100755
--- a/ipsilon/util/page.py
+++ b/ipsilon/util/page.py
@@ -66,7 +66,7 @@ class Page(Log):
if len(args) > 0:
op = getattr(self, args[0], None)
- if callable(op) and getattr(self, args[0]+'.exposed', None):
+ if callable(op) and getattr(op, 'public_function', None):
return op(*args[1:], **kwargs)
else:
if self._is_form_page: