示例#1
0
 forum_opt($last);
 if (empty($info['report']) == false) {
     error($lang->phrase('report_post_locked'), "showtopic.php?action=jumpto&id={$last['id']}&topic_id={$info['id']}" . SID2URL_x);
 }
 if ($_GET['action'] == "report_post2") {
     $error = array();
     if (flood_protect() == false) {
         $error[] = $lang->phrase('flood_control');
     }
     if (strxlen($_POST['comment']) < $config['minpostlength']) {
         $error[] = $lang->phrase('comment_too_short');
     }
     if (count($error) > 0) {
         error($error, "misc.php?action=report_post&id={$info['id']}" . SID2URL_x);
     } else {
         set_flood();
         $message = $_POST['comment'];
         // Update the report
         $db->query("UPDATE {$db->pre}replies SET report = '{$message}' WHERE id = '{$info['id']}' LIMIT 1", __LINE__, __FILE__);
         // Get administrators and global moderators
         $groups = $scache->load('groups');
         $team = $groups->team();
         $cache = array();
         $t = array_merge($team['admin'], $team['gmod']);
         foreach ($t as $row) {
             $cache[] = "FIND_IN_SET({$row},groups)";
         }
         $cache = implode(' OR ', $cache);
         $result = $db->query("SELECT id, name, mail, language FROM {$db->pre}user WHERE {$cache}", __LINE__, __FILE__);
         $cache = array();
         while ($row = $db->fetch_assoc($result)) {
         }
         $data['guest'] = 1;
         $data['name'] = $_POST['name'];
     }
     ($code = $plugins->load('addreply_save_errordata')) ? eval($code) : null;
     $fid = save_error_data($data, $fid);
     if (!empty($_POST['Preview'])) {
         $slog->updatelogged();
         $db->close();
         sendStatusCode(307, $config['furl'] . "/addreply.php?action=preview&id={$id}&fid=" . $fid . SID2URL_JS_x);
         exit;
     } else {
         error($error, "addreply.php?id={$id}&amp;fid=" . $fid . SID2URL_x);
     }
 } else {
     set_flood(FLOOD_TYPE_POSTING);
     if ($my->vlogin) {
         $guest = 0;
     } else {
         $guest = 1;
     }
     $date = time();
     ($code = $plugins->load('addreply_save_queries')) ? eval($code) : null;
     $db->query("\n\t\tUPDATE {$db->pre}topics\n\t\tSET last_name = '{$pnameid}', last = '{$date}', posts = posts+1\n\t\tWHERE id = '{$id}'\n\t\t");
     $db->query("\n\t\tINSERT INTO {$db->pre}replies (board,topic,topic_id,name,comment,dosmileys,dowords,email,date,ip,guest,edit,report)\n\t\tVALUES ('{$info['board']}','{$_POST['topic']}','{$id}','{$pnameid}','{$_POST['comment']}','{$_POST['dosmileys']}','{$_POST['dowords']}','{$_POST['email']}','{$date}','{$my->ip}','{$guest}','','')\n\t\t");
     $redirect = $db->insert_id();
     // Set uploads to correct reply
     $db->query("UPDATE {$db->pre}uploads SET tid = '{$redirect}' WHERE mid = '{$pid}' AND topic_id = '{$id}' AND tid = '0'");
     // Update, insert notifications
     if ($my->vlogin && in_array($digest, $validDigest)) {
         switch ($digest) {
示例#3
0
define('VISCACHA_CORE', '1');
include "data/config.inc.php";
include "classes/function.viscacha_frontend.php";
$my->p = $slog->Permissions();
$my->pb = $slog->GlobalPermissions();
if ($my->p['search'] == 0) {
    error($lang->phrase('query_string_error'));
}
$breadcrumb->Add($lang->phrase('search'));
($code = $plugins->load('search_start')) ? eval($code) : null;
if ($_GET['action'] == "search") {
    if ($config['floodsearch'] == 1) {
        if (flood_protect(FLOOD_TYPE_SEARCH) == false) {
            error($lang->phrase('flood_control'));
        }
        set_flood(FLOOD_TYPE_SEARCH);
    }
    $boards = array();
    if (isset($_POST['boards']) && is_array($_POST['boards'])) {
        $_POST['boards'] = array_map('trim', $_POST['boards']);
        foreach ($_POST['boards'] as $b) {
            if (is_id($b) == true) {
                $boards[] = $b;
            }
        }
    }
    $search = preg_replace("/(\\s){1,}/is", " ", $_POST['search']);
    $search = preg_replace("/\\*{1,}/is", '*', $search);
    $ignorewords = $lang->get_words();
    $word_seperator = "\\.\\,;:\\+!\\?\\_\\|\\s\"'\\#\\[\\]\\%\\{\\}\\(\\)\\/\\\\";
    $searchwords = preg_split('/[' . $word_seperator . ']+?/', $search, -1, PREG_SPLIT_NO_EMPTY);
示例#4
0
        $confirmcode = md5($config['cryptkey'] . $user['pw']);
        ($code = $plugins->load('log_pwremind2_prepare')) ? eval($code) : null;
        $user = $gpc->plain_str($user);
        $data = $lang->get_mail('pwremind');
        $to = array('0' => array('name' => $user['name'], 'mail' => $user['mail']));
        $from = array();
        xmail($to, $from, $data['title'], $data['comment']);
        ($code = $plugins->load('log_pwremind2_end')) ? eval($code) : null;
        ok($lang->phrase('log_pwremind_success'), "log.php?action=login" . SID2URL_x);
    }
    $slog->updatelogged();
} elseif ($_GET['action'] == "pwremind3") {
    if (flood_protect(FLOOD_TYPE_PWRENEW) == false) {
        error($lang->phrase('flood_control'), 'log.php?action=login' . SID2URL_x);
    }
    set_flood(FLOOD_TYPE_PWRENEW);
    ($code = $plugins->load('log_pwremind3_start')) ? eval($code) : null;
    $result = $db->query("SELECT id, pw, mail, name FROM {$db->pre}user WHERE id = '{$_GET['id']}' LIMIT 1", __LINE__, __FILE__);
    $user = $db->fetch_assoc($result);
    $confirmcode = md5($config['cryptkey'] . $user['pw']);
    if ($confirmcode == $_GET['fid']) {
        $pw = random_word();
        $md5 = md5($pw);
        $db->query("UPDATE {$db->pre}user SET pw = '{$md5}' WHERE id = '{$user['id']}' LIMIT 1", __LINE__, __FILE__);
        $user = $gpc->plain_str($user);
        $data = $lang->get_mail('pwremind2');
        $to = array('0' => array('name' => $user['name'], 'mail' => $user['mail']));
        $from = array();
        xmail($to, $from, $data['title'], $data['comment']);
        ($code = $plugins->load('log_pwremind3_success')) ? eval($code) : null;
        ok($lang->phrase('log_pwremind_changed'), "log.php?action=login" . SID2URL_x);