<?php
require_once('auth.class.php'); // parent
/**
* The auth class for use with DB-backend authentication.
*
*/
class AuthAllowAll extends Auth {
/**
* The core of the authentication concept.
* checks a username & password hash (md5) against whatever authentication backend is being used (DB, shadow, etc)
*
* @param string $username
* @param string $password the password given by the user
* @return true or false to indicate success.
*/
function authenticate($username, $password) {
$_SESSION['loggedin'] = 1;
return true;
}
/**
* Caches the info for the currently logged in user into class variables, if it hasn't been loaded yet.
*/
protected function load_auth_cache() {
if (!$this->cache_loaded) {
if (@$_SESSION['loggedin']) {
// set the class variables
$this->username = 'sample';
$this->user_id = 1;
$this->user_group = 'user';
// set the class variable to indicate that the values are ready (for future reference)
$this->cache_loaded = true;
}
else {
// not logged in. do nothing. (class vars will stay 'false')
}
}
}
}
?>