summaryrefslogtreecommitdiff
path: root/plugins/CasAuthentication
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2010-03-02 15:09:28 -0500
committerCraig Andrews <candrews@integralblue.com>2010-03-02 15:10:30 -0500
commit380439ba77c305a2e74c2329d7d34f9eba0a957e (patch)
tree449246bf957f81530f6c7fb6b06c55ef3de2ce99 /plugins/CasAuthentication
parentf65478b624f485098eb1675572357af2f3ca5c40 (diff)
Redirect to main page when transparent SSO is in place for the CAS plugin (which is what the user expects)
Diffstat (limited to 'plugins/CasAuthentication')
-rw-r--r--plugins/CasAuthentication/CasAuthenticationPlugin.php1
-rw-r--r--plugins/CasAuthentication/caslogin.php15
2 files changed, 13 insertions, 3 deletions
diff --git a/plugins/CasAuthentication/CasAuthenticationPlugin.php b/plugins/CasAuthentication/CasAuthenticationPlugin.php
index 483b060ab..203e5fe42 100644
--- a/plugins/CasAuthentication/CasAuthenticationPlugin.php
+++ b/plugins/CasAuthentication/CasAuthenticationPlugin.php
@@ -137,6 +137,7 @@ class CasAuthenticationPlugin extends AuthenticationPlugin
$casSettings['server']=$this->server;
$casSettings['port']=$this->port;
$casSettings['path']=$this->path;
+ $casSettings['takeOverLogin']=$this->takeOverLogin;
}
function onPluginVersion(&$versions)
diff --git a/plugins/CasAuthentication/caslogin.php b/plugins/CasAuthentication/caslogin.php
index 390a75d8b..a66774dc1 100644
--- a/plugins/CasAuthentication/caslogin.php
+++ b/plugins/CasAuthentication/caslogin.php
@@ -54,9 +54,18 @@ class CasloginAction extends Action
// We don't have to return to it again
common_set_returnto(null);
} else {
- $url = common_local_url('all',
- array('nickname' =>
- $user->nickname));
+ if(common_config('site', 'private') && $casSettings['takeOverLogin']) {
+ //SSO users expect to just go to the URL they entered
+ //if we don't have a returnto set, the user entered the
+ //main StatusNet url, so send them there.
+ $url = common_local_url('public');
+ } else {
+ //With normal logins (regular form-based username/password),
+ //the user would expect to go to their home after logging in.
+ $url = common_local_url('public',
+ array('nickname' =>
+ $user->nickname));
+ }
}
common_redirect($url, 303);