Skip to content
Snippets Groups Projects
Commit 95031cb1 authored by Bart Visscher's avatar Bart Visscher
Browse files

remoteStorage: Use OCP\\Util for redirecting for login and generating link

parent 4e6b4b26
No related branches found
No related tags found
No related merge requests found
...@@ -73,9 +73,10 @@ if($userId && $appUrl && $categories) { ...@@ -73,9 +73,10 @@ if($userId && $appUrl && $categories) {
if($currUser) { if($currUser) {
die('You are logged in as '.$currUser.' instead of '.htmlentities($userId)); die('You are logged in as '.$currUser.' instead of '.htmlentities($userId));
} else { } else {
header('Location: /?redirect_url='.urlencode('/apps/remoteStorage/auth.php'.$_SERVER['PATH_INFO'].'?'.$_SERVER['QUERY_STRING'])); // this will display the login page for us
OCP\Util::checkLoggedIn();
} }
} }
} else {//params not ok } else {//params not ok
die('please use e.g. /?app=remoteStorage&getfile=auth.php&userid=admin&redirect_uri=http://host/path&scope=...'); die('please use e.g. '.OCP\Util::linkTo('remoteStorage', 'auth.php').'?userid=admin&redirect_uri=http://host/path&scope=...');
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment