[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PhabricatorAuthValidateController 4 extends PhabricatorAuthController { 5 6 public function shouldRequireLogin() { 7 return false; 8 } 9 10 public function shouldAllowPartialSessions() { 11 return true; 12 } 13 14 public function processRequest() { 15 $request = $this->getRequest(); 16 $viewer = $request->getUser(); 17 18 $failures = array(); 19 20 if (!strlen($request->getStr('expect'))) { 21 return $this->renderErrors( 22 array( 23 pht( 24 'Login validation is missing expected parameter ("%s").', 25 'phusr'), 26 )); 27 } 28 29 $expect_phusr = $request->getStr('expect'); 30 $actual_phusr = $request->getCookie(PhabricatorCookies::COOKIE_USERNAME); 31 if ($actual_phusr != $expect_phusr) { 32 if ($actual_phusr) { 33 $failures[] = pht( 34 "Attempted to set '%s' cookie to '%s', but your browser sent back ". 35 "a cookie with the value '%s'. Clear your browser's cookies and ". 36 "try again.", 37 'phusr', 38 $expect_phusr, 39 $actual_phusr); 40 } else { 41 $failures[] = pht( 42 "Attempted to set '%s' cookie to '%s', but your browser did not ". 43 "accept the cookie. Check that cookies are enabled, clear them, ". 44 "and try again.", 45 'phusr', 46 $expect_phusr); 47 } 48 } 49 50 if (!$failures) { 51 if (!$viewer->getPHID()) { 52 $failures[] = pht( 53 'Login cookie was set correctly, but your login session is not '. 54 'valid. Try clearing cookies and logging in again.'); 55 } 56 } 57 58 if ($failures) { 59 return $this->renderErrors($failures); 60 } 61 62 $finish_uri = $this->getApplicationURI('finish/'); 63 return id(new AphrontRedirectResponse())->setURI($finish_uri); 64 } 65 66 private function renderErrors(array $messages) { 67 return $this->renderErrorPage( 68 pht('Login Failure'), 69 $messages); 70 } 71 72 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |