2 /*=====================================================================*\
3 || ###################################################################
5 || # Copyright (c)2002-2013 Blue Static
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.
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
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 \*=====================================================================*/
22 namespace bugdar
\admin
;
27 require_once HOPLITE_ROOT
. '/http/action.php';
29 class HomeAction
extends http\Action
31 public function Invoke(http\Request
$request, http\Response
$response)
33 $response->data
['title'] = T('Home');
35 $response->data
['new_version_number'] = $this->_DoVersionCheck();
36 $response->data
['current_version'] = Bugdar
::$options['trackerversion'];
38 $response->context
['template'] = 'admin_index';
41 // Contacts Blue Static to see if Bugdar is up-to-date. Returns NULL if the
42 // current version is the latest, or a string version number of the latest
44 private function _DoVersionCheck()
48 if (defined('NO_VERSION_CHECK') && constant('NO_VERSION_CHECK'))
51 $check = @file_get_contents('https://www.bluestatic.org/versioncheck.php?prod=bugdar&ver=' . str_replace(' ', '-', Bugdar
::$options['trackerversion']));
52 if (strpos($check, '<version-check>') !== false
) {
53 if (!isset($check['version-check']['update']))
56 // TODO(rsesek): Switch to SimpleXML.
57 $check = $bugsys->xml
->parse($check);
58 return $check['version-check']['update']['value'];
65 $admin->table_start();
66 $admin->table_head(T('Welcome to the Bugdar Admin Panel'));
68 // -------------------------------------------------------------------
69 $admin->row_span(T('Version Information'), 'thead');
70 $admin->row_text(T('Bugdar Version'), $bugsys->options['trackerversion']);
71 $admin->row_text(T('PHP Version'), phpversion());
73 $mysql = $db->query_first("SELECT VERSION() AS version");
74 $admin->row_text(T('MySQL Version'), $mysql['version']);
76 $admin->row_text(T('Web Server'), ($_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVER_SOFTWARE'] : $SERVER['SERVER_SOFTWARE']));
78 // -------------------------------------------------------------------
79 $admin->row_span(T('Server Options'), 'thead');
81 $mysql = $db->query_first("SHOW VARIABLES LIKE 'max_allowed_packet'");
82 $admin->row_text(T('MySQL: Maximum Packet Size'), $mysql['Value']);
84 $admin->row_text(T('MySQL: Maximum Upload Size'), $funct->fetch_max_attachment_size());
86 $mysql = $db->query_first("SHOW VARIABLES LIKE 'ft_min_word_len'");
87 $admin->row_text(T('MySQL: Full-Text Search Minimum Word Length'), $mysql['Value']);
89 $admin->row_text(T('PHP: Safe Mode'), ((ini_get('safe_mode') == 1 OR strtolower(ini_get('safe_mode')) == 'on') ? T('Yes') : T('No')));
90 $admin->row_text(T('PHP: Register Globals'), ((ini_get('register_globals') == 1 OR strtolower(ini_get('register_globals')) == 'on') ? T('Yes') : T('No')));
91 $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')));
92 $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')));
94 // -------------------------------------------------------------------