-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathautoload.php
More file actions
44 lines (35 loc) · 1.1 KB
/
Copy pathautoload.php
File metadata and controls
44 lines (35 loc) · 1.1 KB
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
<?php
require_once dirname(__FILE__) . '/laf-config.php';
include_once LAF_ROOT_PATH . '/vendor/autoload.php';
include_once LAF_ROOT_PATH . '/src/Connect.php';
include_once LAF_ROOT_PATH . '/functions.php';
if(!isset($_SESSION)){
session_start();
}
function autoload($class){
include LAF_ROOT_PATH . "/src/". str_replace('\\','/', $class) . ".php";
}
spl_autoload_register('autoload');
function errHandle($errNo, $errStr, $errFile, $errLine) {
if (error_reporting() == 0) {
// @ suppression used, don't worry about it
return;
}
$msg = "$errStr in $errFile on line $errLine";
if ($errNo == E_NOTICE || $errNo == E_WARNING) {
throw new ErrorException($msg, $errNo);
} else {
echo $msg;
}
}
set_error_handler('errHandle');
$maintenance = new Maintenance($connection);
$roles = new UserRoles($connection);
if(isset($_SESSION['id'])){
$roles_arr = $roles->getUserRole(@$_SESSION["id"]);
}
if($maintenance->checkIfMaintaining()){
if($roles_arr['rights'] < $maintenance->getMinUserRights()){
include_once LAF_ROOT_PATH . '/maintenance.php';
}
}