From ff1a73ab6d7cde887b73449fb4990f52728e98ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Pe=CC=81rez=20Crespo?= <jaime.perez@uninett.no>
Date: Thu, 29 Nov 2018 10:33:35 +0100
Subject: [PATCH] Allow changing or removing the header of every page by
 configuration.

This introduces a "theme.header" configuration option in order to achieve that.
---
 config-templates/config.php       |  6 ++++++
 lib/SimpleSAML/XHTML/Template.php |  2 ++
 templates/_header.twig            | 11 ++++++++++-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/config-templates/config.php b/config-templates/config.php
index fb7a87623..ddbe91f14 100644
--- a/config-templates/config.php
+++ b/config-templates/config.php
@@ -786,6 +786,12 @@ $config = [
      */
     'theme.use' => 'default',
 
+    /*
+     * Set this option to the text you would like to appear at the header of each page. Set to false if you don't want
+     * any text to appear in the header.
+     */
+    //'theme.header' => 'SimpleSAMLphp'
+
     /*
      * Templating options
      *
diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index 9b2907fd3..90e6c027e 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -462,6 +462,8 @@ class Template extends Response
         }
 
         $this->data['year'] = date('Y');
+
+        $this->data['header'] = $this->configuration->getValue('theme.header', 'SimpleSAMLphp');
     }
 
 
diff --git a/templates/_header.twig b/templates/_header.twig
index efc28c2ff..1359659c4 100644
--- a/templates/_header.twig
+++ b/templates/_header.twig
@@ -3,7 +3,16 @@
                 <div class="left">
                     <div class="v-center logo-header">
                         <div id="logo">
-                            <span class="simple">Simple</span><span class="saml">SAML</span><span class="simple">php</span>
+                            {%- if header == 'SimpleSAMLphp' %}
+
+                            <span class="simple">Simple</span>{# -#}
+                            <span class="saml">SAML</span>{# -#}
+                            <span class="simple">php</span>
+                            {%- else %}
+
+                            {{ header }}
+                            {%- endif %}
+
                             <img class="pure-img hidden" src="" alt="LOGO">
                         </div>
                     </div>
-- 
GitLab