Compare commits

...

No commits in common. "master" and "abc94a1e8bc4f65dad86324459270a07188e4af2" have entirely different histories.

6 changed files with 63 additions and 123 deletions

50
auth.php Normal file
View File

@ -0,0 +1,50 @@
<?php
session_start();
$DATABASE_HOST = 'nerdcity.at';
$DATABASE_USER = 'webstatus';
$DATABASE_PASS = 'wPsCi548z6fKJB2u';
$DATABASE_NAME = 'webstatus';
$con = mysqli_connect($DATABASE_HOST, $DATABASE_USER, $DATABASE_PASS, $DATABASE_NAME);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
if ( !isset($_POST['username'], $_POST['password']) ) {
exit('Please fill both the username and password fields!');
}
if ($stmt = $con->prepare('SELECT id, password FROM accounts WHERE username = ?')) {
$stmt->bind_param('s', $_POST['username']);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
$stmt->bind_result($id, $password);
$stmt->fetch();
if (password_verify($_POST['password'], $password)) {
session_regenerate_id();
$_SESSION['loggedin'] = TRUE;
$_SESSION['name'] = $_POST['username'];
$_SESSION['id'] = $id;
header("Location: admin.php");
} else {
//Incorrect Data
echo 'Incorrect username and/or password!';
}
} else {
//Incorrect Data
echo 'Incorrect username and/or password!';
}
$stmt->close();
}
?>

View File

@ -42,21 +42,21 @@
.status {
max-width: 80%;
}
}
@media only screen and (max-width: 457px) {
.status {
max-width: 75%;
}
.status-text {
font-size: 0.8em;
}
.status-time {
margin-top: 2.5px;
font-size: 0.8em;
font-size: 0.8em;
}
}
@ -130,11 +130,11 @@
margin-left: -60px;
margin-top: -130px;
}
.timeline {
margin-top: 150px;
}
.timeline-info {
position: absolute;
margin-left: -33px;
@ -145,7 +145,7 @@
margin-left: -69px;
margin-top: -76px;
}
.vertical {
grid-gap: 3px;
grid-template-columns: 33% 33% 33% 33% 33% 33% 33%;
@ -193,29 +193,3 @@
margin: 2% auto;
}
}
/* COOKIE BANNER */
@media screen and (max-width: 600px){
.cookies {
height: 160px;
padding-right: 0;
}
.cookies .text {
width: 75%;
}
.cookies .cogs {
position: absolute;
top: 27%;
left: 15px;
font-size: 2em;
color: white;
}
.cookies button {
right: 39%;
bottom: 10px;
}
}

View File

@ -650,66 +650,3 @@ label::after {
text-decoration: underline;
text-decoration-color: #a6a6a6;
}
.cookies {
position: fixed;
width: 99.7%;
height: 100px;
border-color: #3f9066;
border-style: solid;
background-color: #222c3b;
bottom: 0;
left: 0;
}
.cookies .cogs {
position: absolute;
top: 35%;
left: 15px;
font-size: 2em;
color: white;
}
.cookies h1 {
left: 0px;
font-size: 20px;
color: white;
margin-top: 25px;
}
.cookies p {
margin-top: -10px;
color: #a6a6a6;
}
.cookies .text {
position: absolute;
left: 90px;
width: 65%;
}
.cookies button {
position: fixed;
right: 15px;
bottom: 35px;
cursor: pointer;
border-radius: 5px;
border: none;
outline: none;
transition: 0.7s;
width: 100px;
height: 40px;
font-size: 20px;
color: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0);
background-color: #83be4e;
}
.cookies button:hover {
background-color: #578230;
}
.cookies .handshake {
margin-left: 10px;
}

View File

@ -16,6 +16,7 @@
$instancename = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='instancename'"))["value"];
$autoreload_setting = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='autoreload'"))["value"];
$modular_setting = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='modularwindow'"))["value"];
$privacy = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='privacy'"))["value"];
$impressum = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='impressum'"))["value"];
$newtab = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='newtab'"))["value"];
@ -66,7 +67,7 @@
echo '
<div class="global-status">
<div id="status" class="status status-maintenance">
<div class="loading fa fa-cogs">
<div class="loading fa fa-times">
</div>
<div>
@ -78,7 +79,7 @@
echo '
<div class="global-status">
<div id="status" class="status status-okay">
<div class="loading fa fa-check">
<div class="loading fa fa-times">
</div>
<div>
@ -255,6 +256,7 @@ echo '</div>';
}
}
?>
<!-- FOOTER -->
<footer class="footer">
<p class="footer">Powered by <a class="underline" href="http://git.thiemoo.at/Givou/WebStatus.git" target="_blank">WebStatus</a></p>
@ -278,30 +280,6 @@ echo '</div>';
<span class="legend-lastdown legend-text"> Last time down</span>
<span class="legend-problems legend-text"> Offline / Problems</span>
</div>
<?php
if(isset($_GET["disclaimcookie"])) {
setcookie('disclaimed', 'true');
}
if(!isset($_COOKIE['disclaimed']) && !isset($_GET["disclaimcookie"])) {
echo '
<div class="cookies">
<i class="cogs fa fa-cogs" aria-hidden="true"></i>
<div class="text">
<h1>Cookie disclaimer</h1>
<p>This website only uses technical cookies to store session information or to hide this disclaimer!</p>
<a href="index.php?disclaimcookie"><button class="button-green button-up">Got it<i class="handshake fa fa-handshake-o" aria-hidden="true"></i></button></a>
</div>
</div>
';
}
?>
</body>

View File

@ -9,7 +9,7 @@ Made with love by Givou
#Demo
https://status.thiemoo.at
https://status.nerdcity.at
#License
This Project is Licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License

View File

@ -29,6 +29,7 @@ $newtab = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHER
if($role == "administrator") {
$autoreload_setting = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='autoreload'"))["value"];
$modular_setting = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='modularwindow'"))["value"];
}
?>