1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | |
7: | namespace Aurora\Modules\MailMultiAccountsPlugin; |
8: | |
9: | use Aurora\Modules\Mail\Module as MailModule; |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | class Module extends \Aurora\System\Module\AbstractLicensedModule |
20: | { |
21: | public function init() |
22: | { |
23: | $this->subscribeEvent('Mail::CreateAccount::before', array($this, 'onBeforeCreateAccount')); |
24: | $this->subscribeEvent('Mail::CreateAccount::after', array($this, 'onAfterCreateAccount')); |
25: | |
26: | $this->subscribeEvent('Mail::GetSettings::after', array($this, 'onAfterGetSettings')); |
27: | } |
28: | |
29: | |
30: | |
31: | |
32: | public static function getInstance() |
33: | { |
34: | return parent::getInstance(); |
35: | } |
36: | |
37: | |
38: | |
39: | |
40: | public static function Decorator() |
41: | { |
42: | return parent::Decorator(); |
43: | } |
44: | |
45: | |
46: | |
47: | |
48: | public function getModuleSettings() |
49: | { |
50: | return $this->oModuleSettings; |
51: | } |
52: | |
53: | public function onBeforeCreateAccount($aArguments, &$mResult) |
54: | { |
55: | MailModule::getInstance()->setAccountsManager(new Manager($this)); |
56: | |
57: | return false; |
58: | } |
59: | |
60: | public function onAfterCreateAccount($aArguments, &$mResult) |
61: | { |
62: | MailModule::getInstance()->setAccountsManager(new Manager($this)); |
63: | |
64: | return false; |
65: | } |
66: | |
67: | |
68: | |
69: | |
70: | |
71: | |
72: | public function onAfterGetSettings($aArguments, &$mResult) |
73: | { |
74: | $mResult['AllowMultiAccounts'] = true; |
75: | |
76: | return false; |
77: | } |
78: | } |
79: | |