1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | |
7: | |
8: | namespace Aurora\Modules\CoreExtender; |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | class Module extends \Aurora\System\Module\AbstractModule |
22: | { |
23: | public function init() |
24: | { |
25: | $this->subscribeEvent('Core::SetAuthDataAndGetAuthToken::after', array($this, 'onAfterAuthenticate'), 10); |
26: | } |
27: | |
28: | |
29: | |
30: | |
31: | public static function getInstance() |
32: | { |
33: | return parent::getInstance(); |
34: | } |
35: | |
36: | |
37: | |
38: | |
39: | public static function Decorator() |
40: | { |
41: | return parent::Decorator(); |
42: | } |
43: | |
44: | |
45: | |
46: | |
47: | public function getModuleSettings() |
48: | { |
49: | return $this->oModuleSettings; |
50: | } |
51: | |
52: | public function onAfterAuthenticate(&$aArgs, &$mResult) |
53: | { |
54: | if ($mResult && is_array($mResult) && isset($mResult[\Aurora\System\Application::AUTH_TOKEN_KEY])) { |
55: | $sXClientHeader = (string) \MailSo\Base\Http::SingletonInstance()->GetHeader('X-Client'); |
56: | |
57: | if (strtolower($sXClientHeader) !== 'webclient') { |
58: | $mResult['AllowAccess'] = 1; |
59: | } |
60: | } |
61: | } |
62: | } |
63: | |