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 26... Line 26...
26
\defined('INSIDE_OIDPLUS') or die;
26
\defined('INSIDE_OIDPLUS') or die;
27
// phpcs:enable PSR1.Files.SideEffects
27
// phpcs:enable PSR1.Files.SideEffects
28
 
28
 
29
class OIDplusPagePublicRdap extends OIDplusPagePluginPublic {
29
class OIDplusPagePublicRdap extends OIDplusPagePluginPublic {
30
 
30
 
-
 
31
        /**
-
 
32
         * @param string $id
-
 
33
         * @return bool
-
 
34
         */
31
        public function implementsFeature($id) {
35
        public function implementsFeature(string $id): bool {
32
                if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.2') return true; // modifyContent
36
                if (strtolower($id) == '1.3.6.1.4.1.37476.2.5.2.3.2') return true; // modifyContent
33
                return false;
37
                return false;
34
        }
38
        }
35
 
39
 
-
 
40
        /**
-
 
41
         * Implements interface 1.3.6.1.4.1.37476.2.5.2.3.2
-
 
42
         * @param string $id
-
 
43
         * @param string $title
-
 
44
         * @param string $icon
-
 
45
         * @param string $text
-
 
46
         * @return void
-
 
47
         * @throws \ViaThinkSoft\OIDplus\OIDplusException
-
 
48
         */
36
        public function modifyContent($id, &$title, &$icon, &$text) {
49
        public function modifyContent(string $id, string &$title, string &$icon, string &$text) {
37
            $text .= '<br /> <a href="'.OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE)
50
            $text .= '<br /> <a href="'.OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE)
38
                        .'rdap/rdap.php?query='.urlencode($id).'" class="gray_footer_font" target="_blank">'._L('RDAP').'</a>';
51
                        .'rdap/rdap.php?query='.urlencode($id).'" class="gray_footer_font" target="_blank">'._L('RDAP').'</a>';
39
        }
52
        }
40
 
53
 
-
 
54
        /**
-
 
55
         * @param string $request
-
 
56
         * @return bool
-
 
57
         */
41
        public function handle404($request) {
58
        public function handle404(string $request): bool {
42
                $namespaces = array();
59
                $namespaces = array();
43
                foreach (OIDplus::getEnabledObjectTypes() as $ot) {
60
                foreach (OIDplus::getEnabledObjectTypes() as $ot) {
44
                        $namespaces[] = $ot::ns();
61
                        $namespaces[] = $ot::ns();
45
                }
62
                }
46
                foreach ($namespaces as $ns) {
63
                foreach ($namespaces as $ns) {
Line 50... Line 67...
50
                        $query = "$ns:$oid";
67
                        $query = "$ns:$oid";
51
                        $x = new OIDplusRDAP();
68
                        $x = new OIDplusRDAP();
52
                        list($out_content, $out_type) = $x->rdapQuery($query);
69
                        list($out_content, $out_type) = $x->rdapQuery($query);
53
                        if ($out_type) header('Content-Type:'.$out_type);
70
                        if ($out_type) header('Content-Type:'.$out_type);
54
                        echo $out_content;
71
                        echo $out_content;
-
 
72
                        die();
55
                        die(); // return true;
73
                        // return true;
56
                }
74
                }
-
 
75
                return false;
57
        }
76
        }
58
 
77
 
59
}
78
}