X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FCasAuthentication%2Fcaslogin.php;h=0e16427184b45ee03fe3d1cee6a1d4bd66694436;hb=d594c83a5a9a9d42fce917b544c28591fcadb1aa;hp=390a75d8b417261b8cdaf280913947b64174a8e9;hpb=866dfa6822df54765a9b92336722d86cfad6b123;p=quix0rs-gnu-social.git diff --git a/plugins/CasAuthentication/caslogin.php b/plugins/CasAuthentication/caslogin.php index 390a75d8b4..0e16427184 100644 --- a/plugins/CasAuthentication/caslogin.php +++ b/plugins/CasAuthentication/caslogin.php @@ -25,10 +25,11 @@ class CasloginAction extends Action { parent::handle($args); if (common_is_real_login()) { + // TRANS: Client error displayed when trying to log in while already logged on. $this->clientError(_m('Already logged in.')); } else { global $casSettings; - phpCAS::client(CAS_VERSION_2_0,$casSettings['server'],$casSettings['port'],$casSettings['path']); + phpCAS::client(CAS_VERSION_2_0,$casSettings['server'],$casSettings['port'],$casSettings['path'],false); phpCAS::setNoCasServerValidation(); phpCAS::handleLogoutRequests(); phpCAS::forceAuthentication(); @@ -36,13 +37,15 @@ class CasloginAction extends Action $casTempPassword = common_good_rand(16); $user = common_check_user(phpCAS::getUser(), $casTempPassword); if (!$user) { - $this->serverError(_('Incorrect username or password.')); + // TRANS: Server error displayed when trying to log in with 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.')); + // TRANS: Server error displayed when login fails in CAS authentication plugin. + $this->serverError(_m('Error setting user. You are probably not authorized.')); return; } @@ -54,13 +57,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); - } } }