Subversion Repositories oidplus

Rev

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

Rev 1086 Rev 1116
Line 24... Line 24...
24
\defined('INSIDE_OIDPLUS') or die;
24
\defined('INSIDE_OIDPLUS') or die;
25
// phpcs:enable PSR1.Files.SideEffects
25
// phpcs:enable PSR1.Files.SideEffects
26
 
26
 
27
class OIDplusPagePublicRaBaseUtils extends OIDplusPagePluginPublic {
27
class OIDplusPagePublicRaBaseUtils extends OIDplusPagePluginPublic {
28
 
28
 
-
 
29
        /**
-
 
30
         * @param string $actionID
-
 
31
         * @param array $params
-
 
32
         * @return int[]
-
 
33
         * @throws OIDplusException
-
 
34
         */
29
        public function action($actionID, $params) {
35
        public function action(string $actionID, array $params): array {
30
 
36
 
31
                // Action:     delete_ra
37
                // Action:     delete_ra
32
                // Method:     POST
38
                // Method:     POST
33
                // Parameters: email
39
                // Parameters: email
34
                // Outputs:    Text
40
                // Outputs:    Text
Line 54... Line 60...
54
 
60
 
55
                        OIDplus::logger()->log("[?WARN/!OK]RA($email)!/[?INFO/!OK]A?", "RA '$email' deleted");
61
                        OIDplus::logger()->log("[?WARN/!OK]RA($email)!/[?INFO/!OK]A?", "RA '$email' deleted");
56
 
62
 
57
                        return array("status" => 0);
63
                        return array("status" => 0);
58
                } else {
64
                } else {
59
                        throw new OIDplusException(_L('Unknown action ID'));
65
                        return parent::action($actionID, $params);
60
                }
66
                }
61
 
67
 
62
        }
68
        }
63
 
69
 
-
 
70
        /**
-
 
71
         * @param bool $html
-
 
72
         * @return void
-
 
73
         * @throws OIDplusException
-
 
74
         */
64
        public function init($html=true) {
75
        public function init(bool $html=true) {
65
                // Will be used by: plugins admin-130, public-091, public-200, ra-092, ra-101
76
                // Will be used by: plugins admin-130, public-091, public-200, ra-092, ra-101
66
                OIDplus::config()->prepareConfigKey('ra_min_password_length', 'Minimum length for RA passwords', '6', OIDplusConfig::PROTECTION_EDITABLE, function($value) {
77
                OIDplus::config()->prepareConfigKey('ra_min_password_length', 'Minimum length for RA passwords', '6', OIDplusConfig::PROTECTION_EDITABLE, function($value) {
67
                        if (!is_numeric($value) || ($value < 1)) {
78
                        if (!is_numeric($value) || ($value < 1)) {
68
                                throw new OIDplusException(_L('Please enter a valid password length.'));
79
                                throw new OIDplusException(_L('Please enter a valid password length.'));
69
                        }
80
                        }
70
                });
81
                });
71
        }
82
        }
72
 
83
 
-
 
84
        /**
-
 
85
         * @param string $id
-
 
86
         * @param array $out
-
 
87
         * @param bool $handled
-
 
88
         * @return void
-
 
89
         */
73
        public function gui($id, &$out, &$handled) {
90
        public function gui(string $id, array &$out, bool &$handled) {
74
        }
91
        }
75
 
92
 
-
 
93
        /**
-
 
94
         * @param array $out
-
 
95
         * @return void
-
 
96
         */
76
        public function publicSitemap(&$out) {
97
        public function publicSitemap(array &$out) {
77
        }
98
        }
78
 
99
 
-
 
100
        /**
-
 
101
         * @param array $json
-
 
102
         * @param string|null $ra_email
-
 
103
         * @param bool $nonjs
-
 
104
         * @param string $req_goto
-
 
105
         * @return bool
-
 
106
         */
79
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
107
        public function tree(array &$json, string $ra_email=null, bool $nonjs=false, string $req_goto=''): bool {
-
 
108
                return false;
80
        }
109
        }
81
 
110
 
-
 
111
        /**
-
 
112
         * @param string $request
-
 
113
         * @return array|false
-
 
114
         */
82
        public function tree_search($request) {
115
        public function tree_search(string $request) {
83
                return false;
116
                return false;
84
        }
117
        }
85
}
118
}
86
119