forked from henshingly/lmo_php8
/
init.php
113 lines (100 loc) · 3.81 KB
/
init.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/** Liga Manager Online 4
*
* http://lmo.sourceforge.net/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* REMOVING OR CHANGING THE COPYRIGHT NOTICES IS NOT ALLOWED!
*
* $Id$
*/
// First line of XSS-Identification
$get = array();
$get = $_GET;
foreach($get as $value) {
if(str_starts_with($value,"<"))
die("XSS-Scripting detected");
}
@ini_set("session.use_trans_sid","1");
@ini_set("arg_separator.output","&");
if (session_id()=="") session_start();
require(dirname(__FILE__).'/config/init-parameters.php');
if (isset($_GET['debug']) || isset($_SESSION['debug'])) {
$_SESSION['debug']=TRUE;
@error_reporting(E_ALL);
@ini_set('display_errors','1');
}
$_SERVER['QUERY_STRING']=isset($_SERVER['QUERY_STRING'])?$_SERVER['QUERY_STRING']:'';
//Path-Contants
if (!defined('PATH_TO_LMO')) define('PATH_TO_LMO', $lmo_dateipfad);
if (!defined('PATH_TO_ADDONDIR')) define('PATH_TO_ADDONDIR', PATH_TO_LMO.'/addon');
if (!defined('PATH_TO_TEMPLATEDIR'))define('PATH_TO_TEMPLATEDIR', PATH_TO_LMO.'/template');
if (!defined('PATH_TO_IMGDIR')) define('PATH_TO_IMGDIR', PATH_TO_LMO.'/img');
if (!defined('PATH_TO_LANGDIR')) define('PATH_TO_LANGDIR', PATH_TO_LMO.'/lang');
if (!defined('PATH_TO_CONFIGDIR')) define('PATH_TO_CONFIGDIR', PATH_TO_LMO.'/config');
if (!defined('PATH_TO_JSDIR')) define('PATH_TO_JSDIR', PATH_TO_LMO.'/js');
if (!defined('URL_TO_LMO')) define('URL_TO_LMO', $lmo_url);
if (!defined('URL_TO_ADDONDIR')) define('URL_TO_ADDONDIR', URL_TO_LMO.'/addon');
if (!defined('URL_TO_TEMPLATEDIR')) define('URL_TO_TEMPLATEDIR', URL_TO_LMO.'/template');
if (!defined('URL_TO_IMGDIR')) define('URL_TO_IMGDIR', URL_TO_LMO.'/img');
if (!defined('URL_TO_LANGDIR')) define('URL_TO_LANGDIR', URL_TO_LMO.'/lang');
if (!defined('URL_TO_CONFIGDIR')) define('URL_TO_CONFIGDIR', URL_TO_LMO.'/config');
if (!defined('URL_TO_JSDIR')) define('URL_TO_JSDIR', URL_TO_LMO.'/js');
//Check Path
if (!file_exists(PATH_TO_LMO."/init.php")) {
echo "Invalid Path to LMO: '".PATH_TO_LMO."' - please reinstall or correct manually.";
exit();
}
//Configuration
require(PATH_TO_LMO."/lmo-cfgload.php");
if (!defined('LMO_VERSION')) {
define('LMO_VERSION',$cfgarray['lmoVersion']);
}
//Language
if(isset($_GET["lmouserlang"])){
$_SESSION["lmouserlang"]=$_GET["lmouserlang"];
}
if(isset($_POST["lmouserlang"])){
$_SESSION["lmouserlang"]=$_POST["lmouserlang"];
}
if(isset($_SESSION["lmouserlang"])){
$lmouserlang=$_SESSION["lmouserlang"];
} else {
$lmouserlang=$deflang;
$_SESSION["lmouserlang"] = $deflang;
}
require(PATH_TO_LMO."/lmo-langload.php");
//Dateformat
$fmt = new IntlDateFormatter(
$text['704'],
IntlDateFormatter::FULL, /*Datum */
IntlDateFormatter::SHORT, /*Uhrzeit */
$cfgarray['timezone'],
IntlDateFormatter::GREGORIAN,
$cfgarray['defdateformat']
);
//Functions
require_once(PATH_TO_LMO."/lmo-functions.php");
//Übergang Classlib
require_once(PATH_TO_ADDONDIR."/classlib/ini.php");
//Template System
require_once(PATH_TO_LMO."/includes/IT.php");
//Remove Magic Quotes if necessary
magicQuotesRemove($_GET);
magicQuotesRemove($_POST);
magicQuotesRemove($_COOKIE);
//Workaround for register_globals TODO: fix that!!!
if (!function_exists('ini_get') || !ini_get("register_globals")) {
@extract($_GET);
@extract($_POST);
@extract($_COOKIE);
}?>