add card type : review

This commit is contained in:
Schneider Roland 2022-12-01 20:53:50 +01:00
parent 5a705f15b0
commit 0371b6e3ee

View File

@ -40,6 +40,7 @@ class ActivatedFilter extends ActionFilter
// find out if the device is activated // find out if the device is activated
$activated = $mobileDevice->status === MobileDevice::STATUS_ACTIVE; $activated = $mobileDevice->status === MobileDevice::STATUS_ACTIVE;
// override activated to true, if it is a reviewer card // override activated to true, if it is a reviewer card
if (isset($idCard)) {
$card = Card::findOne($idCard); $card = Card::findOne($idCard);
if (isset($card)) { if (isset($card)) {
if (isset($card->type)) { if (isset($card->type)) {
@ -47,6 +48,7 @@ class ActivatedFilter extends ActionFilter
} }
} }
} }
}
// if device is not activated, throw exception with http status 412 // if device is not activated, throw exception with http status 412
if ($activated === false) { if ($activated === false) {
throw new HttpException( HttpStatus::PRECONDITION_FAILED,"Device is not activated: " . $deviceId); throw new HttpException( HttpStatus::PRECONDITION_FAILED,"Device is not activated: " . $deviceId);