Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php final class PhabricatorAuthChallengeStatusController extends PhabricatorAuthContr..

Decoded Output download

<?php

final class PhabricatorAuthChallengeStatusController
  extends PhabricatorAuthController {

  public function shouldAllowPartialSessions() {
    // We expect that users may request the status of an MFA challenge when
    // they hit the session upgrade gate on login.
    return true;
  }

  public function handleRequest(AphrontRequest $request) {
    $viewer = $this->getViewer();
    $id = $request->getURIData('id');
    $now = PhabricatorTime::getNow();

    $result = new PhabricatorAuthChallengeUpdate();

    $challenge = id(new PhabricatorAuthChallengeQuery())
      ->setViewer($viewer)
      ->withIDs(array($id))
      ->withUserPHIDs(array($viewer->getPHID()))
      ->withChallengeTTLBetween($now, null)
      ->executeOne();
    if ($challenge) {
      $config = id(new PhabricatorAuthFactorConfigQuery())
        ->setViewer($viewer)
        ->withPHIDs(array($challenge->getFactorPHID()))
        ->executeOne();
      if ($config) {
        $provider = $config->getFactorProvider();
        $factor = $provider->getFactor();

        $result = $factor->newChallengeStatusView(
          $config,
          $provider,
          $viewer,
          $challenge);
      }
    }

    return id(new AphrontAjaxResponse())
      ->setContent($result->newContent());
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhabricatorAuthChallengeStatusController
  extends PhabricatorAuthController {

  public function shouldAllowPartialSessions() {
    // We expect that users may request the status of an MFA challenge when
    // they hit the session upgrade gate on login.
    return true;
  }

  public function handleRequest(AphrontRequest $request) {
    $viewer = $this->getViewer();
    $id = $request->getURIData('id');
    $now = PhabricatorTime::getNow();

    $result = new PhabricatorAuthChallengeUpdate();

    $challenge = id(new PhabricatorAuthChallengeQuery())
      ->setViewer($viewer)
      ->withIDs(array($id))
      ->withUserPHIDs(array($viewer->getPHID()))
      ->withChallengeTTLBetween($now, null)
      ->executeOne();
    if ($challenge) {
      $config = id(new PhabricatorAuthFactorConfigQuery())
        ->setViewer($viewer)
        ->withPHIDs(array($challenge->getFactorPHID()))
        ->executeOne();
      if ($config) {
        $provider = $config->getFactorProvider();
        $factor = $provider->getFactor();

        $result = $factor->newChallengeStatusView(
          $config,
          $provider,
          $viewer,
          $challenge);
      }
    }

    return id(new AphrontAjaxResponse())
      ->setContent($result->newContent());
  }

}

Function Calls

None

Variables

None

Stats

MD5 4375814373094bc6ef4abb4ad2a9a415
Eval Count 0
Decode Time 85 ms