[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/auth/controller/ -> PhabricatorAuthDowngradeSessionController.php (source)

   1  <?php
   2  
   3  final class PhabricatorAuthDowngradeSessionController
   4    extends PhabricatorAuthController {
   5  
   6    public function processRequest() {
   7      $request = $this->getRequest();
   8      $viewer = $request->getUser();
   9  
  10      $panel_uri = '/settings/panel/sessions/';
  11  
  12      $session = $viewer->getSession();
  13      if ($session->getHighSecurityUntil() < time()) {
  14        return $this->newDialog()
  15          ->setTitle(pht('Normal Security Restored'))
  16          ->appendParagraph(
  17            pht('Your session is no longer in high security.'))
  18          ->addCancelButton($panel_uri, pht('Continue'));
  19      }
  20  
  21      if ($request->isFormPost()) {
  22  
  23        id(new PhabricatorAuthSessionEngine())
  24          ->exitHighSecurity($viewer, $session);
  25  
  26        return id(new AphrontRedirectResponse())
  27          ->setURI($this->getApplicationURI('session/downgrade/'));
  28      }
  29  
  30      return $this->newDialog()
  31        ->setTitle(pht('Leaving High Security'))
  32        ->appendParagraph(
  33          pht(
  34            'Leave high security and return your session to normal '.
  35            'security levels?'))
  36        ->appendParagraph(
  37          pht(
  38            'If you leave high security, you will need to authenticate '.
  39            'again the next time you try to take a high security action.'))
  40        ->appendParagraph(
  41          pht(
  42            'On the plus side, that purple notification bubble will '.
  43            'disappear.'))
  44        ->addSubmitButton(pht('Leave High Security'))
  45        ->addCancelButton($panel_uri, pht('Stay in High Security'));
  46    }
  47  
  48  
  49  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1