passwort ok
This commit is contained in:
@ -22,18 +22,20 @@ require __DIR__.'/classes/lib.php';
|
||||
|
||||
$db_connection = new Database();
|
||||
$conn = $db_connection->dbConnection();
|
||||
|
||||
|
||||
function updatePwtoken($email, $pwtoken)
|
||||
{
|
||||
global $conn;
|
||||
|
||||
$sql = "UPDATE dogs SET pwtoken=? WHERE email=?";
|
||||
$conn->prepare($sql)->execute([$pwtoken, $email]);
|
||||
$now = new DateTime();
|
||||
$sql = "UPDATE dogs SET pwtoken=?, pwt_time=? WHERE email=?";
|
||||
$conn->prepare($sql)->execute([$pwtoken, $now->format('Y-m-d H:i:s'), $email]);
|
||||
}
|
||||
|
||||
function sendMail($email, $pwtoken)
|
||||
{
|
||||
global $G_pwtoken_time_expire;
|
||||
$expires = new DateTime();
|
||||
$expires->add(new DateInterval('PT' . $G_pwtoken_time_expire . 'M'));
|
||||
$expiresStr = $expires->format('d.m.Y H:i:s');
|
||||
$mail = new CNetcupMailer();
|
||||
$mail->CharSet = "UTF-8";
|
||||
|
||||
@ -45,7 +47,10 @@ function sendMail($email, $pwtoken)
|
||||
|
||||
//Content
|
||||
$mail->Subject = 'Passwort zurücksetzen!';
|
||||
$mail->Body = '<h3>Neues Passwort setzen</h3><a href="https://hope-fly.de/dog/pwreset/'.$pwtoken.'" >Setzen</a>';
|
||||
$mail->Body =
|
||||
"<h3>Neues Passwort setzen</h3>
|
||||
<p>Gültig bis $expiresStr</p>
|
||||
<a href='https://hope-fly.de/dog/pwreset/$pwtoken'>Setzen</a>";
|
||||
|
||||
return $mail->send();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user