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 abstract class PhabricatorDashboardApplicationInstallWorkflow extends Phabricator..

Decoded Output download

<?php

abstract class PhabricatorDashboardApplicationInstallWorkflow
  extends PhabricatorDashboardInstallWorkflow {

  abstract protected function newApplication();

  protected function canInstallToGlobalMenu() {
    return PhabricatorPolicyFilter::hasCapability(
      $this->getViewer(),
      $this->newApplication(),
      PhabricatorPolicyCapability::CAN_EDIT);
  }

  public function handleRequest(AphrontRequest $request) {
    $viewer = $this->getViewer();
    $application = $this->newApplication();
    $can_global = $this->canInstallToGlobalMenu();

    switch ($this->getMode()) {
      case 'global':
        if (!$can_global) {
          return $this->newGlobalPermissionDialog();
        } else if ($request->isFormPost()) {
          return $this->installDashboard($application, null);
        } else {
          return $this->newGlobalConfirmDialog();
        }
      case 'personal':
        if ($request->isFormPost()) {
          return $this->installDashboard($application, $viewer->getPHID());
        } else {
          return $this->newPersonalConfirmDialog();
        }
    }

    $global_item = $this->newGlobalMenuItem()
      ->setDisabled(!$can_global);

    $menu = $this->newMenuFromItemMap(
      array(
        'personal' => $this->newPersonalMenuItem(),
        'global' => $global_item,
      ));

    return $this->newApplicationModeDialog()
      ->appendChild($menu);
  }

  abstract protected function newGlobalPermissionDialog();
  abstract protected function newGlobalConfirmDialog();
  abstract protected function newPersonalConfirmDialog();

  abstract protected function newPersonalMenuItem();
  abstract protected function newGlobalMenuItem();
  abstract protected function newApplicationModeDialog();

}
 ?>

Did this file decode correctly?

Original Code

<?php

abstract class PhabricatorDashboardApplicationInstallWorkflow
  extends PhabricatorDashboardInstallWorkflow {

  abstract protected function newApplication();

  protected function canInstallToGlobalMenu() {
    return PhabricatorPolicyFilter::hasCapability(
      $this->getViewer(),
      $this->newApplication(),
      PhabricatorPolicyCapability::CAN_EDIT);
  }

  public function handleRequest(AphrontRequest $request) {
    $viewer = $this->getViewer();
    $application = $this->newApplication();
    $can_global = $this->canInstallToGlobalMenu();

    switch ($this->getMode()) {
      case 'global':
        if (!$can_global) {
          return $this->newGlobalPermissionDialog();
        } else if ($request->isFormPost()) {
          return $this->installDashboard($application, null);
        } else {
          return $this->newGlobalConfirmDialog();
        }
      case 'personal':
        if ($request->isFormPost()) {
          return $this->installDashboard($application, $viewer->getPHID());
        } else {
          return $this->newPersonalConfirmDialog();
        }
    }

    $global_item = $this->newGlobalMenuItem()
      ->setDisabled(!$can_global);

    $menu = $this->newMenuFromItemMap(
      array(
        'personal' => $this->newPersonalMenuItem(),
        'global' => $global_item,
      ));

    return $this->newApplicationModeDialog()
      ->appendChild($menu);
  }

  abstract protected function newGlobalPermissionDialog();
  abstract protected function newGlobalConfirmDialog();
  abstract protected function newPersonalConfirmDialog();

  abstract protected function newPersonalMenuItem();
  abstract protected function newGlobalMenuItem();
  abstract protected function newApplicationModeDialog();

}

Function Calls

None

Variables

None

Stats

MD5 0d9d02c6968cf518ed8aa6464b2bd04d
Eval Count 0
Decode Time 108 ms