1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | |
7: | namespace Aurora\Modules\MailMultiAccountsPlugin; |
8: | |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | class Module extends \Aurora\System\Module\AbstractLicensedModule |
16: | { |
17: | public function init() |
18: | { |
19: | $this->subscribeEvent('Mail::CreateAccount::before', array($this, 'onBeforeCreateAccount')); |
20: | $this->subscribeEvent('Mail::CreateAccount::after', array($this, 'onAfterCreateAccount')); |
21: | |
22: | $this->subscribeEvent('Mail::GetSettings::after', array($this, 'onAfterGetSettings')); |
23: | } |
24: | |
25: | public function onBeforeCreateAccount($aArguments, &$mResult) |
26: | { |
27: | \Aurora\System\Api::GetModule('Mail')->setAccountsManager(new Manager($this)); |
28: | |
29: | return false; |
30: | } |
31: | |
32: | public function onAfterCreateAccount($aArguments, &$mResult) |
33: | { |
34: | \Aurora\System\Api::GetModule('Mail')->setAccountsManager(new Manager($this)); |
35: | |
36: | return false; |
37: | } |
38: | |
39: | |
40: | |
41: | |
42: | |
43: | |
44: | public function onAfterGetSettings($aArguments, &$mResult) |
45: | { |
46: | $mResult['AllowMultiAccounts'] = true; |
47: | |
48: | return false; |
49: | } |
50: | } |
51: | |