aboutsummaryrefslogtreecommitdiff
path: root/www/functions
diff options
context:
space:
mode:
authorroot2014-04-16 13:31:02 +0200
committerroot2014-04-16 13:31:02 +0200
commit2441480079f68bd4bc15a12d7b9b47c18ce0bd52 (patch)
treecd7544145e3539004619dc963c4e6cbf3a7b6c5b /www/functions
parentb4e9313612dd341e43e5dc998469ec346adea8c6 (diff)
downloadjungegemeinde-2441480079f68bd4bc15a12d7b9b47c18ce0bd52.tar.gz
Added stuff.
Diffstat (limited to 'www/functions')
-rwxr-xr-xwww/functions/func_login.php19
-rwxr-xr-xwww/functions/func_user.php2
2 files changed, 13 insertions, 8 deletions
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){
</td><td>
&#160;
</td><td>
- ".date("j.n.Y / H:i:s", $info_ar[5])."
+ ".date("j.n.Y H:i:s", $info_ar[5])."
</td><td>
</td><td>
&#160;