# login.py: Log in as an existing user. This file is almost identical # to register.py, except that it calls User.loginUser() and # not User.createUser(), and the success message is different. import User if not (webvars.has_key('userID') and webvars.has_key('password') ): print "<P>You must fill in both the user ID and the password fields." else: userID, password = webvars['userID'].value, webvars['password'].value try: userObj = User.loginUser(userID, password, headers) except User.Error, message: print "<P>", message else: print "<P>Welcome back, %s!" % (userObj.userID,)
A CGI Framework in Python (Web Techniques, Feb 1998)
Related Reading
More Insights
INFO-LINK
To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy. | |