}
}
/* SUBMITTION CODE */
if (isset($_POST['fud_submit']) && !isset($_POST['btn_detach']) && !isset($_POST['btn_upload']) && !register_form_check($uent->id)) {
    $old_email = $uent->email;
    $old_avatar_loc = $uent->avatar_loc;
    $old_avatar = $uent->avatar;
    /* import data from _POST into $uent object */
    $vars = array_keys(get_object_vars($uent));
    foreach ($vars as $v) {
        if (isset($_POST['reg_' . $v])) {
            $uent->{$v} = $_POST['reg_' . $v];
        }
    }
    $uent->bday = fmt_year($_POST['b_year']) . str_pad((int) $_POST['b_month'], 2, '0', STR_PAD_LEFT) . str_pad((int) $_POST['b_day'], 2, '0', STR_PAD_LEFT);
    $uent->sig = apply_custom_replace($uent->sig);
    if ($FUD_OPT_1 & 131072) {
        $uent->sig = tags_to_html($uent->sig, $FUD_OPT_1 & 524288);
    } else {
        if ($FUD_OPT_1 & 65536) {
            $uent->sig = nl2br(htmlspecialchars($uent->sig));
        }
    }
    if ($FUD_OPT_1 & 196608) {
        char_fix($uent->sig);
    }
    if ($FUD_OPT_1 & 262144) {
        $uent->sig = smiley_to_post($uent->sig);
    }
    fud_wordwrap($uent->sig);
    if ($uent->bio) {
    if (count($_POST['sel_th']) != q_singleval("SELECT count(*) FROM phpgw_fud_thread WHERE forum_id={$frm} AND id IN(" . implode(',', $_POST['sel_th']) . ")")) {
        std_error('access');
    }
}
if ($frm && $post && !empty($_POST['new_title']) && !empty($_POST['sel_th']) && count($_POST['sel_th'])) {
    /* we need to make sure that the user has access to destination forum */
    if (!($usr->users_opt & 1048576) && !q_singleval('SELECT f.id FROM phpgw_fud_forum f LEFT JOIN phpgw_fud_mod mm ON mm.user_id=' . _uid . ' AND mm.forum_id=f.id ' . (_uid ? 'INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=2147483647 AND g1.resource_id=f.id LEFT JOIN phpgw_fud_group_cache g2 ON g2.user_id=' . _uid . ' AND g2.resource_id=f.id' : 'INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=0 AND g1.resource_id=f.id') . ' WHERE f.id=' . $forum . ' AND (mm.id IS NOT NULL OR ' . (_uid ? ' ((CASE WHEN g2.id IS NOT NULL THEN g2.group_cache_opt ELSE g1.group_cache_opt END)' : ' (g1.group_cache_opt') . ' & 4) > 0)')) {
        std_error('access');
    }
    /* sanity check */
    if (!count($_POST['sel_th'])) {
        header('Location: /egroupware/fudforum/3814588639/index.php?t=' . d_thread_view . '&th=' . $th . '&' . _rsidl);
        exit;
    } else {
        if (count($_POST['sel_th']) > 1) {
            apply_custom_replace($_POST['new_title']);
            db_lock('phpgw_fud_thread_view WRITE, phpgw_fud_thread WRITE, phpgw_fud_forum WRITE, phpgw_fud_msg WRITE, phpgw_fud_poll WRITE');
            $tl = implode(',', $_POST['sel_th']);
            list($start, $repl) = db_saq("SELECT MIN(root_msg_id), SUM(replies) FROM phpgw_fud_thread WHERE id IN({$tl})");
            $repl += count($_POST['sel_th']) - 1;
            list($lpi, $lpd) = db_saq("SELECT last_post_id, last_post_date FROM phpgw_fud_thread WHERE id IN({$tl}) ORDER BY last_post_date DESC LIMIT 1");
            $new_th = th_add($start, $forum, $lpd, 0, 0, $repl, $lpi);
            q("UPDATE phpgw_fud_msg SET reply_to=0, subject='" . addslashes(htmlspecialchars($_POST['new_title'])) . "' WHERE id=" . $start);
            q("UPDATE phpgw_fud_msg SET reply_to={$start} WHERE thread_id IN({$tl}) AND (reply_to=0 OR reply_to=id) AND id!={$start}");
            if ($forum != $frm) {
                $p = array();
                $c = q('SELECT poll_id FROM phpgw_fud_msg WHERE thread_id IN(' . $tl . ') AND apr=1 AND poll_id>0');
                while ($r = db_rowarr($c)) {
                    $p[] = $r[0];
                }
                unset($c);
                    continue;
                }
                $tab_url .= '&id=' . _uid;
            }
            $tabs .= $pg == $tab ? '<td class="tabA"><div class="tabT"><a href="' . $tab_url . '">' . $tab_name . '</a></div></td>' : '<td class="tabI"><div class="tabT"><a href="' . $tab_url . '">' . $tab_name . '</a></div></td>';
        }
        $tabs = '<table border=0 cellspacing=1 cellpadding=0 class="tab">
<tr class="tab">' . $tabs . '</tr>
</table>';
    }
}
$cur_ppage = tmpl_cur_ppage('', $folders);
$spell_check_button = $FUD_OPT_1 & 2097152 && extension_loaded('pspell') && $usr->pspell_lang ? '<input type="submit" class="button" value="Spell-check Message" name="spell">&nbsp;' : '';
if (isset($_POST['preview']) || isset($_POST['spell'])) {
    $text = apply_custom_replace($_POST['msg_body']);
    $text_s = apply_custom_replace($_POST['msg_subject']);
    if ($FUD_OPT_1 & 4096) {
        $text = tags_to_html($text, $FUD_OPT_1 & 16384);
    } else {
        if ($FUD_OPT_1 & 2048) {
            $text = nl2br(htmlspecialchars($text));
        }
    }
    if ($FUD_OPT_1 & 6144) {
        char_fix($text);
    }
    if ($FUD_OPT_1 & 8192 && !$msg_smiley_disabled) {
        $text = smiley_to_post($text);
    }
    $text_s = htmlspecialchars($text_s);
    char_fix($text_s);
        q("UPDATE " . sql_p . "msg SET mlist_msg_id='" . addslashes($emsg->msg_id) . "' WHERE id=" . intval($m[2]) . " AND mlist_msg_id IS NULL");
        if (db_affected()) {
            exit;
        }
    }
}
$msg_post->body = apply_custom_replace($emsg->body);
if (!($mlist->mlist_opt & 16)) {
    if ($frm->forum_opt & 16) {
        $msg_post->body = tags_to_html($msg_post->body, 0);
    } else {
        $msg_post->body = nl2br($msg_post->body);
    }
}
fud_wordwrap($msg_post->body);
$msg_post->subject = htmlspecialchars(apply_custom_replace($emsg->subject));
if (!strlen($msg_post->subject)) {
    mlist_error_log("Blank Subject", $emsg->raw_msg);
}
if (!$emsg->from_email || !$emsg->from_name) {
    $msg_post->poster_id = 0;
} else {
    $msg_post->poster_id = match_user_to_post($emsg->from_email, $emsg->from_name, $mlist->mlist_opt & 64, $emsg->user_id);
}
$msg_post->ip_addr = $emsg->ip;
$msg_post->mlist_msg_id = addslashes($emsg->msg_id);
$msg_post->attach_cnt = 0;
$msg_post->poll_id = 0;
$msg_post->msg_opt = 2;
$msg_post->post_stamp = !empty($emsg->headers['date']) ? strtotime($emsg->headers['date']) : 0;
if ($msg_post->post_stamp < 1 || $msg_post->post_stamp > __request_timestamp__) {
Example #5
0
        $minimsg = '';
    }
}
if (!$th_id) {
    $label = 'Crea Topic';
} else {
    if ($msg_id) {
        $label = 'Applica le modifiche al messaggio';
    } else {
        $label = 'Rispondi';
    }
}
$spell_check_button = $FUD_OPT_1 & 2097152 && extension_loaded('pspell') && $usr->pspell_lang ? '<input type="submit" class="button" value="Controllo ortografico del messaggio" name="spell">&nbsp;' : '';
if (isset($_POST['preview']) || isset($_POST['spell'])) {
    $text = apply_custom_replace($msg_body);
    $text_s = apply_custom_replace($msg_subject);
    if ($frm->forum_opt & 16) {
        $text = tags_to_html($text, $perms & 32768);
    } else {
        if ($frm->forum_opt & 8) {
            $text = nl2br(htmlspecialchars($text));
        }
    }
    if ($frm->forum_opt & 24) {
        char_fix($text);
    }
    if ($perms & 16384 && !$msg_smiley_disabled) {
        $text = smiley_to_post($text);
    }
    $text_s = htmlspecialchars($text_s);
    char_fix($text_s);
Example #6
0
    if (!empty($frm->poll_id)) {
        $pl_name = $frm->name;
        reverse_fmt($pl_name);
        $pl_max_votes = $frm->max_votes;
        $pl_expiry_date = $frm->expiry_date;
    } else {
        $pl_name = $pl_max_votes = $pl_expiry_date = '';
    }
}
/* remove a poll option */
if (isset($_GET['del_id'])) {
    poll_del_opt((int) $_GET['del_id'], $pl_id);
}
/* Adding or Updating poll options */
if (!empty($_POST['pl_upd']) || !empty($_POST['pl_add'])) {
    $pl_option = apply_custom_replace($_POST['pl_option']);
    if ($frm->forum_opt & 16) {
        $pl_option = tags_to_html($pl_option, $frm->group_cache_opt & 32768);
    } else {
        if ($frm->forum_opt & 8) {
            $pl_option = nl2br(htmlspecialchars($pl_option));
        }
    }
    if ($frm->group_cache_opt & 16384 && !isset($_POST['pl_smiley_disabled'])) {
        $pl_option = smiley_to_post($pl_option);
    }
    if (isset($_POST['pl_upd'], $_POST['pl_option_id'])) {
        poll_opt_sync((int) $_POST['pl_option_id'], $pl_option);
    } else {
        poll_opt_add($pl_option, $pl_id);
    }