Start porting admin/ to use the hoplite HTTP stack.
[bugdar.git] / admin / home.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar
5 || # Copyright (c)2002-2013 Blue Static
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version 2 of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 namespace bugdar\admin;
23
24 use \bugdar;
25 use \hoplite\http;
26
27 require_once HOPLITE_ROOT . '/http/action.php';
28
29 class HomeAction extends http\Action
30 {
31 public function Invoke(http\Request $request, http\Response $response)
32 {
33 $response->body = 'Hello World';
34 }
35 }
36
37 /*
38 require_once('./global.php');
39
40 NavLinks::optionsPages();
41 $navigator->set_focus('tab', 'options', null);
42 $navigator->set_focus('link', 'options-pages-home', 'options-pages');
43
44 $admin->page_start(T('Home'));
45
46 // ###################################################################
47
48 if (!(defined('NO_VERSION_CHECK') AND constant('NO_VERSION_CHECK') == true))
49 {
50 $check = @file_get_contents('http://www.bluestatic.org/versioncheck.php?prod=bugdar&ver=' . str_replace(' ', '-', $bugsys->options['trackerversion']));
51 if (strpos($check, '<version-check>') !== false)
52 {
53 $check = $bugsys->xml->parse($check);
54 if (isset($check['version-check']['update']))
55 {
56 $admin->page_code('<div style="background-color: white; border-color: red; border-width: 2px; border-style: solid; color: red; padding: 4px"><div style="font-size: 18px; font-weight: bold">' . T('Update Avaliable') . ':</div>' . sprintf(T('Your installation of Bugdar is out-of-date. You are running version <strong>%1$s</strong> and the latest version is <strong>%2$s</strong>. You can download the update at <a href="http://www.bluestatic.org">Blue Static\'s website</a>. You are strongly encouraged to apply all updates to fix bugs and any security issues (if present).'), $bugsys->options['trackerversion'], $check['version-check']['update']['value']) . '</div>');
57 }
58 else if (isset($check['version-check']['up-to-date']))
59 {
60 $admin->page_code('<div style="background-color: white; border-color: green; border-width: 2px; border-style: solid; color: green; padding: 4px"><div style="font-size: 18px; font-weight: bold">' . T('Up-to-Date') . ':</div>' . sprintf(T('Your installation of Bugdar is up-to-date. You are running version <strong>%1$s</strong>.'), $bugsys->options['trackerversion']) . '</div>');
61 }
62 }
63 }
64
65 // ###################################################################
66
67 $admin->table_start();
68 $admin->table_head(T('Welcome to the Bugdar Admin Panel'));
69
70 // -------------------------------------------------------------------
71 $admin->row_span(T('Version Information'), 'thead');
72 $admin->row_text(T('Bugdar Version'), $bugsys->options['trackerversion']);
73 $admin->row_text(T('PHP Version'), phpversion());
74
75 $mysql = $db->query_first("SELECT VERSION() AS version");
76 $admin->row_text(T('MySQL Version'), $mysql['version']);
77
78 $admin->row_text(T('Web Server'), ($_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVER_SOFTWARE'] : $SERVER['SERVER_SOFTWARE']));
79
80 // -------------------------------------------------------------------
81 $admin->row_span(T('Server Options'), 'thead');
82
83 $mysql = $db->query_first("SHOW VARIABLES LIKE 'max_allowed_packet'");
84 $admin->row_text(T('MySQL: Maximum Packet Size'), $mysql['Value']);
85
86 $admin->row_text(T('MySQL: Maximum Upload Size'), $funct->fetch_max_attachment_size());
87
88 $mysql = $db->query_first("SHOW VARIABLES LIKE 'ft_min_word_len'");
89 $admin->row_text(T('MySQL: Full-Text Search Minimum Word Length'), $mysql['Value']);
90
91 $admin->row_text(T('PHP: Safe Mode'), ((ini_get('safe_mode') == 1 OR strtolower(ini_get('safe_mode')) == 'on') ? T('Yes') : T('No')));
92 $admin->row_text(T('PHP: Register Globals'), ((ini_get('register_globals') == 1 OR strtolower(ini_get('register_globals')) == 'on') ? T('Yes') : T('No')));
93 $admin->row_text(T('PHP: Magic Quotes GPC'), ((ini_get('magic_quotes_gpc') == 1 OR strtolower(ini_get('magic_quotes_gpc')) == 'on') ? T('Yes') : T('No')));
94 $admin->row_text(T('PHP: Magic Quotes Sybase'), ((ini_get('magic_quotes_sybase') == 1 OR strtolower(ini_get('magic_quotes_sybase')) == 'on') ? T('Yes') : T('No')));
95
96 // -------------------------------------------------------------------
97
98 $admin->table_end();
99
100 $admin->page_end();
101
102 */