mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2024-11-14 00:01:45 -05:00
7ca811d997
- Mailer class for mail handler - Notification class for all notifications - Parsedown class for implenting support for Markdown when adding new incidents #8.
76 lines
1.5 KiB
PHP
76 lines
1.5 KiB
PHP
<?php
|
|
|
|
if (!file_exists("../config.php"))
|
|
{
|
|
header("Location: ../");
|
|
}
|
|
else{
|
|
require_once("../config.php");
|
|
require_once("../classes/constellation.php");
|
|
require_once("../classes/mailer.php");
|
|
require_once("../classes/notification.php");
|
|
require_once("../template.php");
|
|
require_once("../libs/parsedown/Parsedown.php");
|
|
|
|
if(isset($_COOKIE['user'])&&!isset($_SESSION['user']))
|
|
{
|
|
User::restore_session();
|
|
}
|
|
|
|
if (!isset($_SESSION['user']))
|
|
{
|
|
if (isset($_GET['do']) && $_GET['do']=="lost-password")
|
|
{
|
|
require_once("lost-password.php");
|
|
}else if (isset($_GET['do']) && $_GET['do']=="change-email"){
|
|
$user_pwd = new User($_GET['id']);
|
|
$user_pwd->change_email();
|
|
require_once("login-form.php");
|
|
}
|
|
else{
|
|
User::login();
|
|
require_once("login-form.php");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$user = new User($_SESSION['user']);
|
|
if (!$user->is_active())
|
|
{
|
|
User::logout();
|
|
}
|
|
|
|
if (!isset($_GET['do'])){
|
|
$do = "";
|
|
}else{
|
|
$do = $_GET['do'];
|
|
}
|
|
|
|
switch ($do) {
|
|
case 'change-email':
|
|
$user = new User($_GET['id']);
|
|
$user->change_email();
|
|
case 'user':
|
|
require_once("user.php");
|
|
break;
|
|
|
|
case 'settings':
|
|
require_once("settings.php");
|
|
break;
|
|
|
|
case 'new-user':
|
|
require_once("new-user.php");
|
|
break;
|
|
|
|
case 'logout':
|
|
User::logout();
|
|
break;
|
|
|
|
default:
|
|
require_once("dashboard.php");
|
|
break;
|
|
}
|
|
|
|
Template::render_footer(true);
|
|
}
|
|
} |