diff MoinMoin/userform.py @ 448:45924beef130

user.isSuperUser() check, require cfg.superuser being a list or tuple imported from: moin--main--1.5--patch-452
author Thomas Waldmann <tw@waldmann-edv.de>
date Sat, 18 Feb 2006 15:31:50 +0000
parents c3611b284625
children 12b6367214e3
line wrap: on
line diff
--- a/MoinMoin/userform.py	Sat Feb 18 14:21:40 2006 +0000
+++ b/MoinMoin/userform.py	Sat Feb 18 15:31:50 2006 +0000
@@ -160,8 +160,8 @@
             
         if form.has_key('select_user'): # Select user profile (su user)
             if (wikiutil.checkTicket(self.request.form['ticket'][0]) and
-                self.request.user.name in self.request.cfg.superuser and
-                self.request.request_method == 'POST'):
+                self.request.request_method == 'POST' and
+                self.request.user.isSuperUser()):
                 su_user = form.get('selected_user', [''])[0]
                 uid = user.getUserId(self.request, su_user)
                 theuser = user.User(self.request, uid)
@@ -471,7 +471,7 @@
         _ = self._
         self.make_form()
 
-        if self.request.user.name in self.request.cfg.superuser:
+        if self.request.user.isSuperUser():
             ticket = wikiutil.createTicket()
             self.make_row(_('Select User'), [self._user_select()])
             self._form.append(html.INPUT(type="hidden", name="ticket", value="%s" % ticket))