Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bootstrap #145

Merged
merged 47 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e8881a2
Wrap service with a div
Tealk Mar 18, 2021
d5a4bea
fix variables
Tealk Mar 18, 2021
c3fc84e
fix head.txt path
Tealk Mar 18, 2021
6ab36ff
fix variables
Tealk Mar 18, 2021
8fbee43
center status text on dashboard
Tealk Mar 18, 2021
b2cfd66
fix center status text on dashboard
Tealk Mar 18, 2021
ec86fe2
first steps for bootstrap v5.0
Tealk Mar 18, 2021
e5907f9
transparent input fields for new incidents
Tealk Mar 18, 2021
e2e4a96
jquerry deleted by mistake
Tealk Mar 18, 2021
bf3048b
files reformatted
Tealk Mar 18, 2021
7996958
html tags and container class
Tealk Mar 18, 2021
19c35b5
redesign login form
Tealk Mar 18, 2021
1253140
icons centered on settings page
Tealk Mar 18, 2021
82c9ecb
cleanup, classes lifted to bootstrap 5
Tealk Mar 18, 2021
c08f194
Button colored
Tealk Mar 18, 2021
1907f58
fix button position
Tealk Mar 18, 2021
546404f
remove border
Tealk Mar 18, 2021
c83e9c7
move vendor folder to root
Tealk Mar 19, 2021
9dfefbf
typo at fontawesome link, move jquerry out of admin area
Tealk Mar 19, 2021
5e7f0ff
redesign install.php
Tealk Mar 19, 2021
816d4cd
fix service status colore
Tealk Mar 19, 2021
236e1b1
unused file
Tealk Mar 19, 2021
44f67a2
fix policy.php
Tealk Mar 19, 2021
dbf76d1
add spaces between Services Groups
Tealk Mar 19, 2021
0490a91
spacing of services in the dashboard reduced
Tealk Mar 19, 2021
85f29d8
redesign options.php
Tealk Mar 19, 2021
4d79ae1
lable size unified
Tealk Mar 19, 2021
a5e154a
typo and hover colore delete services
Tealk Mar 19, 2021
ba17ae3
use bootstrap for delete link
Tealk Mar 19, 2021
421a0d2
Cleanup
Tealk Mar 19, 2021
c63c212
group headline colore
Tealk Mar 19, 2021
1c414ea
variable id inserted, css recreated(sass)
Tealk Mar 19, 2021
1fa788d
color value for links
Tealk Mar 19, 2021
c523ddb
remove test button
Tealk Mar 19, 2021
6cecff3
add darkmode switch
Tealk Mar 20, 2021
313c8b1
add darkmode detection
Tealk Mar 20, 2021
274c80d
redesign badge
Tealk Mar 20, 2021
88e5c6e
remove font-family
Tealk Mar 20, 2021
b7b370b
missin quotes
Tealk Mar 21, 2021
335f842
unnecessary code removed
Tealk Mar 21, 2021
bf5e0a6
mobile menu fixed
Tealk Mar 21, 2021
3a4e61b
dashboard status text alignment right
Tealk Mar 21, 2021
a76211d
fix card title width
Tealk Mar 21, 2021
ad8e5ed
add admin link
Tealk Apr 13, 2021
ee13a2e
fix public checkbox for dark toggle
Tealk Apr 13, 2021
6a556a6
split imprint and privacy
Tealk Apr 15, 2021
eb2f8b7
open translation in new tab and add security
Tealk Apr 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions 404.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<?php
<?php
require_once("template.php");
if (!file_exists("config.php"))
{
if (!file_exists("config.php")) {
require_once("install.php");
}else{
require_once("config.php");
} else {
require_once("config.php");

Template::render_header("Page not found");
Template::render_header("Page not found", "notfound");
?>
<div class="text-center">
<h1><?php echo _("Page Not Found");?></h1>
<p><?php echo _("Sorry, but the page you were trying to view does not exist.");?></p>
<h1><?php echo _("Page Not Found"); ?></h1>
<p><?php echo _("Sorry, but the page you were trying to view does not exist."); ?></p>
</div>
<?php
Template::render_footer();
}
<?php
Template::render_footer();
}
156 changes: 80 additions & 76 deletions admin/dashboard.php
Original file line number Diff line number Diff line change
@@ -1,110 +1,114 @@
<?php
$offset = 0;
if (isset($_GET['ajax']))
{
$constellation->render_incidents(false,$_GET['offset'],5);
if (isset($_GET['ajax'])) {
$constellation->render_incidents(false, $_GET['offset'], 5);
exit();
}else if (isset($_GET['offset']))
{
} else if (isset($_GET['offset'])) {
$offset = $_GET['offset'];
}

if (isset($_GET['new']) && $_GET['new']=="incident")
{
if (isset($_GET['new']) && $_GET['new'] == "incident") {
Incident::add();
}

if (isset($_GET['delete']))
{
if (isset($_GET['delete'])) {
Incident::delete($_GET['delete']);
}
if (isset($_GET['tasks'])) {
Queue::process_queue();
Queue::process_queue();
}

Template::render_header(_("Dashboard"), true);
Template::render_header(_("Dashboard"), "dashboard", true);
?>

<div class="text-center">
<h1><?php echo _("Dashboard");?></h1>
<h3><?php echo _("Welcome");?> <?php echo $user->get_name();?></h3>
</div>
<div class="text-center">
<h1><?php echo _("Dashboard"); ?></h1>
<h3><?php echo _("Welcome"); ?> <?php echo $user->get_name(); ?></h3>
</div>

<div id="current">
<?php
$services = $constellation->render_status(true);
?>
</div>
<div id="timeline">
<div class="item">
<div class="timeline">
<div class="line text-muted"></div>
<h3><?php echo _("New incident");?></h3>
<form id="new-incident" action="<?php echo WEB_URL;?>/admin/?new=incident" method="POST" class="clearfix">
<div class="panel">
<?php if (isset($message))
{?>
<p class="alert alert-danger"><?php echo $message?></p>
<div id="current">
<?php
$services = $constellation->render_status(true);
?>
</div>
<div id="timeline">
<div class="item">
<div class="timeline">
<div class="line text-muted"></div>
<h3><?php echo _("New incident"); ?></h3>
<form id="new-incident" action="<?php echo WEB_URL; ?>/admin/?new=incident" method="POST">
<div class="servicelist">
<?php if (isset($message)) { ?>
<p class="alert alert-danger"><?php echo $message ?></p>
<?php
} ?>
<div id="status-container" class="clearfix">
<?php
if (isset($_POST['services']) && !is_array($_POST['services']))
{
$post_services = array($_POST['services']);
}else{
$post_services = array();
}
<div id="status-container">
<?php
if (isset($_POST['services']) && !is_array($_POST['services'])) {
$post_services = array($_POST['services']);
} else {
$post_services = array();
}

foreach($services as $service){
?>
<div class="item clearfix">
<div class="service"><?php if ($service->get_status()!=-1){?><input type="checkbox" name="services[]" value="<?php echo $service->get_id(); ?>" <?php echo (in_array($service->get_id(), $post_services))?"checked":'';?> id="service-<?php echo $service->get_id(); ?>"><?php } ?><label for="service-<?php echo $service->get_id(); ?>"><?php echo $service->get_name(); ?></label></div>
<div class="status <?php if ($service->get_status()!=-1){echo $classes[$service->get_status()];}?>"><?php if ($service->get_status()!=-1){echo $statuses[$service->get_status()];}?></div>
</div>
<?php
}
?>
foreach ($services as $service) {
?>
<div class="input-group mb-2">
<?php if ($service->get_status() != -1) { ?>
<div class="input-group-text service">
<input type="checkbox" name="services[]" value="<?php echo $service->get_id(); ?>" <?php echo (in_array($service->get_id(), $post_services)) ? "checked" : ''; ?> id="service-<?php echo $service->get_id(); ?>">
</div>
<label id="name" class="input-group-text form-control" for="service-<?php echo $service->get_id(); ?>"><?php echo $service->get_name(); ?></label>
<label id="status" class="input-group-text btn-<?php if ($service->get_status() != -1) {
echo $classes[$service->get_status()];
} ?>" for="service-<?php echo $service->get_id(); ?>"><?php echo $statuses[$service->get_status()]; ?></label>
<?php } ?>
</div>
<?php
}
?>
</div>
</div>
<div class="panel new panel-primary">
<div class="panel-heading icon">
<i class="glyphicon glyphicon-info-sign"></i>
</div>
<div class="panel-heading clearfix">
<input type="text" name="title" id="title" placeholder="<?php echo _("Title");?>" value="<?php echo (isset($_POST['title'])?htmlspecialchars($_POST['title']):''); ?>" required> <span id="time"><input id="time_input" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="time" value="<?php echo (isset($_POST['time'])?htmlspecialchars($_POST['time']):''); ?>" class="pull-right" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" placeholder="<?php echo _("Time");?>">
<input id="time_input_js" name="time_js" type="hidden" class="pull-right">
</span>
</div>
<div class="panel-body">
<textarea name="text" placeholder="<?php echo _("Here goes your text...");?>" required><?php echo (isset($_POST['text'])?htmlspecialchars($_POST['text']):''); ?></textarea>
</div>
<div class="panel-footer clearfix">
<small><?php echo _("Posted by");?>: <?php echo $user->get_username();?> <span class="pull-right" id="end_time_wrapper"><?php echo _("Ending");?>:&nbsp;<input id="end_time" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="end_time" class="pull-right" placeholder="<?php echo _("End time");?>" value="<?php echo (isset($_POST['end_time'])?htmlspecialchars($_POST['end_time']):''); ?>"></span></small>
<input id="end_time_js" name="end_time_js" type="hidden" class="pull-right">
</div>
<article class="card new border-primary mb-3">
<div class="card-colore icon bg-primary"><i class="fa fa-info"></i></div>
<div class="card-colore card-header bg-primary border-primary">
<input type="text" name="title" id="title" placeholder="<?php echo _("Title"); ?>" value="<?php echo (isset($_POST['title']) ? htmlspecialchars($_POST['title']) : ''); ?>" required>
<span id="time" class="float-end">
<input id="time_input" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="time" value="<?php echo (isset($_POST['time']) ? htmlspecialchars($_POST['time']) : ''); ?>" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" placeholder="<?php echo _("Time"); ?>">
<input id="time_input_js" name="time_js" type="hidden">
</span>
</div>
<select class="form-control pull-left" id="type" name="type">
<div class="card-body text-primary">
<p class="card-text"><textarea name="text" placeholder="<?php echo _("Here goes your text..."); ?>" required><?php echo (isset($_POST['text']) ? htmlspecialchars($_POST['text']) : ''); ?></textarea></p>
</div>
<div class="card-footer bg-transparent border-primary">
<small><?php echo _("Posted by"); ?>: <?php echo $user->get_username(); ?></small>
<span class="float-end" id="end_time_wrapper"><?php echo _("Ending"); ?>:&nbsp;
<input id="end_time" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="end_time" placeholder="<?php echo _("End time"); ?>" value="<?php echo (isset($_POST['end_time']) ? htmlspecialchars($_POST['end_time']) : ''); ?>">
<input id="end_time_js" name="end_time_js" type="hidden">
</span>
</div>
</article>
<div class="input-group">
<select class="form-select" id="type" name="type">
<?php
if (isset($_POST['type']))
{
if (isset($_POST['type'])) {
$selected_status = $_POST['type'];
}else
{
} else {
$selected_status = 2;
}

foreach ($statuses as $key => $value) {
echo '<option value="'.$key.'"'.(($key==$selected_status)?' selected':'').'>'.$value.'</option>';
echo '<option value="' . $key . '"' . (($key == $selected_status) ? ' selected' : '') . '>' . $value . '</option>';
}
?>
</select>
<button type="submit" class="btn btn-primary pull-right"><?php echo _("Submit");?></button>
</form>
<?php
$constellation->render_incidents(true,$offset,5,true);
$constellation->render_incidents(false,$offset,5,true);
?>
</div>
<button class="card-colore btn btn-secondary" type="submit"><?php echo _("Submit"); ?></button>
</div>
</form>
<?php
$constellation->render_incidents(true, $offset, 5, true);
$constellation->render_incidents(false, $offset, 5, true);
?>
</div>
</div>
</div>
87 changes: 36 additions & 51 deletions admin/index.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?php

if (!file_exists("../config.php"))
{
if (!file_exists("../config.php")) {
header("Location: ../");
}
else{
} else {
require_once("../config.php");
require_once("../classes/constellation.php");
require_once("../classes/mailer.php");
Expand All @@ -14,11 +12,11 @@
require_once("../classes/queue.php");
require_once("../classes/db-class.php");
$db = new SSDB();
define("NAME", $db->getSetting($mysqli,"name"));
define("TITLE", $db->getSetting($mysqli,"title"));
define("WEB_URL", $db->getSetting($mysqli,"url"));
define("MAILER_NAME", $db->getSetting($mysqli,"mailer"));
define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email"));
define("NAME", $db->getSetting($mysqli, "name"));
define("TITLE", $db->getSetting($mysqli, "title"));
define("WEB_URL", $db->getSetting($mysqli, "url"));
define("MAILER_NAME", $db->getSetting($mysqli, "mailer"));
define("MAILER_ADDRESS", $db->getSetting($mysqli, "mailer_email"));

define("GOOGLE_RECAPTCHA", $db->getBooleanSetting($mysqli, "google_recaptcha"));
define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli, "google_recaptcha_secret"));
Expand All @@ -39,76 +37,63 @@

// Process the subscriber notification queue
// If CRON_SERVER_IP is not set, call notification once incident has been saved
if ( empty(CRON_SERVER_IP) )
{
if ( isset($_GET['sent']) && $_GET['sent'] == true )
{
if (empty(CRON_SERVER_IP)) {
if (isset($_GET['sent']) && $_GET['sent'] == true) {
Queue::process_queue();
}
}
else if ( isset($_GET['task']) && $_GET['task'] == 'cron' )
{
} else if (isset($_GET['task']) && $_GET['task'] == 'cron') {
// Else, base it on call to /admin?task=cron being called from IP defined by CRON_SERVER_IP
if (! empty(CRON_SERVER_IP) && $_SERVER['REMOTE_ADDR'] == CRON_SERVER_IP )
{
Queue::process_queue();
syslog(1, "CRON server processed");
}
else {
syslog(1, "CRON called from unauthorised server");
if (!empty(CRON_SERVER_IP) && $_SERVER['REMOTE_ADDR'] == CRON_SERVER_IP) {
Queue::process_queue();
syslog(1, "CRON server processed");
} else {
syslog(1, "CRON called from unauthorised server");
}
}


if(isset($_COOKIE['user'])&&!isset($_SESSION['user']))
{
if (isset($_COOKIE['user']) && !isset($_SESSION['user'])) {
User::restore_session();
}

if (!isset($_SESSION['user']))
{
if (isset($_GET['do']) && $_GET['do']=="lost-password")
{
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"){
} 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{
} else {
User::login();
require_once("login-form.php");
}
}
else
{
} else {
$user = new User($_SESSION['user']);
if (!$user->is_active())
{
if (!$user->is_active()) {
User::logout();
}

if (!isset($_GET['do'])){
if (!isset($_GET['do'])) {
$do = "";
}else{
} 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 'user':
require_once("user.php");
break;

case 'settings':
require_once("settings.php");
break;
case 'settings':
require_once("settings.php");
break;

case 'new-user':
require_once("new-user.php");
break;
case 'new-user':
require_once("new-user.php");
break;

case 'new-service':
case 'edit-service':
Expand All @@ -128,9 +113,9 @@
User::logout();
break;

default:
require_once("dashboard.php");
break;
default:
require_once("dashboard.php");
break;
}

Template::render_footer(true);
Expand Down
Loading