public function processform() { if (!isset($_POST['contactvalue'])) { return ''; } $time = substr($_POST['contactvalue'], strlen('_contactform')); if (time() > $time) { return $this->errmesg; } $email = trim($_POST['email']); if (!tcontentfilter::ValidateEmail($email)) { return sprintf('<p><strong>%s</strong></p>', tlocal::get('comment', 'invalidemail')); } $content = trim($_POST['content']); if (strlen($content) <= 10) { return sprintf('<p><strong>%s</strong></p>', tlocal::get('comment', 'emptycontent')); } if (false !== strpos($content, '<a href')) { return $this->errmesg; } foreach ($this->data['extra'] as $name => $title) { if (isset($_POST[$name])) { $content .= sprintf("\n\n%s:\n%s", $title, trim($_POST[$name])); } } tmailer::sendmail('', $email, '', litepublisher::$options->email, $this->subject, $content); return $this->success; }
public function processform() { if (!isset($_POST['contactvalue'])) { return ''; } $time = substr($_POST['contactvalue'], strlen('_contactform')); if (time() > $time) { return $this->errmesg; } $email = trim($_POST['email']); if (!tcontentfilter::ValidateEmail($email)) { return sprintf('<p><strong>%s</strong></p>', tlocal::get('comment', 'invalidemail')); } $url = trim($_POST['site']); if (empty($url) || strbegin($url, litepublisher::$site->url)) { return $this->errmesg; } if ($s = http::get($url)) { if (!strpos($s, '<meta name="generator" content="Lite Publisher')) { return $this->errmesg; } } else { return $this->errmesg; } $content = trim($_POST['content']); if (strlen($content) <= 15) { return sprintf('<p><strong>%s</strong></p>', tlocal::get('comment', 'emptycontent')); } $content = "{$url}\n" . $_POST['sitetitle'] . "\n\n" . $content; tmailer::sendmail('', $email, '', litepublisher::$options->email, $this->subject, $content); return $this->success; }
private function sendmail($id) { $item = $this->getitem($id); $args = targs::i(); $args->add($item); $args->id = $id; $status = dbversion ? $item['status'] : ($item['approved'] ? 'approved' : 'hold'); $args->localstatus = tlocal::get('commentstatus', $status); $args->adminurl = litepublisher::$site->url . '/admin/comments/pingback/' . litepublisher::$site->q . "id={$id}&post={$item['post']}&action"; $post = tpost::i($item['post']); $args->posttitle = $post->title; $args->postlink = $post->link; tlocal::usefile('mail'); $lang = tlocal::i('mailcomments'); $theme = ttheme::i(); $subject = $theme->parsearg($lang->pingbacksubj, $args); $body = $theme->parsearg($lang->pingbackbody, $args); tmailer::sendmail(litepublisher::$site->name, litepublisher::$options->fromemail, 'admin', litepublisher::$options->email, $subject, $body); }
public function reguser($email, $name) { $email = strtolower(trim($email)); if (!tcontentfilter::ValidateEmail($email)) { return $this->error(tlocal::get('comment', 'invalidemail')); } if (substr_count($email, '.', 0, strpos($email, '@')) > 2) { return $this->error(tlocal::get('comment', 'invalidemail')); } $users = tusers::i(); if ($id = $users->emailexists($email)) { if ('comuser' != $users->getvalue($id, 'status')) { return $this->error(tlocal::i()->invalidregdata); } } tsession::start('reguser-' . md5(litepublisher::$options->hash($email))); $_SESSION['email'] = $email; $_SESSION['name'] = $name; $confirm = md5rand(); $_SESSION['confirm'] = $confirm; $password = md5uniq(); $_SESSION['password'] = $password; $_SESSION['backurl'] = isset($_GET['backurl']) ? $_GET['backurl'] : ''; session_write_close(); $args = new targs(); $args->name = $name; $args->email = $email; $args->confirm = $confirm; $args->password = $password; $args->confirmurl = litepublisher::$site->url . '/admin/reguser/' . litepublisher::$site->q . 'email=' . urlencode($email); tlocal::usefile('mail'); $lang = tlocal::i('mailusers'); $theme = ttheme::i(); $subject = $theme->parsearg($lang->subject, $args); $body = $theme->parsearg($lang->body, $args); tmailer::sendmail(litepublisher::$site->name, litepublisher::$options->fromemail, $name, $email, $subject, $body); return true; }
public static function sendmail() { //tlocal::loadlang('admin'); if (!isset(tlocal::$data['installation'])) { tlocal::loadini(litepublisher::$paths->languages . 'admin' . litepublisher::$options->language . '.ini'); } $lang =& tlocal::$data['installation']; $body = sprintf($lang['body'], litepublisher::$options->url, litepublisher::$options->login, mailpassword); tmailer::sendmail('', litepublisher::$options->fromemail, '', litepublisher::$options->email, $lang['subject'], $body); }
public static function sendmail() { $lang = tlocal::$self->ini['installation']; $body = sprintf($lang['body'], litepublisher::$site->url, litepublisher::$options->email, mailpassword); tmailer::sendmail('', litepublisher::$options->fromemail, '', litepublisher::$options->email, $lang['subject'], $body); }
public function restore($email) { $lang = tlocal::admin('password'); $email = strtolower(trim($email)); if (empty($email)) { return $this->error($lang->error); } $id = $this->getiduser($email); if (!$id) { return $this->error($lang->error); } $args = new targs(); tsession::start('password-restore-' . md5(litepublisher::$options->hash($email))); if (!isset($_SESSION['count'])) { $_SESSION['count'] = 1; } else { if ($_SESSION['count']++ > 3) { return $this->error($lang->outofcount); } } $_SESSION['email'] = $email; $password = md5uniq(); $_SESSION['password'] = $password; $_SESSION['confirm'] = md5rand(); $args->confirm = $_SESSION['confirm']; session_write_close(); $args->email = urlencode($email); if ($id == 1) { $name = litepublisher::$site->author; } else { $item = tusers::i()->getitem($id); $args->add($item); $name = $item['name']; } $args->password = $password; tlocal::usefile('mail'); $lang = tlocal::i('mailpassword'); $theme = ttheme::i(); $subject = $theme->parsearg($lang->subject, $args); $body = $theme->parsearg($lang->body, $args); tmailer::sendmail(litepublisher::$site->name, litepublisher::$options->fromemail, $name, $email, $subject, $body); return true; }
public function added($filename, $content) { $filename = basename($filename); $site = litepublisher::$site; $subject = "[{$site->name}] new keywords added"; $body = "The new widget has been added on\n{$site->url}{$_SERVER['REQUEST_URI']}\n\nWidget content:\n\n{$content}\n\nYou can edit this links at:\n{$site->url}/admin/plugins/{$site->q}plugin=keywords&filename={$filename}\n"; tmailer::sendmail($site->name, litepublisher::$options->fromemail, 'admin', litepublisher::$options->email, $subject, $body); }