2017-11-23 18:09:36 -05:00
|
|
|
<?php
|
2018-11-25 12:33:25 -05:00
|
|
|
require_once("libs/parsedown/Parsedown.php");
|
2017-11-23 18:09:36 -05:00
|
|
|
|
|
|
|
if (!file_exists("config.php"))
|
|
|
|
{
|
2020-05-23 11:03:08 -04:00
|
|
|
require_once("template.php");
|
2018-01-18 16:57:12 -05:00
|
|
|
require_once("install.php");
|
2018-11-25 12:33:25 -05:00
|
|
|
|
|
|
|
} elseif(isset($_GET['do'])) { // we can add other actions with $_GET['do'] later.
|
|
|
|
// Fix for translation via _(). We need config.php first...
|
|
|
|
require_once("config.php");
|
|
|
|
require_once("template.php");
|
2020-06-16 14:20:51 -04:00
|
|
|
|
|
|
|
|
2018-11-25 12:33:25 -05:00
|
|
|
switch ($_GET['do']) {
|
|
|
|
case 'subscriptions':
|
|
|
|
require_once("subscriptions.php");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'email_subscription':
|
|
|
|
case 'manage':
|
2020-06-16 14:20:51 -04:00
|
|
|
case 'unsubscribe';
|
2018-11-25 12:33:25 -05:00
|
|
|
require_once("email_subscriptions.php");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2020-06-16 14:20:51 -04:00
|
|
|
// TODO : How to handle url invalid/unknown [do] commands
|
2018-11-25 12:33:25 -05:00
|
|
|
header('Location: index.php');
|
|
|
|
break;
|
2018-06-07 07:56:05 -04:00
|
|
|
}
|
2018-11-25 12:33:25 -05:00
|
|
|
} else {
|
2017-11-23 18:09:36 -05:00
|
|
|
|
2018-01-18 16:57:12 -05:00
|
|
|
require_once("config.php");
|
2018-11-25 12:33:25 -05:00
|
|
|
require_once("template.php");
|
2018-01-18 16:57:12 -05:00
|
|
|
require_once("classes/constellation.php");
|
2017-11-23 18:09:36 -05:00
|
|
|
|
|
|
|
$offset = 0;
|
|
|
|
|
|
|
|
if (isset($_GET['ajax']))
|
|
|
|
{
|
|
|
|
$constellation->render_incidents(false,$_GET['offset'],5);
|
|
|
|
exit();
|
|
|
|
}else if (isset($_GET['offset']))
|
|
|
|
{
|
|
|
|
$offset = $_GET['offset'];
|
|
|
|
}
|
|
|
|
|
2018-06-07 07:21:35 -04:00
|
|
|
if (isset($_GET['subscriber_logout'])){
|
|
|
|
setcookie('tg_user', '');
|
2018-11-25 12:33:25 -05:00
|
|
|
setcookie('referer', '', time() - 3600);
|
|
|
|
$_SESSION['subscriber_valid'] = false;
|
|
|
|
unset($_SESSION['subscriber_userid']);
|
|
|
|
unset($_SESSION['subscriber_typeid']);
|
|
|
|
unset($_SESSION['subscriber_id']);
|
2018-06-07 07:21:35 -04:00
|
|
|
header('Location: index.php');
|
|
|
|
}
|
|
|
|
|
2018-01-07 14:39:10 -05:00
|
|
|
Template::render_header("Status");
|
2017-11-23 18:09:36 -05:00
|
|
|
?>
|
|
|
|
<div class="text-center">
|
2017-12-30 20:26:04 -05:00
|
|
|
<h2><?php echo _("Current status");?></h2>
|
2017-11-23 18:09:36 -05:00
|
|
|
</div>
|
|
|
|
<div id="current">
|
2020-06-16 14:20:51 -04:00
|
|
|
<?php $constellation->render_status();?>
|
2017-11-23 18:09:36 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php if ($mysqli->query("SELECT count(*) FROM status")->num_rows)
|
2020-06-16 14:20:51 -04:00
|
|
|
{
|
2017-11-23 18:09:36 -05:00
|
|
|
?>
|
|
|
|
<div id="timeline">
|
|
|
|
<div class="item">
|
|
|
|
<div class="timeline">
|
|
|
|
<div class="line text-muted"></div>
|
|
|
|
<?php
|
|
|
|
$constellation->render_incidents(true,$offset);
|
|
|
|
$constellation->render_incidents(false,$offset);
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-06-16 14:20:51 -04:00
|
|
|
<?php }
|
2017-11-23 18:09:36 -05:00
|
|
|
|
2018-01-07 14:39:10 -05:00
|
|
|
Template::render_footer();
|
2020-06-16 14:20:51 -04:00
|
|
|
}
|