diff options
Diffstat (limited to 'www/failure.php')
| -rw-r--r-- | www/failure.php | 90 |
1 files changed, 79 insertions, 11 deletions
diff --git a/www/failure.php b/www/failure.php index 976e414..7461a28 100644 --- a/www/failure.php +++ b/www/failure.php @@ -1,15 +1,28 @@ <?php session_start(); + +$scheme="http://"; + +if(isset($_SERVER["HTTPS"])){ + if($_SERVER["HTTPS"] == "on"){ + $scheme="https://"; + } +} + +include("functions/func_login.php"); $db = new SQLite3("../database/sqlite.db"); -include("include.php"); +if($_GET["e"] != "401" && check_if_banned($db)){ + banned(); +} +//include("include.php"); if(!empty($_GET)){ switch($_GET["e"]){ case("401"): - $message = "Access forbidden"; + $message = "You are banned!"; break; case("403"): - $message = "Access forbidden"; + $message = "I could do that... but access forbidden"; break; case("404"): @@ -36,40 +49,95 @@ if(!empty($_GET)){ header("Refresh: 0; https://".$_SERVER["HTTP_HOST"]."/"); exit; $message = "200 / Everything is okay."; + $_GET["e"] = 200; } ?><!doctype html> <html> <head> - <title>Failure :: Junge Gemeinde Adlershof</title> + <title><?php if($_GET["e"] != "401"){ echo "Failure ".$_GET["e"]; } else { echo "You are banned! "; } ?> :: Junge Gemeinde Adlershof</title> <meta http-equiv='Content-type' content='text/html; charset=utf-8' /> <link rel='stylesheet' type='text/css' href='/static/hyperstyle.css' /> <link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'> </head> -<?php include("static/head.php"); ?> +<?php + +if($_SESSION["login"]){ + include("static/head.php"); + + echo " <br><br> <div id='content_container' align='center'> - <div class='kleineschrift'><div class='ueberschrift'><b><p style='text-decoration:underline;'><?php echo $message; ?></p></b></div></div> + <div class='kleineschrift'><div class='ueberschrift'><b><p style='text-decoration:underline;'>". $message ."</p></b></div></div> + "; + echo " <br><br> <p style='font-size:14px'>Upps, it seems to be something went wrong, sorry.</p> <p style='font-size:14px'>Have a random quote to bridge the time. Try to reload the site or check for typos in the URL.</p> -<?php + "; + $rows = $db->query("SELECT count(*) as count FROM sprueche;"); $row = $rows->fetchArray(); $numRows = $row["count"]; $zufall = mt_rand(1,$numRows); $ergebnis = $db->query("SELECT * FROM sprueche where id=$zufall;"); -?> + + echo " <br> <div id='container' align='center'> <br><br><br> <b>Zitat Nummer #<?php echo $zufall; ?></b><br><br><div id='bgcolor'> -<?php + "; + while($row=$ergebnis->fetchArray()){ echo $row["spruch"]; } -?></div> -</div> + + echo "</div> + </div> + "; +} else { + echo " + <body link='#000000' vlink='#000000' alink='#FF0000'> + "; + echo " +<br><br> +<div id='content_container' align='center'> + <div class='kleineschrift'><div class='ueberschrift'><b><p style='text-decoration:underline;'>". $message ."</p></b></div></div> + "; + + if($_GET["e"] != "401"){ + echo " + <br><br> + <p style='font-size:14px'>Upps, it seems to be something went wrong, sorry.</p> + <p style='font-size:14px'>Have a random quote to bridge the time. Try to reload the site or check for typos in the URL.</p> + <br> + <font style='font-size:14px'>Zurück zur <a href='/login'><u>Startseite</u></a> oder <a href='/password_recover'><u>Passwort vergessen?</u></a></font> + "; + + $rows = $db->query("SELECT count(*) as count FROM sprueche;"); + $row = $rows->fetchArray(); + $numRows = $row["count"]; + + $zufall = mt_rand(1,$numRows); + $ergebnis = $db->query("SELECT * FROM sprueche where id=$zufall;"); + + echo " + <br> + <div id='container' align='center'> + <br><br><br> + <b>Zitat Nummer #". $zufall ."</b><br><br><div id='bgcolor'> + "; + + while($row=$ergebnis->fetchArray()){ + echo $row["spruch"]; + } + + echo "</div> + </div> + "; + } +} |
