Author: shywolf9982
Date: Sat Mar 29 23:43:16 2008
New Revision: 53116

Modified:
   kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/setupbase.py
Log:
* Added a further check that raises a separate exception if the request comes 
through a GET


Modified: kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/setupbase.py
==============================================================================
--- kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/setupbase.py    
(original)
+++ kukit/kss.demo/branch/1.4-kss-test/kss/demo/browser/setupbase.py    Sat Mar 
29 23:43:16 2008
@@ -29,10 +29,12 @@
 
     def checkPermission(self, zoperoot):
         # The form must be submitted by POST, and authenticate correctly.
-        method = self.request.get("REQUEST_METHOD", "GET").upper()
+        method = self.request.get("REQUEST_METHOD", "").upper()
+        if method != "POST":
+            raise Exception("The auth cannot must be passed with a POST")
         username = self.request.get("admin_username", None)
         password = self.request.get("admin_password", None)
-        if method == "POST" and username is not None and password is not None:
+        if username is not None and password is not None:
             admin = zoperoot.acl_users.authenticate(username, password, None)
             if self._required_role in admin.getRoles():
                 return admin
_______________________________________________
Kukit-checkins mailing list
[email protected]
http://codespeak.net/mailman/listinfo/kukit-checkins

Reply via email to