]> git.mxchange.org Git - friendica-addons.git/commitdiff
Replaced goaway() with System::redirectTo()
authorPhilipp Holzer <admin@philipp.info>
Sat, 13 Oct 2018 18:05:05 +0000 (20:05 +0200)
committerPhilipp Holzer <admin@philipp.info>
Mon, 4 Feb 2019 00:50:15 +0000 (01:50 +0100)
blackout/blackout.php
notifyall/notifyall.php
startpage/startpage.php
statusnet/statusnet.php
twitter/twitter.php

index 6885420016a6878a00b97a69548f134d84b73b8e..79b3fc92a7cd1585472ba19b5cb710a6dea71bdf 100644 (file)
@@ -54,6 +54,7 @@ use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
+use Friendica\Core\System;
 
 function blackout_install() {
     Hook::register('page_header', 'addon/blackout/blackout.php', 'blackout_redirect');
@@ -86,8 +87,8 @@ function blackout_redirect ($a, $b) {
            $date2 = 0;
     }
     if (( $date1 <= $now ) && ( $now <= $date2 )) {
-        Logger::log('redirecting user to blackout page');
-        System::externalRedirect($myurl);
+        logger('redirecting user to blackout page');
+        System::redirectTo($myurl);
     }
 }
 
index 51c426cc5d9e7558856796fafef254b3560f1a9f..d739649ed3415a99f28da6ea2569c612e15f69d1 100644 (file)
@@ -14,6 +14,7 @@ use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
+use Friendica\Core\System;
 use Friendica\Util\Emailer;
 
 function notifyall_install()
@@ -95,7 +96,7 @@ function notifyall_post(App $a)
        }
 
        notice(L10n::t('Emails sent'));
-       $a->internalRedirect('admin');
+    System::redirectTo('admin');
 }
 
 function notifyall_content(&$a)
index 82ae1eb04db6f7dd0ea1722b415d82b9dc5c4157..b882c240d68d063b9254c419bd88e5dcdae16498 100644 (file)
@@ -9,6 +9,7 @@
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
+use Friendica\Core\System;
 
 function startpage_install() {
        Hook::register('home_init', 'addon/startpage/startpage.php', 'startpage_home_init');
@@ -31,7 +32,7 @@ function startpage_home_init($a, $b)
 
        $page = PConfig::get(local_user(), 'startpage', 'startpage');
        if (strlen($page)) {
-               $a->internalRedirect($page);
+        System::redirectTo($page);
        }
        return;
 }
index 93fc874f389c0d4638bc5d1bd4836fedd0c1bead..61e76a0c17ba103ca6949ec90dad2510e919d31e 100644 (file)
@@ -48,6 +48,7 @@ use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
+use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
@@ -163,7 +164,7 @@ function statusnet_settings_post(App $a, $post)
                                        }
                                }
                        }
-                       $a->internalRedirect('settings/connectors');
+            System::redirectTo('settings/connectors');
                } else {
                        if (isset($_POST['statusnet-consumersecret'])) {
                                //  check if we can reach the API of the GNU Social server
@@ -191,7 +192,7 @@ function statusnet_settings_post(App $a, $post)
                                                notice(L10n::t('We could not contact the GNU Social API with the Path you entered.') . EOL);
                                        }
                                }
-                               $a->internalRedirect('settings/connectors');
+                System::redirectTo('settings/connectors');
                        } else {
                                if (isset($_POST['statusnet-pin'])) {
                                        //  if the user supplied us with a PIN from GNU Social, let the magic of OAuth happen
@@ -209,7 +210,7 @@ function statusnet_settings_post(App $a, $post)
                                        PConfig::set(local_user(), 'statusnet', 'post', 1);
                                        PConfig::set(local_user(), 'statusnet', 'post_taglinks', 1);
                                        //  reload the Addon Settings page, if we don't do it see Bug #42
-                                       $a->internalRedirect('settings/connectors');
+                    System::redirectTo('settings/connectors');
                                } else {
                                        //  if no PIN is supplied in the POST variables, the user has changed the setting
                                        //  to post a dent for every new __public__ posting to the wall
index f05fc1f208cbd92fcb8a59d24345854705e4e926..fe23ac0df4b116164793d954211a9837c42da062 100644 (file)
@@ -75,6 +75,7 @@ use Friendica\Core\Logger;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
+use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
@@ -260,7 +261,7 @@ function twitter_settings_post(App $a)
                                info($e->getMessage());
                        }
                        //  reload the Addon Settings page, if we don't do it see Bug #42
-                       $a->internalRedirect('settings/connectors');
+            System::redirectTo('settings/connectors');
                } else {
                        //  if no PIN is supplied in the POST variables, the user has changed the setting
                        //  to post a tweet for every new __public__ posting to the wall