Skip to content
Snippets Groups Projects
Commit 85ff59bb authored by Olav Morken's avatar Olav Morken
Browse files

Utilities: Added fatalError helper function.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@100 44740490-163a-0410-bde0-09ae8108e29a
parent bae29de9
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
*/ */
require_once('SimpleSAML/Configuration.php'); require_once('SimpleSAML/Configuration.php');
require_once('SimpleSAML/XHTML/Template.php');
/** /**
* Configuration of SimpleSAMLphp * Configuration of SimpleSAMLphp
*/ */
...@@ -216,6 +217,26 @@ class SimpleSAML_Utilities { ...@@ -216,6 +217,26 @@ class SimpleSAML_Utilities {
return $ts; return $ts;
} }
/* This function logs a error message to the error log and shows the
* message to the user. Script execution terminates afterwards.
*
* Parameters:
* $title Short title for the error message.
* $message The error message.
*/
public static function fatalError($title, $message) {
error_log($title . ': ' . $message);
$config = SimpleSAML_Configuration::getInstance();
$t = new SimpleSAML_XHTML_Template($config, 'error.php');
$t->data['header'] = $title;
$t->data['message'] = $message;
$t->show();
exit;
}
} }
?> ?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment