Source for file logging.php
Documentation is available at logging.php
require_once 'Log/observer.php';
// Callback function to display login form
function loginFunction($username = null , $status = null , &$auth = null )
* Change the HTML output so that it fits to your
echo "<form method=\"post\" action=\"". $_SERVER['PHP_SELF']. "\">";
echo "Username: <input type=\"text\" name=\"username\"><br/>";
echo "Password: <input type=\"password\" name=\"password\"><br/>";
echo "<input type=\"submit\">";
class Auth_Log_Observer extends Log_observer {
function notify ($event) {
$this->messages[] = $event;
'guest' => md5('password'),
$a = new Auth("Array", $options, "loginFunction");
$a->attachLogObserver ($infoObserver);
$a->attachLogObserver ($debugObserver);
* The output of your site goes here.
print "Authentication Successful.<br/>";
print '<h3>Logging Output:</h3>'
. '<b>AUTH_LOG_INFO level messages:</b><br/>';
foreach ($infoObserver->messages as $event) {
print $event['priority']. ': '. $event['message']. '<br/>';
. '<b>AUTH_LOG_DEBUG level messages:</b><br/>';
foreach ($debugObserver->messages as $event) {
print $event['priority']. ': '. $event['message']. '<br/>';
Documentation generated on Mon, 11 Mar 2019 15:41:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|