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 PhortuneAccountEmailRotateController extends PhortuneAccountControlle..

Decoded Output download

<?php

final class PhortuneAccountEmailRotateController
  extends PhortuneAccountController {

  protected function shouldRequireAccountEditCapability() {
    return true;
  }

  protected function handleAccountRequest(AphrontRequest $request) {
    $viewer = $this->getViewer();
    $account = $this->getAccount();

    $address = id(new PhortuneAccountEmailQuery())
      ->setViewer($viewer)
      ->withAccountPHIDs(array($account->getPHID()))
      ->withIDs(array($request->getURIData('addressID')))
      ->requireCapabilities(
        array(
          PhabricatorPolicyCapability::CAN_VIEW,
          PhabricatorPolicyCapability::CAN_EDIT,
        ))
      ->executeOne();
    if (!$address) {
      return new Aphront404Response();
    }

    $address_uri = $address->getURI();

    if ($request->isFormOrHisecPost()) {
      $xactions = array();

      $xactions[] = $address->getApplicationTransactionTemplate()
        ->setTransactionType(
          PhortuneAccountEmailRotateTransaction::TRANSACTIONTYPE)
        ->setNewValue(true);

      $address->getApplicationTransactionEditor()
        ->setActor($viewer)
        ->setContentSourceFromRequest($request)
        ->setContinueOnMissingFields(true)
        ->setContinueOnNoEffect(true)
        ->setCancelURI($address_uri)
        ->applyTransactions($address, $xactions);

      return id(new AphrontRedirectResponse())->setURI($address_uri);
    }

    return $this->newDialog()
      ->setTitle(pht('Rotate Access Key'))
      ->appendParagraph(
        pht(
          'Rotate the access key for email address %s?',
          phutil_tag('strong', array(), $address->getAddress())))
      ->appendParagraph(
        pht(
          'Existing access links which have been sent to this email address '.
          'will stop working.'))
      ->addSubmitButton(pht('Rotate Access Key'))
      ->addCancelButton($address_uri);
  }
}
 ?>

Did this file decode correctly?

Original Code

<?php

final class PhortuneAccountEmailRotateController
  extends PhortuneAccountController {

  protected function shouldRequireAccountEditCapability() {
    return true;
  }

  protected function handleAccountRequest(AphrontRequest $request) {
    $viewer = $this->getViewer();
    $account = $this->getAccount();

    $address = id(new PhortuneAccountEmailQuery())
      ->setViewer($viewer)
      ->withAccountPHIDs(array($account->getPHID()))
      ->withIDs(array($request->getURIData('addressID')))
      ->requireCapabilities(
        array(
          PhabricatorPolicyCapability::CAN_VIEW,
          PhabricatorPolicyCapability::CAN_EDIT,
        ))
      ->executeOne();
    if (!$address) {
      return new Aphront404Response();
    }

    $address_uri = $address->getURI();

    if ($request->isFormOrHisecPost()) {
      $xactions = array();

      $xactions[] = $address->getApplicationTransactionTemplate()
        ->setTransactionType(
          PhortuneAccountEmailRotateTransaction::TRANSACTIONTYPE)
        ->setNewValue(true);

      $address->getApplicationTransactionEditor()
        ->setActor($viewer)
        ->setContentSourceFromRequest($request)
        ->setContinueOnMissingFields(true)
        ->setContinueOnNoEffect(true)
        ->setCancelURI($address_uri)
        ->applyTransactions($address, $xactions);

      return id(new AphrontRedirectResponse())->setURI($address_uri);
    }

    return $this->newDialog()
      ->setTitle(pht('Rotate Access Key'))
      ->appendParagraph(
        pht(
          'Rotate the access key for email address %s?',
          phutil_tag('strong', array(), $address->getAddress())))
      ->appendParagraph(
        pht(
          'Existing access links which have been sent to this email address '.
          'will stop working.'))
      ->addSubmitButton(pht('Rotate Access Key'))
      ->addCancelButton($address_uri);
  }
}

Function Calls

None

Variables

None

Stats

MD5 f25f406ca8fc3b23fed7861007b1b6f7
Eval Count 0
Decode Time 104 ms