From d61347201ecf45b159756d0954020dcadda261cb Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 30 Oct 2013 20:42:43 -0700 Subject: allow rpost parameters to survive a login if you weren't locally logged in at the time. --- mod/rpost.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'mod/rpost.php') 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']; } -- cgit v1.2.3