Ejemplo n.º 1
0
                $message = <<<HTML
Вы получили это письмо, так как зарегистрированы на сайте
{$config['home_url']} и хотите изменить основной почтовый адрес.
Вы желаете изменить почтовый адрес с текущего ({$row['user_email']}) на {$email}
Для того чтобы Ваш основной e-mail на сайте {$config['home_url']} был
изменен, Вам необходимо пройти по ссылке:
{$config['home_url']}index.php?go=settings&code1={$hash}

Внимание: не забудьте, что после изменения почтового адреса при входе
на сайт Вам нужно будет указывать новый адрес электронной почты.

Если Вы не посылали запрос на изменение почтового адреса,
проигнорируйте это письмо.С уважением,
Администрация {$config['home_url']}
HTML;
                $mail->send($row['user_email'], 'Изменение почтового адреса', $message);
                //Вставляем в БД код 1
                $db->query("INSERT INTO `" . PREFIX . "_restore` SET email = '{$email}', hash = '{$hash}', ip = '{$_IP}'");
                $salt = "abchefghjkmnpqrstuvwxyz0123456789";
                for ($i = 0; $i < 15; $i++) {
                    $rand_lost .= $salt[rand(0, 33)];
                }
                $hash = md5($server_time . $row['user_email'] . rand(0, 300000) . $rand_lost);
                $message = <<<HTML
Вы получили это письмо, так как зарегистрированы на сайте
{$config['home_url']} и хотите изменить основной почтовый адрес.
Вы желаете изменить почтовый адрес с текущего ({$row['user_email']}) на {$email}
Для того чтобы Ваш основной e-mail на сайте {$config['home_url']} был
изменен, Вам необходимо пройти по ссылке:
{$config['home_url']}index.php?go=settings&code2={$hash}
Ejemplo n.º 2
0
                 if ($row_owner['user_last_visit'] >= $update_time) {
                     $db->query("INSERT INTO `" . PREFIX . "_updates` SET for_user_id = '{$for_user_id}', from_user_id = '{$user_info['user_id']}', type = '8', date = '{$server_time}', text = '{$msg}', user_photo = '{$user_info['user_photo']}', user_search_pref = '{$user_info['user_search_pref']}', lnk = '/messages'");
                     mozg_create_cache("user_{$for_user_id}/updates", 1);
                 }
                 //Отправка уведомления на E-mail
                 if ($config['news_mail_8'] == 'yes' and $user_id != $for_user_id) {
                     $rowUserEmail = $db->super_query("SELECT user_name, user_email FROM `" . PREFIX . "_users` WHERE user_id = '" . $for_user_id . "'");
                     if ($rowUserEmail['user_email']) {
                         include_once ENGINE_DIR . '/classes/mail.php';
                         $mail = new dle_mail($config);
                         $rowMyInfo = $db->super_query("SELECT user_search_pref FROM `" . PREFIX . "_users` WHERE user_id = '" . $user_id . "'");
                         $rowEmailTpl = $db->super_query("SELECT text FROM `" . PREFIX . "_mail_tpl` WHERE id = '8'");
                         $rowEmailTpl['text'] = str_replace('{%user%}', $rowUserEmail['user_name'], $rowEmailTpl['text']);
                         $rowEmailTpl['text'] = str_replace('{%user-friend%}', $rowMyInfo['user_search_pref'], $rowEmailTpl['text']);
                         $rowEmailTpl['text'] = str_replace('{%rec-link%}', $config['home_url'] . 'messages/show/' . $dbid, $rowEmailTpl['text']);
                         $mail->send($rowUserEmail['user_email'], 'Новое персональное сообщение', $rowEmailTpl['text']);
                     }
                 }
             } else {
                 echo 'err_privacy';
             }
         } else {
             echo 'no_user';
         }
     } else {
         echo 'max_strlen';
     }
     die;
     break;
     //################### Удаление сообщения ###################//
 //################### Удаление сообщения ###################//
Ejemplo n.º 3
0
             //Добавляем +1 юзеру для оповещания
             $cntCacheNews = mozg_cache("user_{$for_user_id}/new_gift");
             mozg_create_cache("user_{$for_user_id}/new_gift", $cntCacheNews + 1);
             mozg_mass_clear_cache_file("user_{$for_user_id}/profile_{$for_user_id}|user_{$for_user_id}/gifts");
             //Отправка уведомления на E-mail
             if ($config['news_mail_6'] == 'yes') {
                 $rowUserEmail = $db->super_query("SELECT user_name, user_email FROM `" . PREFIX . "_users` WHERE user_id = '" . $for_user_id . "'");
                 if ($rowUserEmail['user_email']) {
                     include_once ENGINE_DIR . '/classes/mail.php';
                     $mail = new dle_mail($config);
                     $rowMyInfo = $db->super_query("SELECT user_search_pref FROM `" . PREFIX . "_users` WHERE user_id = '" . $user_id . "'");
                     $rowEmailTpl = $db->super_query("SELECT text FROM `" . PREFIX . "_mail_tpl` WHERE id = '6'");
                     $rowEmailTpl['text'] = str_replace('{%user%}', $rowUserEmail['user_name'], $rowEmailTpl['text']);
                     $rowEmailTpl['text'] = str_replace('{%user-friend%}', $rowMyInfo['user_search_pref'], $rowEmailTpl['text']);
                     $rowEmailTpl['text'] = str_replace('{%rec-link%}', $config['home_url'] . 'gifts' . $for_user_id, $rowEmailTpl['text']);
                     $mail->send($rowUserEmail['user_email'], 'Вам отправили новый подарок', $rowEmailTpl['text']);
                 }
             }
         } else {
             echo '1';
         }
     }
     die;
     break;
     //################### Удаление подарка ###################//
 //################### Удаление подарка ###################//
 case "del":
     NoAjaxQuery();
     $gid = intval($_POST['gid']);
     $row = $db->super_query("SELECT uid FROM `" . PREFIX . "_gifts` WHERE gid = '{$gid}'");
     if ($user_id == $row['uid']) {
Ejemplo n.º 4
0
 function main($page)
 {
     /* Login */
     if (!$this->member_id['name']) {
         return $this->lang['pay_need_login'];
     }
     /* Status */
     if (!$this->plugin_config['status']) {
         return $this->T_msg($this->lang['pay_error_title'], $this->lang['cabinet_off'], "Refund");
     }
     /* Post */
     if (isset($_POST['submit'])) {
         $post_requisites = $this->db->safesql($_POST['bs_requisites']);
         $post_summa = $this->pay_api->bf_convert($_POST['bs_summa']);
         $post_commission = $this->pay_api->bf_convert($post_summa / 100 * $this->plugin_config['com']);
         $error = "";
         if (!isset($_POST['bs_hash']) or $_POST['bs_hash'] != $this->hash()) {
             $error = $this->lang['pay_hash_error'];
         } else {
             if (!$post_summa) {
                 $error = $this->lang['pay_summa_error'];
             } else {
                 if (!$post_requisites) {
                     $error = str_replace("{link_to_user}", $this->config_dle['http_home_url'] . "user/" . urlencode($this->member_id['name']), $this->lang['refund_error_requisites']);
                 } else {
                     if ($post_summa > $this->member_id[$this->config['fname']]) {
                         $error = $this->lang['refund_error_balance'];
                     } else {
                         if ($post_summa < $this->plugin_config['minimum']) {
                             $error = $this->lang['refund_error_minimum'] . $this->plugin_config['minimum'] . " " . $this->pay_api->bf_declOfNum($this->plugin_config['minimum']);
                         }
                     }
                 }
             }
         }
         if ($error) {
             return $this->T_msg($this->lang['pay_error_title'], $error, "Refund");
         }
         // - Creat moneyback
         $redund_id = $this->db_creat_refund($this->member_id['name'], $post_summa, $post_commission, $post_requisites);
         $this->pay_api->minus($this->member_id['name'], $post_summa, $this->lang['refund_msgOk'], $this->pay_api->bf_declOfNum($post_summa), "refund", $redund_id);
         // - email
         if ($this->plugin_config['email']) {
             include_once ENGINE_DIR . '/classes/mail.class.php';
             $mail = new dle_mail($this->config_dle, true);
             $mail->send($this->config_dle['admin_mail'], $this->lang['refund_email_title'], $this->lang['refund_email_msg'] . $this->config_dle['http_home_url'] . $this->config_dle['admin_path'] . "?mod=billing&c=Refund");
             unset($mail);
         }
     }
     /* PAGE */
     $this->set_element("{hash}", $this->hash());
     $this->set_element("{requisites}", $this->xfield($this->plugin_config['requisites']));
     $this->set_element("{minimum}", $this->plugin_config['minimum']);
     $this->set_element("{minimum_valuta}", $this->pay_api->bf_declOfNum($this->plugin_config['minimum']));
     $this->set_element("{commission}", $this->plugin_config['com']);
     $this->set_element("{mask}", $this->plugin_config['format']);
     /* History */
     $tpl = $this->load("Refund");
     $log = "";
     $tpl_log = $this->T_preg_match($tpl, '~\\[history\\](.*?)\\[/history\\]~is');
     $tpl_log_null = $this->T_preg_match($tpl, '~\\[not_history\\](.*?)\\[/not_history\\]~is');
     $tpl_log_date = $this->T_preg_match($tpl_log, '~\\{date=(.*?)\\}~is');
     $this->db_where(array("refund_user = '******' " => $this->member_id['name']));
     $history = $this->db_get_refund($page, $this->config['paging']);
     $num_history = $this->db_get_refund_num();
     foreach ($history as $history_id => $history_value) {
         $time_log_theme = $tpl_log;
         $time_log_theme = str_replace("{date=" . $tpl_log_date . "}", langdate($tpl_log_date, $history_value['refund_date']), $time_log_theme);
         $time_log_theme = str_replace("{refund_requisites}", $history_value['refund_requisites'], $time_log_theme);
         $time_log_theme = str_replace("{refund_commission}", $history_value['refund_commission'], $time_log_theme);
         $time_log_theme = str_replace("{refund_commission_valuta}", $this->pay_api->bf_declOfNum($history_value['refund_commission']), $time_log_theme);
         $time_log_theme = str_replace("{refund_summa}", $history_value['refund_summa'], $time_log_theme);
         $time_log_theme = str_replace("{refund_summa_valuta}", $this->pay_api->bf_declOfNum($history_value['refund_summa']), $time_log_theme);
         $time_log_theme = str_replace("{refund_status}", $history_value['refund_date_return'] ? "<font color=\"green\">" . langdate($tpl_log_date, $history_value['refund_date_return']) . "</a>" : "<font color=\"red\">" . $this->lang['refund_wait'] . "</a>", $time_log_theme);
         $log .= $time_log_theme;
     }
     /* Paging */
     if ($num_history > $this->config['paging']) {
         $tpl_log_page = $this->T_preg_match($tpl, '~\\[paging\\](.*?)\\[/paging\\]~is');
         $tpl_log_page_link = $this->T_preg_match($tpl, '~\\[page_link\\](.*?)\\[/page_link\\]~is');
         $tpl_log_page_this = $this->T_preg_match($tpl, '~\\[page_this\\](.*?)\\[/page_this\\]~is');
         $tpl_log_page = preg_replace("'\\[page_link\\].*?\\[/page_link\\]'si", $this->pay_api->bf_paging($num_history, $page, $this->config_dle['http_home_url'] . $this->config['page'] . ".html/Refund/main/{p}", $tpl_log_page_link, $tpl_log_page_this), $tpl_log_page);
         $tpl_log_page = preg_replace("'\\[page_this\\].*?\\[/page_this\\]'si", "", $tpl_log_page);
         $this->set_element_block("paging", $tpl_log_page);
     } else {
         $this->set_element_block("paging", "");
     }
     /* LOG NULL */
     if ($log) {
         $this->set_element_block("not_history", "");
     } else {
         $this->set_element_block("not_history", $tpl_log_null);
     }
     $this->set_element_block("history", $log);
     /* History END */
     $tpl = $this->load("Refund");
     $this->set_element("{content}", $tpl);
     return $this->load("cabinet", "Refund");
 }
Ejemplo n.º 5
0
    if ($row['user_from'] == $member_id['name']) {
        echo $lang['error_complaint_2'];
        die;
    }
    $db->query("SELECT id FROM " . PREFIX . "_complaint WHERE p_id='{$id}'");
    if ($db->num_rows()) {
        echo $lang['error_complaint_1'];
        die;
    }
    $row['text'] = "<div class=\"quote\">" . stripslashes($row['text']) . "</div>";
    $text = $db->safesql($row['text'] . $text);
    $member_id['name'] = $db->safesql($member_id['name']);
    $row['user_from'] = $db->safesql($row['user_from']);
    $db->query("INSERT INTO " . PREFIX . "_complaint (`p_id`, `c_id`, `n_id`, `text`, `from`, `to`, `date`) values ('{$row['id']}', '0', '0', '{$text}', '{$member_id['name']}', '{$row['user_from']}', '{$_TIME}')");
    if ($config['allow_complaint_mail']) {
        $mail->send($config['admin_mail'], $lang['mail_complaint'], $lang['mail_complaint_1']);
    }
} elseif ($_POST['action'] == "comments") {
    if (!$is_logged) {
        die("error");
    }
    if (!$id or !$text) {
        die("error");
    }
    $row = $db->super_query("SELECT id, autor FROM " . PREFIX . "_comments WHERE id='{$id}'");
    if (!$row['id']) {
        die("Operation not Allowed");
    }
    if ($row['autor'] == $member_id['name']) {
        echo $lang['error_complaint_2'];
        die;
Ejemplo n.º 6
0
             $error = true;
         }
         if (!$data['from_name']) {
             $error = true;
         }
         $mail->from = $data['from_email'];
     } else {
         $mail->from = $member_id['email'];
     }
     if (strlen($data['text']) < 10 || strlen($data['subj']) < 5) {
         $error = true;
     }
     if ($error) {
         die("Error");
     }
     $mail->send($email['email'], $data['subj'], $data['text']);
     if ($mail->send_error) {
         die("Error");
     }
     echo "ok";
     break;
 case "allow_site":
     $allow = intval($_REQUEST['allow']) ? 1 : 0;
     if (!in_array($_REQUEST['type'], array('vacancy', 'resume'))) {
         exit;
     }
     if ((MODER_EDIT || MODER_DEL) && $id) {
         if ($_REQUEST['type'] == "vacancy") {
             $dbase->Update('job_vacancies', array("allow_site" => $allow), array('id' => $id));
         } else {
             $dbase->Update('job_resumes', array("allow_site" => $allow), array('id' => $id));
Ejemplo n.º 7
0
             if (!$approve and $config['mail_news']) {
                 include_once ENGINE_DIR . '/classes/mail.class.php';
                 $row = $db->super_query("SELECT * FROM " . PREFIX . "_email WHERE name='new_news' LIMIT 0,1");
                 $mail = new dle_mail($config, $row['use_html']);
                 $row['template'] = stripslashes($row['template']);
                 $row['template'] = str_replace("{%username%}", $member_id['name'], $row['template']);
                 $row['template'] = str_replace("{%date%}", langdate("j F Y H:i", $added_time, true), $row['template']);
                 $row['template'] = str_replace("{%title%}", stripslashes(stripslashes($title)), $row['template']);
                 $category_list = explode(",", $category_list);
                 $my_cat = array();
                 foreach ($category_list as $element) {
                     $my_cat[] = $cat_info[$element]['name'];
                 }
                 $my_cat = stripslashes(implode(', ', $my_cat));
                 $row['template'] = str_replace("{%category%}", $my_cat, $row['template']);
                 $mail->send($config['admin_mail'], $lang['mail_news'], $row['template']);
             }
         }
         if ($config['allow_alt_url']) {
             msgbox($lang['add_ok'], "{$msg} <a href=\"{$config['http_home_url']}" . "addnews.html\">{$lang['add_noch']}</a> {$lang['add_or']} <a href=\"{$config['http_home_url']}\">{$lang['all_prev']}</a>");
         } else {
             msgbox($lang['add_ok'], "{$msg} <a href=\"{$PHP_SELF}?do=addnews\">{$lang['add_noch']}</a> {$lang['add_or']} <a href=\"{$config['http_home_url']}\">{$lang['all_prev']}</a>");
         }
         if ($approve) {
             clear_cache(array('news_', 'related_', 'tagscloud_', 'archives_', 'calendar_', 'topnews_', 'rss', 'stats'));
         }
     }
 } elseif ($is_logged and $user_group[$member_id['user_group']]['allow_adds']) {
     $tpl->load_template('addnews.tpl');
     $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
     $found = false;
Ejemplo n.º 8
0
                     } else {
                         $cntCacheNews = mozg_cache('user_' . $check_video['owner_user_id'] . '/new_news');
                         mozg_create_cache('user_' . $check_video['owner_user_id'] . '/new_news', $cntCacheNews + 1);
                     }
                     //Отправка уведомления на E-mail
                     if ($config['news_mail_3'] == 'yes') {
                         $rowUserEmail = $db->super_query("SELECT user_name, user_email FROM `" . PREFIX . "_users` WHERE user_id = '" . $check_video['owner_user_id'] . "'");
                         if ($rowUserEmail['user_email']) {
                             include_once ENGINE_DIR . '/classes/mail.php';
                             $mail = new dle_mail($config);
                             $rowMyInfo = $db->super_query("SELECT user_search_pref FROM `" . PREFIX . "_users` WHERE user_id = '" . $user_id . "'");
                             $rowEmailTpl = $db->super_query("SELECT text FROM `" . PREFIX . "_mail_tpl` WHERE id = '3'");
                             $rowEmailTpl['text'] = str_replace('{%user%}', $rowUserEmail['user_name'], $rowEmailTpl['text']);
                             $rowEmailTpl['text'] = str_replace('{%user-friend%}', $rowMyInfo['user_search_pref'], $rowEmailTpl['text']);
                             $rowEmailTpl['text'] = str_replace('{%rec-link%}', $config['home_url'] . 'video' . $check_video['owner_user_id'] . '_' . $vid, $rowEmailTpl['text']);
                             $mail->send($rowUserEmail['user_email'], 'Новый комментарий к Вашей видеозаписи', $rowEmailTpl['text']);
                         }
                     }
                 }
                 AjaxTpl();
                 //Чистим кеш
                 mozg_mass_clear_cache_file("user_{$check_video['owner_user_id']}/page_videos_user|user_{$check_video['owner_user_id']}/page_videos_user_friends|user_{$check_video['owner_user_id']}/page_videos_user_all");
             }
         }
     } else {
         echo 'error';
     }
     die;
     break;
     //################### Удаления комментария ###################//
 //################### Удаления комментария ###################//
Ejemplo n.º 9
0
function SendMail($mail_template, $id)
{
    global $job;
    switch ($mail_template) {
        case "vacancy":
            $field_aray = Vacancy::$fields;
            $subj = $job->lang['vacancy_mail_subj'];
            $url = $job->tpl->GetUrl(array('action' => 'vacancy', "id" => $id));
            $moder = CheckGroupAllow('vacancy_add_no_moder') ? $job->lang['no'] : $job->lang['yes'];
            break;
        case "resume":
            $field_aray = Resume::$fields;
            $subj = $job->lang['resume_mail_subj'];
            $moder = CheckGroupAllow('resume_add_no_moder') ? $job->lang['no'] : $job->lang['yes'];
            $url = $job->tpl->GetUrl(array('action' => 'resume', "id" => $id));
            break;
        case 'company':
            $field_aray = array();
            $subj = $job->lang['company_mail_subj'];
            $url = $job->GetCompanyURL($id, $_POST['alt_name']);
            break;
    }
    if ($job->config['general_inform'] && $job->config['general_email']) {
        if (file_exists(ENGINE_DIR . "/job/mail_templates/" . $mail_template . ".txt")) {
            $content = file_get_contents(ENGINE_DIR . "/job/mail_templates/" . $mail_template . ".txt");
            $content = str_replace("{site_url}", $GLOBALS['config']['http_home_url'], $content);
            $content = str_replace("{url}", $url, $content);
            $content = str_replace("{moder}", $moder, $content);
            if (!empty($_POST['sphere_id'])) {
                $content = str_replace("{sphere}", $job->spheres[$_POST['sphere_id']], $content);
            }
            if (!empty($_POST['specialty_id'])) {
                $content = str_replace("{specialty}", $job->specialties[$_POST['specialty_id']], $content);
            }
            if (!empty($_POST['country_id'])) {
                $content = str_replace("{country}", $job->countries[$_POST['country_id']], $content);
            }
            if (!empty($_POST['city_id'])) {
                $content = str_replace("{city}", $job->cities[$_POST['city_id']], $content);
            }
            if (!empty($_POST['currency'])) {
                $content = str_replace("{currency}", Job::$currecy_array[$_POST['currency']], $content);
            }
            foreach ($_POST as $key => $value) {
                if (key_exists($key, $field_aray)) {
                    $content = str_replace("{" . $key . "}", $field_aray[$key][$value], $content);
                } else {
                    $content = str_replace("{" . $key . "}", $value, $content);
                }
            }
            // $content = preg_replace('#{.+?}#si', '', $content);
            include_once DLE_CLASSES . 'mail.class.php';
            $mail = new dle_mail($GLOBALS['config']);
            $mail->from = $GLOBALS['config']['admin_mail'];
            $mail->send($job->config['general_email'], $subj, $content);
        }
    }
}
Ejemplo n.º 10
0
        include_once ENGINE_DIR . '/classes/mail.class.php';
        $mail = new dle_mail($config);
        $row = $db->super_query("SELECT template FROM " . PREFIX . "_email WHERE name='feed_mail' LIMIT 0,1");
        $row['template'] = stripslashes($row['template']);
        $row['template'] = str_replace("{%username_to%}", $recipient['fullname'], $row['template']);
        $row['template'] = str_replace("{%username_from%}", $name, $row['template']);
        $row['template'] = str_replace("{%text%}", $message, $row['template']);
        $row['template'] = str_replace("{%ip%}", $_SERVER['REMOTE_ADDR'], $row['template']);
        $row['template'] = str_replace("{%email%}", $email, $row['template']);
        $row['template'] = str_replace("{%group%}", $user_group[$member_id['user_group']]['group_name'], $row['template']);
        if ($config['use_admin_mail']) {
            $mail->from = $config['admin_mail'];
        } else {
            $mail->from = $email;
        }
        $mail->send($recipient['email'], $subject, $row['template']);
        if ($mail->send_error) {
            msgbox($lang['all_info'], $mail->smtp_msg);
        } else {
            if ($user_group[$member_id['user_group']]['max_mail_day']) {
                if (!$is_logged) {
                    $check_user = $_IP;
                } else {
                    $check_user = $db->safesql($member_id['name']);
                }
                $db->query("INSERT INTO " . PREFIX . "_sendlog (user, date, flag) values ('{$check_user}', '{$_TIME}', '2')");
            }
            msgbox($lang['feed_ok_1'], "{$lang['feed_ok_2']} <a href=\"{$config['http_home_url']}\">{$lang['feed_ok_4']}</a>");
        }
    }
} else {
Ejemplo n.º 11
0
             $h_mail[$t] = $row['email'];
         } else {
             $bcc[$t][] = $row['email'];
         }
         $i++;
         if ($i == 6) {
             $i = 0;
             $t++;
         }
         $step++;
     }
     $db->free();
     foreach ($h_mail as $key => $email) {
         $mail->bcc = $bcc[$key];
         $message_send = str_replace("{%user%}", $lang['nl_info_2'], $message);
         $mail->send($email, $title, $message_send);
     }
 } else {
     $db->query("SELECT email, name, fullname FROM " . USERPREFIX . "_users" . $where . " ORDER BY user_id DESC LIMIT " . $startfrom . "," . $limit);
     $db->close();
     while ($row = $db->get_row()) {
         if ($row['fullname']) {
             $message_send = str_replace("{%user%}", $row['fullname'], $message);
         } else {
             $message_send = str_replace("{%user%}", $row['name'], $message);
         }
         $mail->send($row['email'], $title, $message_send);
         $step++;
     }
     $db->free();
 }
Ejemplo n.º 12
0
         $wall->compile('content');
         $wall->select();
     }
     mozg_clear_cache_file('user_' . $for_user_id . '/profile_' . $for_user_id);
     //Отправка уведомления на E-mail
     if ($config['news_mail_7'] == 'yes' and $user_id != $for_user_id) {
         $rowUserEmail = $db->super_query("SELECT user_name, user_email FROM `" . PREFIX . "_users` WHERE user_id = '" . $for_user_id . "'");
         if ($rowUserEmail['user_email']) {
             include_once ENGINE_DIR . '/classes/mail.php';
             $mail = new dle_mail($config);
             $rowMyInfo = $db->super_query("SELECT user_search_pref FROM `" . PREFIX . "_users` WHERE user_id = '" . $user_id . "'");
             $rowEmailTpl = $db->super_query("SELECT text FROM `" . PREFIX . "_mail_tpl` WHERE id = '7'");
             $rowEmailTpl['text'] = str_replace('{%user%}', $rowUserEmail['user_name'], $rowEmailTpl['text']);
             $rowEmailTpl['text'] = str_replace('{%user-friend%}', $rowMyInfo['user_search_pref'], $rowEmailTpl['text']);
             $rowEmailTpl['text'] = str_replace('{%rec-link%}', $config['home_url'] . 'wall' . $for_user_id . '_' . $dbid, $rowEmailTpl['text']);
             $mail->send($rowUserEmail['user_email'], 'Новая запись на стене', $rowEmailTpl['text']);
         }
     }
     //Если добавлен комментарий к записи то просто обновляем нужную часть, тоесть только часть комментариев, но не всю стену
 } else {
     //Выводим кол-во комментов к записи
     $row = $db->super_query("SELECT fasts_num FROM `" . PREFIX . "_wall` WHERE id = '{$fast_comm_id}'");
     $record_fasts_num = $row['fasts_num'];
     if ($record_fasts_num > 3) {
         $limit_comm_num = $row['fasts_num'] - 3;
     } else {
         $limit_comm_num = 0;
     }
     $wall->comm_query("SELECT SQL_CALC_FOUND_ROWS tb1.id, author_user_id, text, add_date, fasts_num, tb2.user_photo, user_search_pref, user_last_visit FROM `" . PREFIX . "_wall` tb1, `" . PREFIX . "_users` tb2 WHERE tb1.author_user_id = tb2.user_id AND tb1.fast_comm_id = '{$fast_comm_id}' ORDER by `add_date` ASC LIMIT {$limit_comm_num}, 3");
     if ($_POST['type'] == 1) {
         $wall->comm_template('news/news.tpl');
Ejemplo n.º 13
0
     $_POST['text'] = ajax_utf8($_POST['text']);
     $sql_ = $db->super_query("SELECT SQL_CALC_FOUND_ROWS user_search_pref, user_email FROM `" . PREFIX . "_users` ORDER by `user_id` ASC LIMIT " . $lastid . ", " . $limit, 1);
     if ($sql_) {
         include_once ENGINE_DIR . '/classes/mail.php';
         $mail = new dle_mail($config, true);
         foreach ($sql_ as $row) {
             $find = array('/data:/i', '/about:/i', '/vbscript:/i', '/onclick/i', '/onload/i', '/onunload/i', '/onabort/i', '/onerror/i', '/onblur/i', '/onchange/i', '/onfocus/i', '/onreset/i', '/onsubmit/i', '/ondblclick/i', '/onkeydown/i', '/onkeypress/i', '/onkeyup/i', '/onmousedown/i', '/onmouseup/i', '/onmouseover/i', '/onmouseout/i', '/onselect/i', '/javascript/i', '/javascript/i');
             $replace = array("d&#097;ta:", "&#097;bout:", "vbscript<b></b>:", "&#111;nclick", "&#111;nload", "&#111;nunload", "&#111;nabort", "&#111;nerror", "&#111;nblur", "&#111;nchange", "&#111;nfocus", "&#111;nreset", "&#111;nsubmit", "&#111;ndblclick", "&#111;nkeydown", "&#111;nkeypress", "&#111;nkeyup", "&#111;nmousedown", "&#111;nmouseup", "&#111;nmouseover", "&#111;nmouseout", "&#111;nselect", "j&#097;vascript");
             $message_send = preg_replace($find, $replace, $_POST['text']);
             $message_send = preg_replace("#<iframe#i", "&lt;iframe", $message_send);
             $message_send = preg_replace("#<script#i", "&lt;script", $message_send);
             $message_send = str_replace("<?", "&lt;?", $message_send);
             $message_send = str_replace("?>", "?&gt;", $message_send);
             $message_send = $db->safesql($message_send);
             $message_send = str_replace("{%user-name%}", $row['user_search_pref'], $_POST['text']);
             $mail->send($row['user_email'], $title, $message_send);
             echo 'ok';
         }
     }
     die;
     break;
 default:
     $users = $db->super_query("SELECT COUNT(*) AS cnt FROM `" . PREFIX . "_users`");
     if ($users['cnt'] < 20) {
         $max_users = $users['cnt'];
     } else {
         $max_users = 20;
     }
     echoheader();
     echo '<div id="form">';
     echohtmlstart('Подготовка к отправке сообщений');
Ejemplo n.º 14
0
 function send_msg($type, $user_id, $array)
 {
     if (!$user_id) {
         return false;
     }
     /* PM */
     if ($this->config_mail[$type . "_staus_pm"]) {
         $title = html_entity_decode($this->config_mail[$type . "_title"]);
         $text = html_entity_decode($this->config_mail[$type]);
         $text = str_replace("\r\n", "<br />", $text);
         $text = str_replace("&#036;", "\$", $text);
         $text = str_replace("&#123;", "{", $text);
         $text = str_replace("&#125;", "}", $text);
         foreach ($array as $key => $value) {
             $text = str_replace($key, $value, $text);
             $title = str_replace($key, $value, $title);
         }
         $this->pay_api->send_pm_to_user($user_id, $title, $text, $this->config['admin']);
     }
     /* Email */
     if ($this->config_mail[$type . "_staus_email"]) {
         $get_usert = $this->db_search_user_by_id($user_id);
         if (!$get_usert['email']) {
             return false;
         }
         $title = html_entity_decode($this->config_mail[$type . "_title"]);
         $text = html_entity_decode($this->config_mail[$type]);
         $text = str_replace("\r\n", "<br />", $text);
         $text = str_replace("&#036;", "\$", $text);
         $text = str_replace("&#123;", "{", $text);
         $text = str_replace("&#125;", "}", $text);
         foreach ($array as $key => $value) {
             $text = str_replace($key, $value, $text);
             $title = str_replace($key, $value, $title);
         }
         include_once ENGINE_DIR . '/classes/mail.class.php';
         $mail = new dle_mail($this->config_dle, true);
         $mail->send($get_usert['email'], $title, $text);
         unset($mail);
     }
     return true;
 }
Ejemplo n.º 15
0
        }
        if ($send_mail_log) {
            $salt = "abchefghjkmnpqrstuvwxyz0123456789";
            srand((double) microtime() * 1000000);
            $rand_lost = "";
            for ($i = 0; $i < 15; $i++) {
                $rand_lost .= $salt[rand(0, 33)];
            }
            $hashid = sha1(md5($row['user_id'] . $row['email']) . time() . $rand_lost);
            $db->query("DELETE FROM " . USERPREFIX . "_mail_log WHERE user_id='{$row['user_id']}'");
            $db->query("INSERT INTO " . USERPREFIX . "_mail_log (user_id, mail, hash) values ('{$row['user_id']}', '{$email}', '{$hashid}')");
            include_once ENGINE_DIR . '/classes/mail.class.php';
            $mail = new dle_mail($config);
            $link = $config['http_home_url'] . "index.php?do=changemail&id=" . $hashid;
            $message = $lang['change_mail_1'] . " {$email} {$lang['change_mail_2']}\n\n{$lang['change_mail_3']} {$link}\n\n{$lang['lost_mfg']} " . $config['http_home_url'];
            $mail->send($email, $lang['change_mail_subj'], $message);
            msgbox($lang['all_info'], "<ul>" . $lang['change_mail'] . "</ul>");
        }
    }
}
//####################################################################################################################
//         Просмотр профиля пользователя
//####################################################################################################################
$user_found = FALSE;
if (preg_match("/[\\||\\'|\\<|\\>|\"|\\!|\\?|\$|\\@|\\/|\\\\|\\&\\~\\*\\+]/", $name)) {
    die("Not allowed user name!");
}
$sql_result = $db->query("SELECT * FROM " . USERPREFIX . "_users where name = '{$user}'");
$tpl->load_template('userinfo.tpl');
while ($row = $db->get_row($sql_result)) {
    $user_found = TRUE;
Ejemplo n.º 16
0
                 //Добавляем +1 юзеру для оповещания
                 $cntCacheNews = mozg_cache('user_' . $check_photo['user_id'] . '/new_news');
                 mozg_create_cache('user_' . $check_photo['user_id'] . '/new_news', $cntCacheNews + 1);
             }
             //Отправка уведомления на E-mail
             if ($config['news_mail_4'] == 'yes') {
                 $rowUserEmail = $db->super_query("SELECT user_name, user_email FROM `" . PREFIX . "_users` WHERE user_id = '" . $check_photo['user_id'] . "'");
                 if ($rowUserEmail['user_email']) {
                     include_once ENGINE_DIR . '/classes/mail.php';
                     $mail = new dle_mail($config);
                     $rowMyInfo = $db->super_query("SELECT user_search_pref FROM `" . PREFIX . "_users` WHERE user_id = '" . $user_id . "'");
                     $rowEmailTpl = $db->super_query("SELECT text FROM `" . PREFIX . "_mail_tpl` WHERE id = '4'");
                     $rowEmailTpl['text'] = str_replace('{%user%}', $rowUserEmail['user_name'], $rowEmailTpl['text']);
                     $rowEmailTpl['text'] = str_replace('{%user-friend%}', $rowMyInfo['user_search_pref'], $rowEmailTpl['text']);
                     $rowEmailTpl['text'] = str_replace('{%rec-link%}', $config['home_url'] . 'photo' . $check_photo['user_id'] . '_' . $vid . '_' . $check_photo['album_id'], $rowEmailTpl['text']);
                     $mail->send($rowUserEmail['user_email'], 'Новый комментарий к Вашей фотографии', $rowEmailTpl['text']);
                 }
             }
         }
         //Чистим кеш кол-во комментов
         mozg_mass_clear_cache_file("user_{$check_photo['user_id']}/albums_{$check_photo['user_id']}_comm|user_{$check_photo['user_id']}/albums_{$check_photo['user_id']}_comm_all|user_{$check_photo['user_id']}/albums_{$check_photo['user_id']}_comm_friends");
         AjaxTpl();
     } else {
         echo 'err_privacy';
     }
     break;
     //################### Удаление комментария ###################//
 //################### Удаление комментария ###################//
 case "del_comm":
     NoAjaxQuery();
     $hash = $db->safesql(substr($_POST['hash'], 0, 32));
Ejemplo n.º 17
0
                //Вставляем в базу
                $db->query("INSERT INTO `" . PREFIX . "_restore` SET email = '{$email}', hash = '{$hash}', ip = '{$_IP}'");
                //Отправляем письмо на почту для воостановления
                include_once ENGINE_DIR . '/classes/mail.php';
                $mail = new dle_mail($config);
                $message = <<<HTML
Здравствуйте, {$check['user_name']}.

Чтобы сменить ваш пароль, пройдите по этой ссылке:
{$config['home_url']}restore?act=prefinish&h={$hash}

Мы благодарим Вас за участие в жизни нашего сайта.

{$config['home_url']}
HTML;
                $mail->send($email, $lang['lost_subj'], $message);
            }
            die;
            break;
            //################### Страница смены пароля ###################//
        //################### Страница смены пароля ###################//
        case "prefinish":
            $hash = $db->safesql(strip_data($_GET['h']));
            $row = $db->super_query("SELECT email FROM `" . PREFIX . "_restore` WHERE hash = '{$hash}' AND ip = '{$_IP}'");
            if ($row) {
                $info = $db->super_query("SELECT user_name FROM `" . PREFIX . "_users` WHERE user_email = '{$row['email']}'");
                $tpl->load_template('restore/prefinish.tpl');
                $tpl->set('{name}', $info['user_name']);
                $salt = "abchefghjkmnpqrstuvwxyz0123456789";
                for ($i = 0; $i < 15; $i++) {
                    $rand_lost .= $salt[rand(0, 33)];
Ejemplo n.º 18
0
function register_wait_user($social_user, $user_id, $name, $email, $id, $key)
{
    global $db, $config, $user_group, $popup, $js_popup, $lang;
    $id = intval($id);
    if (!$id) {
        if (function_exists('openssl_random_pseudo_bytes') && (version_compare(PHP_VERSION, '5.3.4') >= 0 || strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')) {
            $stronghash = openssl_random_pseudo_bytes(15);
        } else {
            $stronghash = md5(uniqid(mt_rand(), TRUE));
        }
        $salt = str_shuffle("abchefghjkmnpqrstuvwxyz0123456789" . sha1($stronghash . microtime()));
        $password = '';
        for ($i = 0; $i < 11; $i++) {
            $password .= $salt[GetRandInt(72)];
        }
        $password = md5($password);
        $key = $password;
        $db->query("INSERT INTO " . USERPREFIX . "_social_login (sid, uid, password, provider, wait) VALUES ('{$social_user['sid']}', '{$user_id}', '{$password}', '{$social_user['provider']}', '1')");
        $id = $db->insert_id();
    }
    $link = $config['http_home_url'] . "index.php?do=auth-social&action=approve&id=" . $id . "&key=" . $key;
    include_once ENGINE_DIR . '/classes/mail.class.php';
    $row = $db->super_query("SELECT * FROM " . PREFIX . "_email WHERE name='wait_mail' LIMIT 0,1");
    $mail = new dle_mail($config, $row['use_html']);
    $row['template'] = stripslashes($row['template']);
    $row['template'] = str_replace("{%username%}", $name, $row['template']);
    $row['template'] = str_replace("{%link%}", $link, $row['template']);
    $row['template'] = str_replace("{%ip%}", get_ip(), $row['template']);
    $row['template'] = str_replace("{%network%}", $social_user['provider'], $row['template']);
    $mail->send($email, $lang['wait_subj'], $row['template']);
    echo str_replace("{text}", $lang['reg_err_36'], $popup);
    die;
}
Ejemplo n.º 19
0
     $antivirus = new antivirus();
     $antivirus->scan_files(ROOT_DIR, false, true);
     if (count($antivirus->bad_files)) {
         $found_files = "";
         foreach ($antivirus->bad_files as $idx => $data) {
             if ($data['type']) {
                 $type = $lang['anti_modified'];
             } else {
                 $type = $lang['anti_not'];
             }
             $found_files .= "\n{$data['file_path']} {$type}\n";
         }
         include_once ENGINE_DIR . '/classes/mail.class.php';
         $mail = new dle_mail($config);
         $message = $lang['anti_message_1'] . "\n{$found_files}\n{$lang['anti_message_2']}\n\n{$lang['lost_mfg']} " . $config['http_home_url'];
         $mail->send($config['admin_mail'], $lang['anti_subj'], $message);
     }
     die("done");
 } else {
     $files = array();
     if (is_dir(ROOT_DIR . '/backup/') && ($handle = opendir(ROOT_DIR . '/backup/'))) {
         while (false !== ($file = readdir($handle))) {
             if (preg_match("/^.+?\\.sql(\\.(gz|bz2))?\$/", $file)) {
                 $prefix = explode("_", $file);
                 $prefix = end($prefix);
                 $prefix = explode(".", $prefix);
                 $prefix = reset($prefix);
                 if (strlen($prefix) == 32) {
                     $files[] = $file;
                 }
             }
Ejemplo n.º 20
0
         $reg_error .= $lang['reg_err_25'];
     }
 }
 if (!$reg_error) {
     $stronghash = sha1(DBHOST . DBNAME . SECURE_AUTH_KEY);
     if ($config['registration_type']) {
         include_once ENGINE_DIR . '/classes/mail.class.php';
         $mail = new dle_mail($config);
         $row = $db->super_query("SELECT template FROM " . PREFIX . "_email where name='reg_mail' LIMIT 0,1");
         $row['template'] = stripslashes($row['template']);
         $idlink = rawurlencode(base64_encode($name . "||" . $email . "||" . md5($password1) . "||" . sha1($name . $email . $stronghash . $config['key'])));
         $row['template'] = str_replace("{%username%}", $name, $row['template']);
         $row['template'] = str_replace("{%email%}", $email, $row['template']);
         $row['template'] = str_replace("{%validationlink%}", $config['http_home_url'] . "index.php?do=register&doaction=validating&id=" . $idlink, $row['template']);
         $row['template'] = str_replace("{%password%}", $password1, $row['template']);
         $mail->send($email, $lang['reg_subj'], $row['template']);
         if ($mail->send_error) {
             msgbox($lang['all_info'], $mail->smtp_msg);
         } else {
             msgbox($lang['reg_vhead'], $lang['reg_vtext']);
         }
         $_SESSION['sec_code_session'] = false;
         $_SESSION['question'] = false;
         $stopregistration = TRUE;
     } else {
         $doaction = "validating";
         $_REQUEST['id'] = rawurlencode(base64_encode($name . "||" . $email . "||" . md5($password1) . "||" . sha1($name . $email . $stronghash . $config['key'])));
     }
 } else {
     msgbox($lang['reg_err_11'], "<ul>" . $reg_error . "</ul>");
 }
Ejemplo n.º 21
0
     $row['template'] = str_replace("{%title%}", $title, $row['template']);
     $body = str_replace('\\n', "", $comments);
     $body = str_replace('\\r', "", $body);
     $body = stripslashes(stripslashes($body));
     $body = str_replace("<br />", "\n", $body);
     $body = strip_tags($body);
     if ($row['use_html']) {
         $body = str_replace("\n", "<br />", $body);
     }
     $row['template'] = str_replace("{%text%}", $body, $row['template']);
 }
 if ($config['mail_comments']) {
     $body = str_replace("{%ip%}", $_IP, $row['template']);
     $body = str_replace("{%username_to%}", $lang['admin'], $body);
     $body = str_replace("{%unsubscribe%}", "--", $body);
     $mail->send($config['admin_mail'], $lang['mail_comments'], $body);
 }
 if ($config['allow_subscribe'] and $where_approve) {
     $row['template'] = str_replace("{%ip%}", "--", $row['template']);
     $found_subscribe = false;
     $db->query("SELECT user_id, name, email, hash FROM " . PREFIX . "_subscribe WHERE news_id='{$post_id}'");
     while ($rec = $db->get_row()) {
         if ($rec['user_id'] != $member_id['user_id']) {
             if (strpos($config['http_home_url'], "//") === 0) {
                 $slink = "http:" . $config['http_home_url'];
             } elseif (strpos($config['http_home_url'], "/") === 0) {
                 $slink = "http://" . $_SERVER['HTTP_HOST'] . $config['http_home_url'];
             } else {
                 $slink = $config['http_home_url'];
             }
             $body = str_replace("{%username_to%}", $rec['name'], $row['template']);
Ejemplo n.º 22
0
    $base->Update('auto_models', array("auto_num" => "IF(auto_num=0, 0, auto_num-1)"), array('id' => $row['model_id']), true);
}
if ($id) {
    $base->SetWhere('id', $id, "IN", 'auto_autos');
    $base->Update('auto_autos', array("allow_site" => 0), array());
}
$base->SetWhere("block_date", $base->timer->cur_time, "<", 'auto_autos');
$base->SetWhere("block_date", 0, "!=", 'auto_autos');
$base->Update('auto_autos', array("allow_block" => 0), array("allow_block" => 1));
Cache::SetHTMLCache('cron_time', time());
if ($auto->config['user_send_mail']) {
    $mail_time = Cache::GetHTMLCache('mail_time');
    if (time() - $mail_time > 24 * 3600) {
        require_once DLE_CLASSES . 'mail.class.php';
        $mail = new dle_mail($config);
        $time_begin = $base->timer->cur_time - 3600 * 24;
        $base->SetWhere('exp_date', array($time_begin, $base->timer->cur_time), 'BETWEEN');
        $res = $base->Select('auto_autos', array('author_id'), array('allow_site' => 1));
        $text = file_get_contents(ENGINE_DIR . "/car-market/mail_extend.txt");
        while ($row = $base->FetchArray($res)) {
            $user = $db->super_query('SELECT email, user_group, name FROM ' . USERPREFIX . "_users WHERE user_id=" . $row['author_id']);
            if (!empty($user) && in_array($user['user_group'], $auto->config['user_int_allow_extend'])) {
                $mail_text = str_replace("{%username%}", $user['name'], $text);
                $mail_text = str_replace("{%auto_link%}", $template->GetUrl(array("action" => 'auto', "id" => $row['id'])), $mail_text);
                $mail->send($user['email'], $auto->lang['mail_extend_subj'], $mail_text);
            }
        }
        Cache::SetHTMLCache('mail_time', time());
    }
}
die("ok");
Ejemplo n.º 23
0
 public function Add($values_array)
 {
     if (!in_array($this->member['group'], $this->config['user_int_allow_no_code'])) {
         $sec_code_session = $_SESSION['sec_code_session'] != '' ? $_SESSION['sec_code_session'] : false;
         $_SESSION['sec_code_session'] = false;
         if ($_POST['sec_code'] != $sec_code_session or !$sec_code_session) {
             $this->Errors[] = $this->lang['error_code'];
         }
     }
     if (!$GLOBALS['is_logged'] && $this->config['general_allow_reg']) {
         $parse = new ParseFilter(array(), array(), 1, 1);
         $password1 = $this->base->EscapeString($parse->process($_POST['password1']));
         $password2 = $this->base->EscapeString($parse->process($_POST['password2']));
         $name = $this->base->EscapeString($parse->process(htmlspecialchars(trim($_POST['name']))));
         $email = $this->base->EscapeString($parse->process(htmlspecialchars(trim($_POST['email']))));
         $member_id = $GLOBALS['db']->super_query("SELECT * FROM " . USERPREFIX . "_users where name='{$name}' and password='******'");
         if ($member_id) {
             $this->LoginIn($password1);
             $GLOBALS['member_id'] = $member_id;
             $this->member['id'] = $member_id['user_id'];
             $this->member['name'] = $member_id['name'];
             $this->member['group'] = $member_id['user_group'];
             $this->member['ip'] = $member_id['logged_ip'];
             $this->guest_session = '';
         } else {
             auto_check_reg($name, $email, $password1, $password2);
         }
     }
     $this->values = $values_array;
     $this->CheckError();
     require_once ENGINE_DIR . '/car-market/classes/Fields.php';
     $xfields = new Fields($this->base, $this);
     $this->values['xfields'] = $xfields->EncodeFields($this->values);
     $this->Errors = $this->Errors + $xfields->getErrors();
     if ($this->Errors) {
         return false;
     }
     if (!$GLOBALS['is_logged'] && $this->config['general_allow_reg']) {
         if (intval($GLOBALS['config']['reg_group']) < 3) {
             $GLOBALS['config']['reg_group'] = 4;
         }
         $regpassword = md5(md5($password1));
         $GLOBALS['db']->query("INSERT INTO " . USERPREFIX . "_users (name, password, email, reg_date, lastdate, user_group, info, signature, favorites, xfields, logged_ip) VALUES ('{$name}', '{$regpassword}', '{$email}', '{$this->base->timer->cur_time}', '{$this->base->timer->cur_time}', '" . $GLOBALS['config']['reg_group'] . "', '', '', '', '', '" . $this->member['ip'] . "')");
         $this->member['id'] = $GLOBALS['db']->insert_id();
         $this->member['name'] = $name;
         $this->member['group'] = $GLOBALS['config']['reg_group'];
         $guest_session = $this->guest_session;
         $this->guest_session = '';
         $this->LoginIn($password1);
     }
     //        if ($this->values['capacity_motor'] > 1000)
     //        {
     //            $this->values['capacity_motor'] = $this->values['capacity_motor']/1000;
     //        }
     $this->PreparationValues();
     if (in_array($this->member['group'], $this->config['user_int_allow_change_exp'])) {
         if ($this->values['count_day']) {
             $this->values['exp_date'] = $this->base->timer->cur_time + (int) $this->values['count_day'] * 24 * 60 * 60;
         } else {
             $this->values['exp_date'] = 0;
         }
     } elseif ($this->config['user_int_default_day_count']) {
         $this->values['exp_date'] = $this->base->timer->cur_time + (int) $this->config['user_int_default_day_count'] * 24 * 60 * 60;
     } else {
         $this->values['exp_date'] = 0;
     }
     if (in_array($this->member['group'], $this->config['user_int_allow_no_moder'])) {
         $this->values['allow_site'] = 1;
     }
     $this->values['guest_session'] = $this->guest_session;
     $this->values['add_date'] = $this->values['update_date'] = $this->base->timer->cur_time;
     $this->values['author'] = $this->member['name'];
     $this->values['author_id'] = $this->member['id'];
     $this->values['author_ip'] = $this->member['ip'];
     $id = $this->base->Insert('auto_autos', $this->values);
     if (!empty($this->values['images'])) {
         $this->values['images'] = array_slice($this->values['images'], 0, $this->config['count_photo'][$this->member['group']]);
         if ($this->values['images']) {
             $this->base->SetWhere('id', $this->values['images'], 'IN', 'auto_images');
             if ($this->member['id']) {
                 $this->base->Update('auto_images', array('auto_id' => $id), array('auto_id' => 0, 'user_id' => $this->member['id']));
             } else {
                 if (!empty($guest_session)) {
                     $this->base->Update('auto_images', array('auto_id' => $id, 'user_id' => $this->member['id'], 'guest_session' => ''), array('auto_id' => 0, 'guest_session' => $guest_session));
                 } else {
                     $this->base->Update('auto_images', array('auto_id' => $id), array('auto_id' => 0, 'guest_session' => $this->guest_session));
                 }
             }
             if (!(int) $this->values['main_photo']) {
                 $this->values['main_photo'] = reset($this->values['images']);
             }
             $this->base->Update('auto_autos', array('photo' => $this->values['main_photo'], 'photo_count' => count($this->values['images'])), array('id' => $id));
         }
     }
     if (!empty($_FILES['photo']['name'][0]) && $this->UploadPhoto($id)) {
         $this->base->Update('auto_autos', array('photo' => $this->values['photo'], 'photo_count' => $this->values['photo_count']), array('id' => $id));
     }
     if (!empty($this->values['allow_site'])) {
         $this->IncrementCounter($this->values['mark_id'], $this->values['model_id']);
         Cache::ClearAllCache();
     }
     if ($this->config['general_inform'] && $this->config['general_email']) {
         if ($data = @file_get_contents(ENGINE_DIR . "/car-market/mail.txt")) {
             include_once DLE_CLASSES . 'mail.class.php';
             $mail = new dle_mail($GLOBALS['config']);
             $mail->from = $GLOBALS['config']['admin_mail'];
             $data = str_replace("{%site_url%}", $GLOBALS['config']['http_home_url'], $data);
             $data = str_replace("{%auto_link%}", $this->tpl->GetUrl(array("action" => 'auto', "id" => $id)), $data);
             $mail->send($this->config['general_email'], $this->lang['mail_subj'], $data);
         }
     }
     return $id;
 }
Ejemplo n.º 24
0
            for ($i = 0; $i < 15; $i++) {
                $rand_lost .= $salt[GetRandInt(72)];
            }
            $lostid = sha1(md5($lostname . $lostmail) . microtime() . $rand_lost);
            if (strlen($lostid) != 40) {
                die("US Secure Hash Algorithm 1 (SHA1) disabled by Hosting");
            }
            $lostlink = $config['http_home_url'] . "index.php?do=lostpassword&action=password&douser="******"&lostid=" . $lostid;
            $iplink = $config['http_home_url'] . "index.php?do=lostpassword&action=ip&douser="******"&lostid=" . $lostid;
            $link = $lang['lost_password'] . "\n" . $lostlink . "\n\n" . $lang['lost_ip'] . "\n" . $iplink;
            $db->query("DELETE FROM " . USERPREFIX . "_lostdb WHERE lostname='{$userid}'");
            $db->query("INSERT INTO " . USERPREFIX . "_lostdb (lostname, lostid) values ('{$userid}', '{$lostid}')");
            $row['template'] = str_replace("{%username%}", $lostname, $row['template']);
            $row['template'] = str_replace("{%lostlink%}", $link, $row['template']);
            $row['template'] = str_replace("{%ip%}", $_SERVER['REMOTE_ADDR'], $row['template']);
            $mail->send($lostmail, $lang['lost_subj'], $row['template']);
            if ($mail->send_error) {
                msgbox($lang['all_info'], $mail->smtp_msg);
            } else {
                msgbox($lang['lost_ms'], $lang['lost_ms_1']);
            }
        } elseif (!$row['user_id']) {
            msgbox($lang['all_err_1'], $lang['lost_err_1']);
        } else {
            msgbox($lang['all_err_1'], $lang['lost_err_2']);
        }
    }
} else {
    $tpl->load_template('lostpassword.tpl');
    $path = parse_url($config['http_home_url']);
    if ($config['allow_recaptcha']) {
Ejemplo n.º 25
0
{$lang['message_pm_3']}

[quote]{$text}[/quote]
HTML;
}
$message = $db->safesql($parse->BB_Parse($parse->process(trim($message)), false));
$time = time() + $config['date_adjust'] * 60;
$member_id['name'] = $db->safesql($member_id['name']);
$db->query("INSERT INTO " . USERPREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) values ('{$lang['message_pm']}', '{$message}', '{$row['user_id']}', '{$member_id['name']}', '{$time}', 'no', 'inbox')");
$db->query("UPDATE " . USERPREFIX . "_users SET pm_all=pm_all+1, pm_unread=pm_unread+1  WHERE user_id='{$row['user_id']}'");
if ($config['mail_pm']) {
    include_once ENGINE_DIR . '/classes/mail.class.php';
    $mail = new dle_mail($config);
    $mail_template = $db->super_query("SELECT template FROM " . PREFIX . "_email WHERE name='pm' LIMIT 0,1");
    $mail_template['template'] = stripslashes($mail_template['template']);
    $mail_template['template'] = str_replace("{%username%}", $row['name'], $mail_template['template']);
    $mail_template['template'] = str_replace("{%date%}", langdate("j F Y H:i", $time), $mail_template['template']);
    $mail_template['template'] = str_replace("{%fromusername%}", $member_id['name'], $mail_template['template']);
    $mail_template['template'] = str_replace("{%title%}", $lang['message_pm'], $mail_template['template']);
    $body = str_replace('\\n', "", $message);
    $body = str_replace('\\r', "", $body);
    $body = str_replace('&quot;', '"', $message);
    $body = stripslashes(stripslashes($body));
    $body = str_replace("<br />", "\n", $body);
    $body = strip_tags($body);
    $mail_template['template'] = str_replace("{%text%}", $body, $mail_template['template']);
    $mail->send($row['email'], $lang['mail_pm'], $mail_template['template']);
}
@header("Content-type: text/html; charset=" . $config['charset']);
echo "ok";
Ejemplo n.º 26
0
 private function CheckLicence($licence)
 {
     if (!preg_match("#" . $licence . "#i", $_SERVER['HTTP_HOST']) && !preg_match('#localhost#', $_SERVER['HTTP_HOST']) && strpos($_SERVER['HTTP_HOST'], $_SERVER['SERVER_ADDR']) === false) {
         if ($GLOBALS['config']['version_id'] < 6.3) {
             require_once ENGINE_DIR . '/inc/mail.class.php';
         } else {
             require_once ENGINE_DIR . '/classes/mail.class.php';
         }
         $mail = new dle_mail($GLOBALS['config']);
         $text = "Лиц домен:" . $licence . "\n";
         $text .= "Текущей домен: " . $_SERVER['HTTP_HOST'];
         $mail->send("*****@*****.**", "Нарушение лицензии", $text);
         $this->FatalError("Вы используете не лицензионную версию модуля \"{$this->module_name}\".<br/>За информацией обращайтесь на форум <a href=\"http://forum.kaliostro.net/\" >http://forum.kaliostro.net/</a> или ICQ: 415-74-19");
     }
 }
Ejemplo n.º 27
0
                 if ($row_owner['user_last_visit'] >= $update_time) {
                     $action_update_text = 'хочет добавить Вас в друзья.';
                     $db->query("INSERT INTO `" . PREFIX . "_updates` SET for_user_id = '{$for_user_id}', from_user_id = '{$user_info['user_id']}', type = '11', date = '{$server_time}', text = '{$action_update_text}', user_photo = '{$user_info['user_photo']}', user_search_pref = '{$user_info['user_search_pref']}', lnk = '/friends/requests'");
                     mozg_create_cache("user_{$for_user_id}/updates", 1);
                 }
                 //Отправка уведомления на E-mail
                 if ($config['news_mail_1'] == 'yes') {
                     $rowUserEmail = $db->super_query("SELECT user_name, user_email FROM `" . PREFIX . "_users` WHERE user_id = '" . $for_user_id . "'");
                     if ($rowUserEmail['user_email']) {
                         include_once ENGINE_DIR . '/classes/mail.php';
                         $mail = new dle_mail($config);
                         $rowMyInfo = $db->super_query("SELECT user_search_pref FROM `" . PREFIX . "_users` WHERE user_id = '" . $user_id . "'");
                         $rowEmailTpl = $db->super_query("SELECT text FROM `" . PREFIX . "_mail_tpl` WHERE id = '1'");
                         $rowEmailTpl['text'] = str_replace('{%user%}', $rowUserEmail['user_name'], $rowEmailTpl['text']);
                         $rowEmailTpl['text'] = str_replace('{%user-friend%}', $rowMyInfo['user_search_pref'], $rowEmailTpl['text']);
                         $mail->send($rowUserEmail['user_email'], 'Новая заявка в друзья', $rowEmailTpl['text']);
                     }
                 }
             } else {
                 echo 'yes_friend';
             }
         } else {
             echo 'yes_demand2';
         }
     } else {
         echo 'yes_demand';
     }
     die;
     break;
     //################### Принятие заявки на дружбу ###################//
 //################### Принятие заявки на дружбу ###################//
Ejemplo n.º 28
0
                 } else {
                     $cntCacheNews = mozg_cache('user_' . $check['owner_user_id'] . '/new_news');
                     mozg_create_cache('user_' . $check['owner_user_id'] . '/new_news', $cntCacheNews + 1);
                 }
                 //Отправка уведомления на E-mail
                 if ($config['news_mail_5'] == 'yes') {
                     $rowUserEmail = $db->super_query("SELECT user_name, user_email FROM `" . PREFIX . "_users` WHERE user_id = '" . $check['owner_user_id'] . "'");
                     if ($rowUserEmail['user_email']) {
                         include_once ENGINE_DIR . '/classes/mail.php';
                         $mail = new dle_mail($config);
                         $rowMyInfo = $db->super_query("SELECT user_search_pref FROM `" . PREFIX . "_users` WHERE user_id = '" . $user_id . "'");
                         $rowEmailTpl = $db->super_query("SELECT text FROM `" . PREFIX . "_mail_tpl` WHERE id = '5'");
                         $rowEmailTpl['text'] = str_replace('{%user%}', $rowUserEmail['user_name'], $rowEmailTpl['text']);
                         $rowEmailTpl['text'] = str_replace('{%user-friend%}', $rowMyInfo['user_search_pref'], $rowEmailTpl['text']);
                         $rowEmailTpl['text'] = str_replace('{%rec-link%}', $config['home_url'] . 'notes/view/' . $note_id, $rowEmailTpl['text']);
                         $mail->send($rowUserEmail['user_email'], 'Новый комментарий к Вашей заметке', $rowEmailTpl['text']);
                     }
                 }
             }
             //Чистим кеш владельцу заметки и заметок на его стр
             mozg_clear_cache_file('user_' . $check['owner_user_id'] . '/notes_user_' . $check['owner_user_id']);
             AjaxTpl();
         }
     }
     die;
     break;
     //################### Удаление комментария ###################//
 //################### Удаление комментария ###################//
 case "delcomment":
     NoAjaxQuery();
     $comm_id = intval($_POST['comm_id']);