]> git.mxchange.org Git - friendica-addons.git/commitdiff
Changes:
authorRoland Häder <roland@mxchange.org>
Mon, 12 Sep 2022 17:04:40 +0000 (19:04 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 5 Dec 2023 15:12:03 +0000 (16:12 +0100)
- rewrote `header('Location: foo');` to `System::externalRedirect()`
- no executable permission on these files

saml/README.md [changed mode: 0755->0644]
saml/saml.php [changed mode: 0755->0644]
tumblr/tumblr.php

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 56dd0f5..2ab0a93
@@ -91,7 +91,7 @@ if (target.length) { target.append("<p>$fragment</p>"); }
 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 [
 
index a7a0db4c0657a3fe9bee56d79827a1a1ef3d0443..6c3d4373c9e136a0c1eb6dc10a91ff4f7c4d8df2 100644 (file)
@@ -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])) {