Differential D20659 Diff 49281 src/applications/auth/xaction/PhabricatorAuthConfigRegistrationTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/xaction/PhabricatorAuthConfigRegistrationTransaction.php
- This file was added.
<?php | |||||
final class PhabricatorAuthConfigRegistrationTransaction | |||||
extends PhabricatorAuthConfigTransactionType { | |||||
const TRANSACTIONTYPE = 'config:registration'; | |||||
public function generateOldValue($object) { | |||||
return (int)$object->getShouldAllowRegistration(); | |||||
} | |||||
public function applyInternalEffects($object, $value) { | |||||
$object->setShouldAllowRegistration($value); | |||||
} | |||||
public function getTitle() { | |||||
if ($this->getNewValue()) { | |||||
return pht('%s enabled registration.', | |||||
$this->renderAuthor()); | |||||
} else { | |||||
return pht('%s disabled registration.', | |||||
$this->renderAuthor()); | |||||
} | |||||
} | |||||
} |