Location: PHPKode > projects > PHP Authentication using Uma > uma/admin/loginerr.php
<?
/**
 * This page gets loaded when there is a fatal error with login, not 
 * simply failing to authenticate. It should not load every, but if it 
 * does it gives you the opportunity to dump session contents and clear
 * out the session. You can also use this to determine if someone is trying
 * to hack your site. 
*/
ini_set('include_path', @current(file('mepath.php'))); // you don't have to set your include_path like this, I do it because I thought it was idea at one time. Now I am not so sure.
require("Rampart.inc.php");

session_start();
$fp = @fopen("error.log", "a+");
ob_start();	
echo "\nLogging Started " . date(DATE_FORMAT) . "\n";
echo "Script: ".$_SESSION['rampartPage']."\n";
echo "User Session Content Starts Here\n";
print_r($_SESSION['rampartUser']);
echo "User Session Content Ends Here\n";
// The following is example of my dumping data regarding my particular 
// site so I can examine the log and see if there is something of value
// in there to help determine why the login failed.
/** echo "Property Session Content Starts Here\n";
print_r($sess_property);
echo "Property Session Content Ends Here\n";
echo "Property User Session Content Starts Here\n";
print_r($sess_user_property);
echo "Property User Session Content Ends Here\n";
**/
echo "Logging Ended " . date(DATE_FORMAT) . "\n\n";
$logD = ob_get_contents();
@fwrite($fp, $logD);
ob_end_clean();
@fclose($fp);
session_unset();
session_destroy();
// I like to notified when an error like this occurs, since it should
// never happen
mail(ERROR_MESSAGE_RECPT, 'Rampart Fatal Error', $logD);
// This is the error page someone sees when your system failed to log them in.
// again this only should come up if there is some sort of system failure
// like not being able to connect to the database.
header("location:error.php");
exit;
?>
Return current item: PHP Authentication using Uma