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 PhabricatorPeopleManagementEnableWorkflow extends PhabricatorPeopleMa..
Decoded Output download
<?php
final class PhabricatorPeopleManagementEnableWorkflow
extends PhabricatorPeopleManagementWorkflow {
protected function didConstruct() {
$arguments = array_merge(
$this->getUserSelectionArguments(),
array());
$this
->setName('enable')
->setExamples('**enable** --user __username__')
->setSynopsis(pht('Enable a disabled user account.'))
->setArguments($arguments);
}
public function execute(PhutilArgumentParser $args) {
$user = $this->selectUser($args);
$display_name = $user->getUsername();
if (!$user->getIsDisabled()) {
throw new PhutilArgumentUsageException(
pht(
'User account "%s" is not disabled. You can only enable accounts '.
'that are disabled.',
$display_name));
}
$xactions = array();
$xactions[] = $user->getApplicationTransactionTemplate()
->setTransactionType(PhabricatorUserDisableTransaction::TRANSACTIONTYPE)
->setNewValue(false);
$this->applyTransactions($user, $xactions);
$this->logOkay(
pht('DONE'),
pht('Enabled user account "%s".', $display_name));
return 0;
}
}
?>
Did this file decode correctly?
Original Code
<?php
final class PhabricatorPeopleManagementEnableWorkflow
extends PhabricatorPeopleManagementWorkflow {
protected function didConstruct() {
$arguments = array_merge(
$this->getUserSelectionArguments(),
array());
$this
->setName('enable')
->setExamples('**enable** --user __username__')
->setSynopsis(pht('Enable a disabled user account.'))
->setArguments($arguments);
}
public function execute(PhutilArgumentParser $args) {
$user = $this->selectUser($args);
$display_name = $user->getUsername();
if (!$user->getIsDisabled()) {
throw new PhutilArgumentUsageException(
pht(
'User account "%s" is not disabled. You can only enable accounts '.
'that are disabled.',
$display_name));
}
$xactions = array();
$xactions[] = $user->getApplicationTransactionTemplate()
->setTransactionType(PhabricatorUserDisableTransaction::TRANSACTIONTYPE)
->setNewValue(false);
$this->applyTransactions($user, $xactions);
$this->logOkay(
pht('DONE'),
pht('Enabled user account "%s".', $display_name));
return 0;
}
}
Function Calls
None |
Stats
MD5 | 23dd71f9618ee1bf1f809118f01f2f8b |
Eval Count | 0 |
Decode Time | 83 ms |