Subversion Repositories oidplus

Rev

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

Rev 1086 Rev 1116
Line 23... Line 23...
23
\defined('INSIDE_OIDPLUS') or die;
23
\defined('INSIDE_OIDPLUS') or die;
24
// phpcs:enable PSR1.Files.SideEffects
24
// phpcs:enable PSR1.Files.SideEffects
25
 
25
 
26
class OIDplusPagePublicRaInfo extends OIDplusPagePluginPublic {
26
class OIDplusPagePublicRaInfo extends OIDplusPagePluginPublic {
27
 
27
 
-
 
28
        /**
-
 
29
         * @param bool $html
-
 
30
         * @return void
-
 
31
         */
28
        public function init($html=true) {
32
        public function init(bool $html=true) {
29
        }
33
        }
30
 
34
 
-
 
35
        /**
-
 
36
         * @param string $id
-
 
37
         * @param array $out
-
 
38
         * @param bool $handled
-
 
39
         * @return void
-
 
40
         * @throws OIDplusConfigInitializationException
-
 
41
         * @throws OIDplusException
-
 
42
         */
31
        public function gui($id, &$out, &$handled) {
43
        public function gui(string $id, array &$out, bool &$handled) {
32
                if (explode('$',$id)[0] == 'oidplus:rainfo') {
44
                if (explode('$',$id)[0] == 'oidplus:rainfo') {
33
                        $handled = true;
45
                        $handled = true;
34
 
46
 
35
                        $antispam_email = explode('$',$id.'$')[1];
47
                        $antispam_email = explode('$',$id.'$')[1];
36
                        $ra_email = str_replace('&', '@', $antispam_email);
48
                        $ra_email = str_replace('&', '@', $antispam_email);
Line 127... Line 139...
127
                                }
139
                                }
128
                        }
140
                        }
129
                }
141
                }
130
        }
142
        }
131
 
143
 
-
 
144
        /**
-
 
145
         * @param array $out
-
 
146
         * @return void
-
 
147
         * @throws OIDplusConfigInitializationException
-
 
148
         * @throws OIDplusException
-
 
149
         */
132
        public function publicSitemap(&$out) {
150
        public function publicSitemap(array &$out) {
133
                if (OIDplus::db()->getSlang()->id() == 'mysql') {
151
                if (OIDplus::db()->getSlang()->id() == 'mysql') {
134
                        $res = OIDplus::db()->query("select distinct BINARY(email) as email from ###ra"); // "binary" because we want to ensure that 'distinct' is case sensitive
152
                        $res = OIDplus::db()->query("select distinct BINARY(email) as email from ###ra"); // "binary" because we want to ensure that 'distinct' is case sensitive
135
                } else {
153
                } else {
136
                        $res = OIDplus::db()->query("select distinct email as email from ###ra"); // distinct in PGSQL is always case sensitive
154
                        $res = OIDplus::db()->query("select distinct email as email from ###ra"); // distinct in PGSQL is always case sensitive
137
                }
155
                }
138
                while ($row = $res->fetch_array()) {
156
                while ($row = $res->fetch_array()) {
139
                        $out[] = 'oidplus:rainfo$'.$row['email'];
157
                        $out[] = 'oidplus:rainfo$'.$row['email'];
140
                }
158
                }
141
        }
159
        }
142
 
160
 
-
 
161
        /**
-
 
162
         * @param array $json
-
 
163
         * @param string|null $ra_email
-
 
164
         * @param bool $nonjs
-
 
165
         * @param string $req_goto
-
 
166
         * @return bool
-
 
167
         */
143
        public function tree(&$json, $ra_email=null, $nonjs=false, $req_goto='') {
168
        public function tree(array &$json, string $ra_email=null, bool $nonjs=false, string $req_goto=''): bool {
144
                return false;
169
                return false;
145
        }
170
        }
146
 
171
 
-
 
172
        /**
-
 
173
         * @param $email
-
 
174
         * @return array|string|string[]|null
-
 
175
         * @throws OIDplusException
-
 
176
         */
147
        public static function showRAInfo($email) {
177
        public static function showRAInfo($email) {
148
                $out = '';
178
                $out = '';
149
 
179
 
150
                if (empty($email)) {
180
                if (empty($email)) {
151
                        return '<p>'._L('The superior RA did not define a RA for this OID.').'</p>';
181
                        return '<p>'._L('The superior RA did not define a RA for this OID.').'</p>';
Line 186... Line 216...
186
                }
216
                }
187
 
217
 
188
                return trim_br($out);
218
                return trim_br($out);
189
        }
219
        }
190
 
220
 
-
 
221
        /**
-
 
222
         * @param string $request
-
 
223
         * @return array|false
-
 
224
         */
191
        public function tree_search($request) {
225
        public function tree_search(string $request) {
192
                return false;
226
                return false;
193
        }
227
        }
194
}
228
}