Changeset View
Changeset View
Standalone View
Standalone View
src/app/User.php
Show All 37 Lines | class User extends Authenticatable implements JWTSubject | ||||
// user has been suspended | // user has been suspended | ||||
public const STATUS_SUSPENDED = 1 << 2; | public const STATUS_SUSPENDED = 1 << 2; | ||||
// user has been deleted | // user has been deleted | ||||
public const STATUS_DELETED = 1 << 3; | public const STATUS_DELETED = 1 << 3; | ||||
// user has been created in LDAP | // user has been created in LDAP | ||||
public const STATUS_LDAP_READY = 1 << 4; | public const STATUS_LDAP_READY = 1 << 4; | ||||
// user mailbox has been created in IMAP | // user mailbox has been created in IMAP | ||||
public const STATUS_IMAP_READY = 1 << 5; | public const STATUS_IMAP_READY = 1 << 5; | ||||
// user signup has not been approved yet | |||||
public const STATUS_DRAFT = 1 << 7; | |||||
// change the default primary key type | // change the default primary key type | ||||
public $incrementing = false; | public $incrementing = false; | ||||
protected $keyType = 'bigint'; | protected $keyType = 'bigint'; | ||||
/** | /** | ||||
* The attributes that are mass assignable. | * The attributes that are mass assignable. | ||||
▲ Show 20 Lines • Show All 411 Lines • ▼ Show 20 Lines | class User extends Authenticatable implements JWTSubject | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isDeleted(): bool | public function isDeleted(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_DELETED) > 0; | return ($this->status & self::STATUS_DELETED) > 0; | ||||
} | } | ||||
/** | /** | ||||
* Returns whether this user is a draft (not approved yet). | |||||
* | |||||
* @return bool | |||||
*/ | |||||
public function isDraft(): bool | |||||
{ | |||||
return ($this->status & self::STATUS_DRAFT) > 0; | |||||
} | |||||
/** | |||||
* Returns whether this (external) domain has been verified | * Returns whether this (external) domain has been verified | ||||
* to exist in DNS. | * to exist in DNS. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function isImapReady(): bool | public function isImapReady(): bool | ||||
{ | { | ||||
return ($this->status & self::STATUS_IMAP_READY) > 0; | return ($this->status & self::STATUS_IMAP_READY) > 0; | ||||
▲ Show 20 Lines • Show All 254 Lines • Show Last 20 Lines |