]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/CasAuthentication/caslogin.php
Merge branch 'testing' into privategroup
[quix0rs-gnu-social.git] / plugins / CasAuthentication / caslogin.php
index 390a75d8b417261b8cdaf280913947b64174a8e9..846774e7c671a88cd3c4fae15d88bdff1cc97c42 100644 (file)
@@ -36,13 +36,13 @@ class CasloginAction extends Action
             $casTempPassword = common_good_rand(16);
             $user = common_check_user(phpCAS::getUser(), $casTempPassword);
             if (!$user) {
-                $this->serverError(_('Incorrect username or password.'));
+                $this->serverError(_m('Incorrect username or password.'));
                 return;
             }
 
             // success!
             if (!common_set_user($user)) {
-                $this->serverError(_('Error setting user. You are probably not authorized.'));
+                $this->serverError(_m('Error setting user. You are probably not authorized.'));
                 return;
             }
 
@@ -54,13 +54,21 @@ 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);
-
         }
     }
 }