Subversion Repositories oidplus

Rev

Rev 1264 | Rev 1293 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1264 Rev 1266
Line 35... Line 35...
35
         * @throws OIDplusException
35
         * @throws OIDplusException
36
         */
36
         */
37
        public function action(string $actionID, array $params): array {
37
        public function action(string $actionID, array $params): array {
38
                if ($actionID == 'blacklistJWT') {
38
                if ($actionID == 'blacklistJWT') {
39
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
39
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
40
                                throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')));
40
                                throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), null, 401);
41
                        }
41
                        }
42
 
42
 
43
                        if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_AJAX_ADMIN', true)) {
43
                        if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_AJAX_ADMIN', true)) {
44
                                throw new OIDplusException(_L('The administrator has disabled this feature. (Base configuration setting %1).','JWT_ALLOW_AJAX_ADMIN'));
44
                                throw new OIDplusException(_L('The administrator has disabled this feature. (Base configuration setting %1).','JWT_ALLOW_AJAX_ADMIN'));
45
                        }
45
                        }
Line 67... Line 67...
67
                        $handled = true;
67
                        $handled = true;
68
                        $out['title'] = _L('Automated AJAX calls');
68
                        $out['title'] = _L('Automated AJAX calls');
69
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
69
                        $out['icon'] = file_exists(__DIR__.'/img/main_icon.png') ? OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE).'img/main_icon.png' : '';
70
 
70
 
71
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
71
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
72
                                throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), $out['title']);
72
                                throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), $out['title'], 401);
73
                        }
73
                        }
74
 
74
 
75
                        if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_AJAX_ADMIN', true)) {
75
                        if (!OIDplus::baseConfig()->getValue('JWT_ALLOW_AJAX_ADMIN', true)) {
76
                                throw new OIDplusException(_L('The administrator has disabled this feature. (Base configuration setting %1).','JWT_ALLOW_AJAX_ADMIN'), $out['title']);
76
                                throw new OIDplusException(_L('The administrator has disabled this feature. (Base configuration setting %1).','JWT_ALLOW_AJAX_ADMIN'), $out['title']);
77
                        }
77
                        }