Prevent actions on hosting services with bad order status (#1521)

This commit is contained in:
Belle Aerni authored and GitHub committed 2023-08-08 00:39:15 -07:00
1 parent 409fe5a5f9
commit 6ecb90628f
1 file changed
+10 -2
+10 -2
View File
@@ -379,9 +379,17 @@ class Service implements InjectionAwareInterface
return null;
}
private function _performOnService(\Model_ClientOrder $order)
private function _performOnService(\Model_ClientOrder $order): bool
{
return $order->status != \Model_ClientOrder::STATUS_FAILED_SETUP;
// If the order matches any of the following status, we should prevent actions such as PW resets or username changes from being performed
$badStatus = [
\Model_ClientOrder::STATUS_FAILED_SETUP,
\Model_ClientOrder::STATUS_PENDING_SETUP,
\Model_ClientOrder::STATUS_SUSPENDED,
\Model_ClientOrder::STATUS_CANCELED,
];
return !in_array($order->status, $badStatus);
}
private function _getServerMangerForOrder($model)