Exemple #1
0
     ############################################################################################
     ##                                    Жалоба на спам                                      ##
     ############################################################################################
 ############################################################################################
 ##                                    Жалоба на спам                                      ##
 ############################################################################################
 case 'spam':
     $uid = check($_GET['uid']);
     $pid = abs(intval($_GET['pid']));
     if (is_user()) {
         if ($uid == $_SESSION['token']) {
             $data = DB::run()->queryFetch("SELECT * FROM `posts` WHERE `posts_id`=? LIMIT 1;", array($pid));
             if (!empty($data)) {
                 $queryspam = DB::run()->querySingle("SELECT `spam_id` FROM `spam` WHERE `spam_key`=? AND `spam_idnum`=? LIMIT 1;", array(1, $pid));
                 if (empty($queryspam)) {
                     if (is_flood($log)) {
                         DB::run()->query("INSERT INTO `spam` (`spam_key`, `spam_idnum`, `spam_user`, `spam_login`, `spam_text`, `spam_time`, `spam_addtime`, `spam_link`) VALUES (?, ?, ?, ?, ?, ?, ?, ?);", array(1, $data['posts_id'], $log, $data['posts_user'], $data['posts_text'], $data['posts_time'], SITETIME, $config['home'] . '/forum/topic.php?tid=' . $tid . '&start=' . $start));
                         $_SESSION['note'] = 'Жалоба успешно отправлена!';
                         redirect("topic.php?tid={$tid}&start={$start}");
                     } else {
                         show_error('Антифлуд! Разрешается жаловаться на спам не чаще чем раз в ' . flood_period() . ' секунд!');
                     }
                 } else {
                     show_error('Ошибка! Жалоба на данное сообщение уже отправлена!');
                 }
             } else {
                 show_error('Ошибка! Выбранное вами сообщение для жалобы не существует!');
             }
         } else {
             show_error('Ошибка! Неверный идентификатор сессии, повторите действие!');
         }
Exemple #2
0
 if (!$titre) {
     $erreur = 1;
     $str .= "- {$strElementsTitreInvalide}<br>";
 }
 if (!$contenu) {
     $erreur = 1;
     $str .= "- {$strElementsContenuInvalide}<br>";
 }
 if (!$email || !eregi("^[a-z0-9\\._-]+@+[a-z0-9\\._-]+\\.+[a-z]{2,3}\$", $email)) {
     $erreur = 1;
     $str .= "- {$strElementsEmailInvalide}<br>";
 }
 if ($erreur == 1) {
     show_erreur_saisie($str);
 } else {
     if (is_flood('contact')) {
         show_erreur($strFloodDetect);
     } elseif ($config['mail'] != 'N') {
         //if($config['mail']!='N') {
         $no_send_mail = 'non';
         $titre = remove_XSS($titre);
         $contenu = remove_XSS($contenu);
         $array1 = array("%nomsite%", "%urlsite%");
         $array2 = array($config['nomsite'], $config['urlsite']);
         $body = $strContactMessageEmail . " {$pseudo} {$strAEcrit} :<br>" . stripslashes($contenu);
         $body = str_replace($array1, $array2, $body);
         $mail = new phpTMailer();
         $mail->From = $email;
         $mail->FromName = $pseudo;
         $mail->AddAddress($config['emailcontact']);
         $mail->Subject = stripslashes($titre);
Exemple #3
0
     break;
     ############################################################################################
     ##                                     Cоздание темы                                      ##
     ############################################################################################
 ############################################################################################
 ##                                     Cоздание темы                                      ##
 ############################################################################################
 case 'add':
     $uid = !empty($_GET['uid']) ? check($_GET['uid']) : 0;
     $fid = isset($_POST['fid']) ? abs(intval($_POST['fid'])) : 0;
     $title = isset($_POST['title']) ? check($_POST['title']) : '';
     $msg = isset($_POST['msg']) ? check($_POST['msg']) : '';
     if (is_user()) {
         $forums = DB::run()->queryFetch("SELECT * FROM `forums` WHERE `forums_id`=? LIMIT 1;", array($fid));
         $validation = new Validation();
         $validation->addRule('equal', array($uid, $_SESSION['token']), 'Неверный идентификатор сессии, повторите действие!')->addRule('not_empty', $forums, 'Раздела для новой темы не существует!')->addRule('empty', $forums['forums_closed'], 'В данном разделе запрещено создавать темы!')->addRule('equal', array(is_quarantine($log), true), 'Карантин! Вы не можете писать в течении ' . round($config['karantin'] / 3600) . ' часов!')->addRule('equal', array(is_flood($log), true), 'Антифлуд! Разрешается отправлять сообщения раз в ' . flood_period() . ' сек!')->addRule('string', $title, 'Слишком длинный или короткий заголовок темы!', true, 5, 50)->addRule('string', $msg, 'Слишком длинное или короткое сообщение!', true, 5, $config['forumtextlength']);
         /* Сделать проверку поиска похожей темы */
         if ($validation->run()) {
             $title = antimat($title);
             $msg = antimat($msg);
             DB::run()->query("UPDATE `users` SET `users_allforum`=`users_allforum`+1, `users_point`=`users_point`+1, `users_money`=`users_money`+5 WHERE `users_login`=?", array($log));
             DB::run()->query("INSERT INTO `topics` (`topics_forums_id`, `topics_title`, `topics_author`, `topics_posts`, `topics_last_user`, `topics_last_time`) VALUES (?, ?, ?, ?, ?, ?);", array($fid, $title, $log, 1, $log, SITETIME));
             $lastid = DB::run()->lastInsertId();
             DB::run()->query("INSERT INTO `posts` (`posts_topics_id`, `posts_forums_id`, `posts_user`, `posts_text`, `posts_time`, `posts_ip`, `posts_brow`) VALUES (?, ?, ?, ?, ?, ?, ?);", array($lastid, $fid, $log, $msg, SITETIME, $ip, $brow));
             DB::run()->query("UPDATE `forums` SET `forums_topics`=`forums_topics`+1, `forums_posts`=`forums_posts`+1, `forums_last_id`=?, `forums_last_themes`=?, `forums_last_user`=?, `forums_last_time`=? WHERE `forums_id`=?", array($lastid, $title, $log, SITETIME, $fid));
             // Обновление родительского форума
             if ($forums['forums_parent'] > 0) {
                 DB::run()->query("UPDATE `forums` SET `forums_last_id`=?, `forums_last_themes`=?, `forums_last_user`=?, `forums_last_time`=? WHERE `forums_id`=?", array($lastid, $title, $log, SITETIME, $forums['forums_parent']));
             }
             notice('Новая тема успешно создана!');
             redirect("topic.php?tid={$lastid}");
Exemple #4
0
 */
if ($op == "add") {
    $str = '';
    $erreur = 0;
    if (!$auteur) {
        $erreur = 1;
        $str .= "- {$strElementsAuteurInvalide}<br>";
    }
    if (!$contenu) {
        $erreur = 1;
        $str .= "- {$strElementsContenuInvalide}<br>";
    }
    if ($erreur == 1) {
        show_erreur_saisie($str);
    } else {
        if (is_flood('livredor')) {
            show_erreur($strFloodDetect);
        } else {
            $date = time();
            $auteur = remove_XSS($auteur);
            $contenu = remove_XSS($contenu);
            $db->insert("{$dbprefix}livredor (auteur,contenu,date)");
            $db->values("'{$auteur}','{$contenu}','{$date}'");
            $db->exec();
            /*** redirection ***/
            js_goto("?page=livredor&id={$id}");
        }
    }
} elseif ($op == "delete") {
    /*** verification securite ***/
    if ($op == 'admin') {
Exemple #5
0
     }
     echo '<img src="/images/img/back.gif" alt="image" /> <a href="index.php">К новостям</a><br />';
     break;
     ############################################################################################
     ##                                Добавление комментариев                                 ##
     ############################################################################################
 ############################################################################################
 ##                                Добавление комментариев                                 ##
 ############################################################################################
 case 'add':
     $uid = !empty($_GET['uid']) ? check($_GET['uid']) : 0;
     $msg = isset($_POST['msg']) ? check($_POST['msg']) : '';
     if (is_user()) {
         $data = DB::run()->queryFetch("SELECT * FROM `news` WHERE `news_id`=? LIMIT 1;", array($id));
         $validation = new Validation();
         $validation->addRule('equal', array($uid, $_SESSION['token']), 'Неверный идентификатор сессии, повторите действие!')->addRule('equal', array(is_quarantine($log), true), 'Карантин! Вы не можете писать в течении ' . round($config['karantin'] / 3600) . ' часов!')->addRule('equal', array(is_flood($log), true), 'Антифлуд! Разрешается комментировать раз в ' . flood_period() . ' сек!')->addRule('not_empty', $data, 'Выбранной новости не существует, возможно она было удалена!')->addRule('string', $msg, 'Слишком длинный или короткий комментарий!', true, 5, 1000)->addRule('empty', $data['news_closed'], 'Комментирование данной новости запрещено!');
         if ($validation->run()) {
             $msg = antimat($msg);
             DB::run()->query("INSERT INTO `commnews` (`commnews_news_id`, `commnews_text`, `commnews_author`, `commnews_time`, `commnews_ip`, `commnews_brow`) VALUES (?, ?, ?, ?, ?, ?);", array($id, $msg, $log, SITETIME, $ip, $brow));
             DB::run()->query("DELETE FROM `commnews` WHERE `commnews_news_id`=? AND `commnews_time` < (SELECT MIN(`commnews_time`) FROM (SELECT `commnews_time` FROM `commnews` WHERE `commnews_news_id`=? ORDER BY `commnews_time` DESC LIMIT " . $config['maxkommnews'] . ") AS del);", array($id, $id));
             DB::run()->query("UPDATE `news` SET `news_comments`=`news_comments`+1 WHERE `news_id`=?;", array($id));
             DB::run()->query("UPDATE `users` SET `users_allcomments`=`users_allcomments`+1, `users_point`=`users_point`+1, `users_money`=`users_money`+5 WHERE `users_login`=?", array($log));
             notice('Комментарий успешно добавлен!');
             if (isset($_GET['read'])) {
                 redirect("index.php?act=read&id={$id}");
             }
             redirect("index.php?act=end&id={$id}");
         } else {
             show_error($validation->getErrors());
         }
     } else {