From 080bfa7edb2b5ae1807230d20dd9c336296bb1bc Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Sat, 15 Feb 2020 23:35:33 +0100
Subject: [PATCH] Remove references to old templats

---
 lib/SimpleSAML/Error/Error.php             | 2 +-
 lib/SimpleSAML/IdP/IFrameLogoutHandler.php | 2 +-
 lib/SimpleSAML/Utils/HTTP.php              | 2 +-
 lib/SimpleSAML/XHTML/IdPDisco.php          | 4 ++--
 modules/core/lib/Controller/Exception.php  | 9 ---------
 modules/cron/lib/Controller/Cron.php       | 4 ++--
 6 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/lib/SimpleSAML/Error/Error.php b/lib/SimpleSAML/Error/Error.php
index ab9bd0258..4acb7c291 100644
--- a/lib/SimpleSAML/Error/Error.php
+++ b/lib/SimpleSAML/Error/Error.php
@@ -269,7 +269,7 @@ class Error extends Exception
             call_user_func($show_function, $config, $data);
             Assert::true(false);
         } else {
-            $t = new Template($config, 'error.php', 'errors');
+            $t = new Template($config, 'error.twig', 'errors');
             $t->data = array_merge($t->data, $data);
             $t->send();
         }
diff --git a/lib/SimpleSAML/IdP/IFrameLogoutHandler.php b/lib/SimpleSAML/IdP/IFrameLogoutHandler.php
index 627fea7d0..7ec89343f 100644
--- a/lib/SimpleSAML/IdP/IFrameLogoutHandler.php
+++ b/lib/SimpleSAML/IdP/IFrameLogoutHandler.php
@@ -99,7 +99,7 @@ class IFrameLogoutHandler implements LogoutHandlerInterface
 
         $config = Configuration::getInstance();
 
-        $t = new Template($config, 'IFrameLogoutHandler.tpl.php');
+        $t = new Template($config, 'IFrameLogoutHandler.twig');
         $t->data['assocId'] = var_export($assocId, true);
         $t->data['spId'] = sha1($assocId);
         if (!is_null($error)) {
diff --git a/lib/SimpleSAML/Utils/HTTP.php b/lib/SimpleSAML/Utils/HTTP.php
index a0ab8ecd2..cdf1ba722 100644
--- a/lib/SimpleSAML/Utils/HTTP.php
+++ b/lib/SimpleSAML/Utils/HTTP.php
@@ -1250,7 +1250,7 @@ class HTTP
             self::redirect(self::getSecurePOSTRedirectURL($destination, $data));
         }
 
-        $p = new Template($config, 'post.php');
+        $p = new Template($config, 'post.twig');
         $p->data['destination'] = $destination;
         $p->data['post'] = $data;
         $p->send();
diff --git a/lib/SimpleSAML/XHTML/IdPDisco.php b/lib/SimpleSAML/XHTML/IdPDisco.php
index 7b71ec053..6fa300240 100644
--- a/lib/SimpleSAML/XHTML/IdPDisco.php
+++ b/lib/SimpleSAML/XHTML/IdPDisco.php
@@ -582,10 +582,10 @@ class IdPDisco
          */
         switch ($this->config->getString('idpdisco.layout', 'links')) {
             case 'dropdown':
-                $templateFile = 'selectidp-dropdown.php';
+                $templateFile = 'selectidp-dropdown.twig';
                 break;
             case 'links':
-                $templateFile = 'selectidp-links.php';
+                $templateFile = 'selectidp-links.twig';
                 break;
             default:
                 throw new \Exception('Invalid value for the \'idpdisco.layout\' option.');
diff --git a/modules/core/lib/Controller/Exception.php b/modules/core/lib/Controller/Exception.php
index 905f8c116..8bf7ce300 100644
--- a/modules/core/lib/Controller/Exception.php
+++ b/modules/core/lib/Controller/Exception.php
@@ -73,15 +73,6 @@ class Exception
             ' ' . implode(',', array_keys($state['core:cardinality:errorAttributes']))
         );
 
-        $t = new Template($this->config, 'core:cardinality_error.tpl.php');
-        $t->data['cardinalityErrorAttributes'] = $state['core:cardinality:errorAttributes'];
-        if (isset($state['Source']['auth'])) {
-            $t->data['LogoutURL'] = Module::getModuleURL(
-                'core/authenticate.php',
-                ['as' => $state['Source']['auth']]
-            ) . "&logout";
-        }
-
         $t = new Template($this->config, 'core:cardinality_error.twig');
         $t->data['cardinalityErrorAttributes'] = $state['core:cardinality:errorAttributes'];
         if (isset($state['Source']['auth'])) {
diff --git a/modules/cron/lib/Controller/Cron.php b/modules/cron/lib/Controller/Cron.php
index e3d1a0176..57af87a16 100644
--- a/modules/cron/lib/Controller/Cron.php
+++ b/modules/cron/lib/Controller/Cron.php
@@ -87,7 +87,7 @@ class Cron
             ];
         }
 
-        $t = new Template($this->config, 'cron:croninfo.tpl.php', 'cron:cron');
+        $t = new Template($this->config, 'cron:croninfo.twig', 'cron:cron');
         $t->data['urls'] = $urls;
         return $t;
     }
@@ -138,7 +138,7 @@ class Cron
         }
 
         if ($output === 'xhtml') {
-            $t = new Template($this->config, 'cron:croninfo-result.tpl.php', 'cron:cron');
+            $t = new Template($this->config, 'cron:croninfo-result.twig', 'cron:cron');
             $t->data['tag'] = $croninfo['tag'];
             $t->data['time'] = $time;
             $t->data['url'] = $url;
-- 
GitLab