I wrote a simple UserFolder application that did not use any cookies or
the session management stuff. The UserSource was a MySQL db. ( Tried
mysqlUserFolder but it was too restrictive interms of database structure
for my purposes ). I then used ZSession to handle session and cookie
management and it works great.
When I have a Authenticated-View only folder the browser pops up a box
and I need to login. It authenticated from the db and I go on my merry
way. What I am trying to do is to is to have a logon form that allows
the user to logon, verifies the user and redirects it to a members page.
However it doesnt seem to do that. The login and the logout functions
are given below. 'validate' is the method that is called everytime Zope
decides on the roles and whther the role by the user has access to the
user_login__roles__ = None
def user_login (Self, REQUEST, RESPONSE, username, password,
create_global = 1, login_goto_path = "../../members/"):
# Create authorization variable
ac = encodestring('%s:%s' % (username, password))
auth = 'Basic %s' % ac
return RESPONSE.redirect (login_goto_path)
user_logout__roles__ = ['MySQLUserRole']
def user_logout (Self, REQUEST,RESPONSE):
""" Terminates user session """
user = Self.check_valid_mysql_user (REQUEST)
RESPONSE.setHeader('WWW-Authenticate', 'basic realm="%s"' %
You have been logged out.
The problem is that even when I login and 'validate' accepts the
credentials, the browser still pops up a box. What am I doing wrong?? .
The logout works fine but there is a minor problem in that too which I
had posted earlier.
Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706
(R) 510 7696011 (M) 510 3014871 (O) 510 5279231
"I saw `cout' being shifted "Hello world" times to the left and
stopped right there!!" -- Steve Gonedes
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -