From 7ff421400afdb59024fdf4d9f8a96e04f4e62942 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Fri, 28 Jan 2011 08:48:53 +0000
Subject: [PATCH] Documentation for the custom error show function.

Thanks to Andjelko Horvat for providing the documentation patch.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2725 44740490-163a-0410-bde0-09ae8108e29a
---
 config-templates/config.php          |  8 ++++++++
 docs/simplesamlphp-errorhandling.txt | 14 ++++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/config-templates/config.php b/config-templates/config.php
index 72a421c6c..97ae7b7c9 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 dce9b70ba..1c6a26513 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;
+    }
+
-- 
GitLab