From 2126244d3278952c17dbde4e839062c5113d6314 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Thu, 3 Jul 2008 06:04:26 +0000
Subject: [PATCH] Added template-based logout page.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@758 44740490-163a-0410-bde0-09ae8108e29a
---
 dictionaries/logout.php      | 17 +++++++++++++++++
 templates/default/logout.php | 20 ++++++++++++++++++++
 www/logout.php               | 25 +++++++++++++++++++++++++
 3 files changed, 62 insertions(+)
 create mode 100644 dictionaries/logout.php
 create mode 100644 templates/default/logout.php
 create mode 100644 www/logout.php

diff --git a/dictionaries/logout.php b/dictionaries/logout.php
new file mode 100644
index 000000000..c8c978728
--- /dev/null
+++ b/dictionaries/logout.php
@@ -0,0 +1,17 @@
+<?php
+
+$lang = array(
+	'title' => array (
+		'en' => 'Logged out',
+	),
+	'logged_out_text' => array (
+		'en' => 'You have been logged out. Thank you for using this service.',
+	),
+	'default_link_text' => array (
+		'en' => 'Go back to simpleSAMLphp installation page',
+	),
+
+);
+
+
+?>
\ No newline at end of file
diff --git a/templates/default/logout.php b/templates/default/logout.php
new file mode 100644
index 000000000..ff57112af
--- /dev/null
+++ b/templates/default/logout.php
@@ -0,0 +1,20 @@
+<?php
+
+$this->data['header'] = $this->t('{logout:title}');
+
+$this->includeAtTemplateBase('includes/header.php');
+
+echo('<div id="content">');
+
+echo('<h2>' . $this->data['header'] . '</h2>');
+echo('<p>' . $this->t('{logout:logged_out_text}') . '</p>');
+
+if($this->getTag($this->data['text']) !== NULL) {
+	$this->data['text'] = $this->t($this->data['text']);
+}
+echo('<p>[ <a href="' . htmlspecialchars($this->data['link']) . '">' .
+	htmlspecialchars($this->data['text']) . '</a> ]</p>');
+
+$this->includeAtTemplateBase('includes/footer.php');
+
+?>
\ No newline at end of file
diff --git a/www/logout.php b/www/logout.php
new file mode 100644
index 000000000..52b517dd5
--- /dev/null
+++ b/www/logout.php
@@ -0,0 +1,25 @@
+<?php
+
+require_once('_include.php');
+
+$config = SimpleSAML_Configuration::getInstance();
+
+if(array_key_exists('link_href', $_REQUEST)) {
+	$link = $_REQUEST['link_href'];
+} else {
+	$link = 'index.php';
+}
+
+if(array_key_exists('link_text', $_REQUEST)) {
+	$text = $_REQUEST['link_text'];
+} else {
+	$text = '{logout:default_link_text}';
+}
+
+$t = new SimpleSAML_XHTML_Template($config, 'logout.php');
+$t->data['link'] = $link;
+$t->data['text'] = $text;
+$t->show();
+exit();
+
+?>
\ No newline at end of file
-- 
GitLab