[Phpslash-commit] CVS: phpslash-dev/include/modules/auth slashAuth.class,1.1,1.2
Brought to you by:
joestewart,
nhruby
From: Joe S. <joe...@us...> - 2004-09-16 21:05:17
|
Update of /cvsroot/phpslash/phpslash-dev/include/modules/auth In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv443/phpslash-dev/include/modules/auth Modified Files: slashAuth.class Log Message: updated non CR loginform.tpl to be used with other auth methods Index: slashAuth.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/auth/slashAuth.class,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** slashAuth.class 15 Sep 2004 23:36:29 -0000 1.1 --- slashAuth.class 16 Sep 2004 21:05:07 -0000 1.2 *************** *** 114,118 **** $templ = pslNew("slashTemplate"); $templ->set_file(array( ! 'form' => 'loginformCR.tpl', 'index' => 'index1col.tpl' )); --- 114,118 ---- $templ = pslNew("slashTemplate"); $templ->set_file(array( ! 'form' => 'loginform.tpl', 'index' => 'index1col.tpl' )); *************** *** 787,795 **** } ! // dummy method to be overridden in child class function psl_validate($username, $password, $response, $user_info) { ! return false; } // dummy method to be overridden in child class function psl_preauth($username, $password, $user_info) { --- 787,823 ---- } ! // method to be overridden in child class ! // used by authtypes/slashAuthCR.class and authtypes/slashAuth.class function psl_validate($username, $password, $response, $user_info) { ! global $challenge; ! ! // debug("response", $response); ! // debug("challenge", $challenge); ! ! $is_user = false; ! ! // generate the expected response ! $md5_pw = $user_info['password']; // this is the raw MD5ed user/pass combo ! ! $expected_response = md5("$md5_pw:$challenge"); ! // debug("expected_response", $expected_response); ! // True when JS is disabled ! if ($response == "") { ! $md5_pw_net = md5("$username:$password"); ! $response = md5("$md5_pw_net:$challenge"); ! } ! ! // Response is set, JS might be enabled... ! // compare the responses ! if ($expected_response == $response) { ! // success ! $is_user = true; ! } else { ! $this->auth["error"] = pslgetText("Either your username or password are invalid. Please try again."); ! } ! return $is_user; } + // dummy method to be overridden in child class function psl_preauth($username, $password, $user_info) { *************** *** 797,801 **** } - } --- 825,828 ---- |