@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove support for the "TYPE_AUTH_WILLLOGIN" event

Summary:
Depends on D19903. Ref T13222. This was a Facebook-specific thing from D6202 that I believe no other install ever used, and I'm generally trying to move away from the old "event" system (the more modern modular/engine patterns generally replace it).

Just drop support for this. Since the constant is being removed, anything that's actually using it should break in an obvious way, and I'll note this in the changelog.

There's no explicit replacement but I don't think this hook is useful for anything except "being Facebook in 2013".

Test Plan:
- Grepped for `TYPE_AUTH_WILLLOGIN`.
- Logged in.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13222

Differential Revision: https://secure.phabricator.com/D19904

+18 -34
+18 -33
src/applications/auth/controller/PhabricatorAuthController.php
··· 55 55 $response = $this->buildLoginValidateResponse($user); 56 56 $session_type = PhabricatorAuthSession::TYPE_WEB; 57 57 58 - $event_type = PhabricatorEventType::TYPE_AUTH_WILLLOGINUSER; 59 - $event_data = array( 60 - 'user' => $user, 61 - 'type' => $session_type, 62 - 'response' => $response, 63 - 'shouldLogin' => true, 64 - ); 58 + if ($force_full_session) { 59 + $partial_session = false; 60 + } else { 61 + $partial_session = true; 62 + } 65 63 66 - $event = id(new PhabricatorEvent($event_type, $event_data)) 67 - ->setUser($user); 68 - PhutilEventEngine::dispatchEvent($event); 64 + $session_key = id(new PhabricatorAuthSessionEngine()) 65 + ->establishSession($session_type, $user->getPHID(), $partial_session); 69 66 70 - $should_login = $event->getValue('shouldLogin'); 71 - if ($should_login) { 72 - if ($force_full_session) { 73 - $partial_session = false; 74 - } else { 75 - $partial_session = true; 76 - } 67 + // NOTE: We allow disabled users to login and roadblock them later, so 68 + // there's no check for users being disabled here. 77 69 78 - $session_key = id(new PhabricatorAuthSessionEngine()) 79 - ->establishSession($session_type, $user->getPHID(), $partial_session); 70 + $request = $this->getRequest(); 71 + $request->setCookie( 72 + PhabricatorCookies::COOKIE_USERNAME, 73 + $user->getUsername()); 74 + $request->setCookie( 75 + PhabricatorCookies::COOKIE_SESSION, 76 + $session_key); 80 77 81 - // NOTE: We allow disabled users to login and roadblock them later, so 82 - // there's no check for users being disabled here. 78 + $this->clearRegistrationCookies(); 83 79 84 - $request = $this->getRequest(); 85 - $request->setCookie( 86 - PhabricatorCookies::COOKIE_USERNAME, 87 - $user->getUsername()); 88 - $request->setCookie( 89 - PhabricatorCookies::COOKIE_SESSION, 90 - $session_key); 91 - 92 - $this->clearRegistrationCookies(); 93 - } 94 - 95 - return $event->getValue('response'); 80 + return $response; 96 81 } 97 82 98 83 protected function clearRegistrationCookies() {
-1
src/infrastructure/events/constant/PhabricatorEventType.php
··· 22 22 23 23 const TYPE_PEOPLE_DIDRENDERMENU = 'people.didRenderMenu'; 24 24 const TYPE_AUTH_WILLREGISTERUSER = 'auth.willRegisterUser'; 25 - const TYPE_AUTH_WILLLOGINUSER = 'auth.willLoginUser'; 26 25 const TYPE_AUTH_DIDVERIFYEMAIL = 'auth.didVerifyEmail'; 27 26 28 27 }