Subversion Repositories oidplus

Rev

Rev 138 | Rev 143 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 daniel-mar 1
<?php
2
 
3
/*
4
 * OIDplus 2.0
5
 * Copyright 2019 Daniel Marschall, ViaThinkSoft
6
 *
7
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * you may not use this file except in compliance with the License.
9
 * You may obtain a copy of the License at
10
 *
11
 *     http://www.apache.org/licenses/LICENSE-2.0
12
 *
13
 * Unless required by applicable law or agreed to in writing, software
14
 * distributed under the License is distributed on an "AS IS" BASIS,
15
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
 * See the License for the specific language governing permissions and
17
 * limitations under the License.
18
 */
19
 
120 daniel-mar 20
require_once __DIR__ . '/includes/oidplus.inc.php';
2 daniel-mar 21
 
120 daniel-mar 22
ob_start(); // allow cookie headers to be sent
23
 
24
header('Content-Type:text/html; charset=UTF-8');
25
 
135 daniel-mar 26
if (!function_exists('gmp_init')) {
27
        // Required for uuid_functions.inc.php and ipv6_functions.inc.php
138 daniel-mar 28
        die('<h1>OIDplus Installation</h1><p>ERROR: The extension <b>gmp</b> is not installed.</p><p>Install it using <code>sudo aptitude update && sudo aptitude install php-gmp && sudo service apache2 restart</code> on Linux systems.</p>');
135 daniel-mar 29
}
30
 
138 daniel-mar 31
if (!function_exists('mb_substr')) {
32
        // Required for includes/classes/OIDplusSessionHandler.class.php, includes/oid_utils.inc.php, 3p/minify/path-converter/Converter.php, 3p/0xbb/Sha3.class.php
33
        die('<h1>OIDplus Installation</h1><p>ERROR: The extension <b>php-mbstring</b> is not installed.</p><p>Install it using <code>sudo aptitude update && sudo aptitude install php-mbstring && sudo service apache2 restart</code> on Linux systems.</p>');
34
}
35
 
120 daniel-mar 36
OIDplus::init(true);
37
 
38
OIDplus::db()->set_charset("UTF8");
39
OIDplus::db()->query("SET NAMES 'utf8'");
40
 
41
$static_node_id = isset($_REQUEST['goto']) ? $_REQUEST['goto'] : 'oidplus:system';
42
$static = OIDplus::gui()::generateContentPage($static_node_id);
43
$static_title = $static['title'];
44
$static_icon = $static['icon'];
45
$static_content = $static['text'];
46
 
47
function combine_systemtitle_and_pagetitle($systemtitle, $pagetitle) {
48
        if ($systemtitle == $pagetitle) {
49
                return $systemtitle;
50
        } else {
51
                return $systemtitle . ' - ' . $pagetitle;
52
        }
5 daniel-mar 53
}
120 daniel-mar 54
 
55
$sysid_oid = OIDplus::system_id(true);
56
if (!$sysid_oid) $sysid_oid = 'unknown';
57
header('X-OIDplus-SystemID:'.$sysid_oid);
58
 
59
$sys_url = OIDplus::system_url();
60
header('X-OIDplus-SystemURL:'.$sys_url);
61
 
62
$sys_ver = OIDplus::getVersion();
63
if (!$sys_ver) $sys_ver = 'unknown';
64
header('X-OIDplus-SystemVersion:'.$sys_ver);
65
 
66
$sys_title = OIDplus::config()->systemTitle();
67
header('X-OIDplus-SystemTitle:'.$sys_title);
68
 
142 daniel-mar 69
if (class_exists('OIDplusPageAdminColors')) {
70
        $css = 'oidplus.min.css.php?h_shift='.(OIDplus::config()->getValue('color_hue_shift')/360).'&s_shift='.(OIDplus::config()->getValue('color_sat_shift')/100).'&v_shift='.(OIDplus::config()->getValue('color_val_shift')/100);
71
} else {
72
        $css = 'oidplus.min.css.php';
73
}
74
 
120 daniel-mar 75
?><!DOCTYPE html>
76
<html lang="en">
77
 
78
<head>
79
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
80
        <meta name="OIDplus-SystemID" content="<?php echo htmlentities($sysid_oid); ?>">
81
        <meta name="OIDplus-SystemURL" content="<?php echo htmlentities($sys_url); ?>">
82
        <meta name="OIDplus-SystemVersion" content="<?php echo htmlentities($sys_ver); ?>">
83
        <meta name="OIDplus-SystemTitle" content="<?php echo htmlentities($sys_title); /* Do not remove. This meta tag is acessed via JS */ ?>">
84
        <meta name="theme-color" content="#A9DCF0">
85
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
86
 
87
        <title><?php echo combine_systemtitle_and_pagetitle(OIDplus::config()->systemTitle(), $static_title); ?></title>
88
 
89
        <!-- We are using jQuery 2.2.1, because 3.3.1 seems to be incompatible with jsTree (HTML content will not be loaded into jsTree!) TODO: File bug report -->
90
        <script src="3p/jquery/jquery-2.2.1.min.js"></script>
91
        <script src="3p/bootstrap/js/bootstrap.min.js"></script>
92
        <script src="3p/jstree/jstree.min.js"></script>
93
        <script src='3p/tinymce/tinymce.min.js'></script>
94
        <script src="3p/jquery-ui/jquery-ui.min.js"></script>
95
        <script src="3p/layout/jquery.layout.min.js"></script>
96
        <script src="3p/spamspan/spamspan.js"></script>
97
        <script src='https://www.google.com/recaptcha/api.js'></script>
98
        <script src="oidplus.min.js.php"></script>
99
 
142 daniel-mar 100
        <link rel="stylesheet" href="<?php echo htmlentities($css); ?>">
120 daniel-mar 101
 
142 daniel-mar 102
 
103
 
104
<!-- TODO: in 3p speichern -->
105
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
106
 
107
 
120 daniel-mar 108
        <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
109
 
126 daniel-mar 110
        <!-- DM 28 May 2019: Removed CookieConsent temporarily, because it is placed at the beginning of the page and therefore ruins the Google index ... -->
111
        <!-- We might not need it, because cookies are only set during login, and at the login page we already warn about cookies -->
112
        <!-- TODO: Bring back? -->
113
        <!-- <link rel="stylesheet" type="text/css" href="3p/cookieconsent/cookieconsent.min.css">
120 daniel-mar 114
        <script src="3p/cookieconsent/cookieconsent.min.js"></script>
115
        <script>
116
                window.addEventListener("load", function(){
117
                window.cookieconsent.initialise({
118
                        "palette": {
119
                                "popup": {
120
                                        "background": "#edeff5",
121
                                        "text": "#838391"
122
                                },
123
                                "button": {
124
                                        "background": "#4b81e8"
125
                                }
126
                        },
127
                        "position": "bottom-right"
128
                })});
126 daniel-mar 129
        </script> -->
120 daniel-mar 130
</head>
131
 
132
<body>
133
 
134
<div id="frames">
126 daniel-mar 135
        <div id="content_window" class="borderbox">
136
                <?php
137
                $static_content = preg_replace_callback(
138
                        '|<a\s([^>]*)href="mailto:([^"]+)"([^>]*)>([^<]*)</a>|ismU',
139
                        function ($treffer) {
140
                                $email = $treffer[2];
141
                                $text = $treffer[4];
142
                                return secure_email($email, $text, 1); // AntiSpam
143
                        }, $static_content);
144
 
145
                echo '<h1 id="real_title">';
127 daniel-mar 146
                if ($static_icon != '') echo '<img src="'.htmlentities($static_icon).'" width="48" height="48" alt=""> ';
126 daniel-mar 147
                echo htmlentities($static_title).'</h1>';
148
                echo '<div id="real_content">'.$static_content.'</div>';
149
                if ($_SERVER['REQUEST_METHOD'] == 'GET') {
150
                        echo '<br><p><img src="img/share.png" width="15" height="15" alt="Share"> <a href="?goto='.htmlentities($static_node_id).'" id="static_link" class="gray_footer_font">Static link to this page</a>';
151
                        echo '</p>';
152
                }
153
                echo '<br>';
154
                ?>
155
        </div>
156
 
120 daniel-mar 157
        <div id="system_title_bar">
122 daniel-mar 158
                <div id="system_title_menu" onclick="mobileNavButtonClick(this)" onmouseenter="mobileNavButtonHover(this)" onmouseleave="mobileNavButtonHover(this)">
120 daniel-mar 159
                        <div id="bar1"></div>
160
                        <div id="bar2"></div>
161
                        <div id="bar3"></div>
162
                </div>
163
 
122 daniel-mar 164
                <div id="system_title_text">
120 daniel-mar 165
                        <a <?php echo oidplus_link('oidplus:system'); ?>>
166
                                <span id="system_title_1">ViaThinkSoft OIDplus 2.0</span><br>
167
                                <span id="system_title_2"><?php echo htmlentities(OIDplus::config()->systemTitle()); ?></span>
168
                        </a>
169
                </div>
170
        </div>
171
 
172
        <div id="oidtree" class="borderbox">
122 daniel-mar 173
                <!-- <noscript>
120 daniel-mar 174
                        <p><b>Please enable JavaScript to use all features</b></p>
122 daniel-mar 175
                </noscript> -->
120 daniel-mar 176
                <?php OIDplusTree::nonjs_menu(); ?>
177
        </div>
178
</div>
179
 
180
</body>
181
</html>
182
<?php
183
 
184
$cont = ob_get_contents();
185
ob_end_clean();
186
 
187
echo $cont;