Page MenuHomePhorge

D1708.1775321151.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D1708.1775321151.diff

diff --git a/src/app/Domain.php b/src/app/Domain.php
--- a/src/app/Domain.php
+++ b/src/app/Domain.php
@@ -250,6 +250,31 @@
throw new \Exception("Invalid domain status: {$status}");
}
+ if ($this->isPublic()) {
+ $this->attributes['status'] = $new_status;
+ return;
+ }
+
+ if ($new_status & self::STATUS_CONFIRMED) {
+ // if we have confirmed ownership of or management access to the domain, then we have
+ // also confirmed the domain exists in DNS.
+ $new_status |= self::STATUS_VERIFIED;
+ $new_status |= 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) {
+ $new_status ^= self::STATUS_ACTIVE;
+ }
+
+ // if the domain is now active, it is not new anymore.
+ if ($new_status & self::STATUS_ACTIVE && $new_status & self::STATUS_NEW) {
+ $new_status ^= self::STATUS_NEW;
+ }
+
$this->attributes['status'] = $new_status;
}
diff --git a/src/app/Observers/DomainObserver.php b/src/app/Observers/DomainObserver.php
--- a/src/app/Observers/DomainObserver.php
+++ b/src/app/Observers/DomainObserver.php
@@ -26,7 +26,7 @@
$domain->namespace = \strtolower($domain->namespace);
- $domain->status |= Domain::STATUS_NEW | Domain::STATUS_ACTIVE;
+ $domain->status |= Domain::STATUS_NEW;
}
/**

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 4, 4:45 PM (9 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18830428
Default Alt Text
D1708.1775321151.diff (1 KB)

Event Timeline