Page MenuHomePhorge

PhabricatorPeopleManagementEnableWorkflow.php
No OneTemporary

PhabricatorPeopleManagementEnableWorkflow.php

<?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;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Jan 19, 19:48 (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128136
Default Alt Text
PhabricatorPeopleManagementEnableWorkflow.php (1 KB)

Event Timeline