Logout
diff --git a/src/classes/user.php b/src/classes/user.php
index 567d1758..21f8957f 100644
--- a/src/classes/user.php
+++ b/src/classes/user.php
@@ -31,9 +31,10 @@ class User
global $database;
- $user = $database->query('SELECT * FROM `users`
- WHERE `id` = ' . $this->id . ';')
- ->fetch();
+ $user = $database
+ ->query('SELECT * FROM `users`
+ WHERE `id` = ' . $this->id . ';')
+ ->fetch();
$this->power = $user['power'];
}
diff --git a/src/classes/wishlist.php b/src/classes/wishlist.php
index e739291d..4b2fc560 100644
--- a/src/classes/wishlist.php
+++ b/src/classes/wishlist.php
@@ -149,6 +149,8 @@ class Wishlist
+ */
+
+use wishthis\Page;
+
+$page = new Page(__FILE__, 'Login as');
+
+if (isset($_POST['email'])) {
+ $email = $_POST['email'];
+
+ $user = $database->query('SELECT * FROM `users`
+ WHERE `email` = "' . $email . '";')
+ ->fetch();
+
+ $success = false !== $user;
+
+ if ($success) {
+ $_SESSION['user'] = $user;
+
+ echo '';
+ var_dump($user);
+ echo '';
+ }
+}
+
+$page->header();
+$page->navigation();
+?>
+
+
+
+
+footer();
diff --git a/src/pages/login.php b/src/pages/login.php
index 24023789..71c9adf1 100644
--- a/src/pages/login.php
+++ b/src/pages/login.php
@@ -19,11 +19,10 @@ if (isset($_POST['email'], $_POST['password'])) {
WHERE `email` = "' . $email . '"
AND `password` = "' . $password . '"
;');
- $user = $database->query(
- 'SELECT * FROM `users`
- WHERE `email` = "' . $email . '"
- AND `password` = "' . $password . '";'
- )->fetch();
+ $user = $database->query('SELECT * FROM `users`
+ WHERE `email` = "' . $email . '"
+ AND `password` = "' . $password . '";')
+ ->fetch();
$success = false !== $user;