mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 18:19:22 +03:00
Added: Password change plugin API improvements (#910)
This commit is contained in:
parent
b97bd4edf0
commit
cfad4bb005
11 changed files with 107 additions and 18 deletions
|
|
@ -9,17 +9,29 @@ namespace RainLoop\Exceptions;
|
|||
class ClientException extends Exception
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @var boolen
|
||||
*/
|
||||
private $bLogoutOnException;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sAdditionalMessage;
|
||||
|
||||
public function __construct($iCode, $oPrevious = null, $sAdditionalMessage = '')
|
||||
/**
|
||||
* @param int $iCode
|
||||
* @param \Exception $oPrevious = null
|
||||
* @param string $sAdditionalMessage = ''
|
||||
* @param boolean $bLogoutOnException = false
|
||||
*/
|
||||
public function __construct($iCode, $oPrevious = null, $sAdditionalMessage = '', $bLogoutOnException = false)
|
||||
{
|
||||
parent::__construct(\RainLoop\Notifications::GetNotificationsMessage($iCode, $oPrevious),
|
||||
$iCode, $oPrevious);
|
||||
|
||||
$this->sAdditionalMessage = $sAdditionalMessage;
|
||||
|
||||
$this->setLogoutOnException($bLogoutOnException);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -29,4 +41,27 @@ class ClientException extends Exception
|
|||
{
|
||||
return $this->sAdditionalMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return boolen
|
||||
*/
|
||||
public function getLogoutOnException()
|
||||
{
|
||||
return $this->bLogoutOnException;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param boolean $bLogoutOnException
|
||||
* @param string $sAdditionalLogoutMessage = ''
|
||||
*
|
||||
* @return ClientException
|
||||
*/
|
||||
public function setLogoutOnException($bLogoutOnException, $sAdditionalLogoutMessage = '')
|
||||
{
|
||||
$this->bLogoutOnException = !!$bLogoutOnException;
|
||||
|
||||
$this->sAdditionalMessage = $sAdditionalLogoutMessage;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue