From: Alexander Schmidt Date: Wed, 8 May 2013 12:23:37 +0000 (+0200) Subject: added password recovery X-Git-Url: https://git.treefish.org/banana.git/commitdiff_plain/17e62c4bb73a987b44853d7b07a86c2b14160bda?hp=df32c63a6e9666eb062f806262aa23ed43c6eb99 added password recovery --- diff --git a/include/nav.inc b/include/nav.inc index 59f1950..9b37f9c 100644 --- a/include/nav.inc +++ b/include/nav.inc @@ -12,7 +12,9 @@ summary | register - | + | +recover password + | ADMIN

diff --git a/passrecover.php b/passrecover.php new file mode 100644 index 0000000..a041ccc --- /dev/null +++ b/passrecover.php @@ -0,0 +1,51 @@ +query("SELECT COUNT(*) FROM students WHERE mnumber = $mnumber")->fetch(PDO::FETCH_NUM)[0] == 0) { + print ''; + print ''; + print '
Mat.nummer not found
'; + } + else { + $userinfo = $db->query("SELECT firstname,lastname,email,password FROM students WHERE mnumber=$mnumber")->fetch(PDO::FETCH_NUM); + + // send password-email // + $nachricht = "Hello $userinfo[0]($mnumber)!\nThis is a password-recovery mail for the exercise " . $PREFS['exname'] . " (" . $PREFS['groupname'] . ").\nYour forgotten password is: $userinfo[3]\n\nYours,\nBanana."; + $header = 'From: banana@treefish.org' . "\r\n" . + 'Reply-To: noreply@treefish.org' . "\r\n" . + 'X-Mailer: PHP/' . phpversion(); + mail($userinfo[2], "Banana password-recovery: " . $PREFS['exname'] . " (" . $PREFS['groupname'] . ")", $nachricht, $header); + + print ""; + print ""; + print "
sent password to your email-address
"; + } + } + } +?> + +
+ + +
Password recovery
+ + + + + + + + + + +
Mat.nummer:
+