Skip to content
  • Jakob's avatar
    MDL-53306 auth: Add hook for auth plugins to access user object. · cffd0fa1
    Jakob authored
    Add a hook for auth plugins to be able to modify or check a user, before
    raising any authentication errors.
    
    The auth plugin needs to add a public function like this:
    
    /**
     * Pre user_login hook.
     * This method is called from authenticate_user_login() right after the user
     * object is generated. This gives the auth plugins an option to make adjustments
     * before the verification process starts.
     *
     * @param object $user user object, later used for $USER
    */
    public function pre_user_login_hook(&$user) {
        // Override if needed.
    }
    cffd0fa1