changeset 1541:b54e89c69227

handle exluded lowercase action
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 12 Sep 2006 21:43:18 +0200
parents e61d8846ca2c
children 6d4cdcdab47a
files MoinMoin/request/__init__.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/request/__init__.py	Tue Sep 12 21:34:19 2006 +0200
+++ b/MoinMoin/request/__init__.py	Tue Sep 12 21:43:18 2006 +0200
@@ -1145,7 +1145,15 @@
                 else:
                     from MoinMoin import action
                     handler = action.getHandler(self, action_name)
-                    handler(self.page.page_name, self)
+                    if handler is None:
+                        msg = _("You are not allowed to do %(action_name)s on this page.") % {
+                                'action_name': wikiutil.escape(action_name), }
+                        if not self.user.valid:
+                            # Suggest non valid user to login
+                            msg += " " + _("Login and try again.", formatted=0)
+                        self.page.send_page(self, msg=msg)
+                    else:
+                        handler(self.page.page_name, self)
 
             # every action that didn't use to raise MoinMoinNoFooter must call this now:
             # self.theme.send_closing_html()