Changeset View
Changeset View
Standalone View
Standalone View
src/app/Domain.php
Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | public function setStatusAttribute($status) | ||||
$new_status = $status; | $new_status = $status; | ||||
if ($this->isPublic()) { | if ($this->isPublic()) { | ||||
$this->attributes['status'] = $new_status; | $this->attributes['status'] = $new_status; | ||||
return; | return; | ||||
} | } | ||||
if ($new_status & self::STATUS_CONFIRMED) { | |||||
// if we have confirmed ownership of or management access to the domain, then we have | // if we have confirmed ownership of or management access to the domain, then we have | ||||
// also confirmed the domain exists in DNS. | // also confirmed the domain exists in DNS. | ||||
$new_status |= self::STATUS_VERIFIED; | if ($new_status & self::STATUS_CONFIRMED) { | ||||
$new_status |= self::STATUS_ACTIVE; | $new_status |= self::STATUS_VERIFIED | self::STATUS_ACTIVE; | ||||
} | |||||
if ($new_status & self::STATUS_DELETED && $new_status & self::STATUS_ACTIVE) { | |||||
$new_status ^= self::STATUS_ACTIVE; | |||||
} | } | ||||
if ($new_status & self::STATUS_SUSPENDED && $new_status & self::STATUS_ACTIVE) { | // it can't be deleted-or-suspended and active | ||||
$new_status ^= self::STATUS_ACTIVE; | if ($new_status & self::STATUS_DELETED || $new_status & self::STATUS_SUSPENDED) { | ||||
$new_status &= ~self::STATUS_ACTIVE; | |||||
} | } | ||||
// if the domain is now active, it is not new anymore. | // if the domain is now active, it is not new anymore. | ||||
if ($new_status & self::STATUS_ACTIVE && $new_status & self::STATUS_NEW) { | if ($new_status & self::STATUS_ACTIVE) { | ||||
$new_status ^= self::STATUS_NEW; | $new_status &= ~self::STATUS_NEW; | ||||
} | } | ||||
$this->attributes['status'] = $new_status; | $this->attributes['status'] = $new_status; | ||||
} | } | ||||
/** | /** | ||||
* Ownership verification by checking for a TXT (or CNAME) record | * Ownership verification by checking for a TXT (or CNAME) record | ||||
* in the domain's DNS (that matches the verification hash). | * in the domain's DNS (that matches the verification hash). | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |