X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ffollow.php;h=adc3fcc3bd5125465e4c3a0720053869360f8cfb;hb=a09273802ef0b790c0374a2fece6cded5686ebc2;hp=65028a70e007fb1d7f4c2e61c74cc921aa7e2840;hpb=6a8ebc8639507404be07bb7d6fd5a37189e46563;p=friendica.git diff --git a/mod/follow.php b/mod/follow.php index 65028a70e0..adc3fcc3bd 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -20,40 +20,41 @@ function follow_post(App $a) } if (isset($_REQUEST['cancel'])) { - goaway($_SESSION['return_url']); + $a->internalRedirect('contacts'); } $uid = local_user(); $url = notags(trim($_REQUEST['url'])); - $return_url = $_SESSION['return_url']; + $return_path = 'contacts'; // Makes the connection request for friendica contacts easier // This is just a precaution if maybe this page is called somewhere directly via POST $_SESSION['fastlane'] = $url; - $result = Contact::createFromProbe($uid, $url, true, Protocol::ACTIVITYPUB); -// $result = Contact::createFromProbe($uid, $url, true); + $result = Contact::createFromProbe($uid, $url, true); if ($result['success'] == false) { if ($result['message']) { notice($result['message']); } - goaway($return_url); + $a->internalRedirect($return_path); } elseif ($result['cid']) { - goaway(System::baseUrl() . '/contacts/' . $result['cid']); + $a->internalRedirect('contact/' . $result['cid']); } info(L10n::t('The contact could not be added.')); - goaway($return_url); + $a->internalRedirect($return_path); // NOTREACHED } function follow_content(App $a) { + $return_path = 'contacts'; + if (!local_user()) { notice(L10n::t('Permission denied.')); - goaway($_SESSION['return_url']); + $a->internalRedirect($return_path); // NOTREACHED } @@ -73,7 +74,7 @@ function follow_content(App $a) if ($r[0]['pending']) { notice(L10n::t('You already added this contact.')); $submit = ''; - //goaway($_SESSION['return_url']); + //$a->internalRedirect($_SESSION['return_path']); // NOTREACHED } } @@ -83,21 +84,21 @@ function follow_content(App $a) if (($ret['network'] == Protocol::DIASPORA) && !Config::get('system', 'diaspora_enabled')) { notice(L10n::t("Diaspora support isn't enabled. Contact can't be added.")); $submit = ''; - //goaway($_SESSION['return_url']); + //$a->internalRedirect($_SESSION['return_path']); // NOTREACHED } if (($ret['network'] == Protocol::OSTATUS) && Config::get('system', 'ostatus_disabled')) { notice(L10n::t("OStatus support is disabled. Contact can't be added.")); $submit = ''; - //goaway($_SESSION['return_url']); + //$a->internalRedirect($_SESSION['return_path']); // NOTREACHED } if ($ret['network'] == Protocol::PHANTOM) { notice(L10n::t("The network type couldn't be detected. Contact can't be added.")); $submit = ''; - //goaway($_SESSION['return_url']); + //$a->internalRedirect($_SESSION['return_path']); // NOTREACHED } @@ -117,7 +118,7 @@ function follow_content(App $a) if (!$r) { notice(L10n::t('Permission denied.')); - goaway($_SESSION['return_url']); + $a->internalRedirect($return_path); // NOTREACHED }