From c71181b6ad393ee3bf9699a6b01a301d5c287ec2 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 16 Mar 2019 11:12:43 +0100 Subject: [PATCH 1/2] Mail sending works again I moved the email.php file to the right folder and added the sending to the right method --- includes/{ => classes}/email.php | 0 includes/classes/user.php | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) rename includes/{ => classes}/email.php (100%) diff --git a/includes/email.php b/includes/classes/email.php similarity index 100% rename from includes/email.php rename to includes/classes/email.php diff --git a/includes/classes/user.php b/includes/classes/user.php index aa8d55b..ae32b87 100644 --- a/includes/classes/user.php +++ b/includes/classes/user.php @@ -35,6 +35,7 @@ public static function verify_user($email, $password) { $sql = "SELECT * FROM " . self::$db_table . " WHERE "; $sql .= "email = '{$email}' "; + //$sql .= "AND status = 1 "; $sql .= "LIMIT 1"; // Sends the sql into the database, gets a array with the users back, only one because limit 1. @@ -277,7 +278,6 @@ public static function verify_new_user($username, $email, $password, $password_c $sql = "SELECT * FROM " . self::$db_table . " WHERE "; $sql .= "email = '{$email}' "; $sql .= "AND password = '{$password}' "; - $sql .= "AND status = 1 "; $sql .= "LIMIT 1"; $the_result_array = self::find_by_query($sql); @@ -334,6 +334,9 @@ public static function verify_new_user($username, $email, $password, $password_c $user->last_name = $last_name; $user->user_image = "1.png"; $user->joined = date("Y-m-d"); + $user->verify_code = md5($username . microtime()); + + Email::send_ActivationMail($email, $firstname, $user->verify_code); $user->create(); From 241392f47feb05315c62114406261d88f4d35dbe Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 16 Mar 2019 11:20:50 +0100 Subject: [PATCH 2/2] Activating works again I have added the needed includes to the activate.php file, still has some minor issues with session and activity log --- activate.php | 5 +++-- includes/classes/user.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/activate.php b/activate.php index 235ebe4..00fe6f3 100644 --- a/activate.php +++ b/activate.php @@ -1,4 +1,5 @@ - + + @@ -28,4 +29,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/includes/classes/user.php b/includes/classes/user.php index ae32b87..aabb99e 100644 --- a/includes/classes/user.php +++ b/includes/classes/user.php @@ -35,7 +35,7 @@ public static function verify_user($email, $password) { $sql = "SELECT * FROM " . self::$db_table . " WHERE "; $sql .= "email = '{$email}' "; - //$sql .= "AND status = 1 "; + $sql .= "AND status = 1 "; $sql .= "LIMIT 1"; // Sends the sql into the database, gets a array with the users back, only one because limit 1.