Commit 4ad48ef4 authored by jurgbohn's avatar jurgbohn

Delete recovery-code after using it

parent d6ddc4a3
......@@ -19,6 +19,8 @@
*/
// TODO: Check if the request has expired before changing.
require_once('database.php');
require_once('templating.php');
require_once('utils/EmailAddressValidator.php');
......@@ -56,6 +58,8 @@ if (isset($_GET['code'])) {
. $mdb2->quote($email, 'text');
$mdb2->exec($sql);
$sql = "DELETE FROM Recovery_Request WHERE code=" . $mdb2->quote($_GET['code'], 'text');
$mdb2->exec($sql);
$content = "Hi!\n\nYour password has been set to " . $password . "\n\n - The Libre.fm Team";
sendEmail($content, $email);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment