Subversion Repositories oidplus

Rev

Rev 1267 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1267 Rev 1293
Line 24... Line 24...
24
// phpcs:enable PSR1.Files.SideEffects
24
// phpcs:enable PSR1.Files.SideEffects
25
 
25
 
26
class OIDplusPageAdminSystemConfig extends OIDplusPagePluginAdmin {
26
class OIDplusPageAdminSystemConfig extends OIDplusPagePluginAdmin {
27
 
27
 
28
        /**
28
        /**
29
         * @param string $actionID
-
 
30
         * @param array $params
29
         * @param array $params
31
         * @return array
30
         * @return array
32
         * @throws OIDplusException
31
         * @throws OIDplusException
33
         */
32
         */
34
        public function action(string $actionID, array $params): array {
33
        private function action_Update(array $params): array {
35
                if ($actionID == 'config_update') {
-
 
36
                        if (!OIDplus::authUtils()->isAdminLoggedIn()) {
34
                if (!OIDplus::authUtils()->isAdminLoggedIn()) {
37
                                throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), null, 401);
35
                        throw new OIDplusHtmlException(_L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login$admin')), null, 401);
38
                        }
36
                }
39
 
37
 
40
                        _CheckParamExists($params, 'name');
38
                _CheckParamExists($params, 'name');
Line 57... Line 55...
57
                        if ($old_value != $value) {
55
                if ($old_value != $value) {
58
                                OIDplus::logger()->log("V2:[OK/INFO]A", "Changed system config setting '%1' from '%2' to '%3'", $name, $old_value, $value);
56
                        OIDplus::logger()->log("V2:[OK/INFO]A", "Changed system config setting '%1' from '%2' to '%3'", $name, $old_value, $value);
59
                        }
57
                }
60
 
58
 
61
                        return array("status" => 0);
59
                return array("status" => 0);
-
 
60
        }
-
 
61
 
-
 
62
        /**
-
 
63
         * @param string $actionID
-
 
64
         * @param array $params
-
 
65
         * @return array
-
 
66
         * @throws OIDplusException
-
 
67
         */
-
 
68
        public function action(string $actionID, array $params): array {
-
 
69
                if ($actionID == 'config_update') {
-
 
70
                        return $this->action_Update($params);
62
                } else {
71
                } else {
63
                        return parent::action($actionID, $params);
72
                        return parent::action($actionID, $params);
64
                }
73
                }
65
        }
74
        }
66
 
75