";
echo "Username:
";
echo "Password:
";
echo "";
echo "";
}
class Auth_Log_Observer extends Log_observer {
var $messages = array();
function notify($event) {
$this->messages[] = $event;
}
}
$options = array(
'enableLogging' => true,
array(
'type' => 'Array',
'options' => array(
'cryptType' => 'md5',
'users' => array(
'guest' => md5('password'),
),
),
),
array(
'type' => 'Array',
'options' => array(
'cryptType' => 'md5',
'users' => array(
'admin' => md5('password'),
),
),
),
);
$a = new Auth("Multiple", $options, "loginFunction");
$infoObserver = new Auth_Log_Observer(AUTH_LOG_INFO);
$a->attachLogObserver($infoObserver);
$debugObserver = new Auth_Log_Observer(AUTH_LOG_DEBUG);
$a->attachLogObserver($debugObserver);
$a->start();
if ($a->checkAuth()) {
/*
* The output of your site goes here.
*/
print "Authentication Successful.
";
}
print '