From 2441480079f68bd4bc15a12d7b9b47c18ce0bd52 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 16 Apr 2014 13:31:02 +0200 Subject: Added stuff. --- www/failure.php | 90 ++++++++++++++++++++++++++++++++++++++------ www/functions/func_login.php | 19 ++++++---- www/functions/func_user.php | 2 +- www/index.php | 3 +- www/liste.php | 42 +++++++++++++++------ www/services.php | 2 +- 6 files changed, 124 insertions(+), 34 deletions(-) (limited to 'www') 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 @@ - Failure :: Junge Gemeinde Adlershof + <?php if($_GET["e"] != "401"){ echo "Failure ".$_GET["e"]; } else { echo "You are banned! "; } ?> :: Junge Gemeinde Adlershof - +
-

+

". $message ."

+ "; + echo "

Upps, it seems to be something went wrong, sorry.

Have a random quote to bridge the time. Try to reload the site or check for typos in the URL.

-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 "



Zitat Nummer #

-fetchArray()){ echo $row["spruch"]; } -?>
-
+ + echo "
+ + "; +} else { + echo " + + "; + echo " +

+
+

". $message ."

+ "; + + if($_GET["e"] != "401"){ + echo " +

+

Upps, it seems to be something went wrong, sorry.

+

Have a random quote to bridge the time. Try to reload the site or check for typos in the URL.

+
+ Zurück zur Startseite oder Passwort vergessen? + "; + + $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 " +
+
+


+ Zitat Nummer #". $zufall ."

+ "; + + while($row=$ergebnis->fetchArray()){ + echo $row["spruch"]; + } + + echo "
+
+ "; + } +} diff --git a/www/functions/func_login.php b/www/functions/func_login.php index ccd99db..d909180 100755 --- a/www/functions/func_login.php +++ b/www/functions/func_login.php @@ -10,8 +10,9 @@ function login($db){ $real_password = ""; if($username == "Guest"){ - $real_password_db = $db->query("SELECT email FROM jg"); - while($row = $real_passsword_db->fetchArray(SQLITE3_NUM)){ + + $real_password_db = $db->query("SELECT email FROM jg;"); + while($row = $real_password_db->fetchArray(SQLITE3_NUM)){ if($row[0] == $password){ $log_in = true; break; @@ -83,14 +84,13 @@ function brutforce_protection($db){ $time = $_SERVER["REQUEST_TIME"]; if($_SESSION["login_attempts"] <= 0){ - if($db->exec(" + $db->exec(" BEGIN TRANSACTION; INSERT INTO banned_user (id, login_attempts, ip, session_id, time) VALUES (NULL, ".$_SESSION["login_attempts"].", '".SQLite3::escapeString($remote_ip)."', '".SQLite3::escapeString($session_id)."', ".$time."); COMMIT; - ")){ - echo "You are banned. ;_;"; - } - exit; + "); + banned(); + } else { if($db->exec(" BEGIN TRANSACTION; @@ -127,3 +127,8 @@ function check_if_banned($db){ return false; // not longer banned } + +function banned(){ + header("Refresh: 0; ".$GLOBALS["scheme"].$_SERVER["HTTP_HOST"]."/banned"); + exit; +} diff --git a/www/functions/func_user.php b/www/functions/func_user.php index 8efd104..f044334 100755 --- a/www/functions/func_user.php +++ b/www/functions/func_user.php @@ -164,7 +164,7 @@ function account($db, $var){   - ".date("j.n.Y / H:i:s", $info_ar[5])." + ".date("j.n.Y H:i:s", $info_ar[5])."   diff --git a/www/index.php b/www/index.php index b6dce19..189e880 100755 --- a/www/index.php +++ b/www/index.php @@ -12,8 +12,7 @@ if(!isset($_SESSION["login_attempts"])){ require_once("include.php"); // handles all the stuff that needs to be included if(check_if_banned($db)){ - echo "You are banned. ;_;"; - exit; + banned(); } if(empty($_GET)){ diff --git a/www/liste.php b/www/liste.php index 1df43ce..211f485 100644 --- a/www/liste.php +++ b/www/liste.php @@ -1,10 +1,24 @@ - + + Adressliste :: Junge Gemeinde + + + + + + "; + include("static/head.php"); echo "