From 678f844a3531f39e5a845aa4f5c9814e1e2efad3 Mon Sep 17 00:00:00 2001 From: "zach%zachlipton.com" Date: Wed, 28 Dec 2005 20:42:49 +0000 Subject: [PATCH] Add a validate_login stub to Litmus::Auth so as not to block coop's web services work with authentication issues. --- webtools/litmus/Litmus/Auth.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/webtools/litmus/Litmus/Auth.pm b/webtools/litmus/Litmus/Auth.pm index b6200788ec6..25c5c7cedad 100755 --- a/webtools/litmus/Litmus/Auth.pm +++ b/webtools/litmus/Litmus/Auth.pm @@ -46,6 +46,24 @@ our @EXPORT = qw(); my $logincookiename = $Litmus::Config::user_cookiename; +# (XXX) stub +# Given a username and password, validate the login. Returns the +# Lutmus::DB::User object associated with the username if the login +# is sucuessful. Returns false otherwise. +sub validate_login($$) { + my $username = shift; + my $password = shift; + + # we'll fill this in later once we actually _have_ passwords. + # for now, just return the user object or false: + my @usrobjs = Litmus::DB::User->search(email => $username); + if (@usrobjs) { + return $usrobjs[0]; + } else { + return 0; + } +} + sub setCookie { my $user = shift; my $expires = shift;