예제 #1
0
파일: bug.php 프로젝트: phpsource/web-bugs
        if (!empty($_POST['in']['assign']) && $_POST['in']['status'] == 'Open') {
            $status = 'Assigned';
        } elseif (empty($_POST['in']['assign']) && $_POST['in']['status'] == 'Assigned') {
            $status = 'Open';
        } else {
            $status = $_POST['in']['status'];
        }
        // Assign automatically when closed
        if ($status == 'Closed' && $_POST['in']['assign'] == '') {
            $_POST['in']['assign'] = $auth_user->handle;
        }
        $dbh->prepare($query . "\n\t\t\t\tsdesc = ?, \n\t\t\t\tstatus = ?, \n\t\t\t\tpackage_name = ?,\n\t\t\t\tbug_type = ?,\n\t\t\t\tassign = ?,\n\t\t\t\tphp_version = ?,\n\t\t\t\tphp_os = ?,\n\t\t\t\tblock_user_comment = ?,\n\t\t\t\tcve_id = ?,\n\t\t\t\tprivate = ?,\n\t\t\t\tts2 = NOW()\n\t\t\tWHERE id = {$bug_id}\n\t\t")->execute(array($_POST['in']['sdesc'], $status, $_POST['in']['package_name'], $_POST['in']['bug_type'], $_POST['in']['assign'], $_POST['in']['php_version'], $_POST['in']['php_os'], $block_user, $_POST['in']['cve_id'], $is_private));
        // Add changelog entry
        $changed = bug_diff($bug, $_POST['in']);
        if (!empty($changed)) {
            $log_comment = bug_diff_render_html($changed);
            if (!empty($log_comment)) {
                $res = bugs_add_comment($bug_id, $from, $comment_name, $log_comment, 'log');
            }
        }
        // Add normal comment
        if (!empty($ncomment)) {
            $res = bugs_add_comment($bug_id, $from, $comment_name, $ncomment, 'comment');
            mark_related_bugs($from, $comment_name, $ncomment);
        }
    }
} elseif (isset($_POST['in']) && isset($_POST['preview']) && $edit == 1) {
    $ncomment = trim($_POST['ncomment']);
    $from = $auth_user->email;
} elseif (isset($_POST['in'])) {
    $errors[] = 'Invalid edit mode.';
예제 #2
0
파일: bug.php 프로젝트: stof/pearweb
             if (isset($_POST['in']['fixed_versions']) && !in_array($status, array('Bogus', 'Wont fix', 'No Feedback'))) {
                 foreach ($_POST['in']['fixed_versions'] as $rid) {
                     $link->id = $id;
                     $link->roadmap_id = $rid;
                     $link->insert();
                 }
             }
             $current = $dbh->getAll('SELECT roadmap_version
             FROM bugdb_roadmap_link l, bugdb_roadmap b
             WHERE l.id = ? AND b.id = l.roadmap_id', array($id));
         } else {
             $current = $previous;
         }
         $changed = bug_diff($bug, $_POST['in'], $previous, $current);
         if (!empty($changed)) {
             $ncomment = bug_diff_render_html($changed) . $ncomment;
         }
         if (!empty($ncomment)) {
             $query = 'INSERT INTO bugdb_comments' . ' (bug, email, ts, comment, reporter_name, handle, active) VALUES (?, ?, NOW(), ?, ?, ?, 1)';
             $dbh->query($query, array($id, $from, $ncomment, $comment_name, $auth_user->handle));
         }
         localRedirect('bug.php?id=' . $id);
         exit;
     }
 } elseif (isset($_POST['in']) && isset($_POST['preview']) && $edit == 1) {
     $ncomment = trim($_POST['ncomment']);
     $from = $auth_user->email;
 } elseif (isset($_POST['in'])) {
     $errors[] = 'Invalid edit mode.';
     $ncomment = '';
 } else {