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 PhabricatorPeopleManagementApproveWorkflow extends PhabricatorPeople..

Decoded Output download

<?php


final class PhabricatorPeopleManagementApproveWorkflow
  extends PhabricatorPeopleManagementWorkflow {

  protected function didConstruct() {
    $arguments = array_merge(
      $this->getUserSelectionArguments(),
      array());

    $this
      ->setName('approve')
      ->setExamples('**approve** --user __username__')
      ->setSynopsis(pht('Approves a user.'))
      ->setArguments($arguments);
  }

  public function execute(PhutilArgumentParser $args) {
    $user = $this->selectUser($args);
    $display_name = $user->getUsername();

    if ($user->getIsApproved()) {
      throw new PhutilArgumentUsageException(
        pht(
          'User account "%s" is already approved. You can only '.
          'approve accounts that are not yet approved.',
          $display_name));
    }

    $xactions = array();
    $xactions[] = $user->getApplicationTransactionTemplate()
      ->setTransactionType(PhabricatorUserApproveTransaction::TRANSACTIONTYPE)
      ->setNewValue(true);

    $this->applyTransactions($user, $xactions);

    $this->logOkay(
      pht('DONE'),
      pht('Approved user account "%s".', $display_name));

    return 0;
  }
}
 ?>

Did this file decode correctly?

Original Code

<?php


final class PhabricatorPeopleManagementApproveWorkflow
  extends PhabricatorPeopleManagementWorkflow {

  protected function didConstruct() {
    $arguments = array_merge(
      $this->getUserSelectionArguments(),
      array());

    $this
      ->setName('approve')
      ->setExamples('**approve** --user __username__')
      ->setSynopsis(pht('Approves a user.'))
      ->setArguments($arguments);
  }

  public function execute(PhutilArgumentParser $args) {
    $user = $this->selectUser($args);
    $display_name = $user->getUsername();

    if ($user->getIsApproved()) {
      throw new PhutilArgumentUsageException(
        pht(
          'User account "%s" is already approved. You can only '.
          'approve accounts that are not yet approved.',
          $display_name));
    }

    $xactions = array();
    $xactions[] = $user->getApplicationTransactionTemplate()
      ->setTransactionType(PhabricatorUserApproveTransaction::TRANSACTIONTYPE)
      ->setNewValue(true);

    $this->applyTransactions($user, $xactions);

    $this->logOkay(
      pht('DONE'),
      pht('Approved user account "%s".', $display_name));

    return 0;
  }
}

Function Calls

None

Variables

None

Stats

MD5 0d1140cb481be5010170ed9d0c5c7ceb
Eval Count 0
Decode Time 79 ms