? login/.index.php.swp
Index: lib/authlib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/authlib.php,v
retrieving revision 1.27
diff -r1.27 authlib.php
359a360,375
>      * Pre-authentication hook.
>      * This method is called from login/index.php for all enabled auth plugins.
>      *
>      * @param object $user user object, later used for $USER
>      * @param string $username (with system magic quotes)
>      * @param string $password plain text password (with system magic quotes)
>      * @return object instance of auth_status
>      */
>     function preauthentication_hook($username, $password) {
>         //override if needed
>         $auth = new auth_status();
>         return $auth;
>     }
> 
> 
>     /**
444a461,477
> 
> /**
>  * Keep the status of authentication in one place.
>  *
>  * This class could be fleshed out and used through the entire authentication 
>  * process.
>  */
> class auth_status {
>     /** must be either null or one of AUTH_OK, AUTH_FAIL, AUTH_DENIED, AUTH_ERROR */
>     var $status = null; # null is neutral
> 
>     /** optional message from plugin to explain $this->status */
>     var $message = '';
> 
>     /** optional error code */
>     var $errorcode = 0;
> }
Index: login/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/login/index.php,v
retrieving revision 1.174
diff -r1.174 index.php
115a116,127
>     foreach($authsequence as $authname) {
>         $authplugin = get_auth_plugin($authname);
>         $authstatus = $authplugin->preauthentication_hook($frm->username, $frm->password);
>         if ($authstatus->status === AUTH_DENIED) {
>             $user = false;
>             $frm = false;
>             $errormsg = $authstatus->message;
>             break; # Do not continue -- this $authstatus must be the final one coming out of preauth.
>         }
>     }
> 
> 
117c129
<         //user already supplied by aut plugin prelogin hook
---
>         //user already supplied by auth plugin prelogin hook
233,235c245,252
<         if (empty($errormsg)) {
<             $errormsg = get_string("invalidlogin");
<             $errorcode = 3;
---
>         if (isset($authstatus) and isset($authstatus->status)) {
>             $errormsg = $authstatus->message;
>             $errorcode = $authstatus->errorcode;
>         } else {
>             if (empty($errormsg)) {
>                 $errormsg = get_string("invalidlogin");
>                 $errorcode = 3;
>             }
