error_permission(); } // ################################################################### if (empty($_REQUEST['do'])) { $_REQUEST['do'] = 'add'; } // ################################################################### if ($_POST['do'] == 'insert') { $bugsys->in['comment_parsed'] = $bugsys->in['comment']; if (!$bugsys->options['allowhtml']) { $bugsys->in['comment_parsed'] = $bugsys->sanitize($bugsys->in['comment_parsed']); } $time = time(); $db->query(" INSERT INTO " . TABLE_PREFIX . "comment (bugid, userid, dateline, comment, comment_parsed) VALUES (" . intval($bugsys->in['bugid']) . ", " . $bugsys->userinfo['userid'] . ", $time, '" . $bugsys->in['comment'] . "', '" . nl2br($bugsys->in['comment_parsed']) . "' )" ); $commentid = $db->insert_id(); $db->query("UPDATE " . TABLE_PREFIX . "bug SET lastposttime = $time, lastpostby = " . $bugsys->userinfo['userid'] . " WHERE bugid = " . intval($bugsys->in['bugid'])); // setup logging require_once('./includes/class_history.php'); $log = new History(); $log->bugid = $bugsys->in['bugid']; $log->language = 'log_new_comment'; $log->arguments = array($commentid); $log->log(); echo "in['bugid']) . "\">comment inserted"; } // ################################################################### if ($_REQUEST['do'] == 'add') { $bug = $db->query_first("SELECT bug.*, comment.comment FROM " . TABLE_PREFIX . "bug LEFT JOIN " . TABLE_PREFIX . "comment AS comment ON (bug.bugid = comment.bugid) WHERE bug.bugid = " . intval($bugsys->in['bugid'])); if (!$bug) { $message->error('alert: bad bug'); } eval('$template->flush("' . $template->fetch('newcomment') . '");'); } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>