$page_dropping = ((local_user() && local_user() == $profile_owner) ? true : false);
if (!$update) {
- $_SESSION['return_url'] = $a->query_string;
+ $_SESSION['return_path'] = $a->query_string;
}
$cb = ['items' => $items, 'mode' => $mode, 'update' => $update, 'preview' => $preview];
}
if ($a->argc == 1) {
- $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
+ $_SESSION['return_path'] = $a->cmd;
}
if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) {
$uid = local_user();
$url = notags(trim($_REQUEST['url']));
- $return_url = 'contacts';
+ $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
if ($result['message']) {
notice($result['message']);
}
- $a->internalRedirect($return_url);
+ $a->internalRedirect($return_path);
} elseif ($result['cid']) {
$a->internalRedirect('contact/' . $result['cid']);
}
info(L10n::t('The contact could not be added.'));
- $a->internalRedirect($return_url);
+ $a->internalRedirect($return_path);
// NOTREACHED
}
function follow_content(App $a)
{
- $return_url = 'contacts';
+ $return_path = 'contacts';
if (!local_user()) {
notice(L10n::t('Permission denied.'));
- $a->internalRedirect($return_url);
+ $a->internalRedirect($return_path);
// NOTREACHED
}
if ($r[0]['pending']) {
notice(L10n::t('You already added this contact.'));
$submit = '';
- //$a->internalRedirect($_SESSION['return_url']);
+ //$a->internalRedirect($_SESSION['return_path']);
// NOTREACHED
}
}
if (($ret['network'] == Protocol::DIASPORA) && !Config::get('system', 'diaspora_enabled')) {
notice(L10n::t("Diaspora support isn't enabled. Contact can't be added."));
$submit = '';
- //$a->internalRedirect($_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 = '';
- //$a->internalRedirect($_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 = '';
- //$a->internalRedirect($_SESSION['return_url']);
+ //$a->internalRedirect($_SESSION['return_path']);
// NOTREACHED
}
if (!$r) {
notice(L10n::t('Permission denied.'));
- $a->internalRedirect($return_url);
+ $a->internalRedirect($return_path);
// NOTREACHED
}
unset($_SESSION['theme']);
unset($_SESSION['mobile-theme']);
unset($_SESSION['page_flags']);
- unset($_SESSION['return_url']);
+ unset($_SESSION['return_path']);
if (x($_SESSION, 'submanage')) {
unset($_SESSION['submanage']);
}
$a->page['aside'] .= Widget::findPeople();
$a->page['aside'] .= Widget::follow();
- $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
+ $_SESSION['return_path'] = $a->cmd;
$r = q(
"SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
}
- $_SESSION['return_url'] = $a->query_string;
+ $_SESSION['return_path'] = $a->query_string;
if ($a->argc == 1) {
if (count($linked_items)) {
$cmnt_tpl = get_markup_template('comment_item.tpl');
$tpl = get_markup_template('photo_item.tpl');
- $return_url = $a->cmd;
+ $return_path = $a->cmd;
if ($can_post || Security::canWriteToUserWall($owner_uid)) {
$like_tpl = get_markup_template('like_noshare.tpl');
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
$comments .= replace_macros($cmnt_tpl, [
'$return_path' => '',
- '$jsreload' => $return_url,
+ '$jsreload' => $return_path,
'$id' => $link_item['id'],
'$parent' => $link_item['id'],
'$profile_uid' => $owner_uid,
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
$comments .= replace_macros($cmnt_tpl,[
'$return_path' => '',
- '$jsreload' => $return_url,
+ '$jsreload' => $return_path,
'$id' => $link_item['id'],
'$parent' => $link_item['id'],
'$profile_uid' => $owner_uid,
if (($can_post || Security::canWriteToUserWall($owner_uid))) {
$comments .= replace_macros($cmnt_tpl, [
'$return_path' => '',
- '$jsreload' => $return_url,
+ '$jsreload' => $return_path,
'$id' => $item['item_id'],
'$parent' => $item['parent'],
'$profile_uid' => $owner_uid,
return;
}
- $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd;
+ $_SESSION['return_path'] = $a->cmd;
$a->page['aside'] .= Widget::findPeople();
$a->page['aside'] .= Widget::follow();
function unfollow_post(App $a)
{
- $return_url = 'contacts';
+ $return_path = 'contacts';
if (!local_user()) {
notice(L10n::t('Permission denied.'));
if (!DBA::isResult($contact)) {
notice(L10n::t("You aren't following this contact."));
- $a->internalRedirect($return_url);
+ $a->internalRedirect($return_path);
// NOTREACHED
}
if (!empty($_REQUEST['cancel'])) {
- $a->internalRedirect($return_url . '/' . $contact['id']);
+ $a->internalRedirect($return_path . '/' . $contact['id']);
}
if (!in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
notice(L10n::t('Unfollowing is currently not supported by your network.'));
- $a->internalRedirect($return_url . '/' . $contact['id']);
+ $a->internalRedirect($return_path . '/' . $contact['id']);
// NOTREACHED
}
function unfollow_content(App $a)
{
- $return_url = 'contacts';
+ $return_path = 'contacts';
if (!local_user()) {
notice(L10n::t('Permission denied.'));
if (!DBA::isResult($contact)) {
notice(L10n::t("You aren't following this contact."));
- $a->internalRedirect($return_url);
+ $a->internalRedirect($return_path);
// NOTREACHED
}
if (!DBA::isResult($self)) {
notice(L10n::t('Permission denied.'));
- $a->internalRedirect($return_url);
+ $a->internalRedirect($return_path);
// NOTREACHED
}
if ($interactive) {
if ($a->user['login_date'] <= NULL_DATE) {
- $_SESSION['return_url'] = 'profile_photo/new';
+ $_SESSION['return_path'] = 'profile_photo/new';
$a->module = 'profile_photo';
info(L10n::t("Welcome ") . $a->user['username'] . EOL);
info(L10n::t('Please upload a profile photo.') . EOL);
if ($login_initial) {
Addon::callHooks('logged_in', $a->user);
- if (($a->module !== 'home') && isset($_SESSION['return_url'])) {
- $a->internalRedirect($_SESSION['return_url']);
+ if (($a->module !== 'home') && isset($_SESSION['return_path'])) {
+ $a->internalRedirect($_SESSION['return_path']);
}
}
}
}
}
- $_SESSION['return_url'] = $a->query_string;
+ $_SESSION['return_path'] = $a->query_string;
if (!empty($a->data['contact']) && is_array($a->data['contact'])) {
$contact_id = $a->data['contact']['id'];
$a->internalRedirect();
}
- return self::form($_SESSION['return_url'], intval(Config::get('config', 'register_policy')) !== REGISTER_CLOSED);
+ return self::form($_SESSION['return_path'], intval(Config::get('config', 'register_policy')) !== REGISTER_CLOSED);
}
public static function post()
{
- $return_url = $_SESSION['return_url'];
+ $return_path = $_SESSION['return_path'];
session_unset();
- $_SESSION['return_url'] = $return_url;
+ $_SESSION['return_path'] = $return_path;
// OpenId Login
if (
$_SESSION['last_login_date'] = DateTimeFormat::utcNow();
Authentication::setAuthenticatedSessionForUser($record, true, true);
- if (x($_SESSION, 'return_url')) {
- $return_url = $_SESSION['return_url'];
- unset($_SESSION['return_url']);
+ if (x($_SESSION, 'return_path')) {
+ $return_path = $_SESSION['return_path'];
+ unset($_SESSION['return_path']);
} else {
- $return_url = '';
+ $return_path = '';
}
- $a->internalRedirect($return_url);
+ $a->internalRedirect($return_path);
}
/**
/**
* @brief Wrapper for adding a login box.
*
- * @param string $return_url The url relative to the base the user should be sent
+ * @param string $return_path The path relative to the base the user should be sent
* back to after login completes
* @param bool $register If $register == true provide a registration link.
* This will most always depend on the value of config.register_policy.
*
* @hooks 'login_hook' string $o
*/
- public static function form($return_url = null, $register = false, $hiddens = [])
+ public static function form($return_path = null, $register = false, $hiddens = [])
{
$a = self::getApp();
$o = '';
$noid = Config::get('system', 'no_openid');
- if (is_null($return_url)) {
- $return_url = $a->query_string;
+ if (is_null($return_path)) {
+ $return_path = $a->query_string;
}
if (local_user()) {
);
$tpl = get_markup_template('login.tpl');
- $_SESSION['return_url'] = $return_url;
+ $_SESSION['return_path'] = $return_path;
}
$o .= replace_macros(