Redesign index.php
[bugdar.git] / admin / index.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar
5 || # Copyright (c)2004-2008 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 require_once('./global.php');
23
24 $template = new BSTemplate('main');
25
26 // ###################################################################
27 // do version check
28
29 if (!(defined('NO_VERSION_CHECK') AND constant('NO_VERSION_CHECK') == true))
30 {
31 $template->vars['versionCheck'] = true;
32
33 $check = @file_get_contents('http://www.bluestatic.org/versioncheck.php?prod=bugdar&ver=' . str_replace(' ', '-', bugdar::$options['trackerversion']));
34 if (strpos($check, '<version-check>') !== false)
35 {
36 $check = simplexml_load_string($check);
37 if ($check->update)
38 {
39 $template->vars['upToDate'] = false;
40 $template->vars['updateTitle'] = T('Update Avaliable');
41 $template->vars['updateString'] = 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).'), bugdar::$options['trackerversion'], $check->update);
42 }
43 else
44 {
45 $template->vars['upToDate'] = true;
46 $template->vars['updateTitle'] = T('Up-to-Date');
47 $template->vars['updateString'] = sprintf(T('Your installation of Bugdar is up-to-date. You are running version <strong>%1$s</strong>.'), bugdar::$options['trackerversion']);
48 }
49 }
50 }
51
52 // ###################################################################
53 // some option information
54
55 $template->vars['mysqlVersion'] = $db->queryFirst("SELECT VERSION() AS version", 'fetchObject')->version;
56 $template->vars['webServer'] = ($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : $SERVER['SERVER_SOFTWARE'];
57
58 $template->vars['mysqlPacketSize'] = $db->queryFirst("SHOW VARIABLES LIKE 'max_allowed_packet'", 'fetchObject')->Value;
59 $template->vars['mysqlWordLength'] = $db->queryFirst("SHOW VARIABLES LIKE 'ft_min_word_len'", 'fetchObject')->Value;
60
61 $template->vars['phpSafeMode'] = (ini_get('safe_mode') == 1 || strtolower(ini_get('safe_mode')) == 'on');
62 $template->vars['phpRegGlobals'] = (ini_get('register_globals') == 1 || strtolower(ini_get('register_globals')) == 'on');
63 $template->vars['phpMagicQuotesGPC'] = (ini_get('magic_quotes_gpc') == 1 || strtolower(ini_get('magic_quotes_gpc')) == 'on');
64 $template->vars['phpMagicQuotesSybase'] = (ini_get('magic_quotes_sybase') == 1 || strtolower(ini_get('magic_quotes_sybase')) == 'on');
65
66 $template->evaluate()->flush();
67
68 ?>