diff --git a/.gitignore b/.gitignore
index 49adb33..9479d1a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,7 +8,7 @@
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
-
+.idea/*
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
diff --git a/website/.htaccess b/website/.htaccess
new file mode 100644
index 0000000..5c0147b
--- /dev/null
+++ b/website/.htaccess
@@ -0,0 +1,14 @@
+Options +FollowSymLinks
+RewriteEngine On
+
+ErrorDocument 404 /error404.jpg
+
+RewriteCond %{SCRIPT_FILENAME} !-d
+RewriteCond %{SCRIPT_FILENAME} !-f
+
+# Resolve .php file for extensionless php urls
+RewriteRule ^([^/.]+)$ $1.php [L]
+
+RewriteRule ^([^/.]+)\/$ $1.php [L]
+
+RewriteRule ^profile/([A-z0-9]+)\/?$ profile.php?username=$1 [NC]
\ No newline at end of file
diff --git a/website/mysql_config.xml b/website/mysql_config.xml
deleted file mode 100644
index de2d929..0000000
--- a/website/mysql_config.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
- localhost
- myhyvesbookplus
- mhbp
- qdtboXhCHJyL2szC
-
\ No newline at end of file
diff --git a/website/public/API/loadMessages.php b/website/public/API/loadMessages.php
new file mode 100644
index 0000000..fef9db7
--- /dev/null
+++ b/website/public/API/loadMessages.php
@@ -0,0 +1,13 @@
+
+ window.onload=checkLoggedIn();
+ ";
+ }
+
// Define variables and set to empty values
$uname = $psw ="";
$loginErr ="";
// Trying to login
if ($_SERVER["REQUEST_METHOD"] == "POST") {
- $uname=strtolower($_POST["uname"]);
// Empty username or password field
if (empty($_POST["uname"]) || empty($_POST["psw"])) {
$loginErr = "Gebruikersnaam of wachtwoord is niet ingevuld";
}
else {
- $psw=$_POST["psw"];
- $hash=hashPassword()["password"];
- $userid=hashPassword()["userID"];
+ $uname = strtolower(test_input($_POST["uname"]));
+ $psw = test_input($_POST["psw"]);
+ $hash = getUser()["password"];
+ $userid = getUser()["userID"];
// If there's an account, go to the profile page
- if(password_verify($psw.$uname, $hash)) {
+ if(password_verify($psw, $hash)) {
$_SESSION["userID"] = $userid;
header("location: profile.php");
@@ -41,5 +48,18 @@
/* This view adds login view */
include("../views/login-view.php");
?>
+
+
+