diff --git a/config-templates/config.php b/config-templates/config.php index 72a421c6c9dc8bdc75cb4322bd9dbd90e50929cf..97ae7b7c9784a20c100650735fd61c13a3110ec0 100644 --- a/config-templates/config.php +++ b/config-templates/config.php @@ -38,6 +38,14 @@ $config = array ( 'showerrors' => TRUE, + /** + * Custom error show function called from SimpleSAML_Error_Error::show. + * See docs/simplesamlphp-errorhandling.txt for function code example. + * + * Example: + * 'errors.show_function' => 'sspmod_exmaple_Error_Show::show', + */ + /** * This option allows you to enable validation of XML data against its * schemas. A warning will be written to the log if validation fails. diff --git a/docs/simplesamlphp-errorhandling.txt b/docs/simplesamlphp-errorhandling.txt index dce9b70ba0296d6ffe608611ae6be9caee3feb80..1c6a2651349591205abec154d2bd93e53bff4e2f 100644 --- a/docs/simplesamlphp-errorhandling.txt +++ b/docs/simplesamlphp-errorhandling.txt @@ -227,3 +227,17 @@ This happens regardless of whether the exception is delivered directly or throug This is done to be consistent in what the application receives - now it will always receive the same exception, regardless of whether it is delivered directly or through a redirect. +Custom error show function +-------------------------- + +Optional custom error show function, called from SimpleSAML_Error_Error::show, is defined with 'errors.show_function' in config.php. + +Example code for this function, which implements the same functionality as SimpleSAML_Error_Error::show, looks something like: + + public static function show(SimpleSAML_Configuration $config, array $data) { + $t = new SimpleSAML_XHTML_Template($config, 'error.php', 'errors'); + $t->data = array_merge($t->data, $data); + $t->show(); + exit; + } +