e-mail address.'); // USERNAME AND E-MAIL } else { // NO MATCH $userinfo = $userservice->getObjectUserByUsername(POST_USERNAME); if ($userinfo == NULL) { $tplVars['error'] = T_('No matches found for that username.'); } elseif (POST_EMAIL != $userinfo->getEmail()) { $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->getId()); if (!($password = $userservice->generatePassword($userinfo->getId()))) { $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); ?>