mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Changed some Plugin hooks for better handling:
* json.action-pre-call => json.before-{actionname}
* json.action-post-call => json.after-{actionname}
This commit is contained in:
parent
4397eaed86
commit
477158e54a
6 changed files with 83 additions and 92 deletions
|
|
@ -5,7 +5,7 @@ class DemoAccountPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
const
|
||||
NAME = 'Demo Account Extension',
|
||||
CATEGORY = 'Login',
|
||||
REQUIRED = '2.14.0',
|
||||
REQUIRED = '2.23',
|
||||
DESCRIPTION = 'Extension to enable a demo account';
|
||||
|
||||
/**
|
||||
|
|
@ -15,7 +15,7 @@ class DemoAccountPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
{
|
||||
$this->addHook('filter.app-data', 'FilterAppData');
|
||||
$this->addHook('filter.action-params', 'FilterActionParams');
|
||||
$this->addHook('json.action-pre-call', 'JsonActionPreCall');
|
||||
$this->addHook('json.before-accountsetup', 'BeforeAccountSetup');
|
||||
$this->addHook('filter.send-message', 'FilterSendMessage');
|
||||
$this->addHook('main.fabrica', 'MainFabrica');
|
||||
}
|
||||
|
|
@ -78,11 +78,9 @@ class DemoAccountPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
return ($oAccount && $oAccount->Email() === $this->Config()->Get('plugin', 'email'));
|
||||
}
|
||||
|
||||
public function JsonActionPreCall($sAction)
|
||||
public function BeforeAccountSetup()
|
||||
{
|
||||
if ('AccountSetup' === $sAction && $this->isDemoAccount()) {
|
||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::DemoAccountError);
|
||||
}
|
||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::DemoAccountError);
|
||||
}
|
||||
|
||||
public function FilterSendMessage($oMessage)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue