From d582054c77b22daeb08d2bff17794b9a69a20dd4 Mon Sep 17 00:00:00 2001 From: mensonge Date: Wed, 12 Dec 2007 16:29:16 +0000 Subject: import of scuttle 0.7.2 git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@1 b3834d28-1941-0410-a4f8-b48e95affb8f --- password.php | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 password.php (limited to 'password.php') diff --git a/password.php b/password.php new file mode 100644 index 0000000..b7daa70 --- /dev/null +++ b/password.php @@ -0,0 +1,72 @@ +e-mail address.'); + + // USERNAME AND E-MAIL + } else { + + // NO MATCH + if (!($userinfo = $userservice->getUserByUsername($_POST['username']))) { + $tplVars['error'] = T_('No matches found for that username.'); + + } elseif ($_POST['email'] != $userinfo['email']) { + $tplVars['error'] = T_('No matches found for that combination of username and e-mail address.'); + + // MATCH + } else { + + // GENERATE AND STORE PASSWORD + $password = $userservice->generatePassword($userinfo['uId']); + if (!($password = $userservice->generatePassword($userinfo['uId']))) { + $tplVars['error'] = T_('There was an error while generating your new password. Please try again.'); + + } else { + // SEND E-MAIL + $message = T_('Your new password is:') ."\n". $password ."\n\n". T_('To keep your bookmarks secure, you should change this password in your profile the next time you log in.'); + $message = wordwrap($message, 70); + $headers = 'From: '. $adminemail; + $mail = mail($_POST['email'], sprintf(T_('%s Account Information'), $sitename), $message); + + $tplVars['msg'] = sprintf(T_('New password generated and sent to %s'), $_POST['email']); + } + } + } +} + +$templatename = 'password.tpl'; +$tplVars['subtitle'] = T_('Forgotten Password'); +$tplVars['formaction'] = createURL('password'); +$templateservice->loadTemplate($templatename, $tplVars); +?> -- cgit v1.2.3