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