Update of /cvsroot/webware/Webware/WebKit/Admin
In directory sc8-pr-cvs1:/tmp/cvs-serv6490/WebKit/Admin
Modified Files:
AdminSecurity.py LoginPage.py
Log Message:
Damn, let a commit to Application.config slip in.
Anyway, changed Application.config to have an empty password, and for
admin page login to be disabled as long as there is an empty password.
Index: AdminSecurity.py
===================================================================
RCS file: /cvsroot/webware/Webware/WebKit/Admin/AdminSecurity.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** AdminSecurity.py 24 Feb 2002 15:13:32 -0000 1.5
--- AdminSecurity.py 22 Nov 2002 10:07:58 -0000 1.6
***************
*** 47,50 ****
--- 47,51 ----
else:
# Failed login attempt; have them try again
+
request.fields()['extra'] = 'Login failed. Please try again. (And make sure cookies are enabled.)'
app.forward(trans, 'LoginPage')
***************
*** 63,67 ****
# Replace this with a database lookup, or whatever you're using for
# authentication...
! users = [('admin', self.application().setting('AdminPassword')),]
! return (username, password) in users
--- 64,81 ----
# Replace this with a database lookup, or whatever you're using for
# authentication...
! adminPassword = self.application().setting('AdminPassword')
! if username == 'admin' and adminPassword and \
! password == adminPassword:
! return 1
! else:
! return 0
+ def loginDisabled(self):
+ """
+ Return None if login is enabled, else a message
+ about why not
+ """
+ if self.application().setting('AdminPassword'):
+ return None
+ else:
+ return """Logins to admin pages are disabled until you supply an AdminPassword in Application.config"""
Index: LoginPage.py
===================================================================
RCS file: /cvsroot/webware/Webware/WebKit/Admin/LoginPage.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** LoginPage.py 3 Mar 2001 02:33:56 -0000 1.3
--- LoginPage.py 22 Nov 2002 10:07:59 -0000 1.4
***************
*** 5,8 ****
--- 5,11 ----
class LoginPage(AdminPage):
def writeContent(self):
+ if self.loginDisabled():
+ self.write(self.loginDisabled())
+ return
self.write('''
<center>
***************
*** 57,59 ****
</center>
''')
-
--- 60,61 ----
|