-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathfeindura.include.php
executable file
·79 lines (69 loc) · 2.93 KB
/
feindura.include.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
<?php
/**
* feindura - Flat File Content Management System
* Copyright (C) Fabian Vogelsteller [frozeman.de]
*
* 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 3 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.
*
* You should have received a copy of the GNU General Public License along with this program;
* if not,see <http://www.gnu.org/licenses/>.
*
* feindura.include.php
*
* @version 0.1.3
*
*
* !!! PROTECTED VARs (do not overwrite these in your script)
* -> $feindura_adminConfig
* -> $feindura_websiteConfig
* -> $feindura_categoryConfig
* -> $feindura_statisticConfig
* -> $feindura_websiteStatistic
*/
// -> starts a SESSION; needed to prevent multiple counting of the visitor in the statistics
ini_set('session.gc_maxlifetime', 3600); // saves the session for 60 minutes
ini_set('session.cookie_lifetime', 3600); // saves the session for 60 minutes
session_name('session');
// prevent Full Path Disclosure, through session error
$sessid = (isset($_COOKIE['session']))
? $_COOKIE['session']
: session_id();
if(empty($sessid))
session_start();
elseif(preg_match('/^[a-z0-9]{5,}$/', $sessid))
session_start();
unset($sessid);
// for statistics testing
// unset($_SESSION['feinduraSession']['log']);
// -> CHECKS if cookies are enabled
if(!isset($_COOKIE['feindura_checkCookies']) || $_COOKIE['feindura_checkCookies'] != 'true')
@setcookie( "feindura_checkCookies", 'true'); // try to set a cookie, to check in the next webpage whether its set or not
// -> INCLUDE ALL important FUNCTIONS, CLASSES and CONFIG vars
require_once(dirname(__FILE__)."/library/includes/general.include.php");
/**
* The ID of the current user
* (also defined in login.include.php)
*/
define('USERID',$_SESSION['feinduraSession']['login']['user']);
// -> SEND FRONTEND HEADER
header('Content-Type:text/html; charset=UTF-8');
if($websiteConfig['multiLanguageWebsite']['active'] && strlen($_SESSION['feinduraSession']['websiteLanguage']) === 2)
header('Content-Language:'.$_SESSION['feinduraSession']['websiteLanguage']);
// -> rename the config var names
$feindura_adminConfig = $adminConfig;
$feindura_websiteConfig = $websiteConfig;
$feindura_categoryConfig = $categoryConfig;
$feindura_userConfig = $userConfig;
$feindura_statisticConfig = $statisticConfig;
$feindura_websiteStatistic = $websiteStatistic;
$feindura_pagesMetaData = $pagesMetaData;
$feindura_languageNames = $languageNames;
// -> delete old config vars
unset($adminConfig,$websiteConfig,$categoryConfig,$userConfig,$statisticConfig,$websiteStatistic,$pagesMetaData,$languageNames);
?>