allow rpost parameters to survive a login if you weren't locally logged in at the time.

This commit is contained in:
friendica 2013-10-30 20:42:43 -07:00
parent 39318e299e
commit d61347201e

View File

@ -45,13 +45,22 @@ function rpost_content(&$a) {
} }
} }
// FIXME // The login procedure is going to bugger our $_REQUEST variables
// probably need to figure out how to preserve the $_REQUEST variables in the session // so save them 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. if(array_key_exists($_REQUEST,'body')) {
$_SESSION['rpost'] = $_REQUEST;
}
return login(); 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']) { if($_REQUEST['remote_return']) {
$_SESSION['remote_return'] = $_REQUEST['remote_return']; $_SESSION['remote_return'] = $_REQUEST['remote_return'];
} }