Rev 939 | Rev 1050 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 939 | Rev 950 | ||
---|---|---|---|
Line 29... | Line 29... | ||
29 | public function modifyContent($id, &$title, &$icon, &$text) { |
29 | public function modifyContent($id, &$title, &$icon, &$text) { |
30 | $text .= '<br /> <a href="'.OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE) |
30 | $text .= '<br /> <a href="'.OIDplus::webpath(__DIR__,OIDplus::PATH_RELATIVE) |
31 | .'rdap/rdap.php?query='.urlencode($id).'" class="gray_footer_font" target="_blank">'._L('RDAP').'</a>'; |
31 | .'rdap/rdap.php?query='.urlencode($id).'" class="gray_footer_font" target="_blank">'._L('RDAP').'</a>'; |
32 | } |
32 | } |
33 | 33 | ||
- | 34 | public function handle404($request) { |
|
- | 35 | $namespaces = array(); |
|
- | 36 | foreach (OIDplus::getEnabledObjectTypes() as $ot) { |
|
- | 37 | $namespaces[] = $ot::ns(); |
|
- | 38 | } |
|
- | 39 | foreach ($namespaces as $ns) { |
|
- | 40 | // Note: This only works if OIDplus is located at the domain root (because $request is relative to the domain) |
|
- | 41 | if (!preg_match('@^/'.preg_quote($ns,'@').'/(.+)$@', $request, $m)) return false; |
|
- | 42 | $oid = $m[1]; |
|
- | 43 | $query = "$ns:$oid"; |
|
- | 44 | $x = new OIDplusRDAP(); |
|
- | 45 | list($out_content, $out_type) = $x->rdapQuery($query); |
|
- | 46 | if ($out_type) header('Content-Type:'.$out_type); |
|
- | 47 | echo $out_content; |
|
- | 48 | die(); // return true; |
|
- | 49 | } |
|
- | 50 | } |
|
- | 51 | ||
34 | } |
52 | } |