Subversion Repositories ALCASAR

Rev

Rev 2770 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2770 Rev 3037
1
<?php
1
<?php
2
/**
2
/**
3
 * start page for webaccess
3
 * start page for webaccess
4
 * redirect the user to the supported page type by the users webbrowser (js available or not)
4
 * redirect the user to the supported page type by the users webbrowser (js available or not)
5
 *
5
 *
6
 * PHP version 5
6
 * PHP version 5
7
 *
7
 *
8
 * @category  PHP
8
 * @category  PHP
9
 * @package   PSI
9
 * @package   PSI
10
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
10
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
11
 * @copyright 2009 phpSysInfo
11
 * @copyright 2009 phpSysInfo
12
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
12
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
13
 * @version   SVN: $Id: index.php 687 2012-09-06 20:54:49Z namiltd $
13
 * @version   SVN: $Id: index.php 687 2012-09-06 20:54:49Z namiltd $
14
 * @link      http://phpsysinfo.sourceforge.net
14
 * @link      http://phpsysinfo.sourceforge.net
15
 */
15
 */
16
/**
16
/**
17
 * define the application root path on the webserver
17
 * define the application root path on the webserver
18
 * @var string
18
 * @var string
19
 */
19
 */
20
define('PSI_APP_ROOT', dirname(__FILE__));
20
define('PSI_APP_ROOT', dirname(__FILE__));
21
 
21
 
22
if (version_compare("5.1.3", PHP_VERSION, ">")) {
22
if (version_compare("5.1.3", PHP_VERSION, ">")) {
23
    die("PHP 5.1.3 or greater is required!!!");
23
    die("PHP 5.1.3 or greater is required!!!");
24
}
24
}
25
if (!extension_loaded("pcre")) {
25
if (!extension_loaded("pcre")) {
26
    die("phpSysInfo requires the pcre extension to php in order to work properly.");
26
    die("phpSysInfo requires the pcre extension to php in order to work properly.");
27
}
27
}
28
 
28
 
29
require_once PSI_APP_ROOT.'/includes/autoloader.inc.php';
29
require_once PSI_APP_ROOT.'/includes/autoloader.inc.php';
30
 
30
 
31
// Load configuration
31
// Load configuration
32
require_once PSI_APP_ROOT.'/read_config.php';
32
require_once PSI_APP_ROOT.'/read_config.php';
33
 
33
 
34
if (!defined('PSI_CONFIG_FILE') || !defined('PSI_DEBUG')) {
34
if (!defined('PSI_CONFIG_FILE') || !defined('PSI_DEBUG')) {
35
    $tpl = new Template("/templates/html/error_config.html");
35
    $tpl = new Template("/templates/html/error_config.html");
36
    echo $tpl->fetch();
36
    echo $tpl->fetch();
37
    die();
37
    die();
38
}
38
}
39
 
39
 
40
// redirect to page with and without javascript
40
// redirect to page with and without javascript
41
$display = strtolower(isset($_GET['disp']) ? $_GET['disp'] : PSI_DEFAULT_DISPLAY_MODE);
41
$display = strtolower(isset($_GET['disp']) ? $_GET['disp'] : PSI_DEFAULT_DISPLAY_MODE);
42
switch ($display) {
42
switch ($display) {
43
case "static":
43
case "static":
44
    $webpage = new WebpageXSLT();
44
    $webpage = new WebpageXSLT();
45
    $webpage->run();
45
    $webpage->run();
46
    break;
46
    break;
47
case "dynamic":
47
case "dynamic":
48
    $webpage = new Webpage();
48
    $webpage = new Webpage();
49
    $webpage->run();
49
    $webpage->run();
50
    break;
50
    break;
51
case "xml":
51
case "xml":
52
    $webpage = new WebpageXML("complete");
52
    $webpage = new WebpageXML("complete");
53
    $webpage->run();
53
    $webpage->run();
54
    break;
54
    break;
55
case "json":
55
case "json":
56
    $webpage = new WebpageXML("complete");
56
    $webpage = new WebpageXML("complete");
57
    $json = $webpage->getJsonString();
57
    $json = $webpage->getJsonString();
58
    header("Cache-Control: no-cache, must-revalidate\n");
58
    header('Cache-Control: no-cache, must-revalidate');
59
    header("Content-Type: application/json\n\n");
59
    header('Content-Type: application/json');
60
    echo $json;
60
    echo $json;
61
    break;
61
    break;
62
case "bootstrap":
62
case "bootstrap":
63
/*
63
/*
64
    $tpl = new Template("/templates/html/index_bootstrap.html");
64
    $tpl = new Template("/templates/html/index_bootstrap.html");
65
    echo $tpl->fetch();
65
    echo $tpl->fetch();
66
*/
66
*/
67
    $webpage = new Webpage("bootstrap");
67
    $webpage = new Webpage("bootstrap");
68
    $webpage->run();
68
    $webpage->run();
69
    break;
69
    break;
70
case "auto":
70
case "auto":
71
    $tpl = new Template("/templates/html/index_all.html");
71
    $tpl = new Template("/templates/html/index_all.html");
72
    echo $tpl->fetch();
72
    echo $tpl->fetch();
73
    break;
73
    break;
74
default:
74
default:
75
    $defaultdisplay = strtolower(PSI_DEFAULT_DISPLAY_MODE);
75
    $defaultdisplay = strtolower(PSI_DEFAULT_DISPLAY_MODE);
76
    switch ($defaultdisplay) {
76
    switch ($defaultdisplay) {
77
    case "static":
77
    case "static":
78
        $webpage = new WebpageXSLT();
78
        $webpage = new WebpageXSLT();
79
        $webpage->run();
79
        $webpage->run();
80
        break;
80
        break;
81
    case "dynamic":
81
    case "dynamic":
82
        $webpage = new Webpage();
82
        $webpage = new Webpage();
83
        $webpage->run();
83
        $webpage->run();
84
        break;
84
        break;
85
    case "bootstrap":
85
    case "bootstrap":
86
        $webpage = new Webpage("bootstrap");
86
        $webpage = new Webpage("bootstrap");
87
        $webpage->run();
87
        $webpage->run();
88
        break;
88
        break;
89
    default:
89
    default:
90
        $tpl = new Template("/templates/html/index_all.html");
90
        $tpl = new Template("/templates/html/index_all.html");
91
        echo $tpl->fetch();
91
        echo $tpl->fetch();
92
        break;
-
 
93
    }
92
    }
94
    break;
-
 
95
}
93
}
96
 
94