Subversion Repositories oidplus

Rev

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

Rev 101 Rev 104
Line 29... Line 29...
29
        public function action(&$handled) {
29
        public function action(&$handled) {
30
                // Nothing
30
                // Nothing
31
        }
31
        }
32
 
32
 
33
        public function init($html=true) {
33
        public function init($html=true) {
-
 
34
                OIDplus::config()->prepareConfigKey('whois_auth_token', 'OID-over-WHOIS authentication token to display confidential data', '', 0, 1);
34
        }
35
        }
35
 
36
 
36
        public function cfgSetValue($name, $value) {
37
        public function cfgSetValue($name, $value) {
-
 
38
                if ($name == 'whois_auth_token') {
-
 
39
                        $test_value = preg_replace('@[0-9a-zA-Z]*@', '', $value);
-
 
40
                        if ($test_value != '') {
-
 
41
                                throw new Exception("Only characters and numbers are allowed as authentication token.");
-
 
42
                        }
-
 
43
                }
37
        }
44
        }
38
 
45
 
39
        public function gui($id, &$out, &$handled) {
46
        public function gui($id, &$out, &$handled) {
40
                if (explode('$',$id)[0] == 'oidplus:whois') {
47
                if (explode('$',$id)[0] == 'oidplus:whois') {
41
                        $handled = true;
48
                        $handled = true;
Line 43... Line 50...
43
                        $out['title'] = 'Web WHOIS';
50
                        $out['title'] = 'Web WHOIS';
44
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? 'plugins/publicPages/'.basename(__DIR__).'/icon_big.png' : '';
51
                        $out['icon'] = file_exists(__DIR__.'/icon_big.png') ? 'plugins/publicPages/'.basename(__DIR__).'/icon_big.png' : '';
45
 
52
 
46
                        $out['text'] = '';
53
                        $out['text']  = '';
47
                        $out['text'] .= '<p>With the web based whois service, you can query object information in a machine readable format.</p>';
54
                        $out['text'] .= '<p>With the web based whois service, you can query object information in a machine readable format.</p>';
-
 
55
                        $out['text'] .= '<p>RFC draft: <a href="plugins/publicPages/'.basename(__DIR__).'/whois/rfc/draft-viathinksoft-oidwhois-00.txt">TXT</a> | <a href="plugins/publicPages/'.basename(__DIR__).'/whois/rfc/draft-viathinksoft-oidwhois-00.nroff">NROFF</a></p>';
48
                        $out['text'] .= '<form action="plugins/publicPages/'.basename(__DIR__).'/whois/webwhois.php" method="GET">';
56
                        $out['text'] .= '<form action="plugins/publicPages/'.basename(__DIR__).'/whois/webwhois.php" method="GET">';
49
                        $out['text'] .= '       <input type="text" name="query" value="oid:2.999">';
57
                        $out['text'] .= '       <input type="text" name="query" value="oid:2.999">';
50
                        $out['text'] .= '       <input type="submit">';
58
                        $out['text'] .= '       <input type="submit" value="Query">';
51
                        $out['text'] .= '</form>';
59
                        $out['text'] .= '</form>';
52
                }
60
                }
53
        }
61
        }
54
 
62
 
55
        public function tree(&$json, $ra_email=null) {
63
        public function tree(&$json, $ra_email=null, $nonjs=false) {
56
                if (file_exists(__DIR__.'/treeicon.png')) {
64
                if (file_exists(__DIR__.'/treeicon.png')) {
57
                        $tree_icon = 'plugins/publicPages/'.basename(__DIR__).'/treeicon.png';
65
                        $tree_icon = 'plugins/publicPages/'.basename(__DIR__).'/treeicon.png';
58
                } else {
66
                } else {
59
                        $tree_icon = null; // default icon (folder)
67
                        $tree_icon = null; // default icon (folder)
60
                }
68
                }
Line 62... Line 70...
62
                $json[] = array(
70
                $json[] = array(
63
                        'id' => 'oidplus:whois',
71
                        'id' => 'oidplus:whois',
64
                        'icon' => $tree_icon,
72
                        'icon' => $tree_icon,
65
                        'text' => 'Web WHOIS'
73
                        'text' => 'Web WHOIS'
66
                );
74
                );
-
 
75
 
-
 
76
                return true;
67
        }
77
        }
68
 
78
 
69
        public function modifyContent($id, &$title, &$icon, &$text) {
79
        public function modifyContent($id, &$title, &$icon, &$text) {
70
                $text .= '<br><img src="plugins/publicPages/'.basename(__DIR__).'/page_pictogram.png" height="15" alt=""> <a href="plugins/publicPages/'.basename(__DIR__).'/whois/webwhois.php?query='.urlencode($id).'" class="gray_footer_font">Whois</a>';
80
                $text .= '<br><img src="plugins/publicPages/'.basename(__DIR__).'/page_pictogram.png" height="15" alt=""> <a href="plugins/publicPages/'.basename(__DIR__).'/whois/webwhois.php?query='.urlencode($id).'" class="gray_footer_font">Whois</a>';
71
        }
81
        }