Rev 348 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 348 | Rev 360 | ||
---|---|---|---|
Line 26... | Line 26... | ||
26 | } |
26 | } |
27 | 27 | ||
28 | public function gui($id, &$out, &$handled) { |
28 | public function gui($id, &$out, &$handled) { |
29 | if ($id === 'oidplus:systeminfo') { |
29 | if ($id === 'oidplus:systeminfo') { |
30 | $handled = true; |
30 | $handled = true; |
31 | $out['title'] = 'System information'; |
31 | $out['title'] = _L('System information'); |
32 | $out['icon'] = OIDplus::webpath(__DIR__).'icon_big.png'; |
32 | $out['icon'] = OIDplus::webpath(__DIR__).'icon_big.png'; |
33 | 33 | ||
34 | if (!OIDplus::authUtils()::isAdminLoggedIn()) { |
34 | if (!OIDplus::authUtils()::isAdminLoggedIn()) { |
35 | $out['icon'] = 'img/error_big.png'; |
35 | $out['icon'] = 'img/error_big.png'; |
36 | $out['text'] = '<p>You need to <a '.OIDplus::gui()->link('oidplus:login').'>log in</a> as administrator.</p>'; |
36 | $out['text'] = '<p>'._L('You need to <a %1>log in</a> as administrator.',OIDplus::gui()->link('oidplus:login')).'</p>'; |
37 | return; |
37 | return; |
38 | } |
38 | } |
39 | 39 | ||
40 | $out['text'] = ''; |
40 | $out['text'] = ''; |
41 | 41 | ||
42 | # --- |
42 | # --- |
43 | 43 | ||
44 | $out['text'] .= '<h2>OIDplus</h2>'; |
44 | $out['text'] .= '<h2>'._L('OIDplus').'</h2>'; |
45 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
45 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
46 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
46 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
47 | $out['text'] .= ' <tr>'; |
47 | $out['text'] .= ' <tr>'; |
48 | $out['text'] .= ' <th width="50%">Attribute</th>'; |
48 | $out['text'] .= ' <th width="50%">'._L('Attribute').'</th>'; |
49 | $out['text'] .= ' <th width="50%">Value</th>'; |
49 | $out['text'] .= ' <th width="50%">'._L('Value').'</th>'; |
50 | $out['text'] .= ' </tr>'; |
50 | $out['text'] .= ' </tr>'; |
51 | $out['text'] .= ' <tr>'; |
51 | $out['text'] .= ' <tr>'; |
- | 52 | ||
52 | $sysid_oid = OIDplus::getSystemId(true); |
53 | $sysid_oid = OIDplus::getSystemId(true); |
53 | if (!$sysid_oid) $sysid_oid = 'unknown'; |
- | |
54 | $out['text'] .= ' <td>System OID</td>'; |
54 | $out['text'] .= ' <td>'._L('System OID').'</td>'; |
55 | $out['text'] .= ' <td>'.$sysid_oid.'</td>'; |
55 | $out['text'] .= ' <td>'.(!$sysid_oid ? '<i>'._L('unknown').'</i>' : htmlentities($sysid_oid)).'</td>'; |
56 | $out['text'] .= ' </tr>'; |
56 | $out['text'] .= ' </tr>'; |
- | 57 | ||
57 | $sys_url = OIDplus::getSystemUrl(); |
58 | $sys_url = OIDplus::getSystemUrl(); |
58 | $out['text'] .= ' <tr>'; |
59 | $out['text'] .= ' <tr>'; |
59 | $out['text'] .= ' <td>System URL</td>'; |
60 | $out['text'] .= ' <td>'._L('System URL').'</td>'; |
60 | $out['text'] .= ' <td>'.$sys_url.'</td>'; |
61 | $out['text'] .= ' <td>'.htmlentities($sys_url).'</td>'; |
61 | $out['text'] .= ' </tr>'; |
62 | $out['text'] .= ' </tr>'; |
- | 63 | ||
62 | $sys_ver = OIDplus::getVersion(); |
64 | $sys_ver = OIDplus::getVersion(); |
63 | if (!$sys_ver) $sys_ver = 'unknown'; |
- | |
64 | $out['text'] .= ' <tr>'; |
65 | $out['text'] .= ' <tr>'; |
65 | $out['text'] .= ' <td>System version</td>'; |
66 | $out['text'] .= ' <td>'._L('System version').'</td>'; |
66 | $out['text'] .= ' <td>'.$sys_ver.'</td>'; |
67 | $out['text'] .= ' <td>'.(!$sys_ver ? '<i>'._L('unknown').'</i>' : htmlentities($sys_ver)).'</td>'; |
67 | $out['text'] .= ' </tr>'; |
68 | $out['text'] .= ' </tr>'; |
- | 69 | ||
68 | $sys_install_type = OIDplus::getInstallType(); |
70 | $sys_install_type = OIDplus::getInstallType(); |
69 | $out['text'] .= ' <tr>'; |
71 | $out['text'] .= ' <tr>'; |
70 | $out['text'] .= ' <td>Installation type</td>'; |
72 | $out['text'] .= ' <td>'._L('Installation type').'</td>'; |
71 | $out['text'] .= ' <td>'.$sys_install_type.'</td>'; |
73 | $out['text'] .= ' <td>'.htmlentities($sys_install_type).'</td>'; |
72 | $out['text'] .= ' </tr>'; |
74 | $out['text'] .= ' </tr>'; |
- | 75 | ||
73 | $sys_title = OIDplus::config()->getValue('system_title'); |
76 | $sys_title = OIDplus::config()->getValue('system_title'); |
74 | $out['text'] .= ' <tr>'; |
77 | $out['text'] .= ' <tr>'; |
75 | $out['text'] .= ' <td>System title</td>'; |
78 | $out['text'] .= ' <td>'._L('System title').'</td>'; |
76 | $out['text'] .= ' <td>'.$sys_title.'</td>'; |
79 | $out['text'] .= ' <td>'.htmlentities($sys_title).'</td>'; |
- | 80 | $out['text'] .= ' </tr>'; |
|
- | 81 | ||
- | 82 | $out['text'] .= ' <tr>'; |
|
- | 83 | $out['text'] .= ' <td>'._L('System directory').'</td>'; |
|
- | 84 | $out['text'] .= ' <td>'.(isset($_SERVER['SCRIPT_FILENAME']) ? htmlentities(dirname($_SERVER['SCRIPT_FILENAME'])) : '<i>'._L('unknown').'</i>').'</td>'; |
|
77 | $out['text'] .= ' </tr>'; |
85 | $out['text'] .= ' </tr>'; |
- | 86 | ||
78 | $out['text'] .= '</table>'; |
87 | $out['text'] .= '</table>'; |
79 | $out['text'] .= '</div></div>'; |
88 | $out['text'] .= '</div></div>'; |
80 | 89 | ||
81 | # --- |
90 | # --- |
82 | 91 | ||
83 | $out['text'] .= '<h2>PHP</h2>'; |
92 | $out['text'] .= '<h2>'._L('PHP').'</h2>'; |
84 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
93 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
85 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
94 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
86 | $out['text'] .= ' <tr>'; |
95 | $out['text'] .= ' <tr>'; |
87 | $out['text'] .= ' <th width="50%">Attribute</th>'; |
96 | $out['text'] .= ' <th width="50%">'._L('Attribute').'</th>'; |
88 | $out['text'] .= ' <th width="50%">Value</th>'; |
97 | $out['text'] .= ' <th width="50%">'._L('Value').'</th>'; |
89 | $out['text'] .= ' </tr>'; |
98 | $out['text'] .= ' </tr>'; |
90 | $out['text'] .= ' <tr>'; |
99 | $out['text'] .= ' <tr>'; |
91 | $out['text'] .= ' <td>PHP version</td>'; |
100 | $out['text'] .= ' <td>'._L('PHP version').'</td>'; |
92 | $out['text'] .= ' <td>'.phpversion().'</td>'; |
101 | $out['text'] .= ' <td>'.phpversion().'</td>'; |
93 | $out['text'] .= ' </tr>'; |
102 | $out['text'] .= ' </tr>'; |
94 | $out['text'] .= '</table>'; |
103 | $out['text'] .= '</table>'; |
95 | $out['text'] .= '</div></div>'; |
104 | $out['text'] .= '</div></div>'; |
96 | 105 | ||
97 | # --- |
106 | # --- |
98 | 107 | ||
99 | $out['text'] .= '<h2>Webserver</h2>'; |
108 | $out['text'] .= '<h2>'._L('Webserver').'</h2>'; |
100 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
109 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
101 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
110 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
102 | $out['text'] .= ' <tr>'; |
111 | $out['text'] .= ' <tr>'; |
103 | $out['text'] .= ' <th width="50%">Attribute</th>'; |
112 | $out['text'] .= ' <th width="50%">'._L('Attribute').'</th>'; |
104 | $out['text'] .= ' <th width="50%">Value</th>'; |
113 | $out['text'] .= ' <th width="50%">'._L('Value').'</th>'; |
105 | $out['text'] .= ' </tr>'; |
114 | $out['text'] .= ' </tr>'; |
106 | $out['text'] .= ' <tr>'; |
115 | $out['text'] .= ' <tr>'; |
107 | $out['text'] .= ' <td>Server software</td>'; |
116 | $out['text'] .= ' <td>'._L('Server software').'</td>'; |
108 | $out['text'] .= ' <td>'.(isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : 'unknown').'</td>'; |
117 | $out['text'] .= ' <td>'.(isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : '<i>'._L('unknown').'</i>').'</td>'; |
109 | $out['text'] .= ' </tr>'; |
118 | $out['text'] .= ' </tr>'; |
110 | $out['text'] .= '</table>'; |
119 | $out['text'] .= '</table>'; |
111 | $out['text'] .= '</div></div>'; |
120 | $out['text'] .= '</div></div>'; |
112 | 121 | ||
113 | # --- |
122 | # --- |
114 | 123 | ||
115 | $out['text'] .= '<h2>Database</h2>'; |
124 | $out['text'] .= '<h2>'._L('Operating System').'</h2>'; |
116 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
125 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
117 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
126 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
118 | $out['text'] .= ' <tr>'; |
127 | $out['text'] .= ' <tr>'; |
119 | $out['text'] .= ' <th width="50%">Attribute</th>'; |
128 | $out['text'] .= ' <th width="50%">'._L('Attribute').'</th>'; |
120 | $out['text'] .= ' <th width="50%">Value</th>'; |
129 | $out['text'] .= ' <th width="50%">'._L('Value').'</th>'; |
- | 130 | $out['text'] .= ' </tr>'; |
|
- | 131 | $out['text'] .= ' <tr>'; |
|
- | 132 | $out['text'] .= ' <td>'._L('Operating System').'</td>'; |
|
- | 133 | $out['text'] .= ' <td>'.htmlentities(php_uname("s").' '.php_uname("r").' '.php_uname("v")).'</td>'; |
|
121 | $out['text'] .= ' </tr>'; |
134 | $out['text'] .= ' </tr>'; |
122 | $out['text'] .= ' <tr>'; |
135 | $out['text'] .= ' <tr>'; |
- | 136 | $out['text'] .= ' <td>'._L('Machine type').'</td>'; |
|
- | 137 | $out['text'] .= ' <td>'.htmlentities(php_uname("m")).'</td>'; |
|
- | 138 | $out['text'] .= ' </tr>'; |
|
- | 139 | $out['text'] .= ' <tr>'; |
|
- | 140 | $out['text'] .= ' <td>'._L('Hostname').'</td>'; |
|
- | 141 | $out['text'] .= ' <td>'.htmlentities(php_uname("n")).'</td>'; |
|
- | 142 | $out['text'] .= ' </tr>'; |
|
- | 143 | $out['text'] .= '</table>'; |
|
- | 144 | $out['text'] .= '</div></div>'; |
|
- | 145 | ||
- | 146 | # --- |
|
- | 147 | ||
- | 148 | $out['text'] .= '<h2>'._L('Database').'</h2>'; |
|
- | 149 | $out['text'] .= '<div class="container box"><div id="suboid_table" class="table-responsive">'; |
|
- | 150 | $out['text'] .= '<table class="table table-bordered table-striped">'; |
|
- | 151 | $out['text'] .= ' <tr>'; |
|
- | 152 | $out['text'] .= ' <th width="50%">'._L('Attribute').'</th>'; |
|
- | 153 | $out['text'] .= ' <th width="50%">'._L('Value').'</th>'; |
|
- | 154 | $out['text'] .= ' </tr>'; |
|
- | 155 | ||
- | 156 | $out['text'] .= ' <tr>'; |
|
123 | $out['text'] .= ' <td>Database provider</td>'; |
157 | $out['text'] .= ' <td>'._L('Database provider').'</td>'; |
124 | $out['text'] .= ' <td>'.OIDplus::db()->getPlugin()->getManifest()->getName().'</td>'; |
158 | $out['text'] .= ' <td>'.OIDplus::db()->getPlugin()->getManifest()->getName().'</td>'; |
125 | $out['text'] .= ' </tr>'; |
159 | $out['text'] .= ' </tr>'; |
- | 160 | ||
126 | $out['text'] .= ' <tr>'; |
161 | $out['text'] .= ' <tr>'; |
127 | $out['text'] .= ' <td>SQL slang</td>'; |
162 | $out['text'] .= ' <td>'._L('SQL slang').'</td>'; |
128 | $out['text'] .= ' <td>'.OIDplus::db()->getSlang()->getManifest()->getName().'</td>'; |
163 | $out['text'] .= ' <td>'.OIDplus::db()->getSlang()->getManifest()->getName().'</td>'; |
129 | $out['text'] .= ' </tr>'; |
164 | $out['text'] .= ' </tr>'; |
- | 165 | ||
- | 166 | $table_prefix = OIDplus::baseConfig()->getValue('TABLENAME_PREFIX'); |
|
- | 167 | $out['text'] .= ' <tr>'; |
|
- | 168 | $out['text'] .= ' <td>'._L('Table name prefix').'</td>'; |
|
- | 169 | $out['text'] .= ' <td>'.(!empty($table_prefix) ? htmlentities($table_prefix) : '<i>'._L('none').'</i>').'</td>'; |
|
- | 170 | $out['text'] .= ' </tr>'; |
|
130 | $out['text'] .= '</table>'; |
171 | $out['text'] .= '</table>'; |
131 | $out['text'] .= '</div></div>'; |
172 | $out['text'] .= '</div></div>'; |
132 | 173 | ||
133 | // TODO: can we somehow get the DBMS version, connection string etc? |
174 | // TODO: can we somehow get the DBMS version, connection string etc? |
134 | 175 | ||
Line 147... | Line 188... | ||
147 | } |
188 | } |
148 | 189 | ||
149 | $json[] = array( |
190 | $json[] = array( |
150 | 'id' => 'oidplus:systeminfo', |
191 | 'id' => 'oidplus:systeminfo', |
151 | 'icon' => $tree_icon, |
192 | 'icon' => $tree_icon, |
152 | 'text' => 'System information' |
193 | 'text' => _L('System information') |
153 | ); |
194 | ); |
154 | 195 | ||
155 | return true; |
196 | return true; |
156 | } |
197 | } |
157 | 198 |