if (!$ret) { $page->smarty->assign('error', "The email address is not recognised."); $sent = "true"; break; } else { // // Generate a forgottenpassword guid, store it in the user table // $guid = md5(uniqid()); $page->users->updatePassResetGuid($ret["id"], $guid); // // Send the email // $to = $ret["email"]; $subject = $page->settings->getSetting('title') . " Forgotten Password Request"; $contents = "Someone has requested a password reset for this email address. To reset the password use the following link.\n\n " . $page->serverurl . "forgottenpassword?action=reset&guid=" . $guid; Utility::sendEmail($to, $subject, $contents, $page->settings->getSetting('email')); $sent = "true"; break; } } break; } } $page->smarty->assign(['email' => $email, 'confirmed' => $confirmed, 'sent' => $sent]); $page->title = "Forgotten Password"; $page->meta_title = "Forgotten Password"; $page->meta_keywords = "forgotten,password,signup,registration"; $page->meta_description = "Forgotten Password"; $page->content = $page->smarty->fetch('forgottenpassword.tpl'); $page->render();
use newznab\utility\Utility; $captcha = new Captcha($page); if (isset($_POST["useremail"])) { // // send the contact info and report back to user. // if ($captcha->getError() === false) { $email = $_POST["useremail"]; $mailto = $page->settings->getSetting('email'); $mailsubj = "Contact Form Submitted"; $mailhead = "From: {$email}\n"; $mailbody = "Values submitted from contact form:\n"; while (list($key, $val) = each($_POST)) { if ($key != "submit") { $mailbody .= "{$key} : {$val}<br />\r\n"; } } if (!preg_match("/\n/i", $_POST["useremail"])) { Utility::sendEmail($mailto, $mailsubj, $mailbody, $email); } $msg = "<h2 style='text-align:center;'>Thank you for getting in touch with " . $page->settings->getSetting('title') . ".</h2>"; } } $page->smarty->assign("msg", $msg); $page->title = "Contact " . $page->settings->getSetting('title'); $page->meta_title = "Contact " . $page->settings->getSetting('title'); $page->meta_keywords = "contact us,contact,get in touch,email"; $page->meta_description = "Contact us at " . $page->settings->getSetting('title') . " and submit your feedback"; $page->content = $page->smarty->fetch('contact.tpl'); $page->render();
public function sendInvite($sitetitle, $siteemail, $serverurl, $uid, $emailto) { $sender = $this->getById($uid); $token = $this->hashSHA1(uniqid()); $subject = $sitetitle . " Invitation"; $url = $serverurl . "register?invitecode=" . $token; $contents = $sender["username"] . " has sent an invite to join " . $sitetitle . " to this email address. To accept the invitation click the following link.\n\n " . $url; Utility::sendEmail($emailto, $subject, $contents, $siteemail); $this->addInvite($uid, $token); return $url; }