<?php
// imports
if (!defined('NO_IMPORTS')) {
require_once(WCF_DIR.'lib/system/auth/UserAuthDefault.class.php');
require_once(WCF_DIR.'lib/system/event/EventHandler.class.php');
}
/**
* All user authentication type should implement the abstract functions of this class.
*
* @package com.woltlab.wcf.system.auth
* @author Marcel Werk
* @copyright 2001-2007 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*/
abstract class UserAuth {
protected static $instance = null;
/**
* Returns an instance of the enabled user auth class.
*
* @return UserAuth
*/
public static function getInstance() {
if (self::$instance === null) {
// call loadInstance event
if (!defined('NO_IMPORTS')) EventHandler::fireAction('UserAuth', 'loadInstance');
if (self::$instance === null) self::$instance = new UserAuthDefault();
}
return self::$instance;
}
/**
* Returns true, if this auth type supports persistent logins.
*
* @return boolean
*/
public abstract function supportsPersistentLogins();
/**
* Stores the user access data for a persistent login.
*/
public abstract function storeAccessData($user, $username, $password);
/**
* Does an manual user login.
*
* @return User
*/
public abstract function loginManually($username, $password, $userClassname = 'UserSession');
/**
* Does an automatic user login.
*
* @return User
*/
public abstract function loginAutomatically($persistent = false, $userClassname = 'UserSession');
}
?>