diff -r 000000000000 -r c94bd9ae70d2 app/projrev/views/login.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/projrev/views/login.py Tue Aug 04 02:21:15 2009 -0400 @@ -0,0 +1,35 @@ +"""This module contains the views for the login for the portal. +""" + + +__authors__ = [ + '"Madhusudan.C.S" ', +] + + +from django.contrib.auth import authenticate, login +from django.shortcuts import render_to_response, get_object_or_404 + + +def login_validate(request): + """Validate the user and log him in. + """ + + username = request.POST['username'] + password = request.POST['password'] + user = authenticate(username=username, password=password) + if user is not None: + if user.is_active: + login(request, user) + # Redirect to a success page. + else: + pass + # Return a 'disabled account' error message + else: + # Return an 'invalid login' error message. + pass + +def logout_view(request): + """Logout the user + """ + \ No newline at end of file