aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-10-30 20:42:43 -0700
committerfriendica <info@friendica.com>2013-10-30 20:42:43 -0700
commitd61347201ecf45b159756d0954020dcadda261cb (patch)
treed325a72e2eb3d01a21c1640067a490dcb1c72ff2
parent39318e299ee36f4c14314b38238390e9b6e007bc (diff)
downloadvolse-hubzilla-d61347201ecf45b159756d0954020dcadda261cb.tar.gz
volse-hubzilla-d61347201ecf45b159756d0954020dcadda261cb.tar.bz2
volse-hubzilla-d61347201ecf45b159756d0954020dcadda261cb.zip
allow rpost parameters to survive a login if you weren't locally logged in at the time.
-rw-r--r--mod/rpost.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/mod/rpost.php b/mod/rpost.php
index ddcd3c53f..7ce403484 100644
--- a/mod/rpost.php
+++ b/mod/rpost.php
@@ -45,13 +45,22 @@ function rpost_content(&$a) {
}
}
- // FIXME
- // probably need to figure out how to preserve the $_REQUEST variables in the session
- // in case you aren't currently logged in. Otherwise you'll have to go back to
- // the site that sent you here and try again.
+ // The login procedure is going to bugger our $_REQUEST variables
+ // so save them in the session.
+
+ if(array_key_exists($_REQUEST,'body')) {
+ $_SESSION['rpost'] = $_REQUEST;
+ }
return login();
}
+ // If we have saved rpost session variables, but nothing in the current $_REQUEST, recover the saved variables
+
+ if((! array_key_exists($_REQUEST,'body')) && (array_key_exists($_SESSION,'rpost'))) {
+ $_REQUEST = $_SESSION['rpost'];
+ unset($_SESSION['rpost']);
+ }
+
if($_REQUEST['remote_return']) {
$_SESSION['remote_return'] = $_REQUEST['remote_return'];
}