diff options
author | Sixto Martin <smartin@yaco.es> | 2013-01-22 17:01:50 +0400 |
---|---|---|
committer | Sixto Martin <smartin@yaco.es> | 2013-01-22 17:01:50 +0400 |
commit | eecd91c1472de06aadd0dd1c14b63ca94b74516b (patch) | |
tree | c9d629835ffca312d88ce9b01c976a2cbbe98f8c /user_saml | |
parent | 7528fdf147a767a0be17faa097ac62ba9378c768 (diff) |
Fix redirect
Diffstat (limited to 'user_saml')
-rw-r--r-- | user_saml/README.md | 4 | ||||
-rw-r--r-- | user_saml/appinfo/app.php | 10 | ||||
-rw-r--r-- | user_saml/auth.php | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/user_saml/README.md b/user_saml/README.md index 202ea579e..41f4d91d5 100644 --- a/user_saml/README.md +++ b/user_saml/README.md @@ -41,6 +41,10 @@ EXTRA INFO the value of the defaultGroup field will be used instead. If both are undefined, then the user will be set with no groups. But if you configure the "protected groups" field, those groups will not be unlinked from the user. +* If you want to redirect to any specific app after force the login you can set the url param linktoapp. Also you can pass extra args to build the target url using the param linktoargs (the value must be urlencoded). + Ex. ?app=user_saml&linktoapp=files&linktoargs=file%3d%2ftest%2ftest_file.txt%26getfile%3ddownload.php + ?app=user_saml&linktoapp=files&linktoargs=dir%3d%2ftest + NOTES ===== diff --git a/user_saml/appinfo/app.php b/user_saml/appinfo/app.php index f8c13a2c4..edaffda3c 100644 --- a/user_saml/appinfo/app.php +++ b/user_saml/appinfo/app.php @@ -44,12 +44,16 @@ if (OCP\App::isEnabled('user_saml')) { OC_Log::write('saml','Error trying to authenticate the user', OC_Log::DEBUG); } - if (isset($_SERVER["QUERY_STRING"]) && !empty($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != 'app=user_saml') { - header( 'Location: ' . OC::$WEBROOT . '/?' . $_SERVER["QUERY_STRING"]); + if (isset($_GET["linktoapp"])) { + $path = OC::$WEBROOT . '/?app='.$_GET["linktoapp"]; + if (isset($_GET["linktoargs"])) { + $path .= '&'.urldecode($_GET["linktoargs"]); + } + header( 'Location: ' . $path); exit(); } - OC::$REQUESTEDAPP = ''; + OC::$REQUESTEDAPP = ''; OC_Util::redirectToDefaultPage(); } diff --git a/user_saml/auth.php b/user_saml/auth.php index 641c975be..d99b4c123 100644 --- a/user_saml/auth.php +++ b/user_saml/auth.php @@ -21,6 +21,8 @@ * */ + OCP\App::checkAppEnabled('user_saml'); + $sspPath = OCP\Config::getAppValue('user_saml', 'saml_ssp_path', ''); $spSource = OCP\Config::getAppValue('user_saml', 'saml_sp_source', ''); $autocreate = OCP\Config::getAppValue('user_saml', 'saml_autocreate', false); |