mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 12:39:20 +03:00
Privacy/GDPR friendly version (removed: Social, Gravatar, Facebook, Google, Twitter, DropBox, OwnCloud)
Also removed: POP3, OAuth2 and update feature Added: admin password_hash/password_verify Requires: PHP 7.3+ Replaced: CRLF with LF Replaced: pclZip with ZipArchive
This commit is contained in:
parent
15ceddc202
commit
2cada68f41
293 changed files with 23728 additions and 85420 deletions
|
|
@ -40,12 +40,9 @@ class Identity
|
|||
private $bSignatureInsertBefore;
|
||||
|
||||
/**
|
||||
* @param string $sId = ''
|
||||
* @param string $sEmail = ''
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function __construct($sId = '', $sEmail = '')
|
||||
protected function __construct(string $sId = '', string $sEmail = '')
|
||||
{
|
||||
$this->sId = empty($sId) ? '' : $sId;
|
||||
$this->sEmail = empty($sEmail) ? '' : $sEmail;
|
||||
|
|
@ -56,101 +53,59 @@ class Identity
|
|||
$this->bSignatureInsertBefore = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \RainLoop\Model\Identity
|
||||
*/
|
||||
public static function NewInstance()
|
||||
public static function NewInstance() : self
|
||||
{
|
||||
return new self();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \RainLoop\Model\Account $oAccount
|
||||
*
|
||||
* @return \RainLoop\Model\Identity
|
||||
*/
|
||||
public static function NewInstanceFromAccount(\RainLoop\Model\Account $oAccount)
|
||||
public static function NewInstanceFromAccount(\RainLoop\Model\Account $oAccount) : self
|
||||
{
|
||||
return new self('', $oAccount->Email());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bFillOnEmpty = false
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function Id($bFillOnEmpty = false)
|
||||
public function Id(bool $bFillOnEmpty = false) : string
|
||||
{
|
||||
return $bFillOnEmpty ? ('' === $this->sId ? '---' : $this->sId) : $this->sId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Email()
|
||||
public function Email() : string
|
||||
{
|
||||
return $this->sEmail;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sEmail
|
||||
*
|
||||
* @return \RainLoop\Model\Identity
|
||||
*/
|
||||
public function SetEmail($sEmail)
|
||||
public function SetEmail(string $sEmail) : self
|
||||
{
|
||||
$this->sEmail = $sEmail;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Name()
|
||||
public function Name() : string
|
||||
{
|
||||
return $this->sName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function ReplyTo()
|
||||
public function ReplyTo() : string
|
||||
{
|
||||
return $this->sReplyTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Bcc()
|
||||
public function Bcc() : string
|
||||
{
|
||||
return $this->sBcc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function Signature()
|
||||
public function Signature() : string
|
||||
{
|
||||
return $this->sSignature;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function SignatureInsertBefore()
|
||||
public function SignatureInsertBefore() : bool
|
||||
{
|
||||
return $this->bSignatureInsertBefore;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $aData
|
||||
* @param bool $bAjax = false
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function FromJSON($aData, $bAjax = false)
|
||||
public function FromJSON(array $aData, bool $bAjax = false) : bool
|
||||
{
|
||||
if (!empty($aData['Email']))
|
||||
{
|
||||
|
|
@ -169,12 +124,7 @@ class Identity
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bAjax = false
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function ToSimpleJSON($bAjax = false)
|
||||
public function ToSimpleJSON(bool $bAjax = false) : array
|
||||
{
|
||||
return array(
|
||||
'Id' => $this->Id(),
|
||||
|
|
@ -187,18 +137,12 @@ class Identity
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function Validate()
|
||||
public function Validate() : bool
|
||||
{
|
||||
return !empty($this->sEmail);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function IsAccountIdentities()
|
||||
public function IsAccountIdentities() : bool
|
||||
{
|
||||
return '' === $this->Id();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue