From 025132d18ddaa97687be44a52f86d79dc9f7f684 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 12 Sep 2022 19:04:40 +0200 Subject: [PATCH] Changes: - rewrote `header('Location: foo');` to `System::externalRedirect()` - no executable permission on these files --- saml/README.md | 0 saml/saml.php | 17 +++++------------ tumblr/tumblr.php | 5 +---- 3 files changed, 6 insertions(+), 16 deletions(-) mode change 100755 => 100644 saml/README.md mode change 100755 => 100644 saml/saml.php diff --git a/saml/README.md b/saml/README.md old mode 100755 new mode 100644 diff --git a/saml/saml.php b/saml/saml.php old mode 100755 new mode 100644 index 56dd0f5d..2ab0a93b --- a/saml/saml.php +++ b/saml/saml.php @@ -91,7 +91,7 @@ if (target.length) { target.append("

$fragment

"); } EOL; } -function saml_is_configured() +function saml_is_configured(): bool { return DI::config()->get('saml', 'idp_id') && @@ -114,10 +114,7 @@ function saml_sso_initiate(string &$body) $auth = new \OneLogin\Saml2\Auth(saml_settings()); $ssoBuiltUrl = $auth->login(null, [], false, false, true); DI::session()->set('AuthNRequestID', $auth->getLastRequestID()); - header('Pragma: no-cache'); - header('Cache-Control: no-cache, must-revalidate'); - header('Location: ' . $ssoBuiltUrl); - exit(); + System::externalRedirect($ssoBuiltUrl); } function saml_sso_reply() @@ -177,13 +174,9 @@ function saml_slo_initiate() } $auth = new \OneLogin\Saml2\Auth(saml_settings()); - $sloBuiltUrl = $auth->logout(); DI::session()->set('LogoutRequestID', $auth->getLastRequestID()); - header('Pragma: no-cache'); - header('Cache-Control: no-cache, must-revalidate'); - header('Location: ' . $sloBuiltUrl); - exit(); + System::externalRedirect($sloBuiltUrl); } function saml_slo_reply() @@ -207,7 +200,7 @@ function saml_slo_reply() } } -function saml_input($key, $label, $description) +function saml_input($key, $label, $description): array { return [ '$' . $key => [ @@ -333,7 +326,7 @@ function saml_create_user($username, $email, $name) } } -function saml_settings() +function saml_settings(): array { return [ diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index a7a0db4c..6c3d4373 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -88,10 +88,7 @@ function tumblr_check_item_notification(array &$notification_data) function tumblr_probe_detect(array &$hookData) { - // Don't overwrite an existing result - if (isset($hookData['result'])) { - return; - } + $t = Renderer::getMarkupTemplate( 'admin.tpl', 'addon/tumblr/' ); // Avoid a lookup for the wrong network if (!in_array($hookData['network'], ['', Protocol::TUMBLR])) { -- 2.39.5