summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rw-r--r--www/functions.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/www/functions.php b/www/functions.php
index d0d848e..0a50294 100644
--- a/www/functions.php
+++ b/www/functions.php
@@ -1,9 +1,9 @@
<?
-/* --LOGIN-- */
-
require_once("select_function.php");
+/* --LOGIN-- */
+
function login($db){
if($_SERVER['REQUEST_METHOD'] == 'POST') {
@@ -59,16 +59,16 @@ function login($db){
if($_SESSION["login"]){
header("Refresh: 0; /");
} else {
- foreach ($_GET as $argument => $value) {
+/* foreach ($_GET as $argument => $value) {
if(preg_match("/success/",$argument))
$logout="Log out was succesfull!";
}
if($logout){
- echo $logout;
+ header("Refresh: 0; login?reason=logout&username=" . $unsafe_username);
}
-/* echo "<form method='post' action='/login'>
+ echo "<form method='post' action='/login'>
<p>Name: <input type='text' name='username'></p>
<p>Password: <input type='password' name='password'>
<p><input type='submit' name='submit' value='login'></p>
@@ -85,7 +85,7 @@ function login($db){
function logout(){
session_destroy();
- header("Refresh: 0; /login?success");
+ header("Refresh: 0; login?reason=logout&username=" . $unsafe_username);
exit;
}