]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Redirect to main page when transparent SSO is in place for the CAS plugin (which...
authorCraig Andrews <candrews@integralblue.com>
Tue, 2 Mar 2010 20:09:28 +0000 (15:09 -0500)
committerCraig Andrews <candrews@integralblue.com>
Tue, 2 Mar 2010 20:10:30 +0000 (15:10 -0500)
plugins/CasAuthentication/CasAuthenticationPlugin.php
plugins/CasAuthentication/caslogin.php

index 483b060abdba12d03806da23eccc0c26a129b063..203e5fe420c6e6f1e09e1bb172ab47f1c8466c50 100644 (file)
@@ -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)
index 390a75d8b417261b8cdaf280913947b64174a8e9..a66774dc17e911caf71d08069d648c0485020817 100644 (file)
@@ -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);