-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinclude.inc
40 lines (29 loc) · 842 Bytes
/
include.inc
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
<?php
session_start();
mb_internal_encoding("UTF-8");
function nactiTridu($trida)
{
$ajaxDir = (isset($ajax) && $ajax) ? "../" : "";
require($ajaxDir."php_classes/$trida.php");
}
spl_autoload_register("nactiTridu");
if(!isset($dontIncludeError)){
require('php_classes/php_error.php' );
php_error\reportErrors();
}
#Databaze::pripoj('localhost', 'root', 'root', 'chat');
Databaze::pripoj('wm98.wedos.net', 'a18034_chat', '7qQjgVrw', 'd18034_chat');
date_default_timezone_set("Europe/Prague");
if(!isset($turnOffSecurity)){
$userManager = new UsersManager();
if(!isset($_SESSION["ID"])) {
header("Location: index.html?error=bad");
die();
}
$user = $userManager->getUserByHash($_SESSION["ID"]);
if(!$user) {
header("Location: index.html?error=bad");
die();
}
}
?>