1: | <?php |
2: | |
3: | |
4: | |
5: | |
6: | |
7: | |
8: | namespace Aurora\Modules\CoreExtender; |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | class Module extends \Aurora\System\Module\AbstractModule |
20: | { |
21: | public function init() |
22: | { |
23: | $this->subscribeEvent('Core::SetAuthDataAndGetAuthToken::after', array($this, 'onAfterAuthenticate'), 10); |
24: | } |
25: | |
26: | public function onAfterAuthenticate(&$aArgs, &$mResult) |
27: | { |
28: | if ($mResult && is_array($mResult) && isset($mResult['AuthToken'])) { |
29: | $sXClientHeader = (string) \MailSo\Base\Http::SingletonInstance()->GetHeader('X-Client'); |
30: | |
31: | if (strtolower($sXClientHeader) !== 'webclient') { |
32: | $mResult['AllowAccess'] = 1; |
33: | } |
34: | } |
35: | } |
36: | } |
37: | |