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; }
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 send() { $backuper = tbackuper::i(); $filename = $backuper->createbackup(); $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR; $ini = parse_ini_file($dir . 'about.ini'); tmailer::SendAttachmentToAdmin("[backup] {$filename}", $ini['body'], basename($filename), file_get_contents($filename)); }
private function sendmail() { $args = new targs(); $args->url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $args->ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; tlocal::usefile('mail'); $lang = tlocal::i('notfound'); $theme = ttheme::i(); $subject = $theme->parsearg($lang->subject, $args); $body = $theme->parsearg($lang->body, $args); tmailer::sendtoadmin($subject, $body, true); }
private function notify(tticket $ticket) { ttheme::$vars['ticket'] = $ticket; $args = new targs(); $args->adminurl = litepublisher::$site->url . '/admin/tickets/editor/' . litepublisher::$site->q . 'id=' . $ticket->id; tlocal::usefile('mail'); $lang = tlocal::i('mailticket'); $lang->addsearch('ticket'); $theme = ttheme::i(); $subject = $theme->parsearg($lang->subject, $args); $body = $theme->parsearg($lang->body, $args); tmailer::sendtoadmin($subject, $body); }
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); }
private function sendmail($id, $event) { $item = $this->getitem($id); $args = targs::i(); $args->add($item); $lang = tlocal::i('foaf'); $event = 'mail' . $event; $args->event = $lang->{$event}; tlocal::usefile('mail'); $lang = tlocal::i('mailfoaf'); $theme = ttheme::i(); $subject = $theme->parsearg($lang->subject, $args); $body = $theme->parsearg($lang->body, $args); tmailer::sendtoadmin($subject, $body); }
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); }
function update586() { $menus = tadminmenus::i(); $id = $menus->url2id('/admin/logout/'); if (!$id) { $id = $menus->addfake('/admin/logout/', tlocal::i()->logout); } $menus->items[$id]['order'] = 9999999; $menus->save(); tjsonserver::i()->addevent('comments_get_logged', 'tjsoncomments', 'comments_get_logged'); $man = tdbmanager::i(); $prefix = strtolower(litepublisher::$options->dbconfig['prefix']); $tables = $man->gettables(); foreach ($tables as $table) { if (strbegin(strtolower($table), $prefix)) { $man->query("alter table {$table} ENGINE = MYISAM"); } } if (isset(litepublisher::$options->solt)) { return; } litepublisher::$options->solt = md5uniq(); litepublisher::$options->emptyhash = basemd5(litepublisher::$secret . litepublisher::$options->solt); litepublisher::$options->securecookie = false; litepublisher::$options->authenabled = true; if (function_exists('mcrypt_encrypt')) { litepublisher::$options->data['dbconfig']['password'] = _encrypt(str_rot13(base64_decode(litepublisher::$options->data['dbconfig']['password'])), litepublisher::$options->solt . litepublisher::$secret); } $expired = time() + 31536000; $cookie = md5uniq(); //litepublisher::$options->setcookies($cookie, $expired); $subdir = litepublisher::$site->subdir . '/'; setcookie('litepubl_user_id', litepublisher::$options->user, $expired, $subdir, false); setcookie('litepubl_user', $cookie, $expired, $subdir, false); setcookie('litepubl_user_flag', 'true', $expired, $subdir, false); $cookie = basemd5((string) $cookie . litepublisher::$options->solt . litepublisher::$secret); litepublisher::$options->data['cookiehash'] = $cookie; litepublisher::$options->cookieexpired = $expired; unset(litepublisher::$options->data['cookie'], litepublisher::$options->data['authcookie']); $password = md5uniq(); litepublisher::$options->data['password'] = basemd5($password . litepublisher::$options->solt . litepublisher::$secret); unset(litepublisher::$classes->items['tauthdigest']); litepublisher::$classes->items['tableprop'] = array('kernel.admin.php', '', 'htmlresource.class.php'); litepublisher::$classes->save(); tusers::i()->db->update("password = ''", 'id > 0'); $theme = ttheme::i(); $args = new targs(); $args->password = $password; $subj = $theme->parsearg('[$site.name] Смена пароля', $args); $body = $theme->parsearg('Внимание! Обновление LitePublisher 5.86 включает в себя новые алгоритмы безопасности и поэтому старые пароли больше не будут работать. Скрипт сгенерировал для вас новый пароль: $password Пожалуйста, используйте его или получите другой на странице восстановления пароля: $site.url/admin/password/ Сохранение старых паролей невозможно потому, что в системе никогда не хранились пароли, а только их хеши. Приносим извенения за доставленные неудобства. Новые алгоритмы защиты значительно усиливают безопасность вашего сайта, также не забывайте регулярно менять пароли для лучшей безопасности. На сайтах, у которых псетители могли залогиниватся также сброшены все пароли, но им не была сделана рассылка уведомлений о смене паролей. При попытки залогинится таким посетителям будет предложено восстановить пароль. Для залогинивающихся через соцсети будет просто предложено еще раз авторизоваться (ранее они даже и не имели паролей) ', $args); tmailer::sendtoadmin($subj, $body); }
<?php Header('Cache-Control: no-cache, must-revalidate'); Header('Pragma: no-cache'); error_reporting(E_ALL | E_NOTICE | E_STRICT | E_WARNING); ini_set('display_errors', 1); define('litepublisher_mode', 'xmlrpc'); include 'index.php'; for ($i = 1; $i <= 3; $i++) { tmailer::sendtoadmin("{$i} test", "{$i} body text"); }
public function cronsendmail($id) { $comments = tcomments::i(); try { $item = $comments->getitem($id); } catch (Exception $e) { return; } $subscribers = $this->getitems($item['post']); if (!$subscribers || count($subscribers) == 0) { return; } $comment = $comments->getcomment($id); ttheme::$vars['comment'] = $comment; tlocal::usefile('mail'); $lang = tlocal::i('mailcomments'); $theme = ttheme::i(); $args = new targs(); $subject = $theme->parsearg($lang->subscribesubj, $args); $body = $theme->parsearg($lang->subscribebody, $args); $body .= "\n"; $adminurl = litepublisher::$site->url . '/admin/subscribers/'; $users = tusers::i(); $users->loaditems($subscribers); $list = array(); foreach ($subscribers as $uid) { $user = $users->getitem($uid); if ($user['status'] == 'hold') { continue; } $email = $user['email']; if (empty($email)) { continue; } if ($email == $comment->email) { continue; } if (in_array($email, $this->blacklist)) { continue; } $admin = $adminurl; if ('comuser' == $user['status']) { $admin .= litepublisher::$site->q . 'auth='; if (empty($user['cookie'])) { $user['cookie'] = md5uniq(); $users->setvalue($user['id'], 'cookie', $user['cookie']); } $admin .= rawurlencode($user['cookie']); } $list[] = array('fromname' => litepublisher::$site->name, 'fromemail' => $this->fromemail, 'toname' => $user['name'], 'toemail' => $email, 'subject' => $subject, 'body' => $body . $admin); } if (count($list)) { tmailer::sendlist($list); } }
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); }
public function check() { $result = ''; $lang = tlocal::i('foaf'); $foaf = tfoaf::i(); $items = $foaf->getapproved(0); foreach ($items as $id) { $item = $foaf->getitem($item); if (!$this->checkfriend($item['foafurl'])) { $result .= sprintf($lang->mailerror, $item['nick'], $item['blog'], $item['url']); $foaf->lock(); $foaf->setvalue($id, 'errors', ++$item['errors']); if ($item['errors'] > 3) { $foaf->setstatus($id, 'error'); $result .= sprintf($lang->manyerrors, $item['errors']); } $foaf->unlock(); } } if ($result != '') { $result = $lang->founderrors . $result; $result = str_replace('\\n', "\n", $result); $args = targs::i(); $args->errors = $result; tlocal::usefile('mail'); $lang = tlocal::i('mailfoaf'); $theme = ttheme::i(); $subject = $theme->parsearg($lang->errorsubj, $args); $body = $theme->parsearg($lang->errorbody, $args); tmailer::sendtoadmin($subject, $body); } }
public function send_mail($id) { $comments = tcomments::i(); $comment = $comments->getcomment($id); //ignore admin comments if ($comment->author == 1) { return; } ttheme::$vars['comment'] = $comment; $args = new targs(); $adminurl = litepublisher::$site->url . '/admin/comments/' . litepublisher::$site->q . "id={$id}"; $ref = md5(litepublisher::$secret . $adminurl . litepublisher::$options->solt); $adminurl .= "&ref={$ref}&action"; $args->adminurl = $adminurl; tlocal::usefile('mail'); $lang = tlocal::i('mailcomments'); $theme = ttheme::i(); $subject = $theme->parsearg($lang->subject, $args); $body = $theme->parsearg($lang->body, $args); return tmailer::sendtoadmin($subject, $body, false); }
public function sendexceptions() { $filename = litepublisher::$paths->data . 'logs' . DIRECTORY_SEPARATOR . 'exceptionsmail.log'; if (!file_exists($filename)) { return; } $time = @filectime($filename); if ($time === false || $time + 3600 > time()) { return; } $s = file_get_contents($filename); tfilestorage::delete($filename); tmailer::SendAttachmentToAdmin('[error] ' . litepublisher::$site->name, 'See attachment', 'errors.txt', $s); sleep(2); }
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 send($fromname, $fromemail, $toname, $toemail, $subj, $body) { if ($this->smtp->Mail($this->login) && $this->smtp->Recipient($toemail)) { $options = litepublisher::$options; $subj = $subj == '' ? '' : '=?utf-8?B?' . @base64_encode($subj) . '?='; $date = date('r'); $from = tmailer::CreateEmail($fromname, $fromemail); $to = tmailer::CreateEmail($toname, $toemail); $this->smtp->data("To: {$to}\nFrom: {$from}\nReply-To: {$from}\nContent-Type: text/plain; charset=\"utf-8\"\nContent-Transfer-Encoding: 8bit\nDate: {$date}\nSubject: {$subj}\nX-Priority: 3\nX-Mailer: Lite Publisher ver {$options->version}\n\n{$body}"); return true; } return false; }
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; }