81 lines
1.8 KiB
PHP
81 lines
1.8 KiB
PHP
<?php
|
|
// Melde alle PHP Fehler (siehe Changelog)
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', 1);
|
|
//
|
|
require('lib/config.php');
|
|
session_name(CONFIG_SESSION);
|
|
session_start();
|
|
$loginerror='';
|
|
|
|
if(isset($_POST['logout'])) {
|
|
session_destroy();
|
|
require('login.php');
|
|
} else {
|
|
if(isset($_POST['password'])) {
|
|
if($_POST['password'] == CONFIG_PASS) {
|
|
$_SESSION['login']=time();
|
|
}
|
|
|
|
}
|
|
if(isset($_SESSION['login'])){
|
|
|
|
$realtime=time();
|
|
|
|
$userip=$_SERVER['REMOTE_ADDR'];
|
|
|
|
// Default Time Zone
|
|
date_default_timezone_set('Europe/Berlin');
|
|
|
|
define('SITE_ACCESS',true);
|
|
// Config
|
|
|
|
// Lib's
|
|
|
|
require('lib/mysql.class.php');
|
|
require('lib/email.class.php');
|
|
require('lib/phpmailer/phpmailer.inc.php');
|
|
require('lib/core.class.php');
|
|
require('lib/function.php');
|
|
require('lib/smarty/Smarty.class.php');
|
|
|
|
// Session
|
|
|
|
// Template
|
|
$template = new smarty();
|
|
$template->template_dir = './template/';
|
|
$template->compile_dir = './template/compile';
|
|
$template->compile_check = TRUE;
|
|
$template->debugging = false;
|
|
$template->debug_output = "html";
|
|
$template->plugins_dir[] = 'libs/smarty/plugins/';
|
|
$template->force_compile = true;
|
|
|
|
//Mysql
|
|
$GLOBALS['mysql'] = new mysql(CONFIG_MYSQL_HOST,CONFIG_MYSQL_USER,CONFIG_MYSQL_PW,CONFIG_MYSQL_DB);
|
|
|
|
//Seite generieren
|
|
$GLOBALS['core'] = new core;
|
|
$GLOBALS['template']=$template;
|
|
|
|
//E-Mailer starten
|
|
//$GLOBALS['email'] = new email;
|
|
|
|
//Grundinformationen aus der DB holen
|
|
|
|
|
|
|
|
if(isset($_GET['s']) AND file_exists('scripts/'.$_GET['s'].'.php')){
|
|
|
|
require('scripts/'.$_GET['s'].'.php');
|
|
} else {
|
|
$_GET['s']='home';
|
|
require('scripts/home.php');
|
|
}
|
|
|
|
|
|
$GLOBALS['template']->display('input.tpl');
|
|
} else { require('login.php'); }
|
|
}
|
|
|
|
?>
|