예제 #1
0
파일: report.php 프로젝트: stof/pearweb
            $_POST['in']['did_luser_search'] = 1;
            // search for a match using keywords from the subject
            $sdesc = $_POST['in']['sdesc'];
            /*
             * If they are filing a feature request,
             * only look for similar features
             */
            $package_name = $_POST['in']['package_name'];
            $where_clause = 'WHERE bugdb.package_name=p.name ';
            if ($package_name == 'Feature/Change Request') {
                $where_clause .= "AND package_name = '{$package_name}'";
            } else {
                $where_clause .= "AND package_name != 'Feature/Change Request'";
            }
            define('BOOLEAN_SEARCH', 0);
            list($sql_search, $ignored) = format_search_string($sdesc);
            $where_clause .= $sql_search;
            /** Bug #11423 Make sure that a bug report is registered */
            $where_clause .= ' AND p.package_type="pear" and bugdb.registered = 1 ';
            $query = "SELECT bugdb.* from bugdb, packages p {$where_clause} LIMIT 5";
            $res =& $dbh->query($query);
            if ($res->numRows() == 0) {
                $ok_to_submit_report = true;
            } else {
                response_header('Report - Confirm');
                ?>

<p>
 Are you sure that you searched before you submitted your bug report? We
 found the following bugs that seem to be similar to yours; please check
 them before sumitting the report as they might contain the solution you
예제 #2
0
파일: search.php 프로젝트: stof/pearweb
            break;
        }
        $where_clause .= ' AND bugdb.status IN' . " ('Closed', 'Duplicate', 'Bogus', 'Wont Fix', 'Suspended')\n                           AND (UNIX_TIMESTAMP('" . $releaseDate[0]['releasedate'] . "') < UNIX_TIMESTAMP(bugdb.ts2))\n                         ";
        break;
    case 'Open':
    default:
        $where_clause .= " AND bugdb.status IN ('Open', 'Assigned'," . " 'Analyzed', 'Critical', 'Verified')";
    case 'OpenFeedback':
    default:
        $where_clause .= " AND bugdb.status IN ('Open', 'Assigned'," . " 'Analyzed', 'Critical', 'Verified', 'Feedback')";
}
if (empty($_GET['search_for'])) {
    $search_for = '';
} else {
    $search_for = htmlspecialchars($_GET['search_for']);
    list($sql_search, $ignored) = format_search_string($search_for);
    $where_clause .= $sql_search;
    if (count($ignored) > 0) {
        $warnings[] = 'The following words were ignored: ' . implode(', ', array_unique($ignored));
    }
}
if (empty($_GET['bug_type']) || $_GET['bug_type'] == 'All') {
    $bug_type = '';
} else {
    $bug_type = $_GET['bug_type'];
    if ($bug_type == 'Bugs') {
        $where_clause .= ' AND (bugdb.bug_type = "Bug" OR bugdb.bug_type="Documentation Problem")';
    } else {
        $where_clause .= ' AND bugdb.bug_type = ' . $dbh->quoteSmart($bug_type);
    }
}
예제 #3
0
    if ($logged_in || $_POST['in']['passwd'] == '') {
        $_POST['in']['passwd'] = uniqid();
    }
    // try to verify the user
    $_POST['in']['email'] = $auth_user->email;
    $package_name = $_POST['in']['package_name'];
    if (!$errors) {
        // When user submits a report, do a search and display the results before allowing them to continue.
        if (!isset($_POST['preview']) && empty($_POST['in']['did_luser_search'])) {
            $_POST['in']['did_luser_search'] = 1;
            $where_clause = "WHERE package_name != 'Feature/Change Request'";
            if (!$is_security_developer) {
                $where_clause .= " AND private = 'N' ";
            }
            // search for a match using keywords from the subject
            list($sql_search, $ignored) = format_search_string($_POST['in']['sdesc']);
            $where_clause .= $sql_search;
            $query = "SELECT * from bugdb {$where_clause} LIMIT 5";
            $res = $dbh->prepare($query)->execute();
            if ($res->numRows() == 0) {
                $ok_to_submit_report = true;
            } else {
                response_header("Report - Confirm");
                if (count($_FILES)) {
                    echo '<h1>WARNING: YOU MUST RE-UPLOAD YOUR PATCH, OR IT WILL BE IGNORED</h1>';
                }
                ?>
				<p>
					Are you sure that you searched before you submitted your bug report? We
					found the following bugs that seem to be similar to yours; please check
					them before submitting the report as they might contain the solution you
예제 #4
0
         break;
     case 'Stale':
         $where_clause .= "\tAND bugdb.status NOT IN ('Closed', 'Duplicate', 'Not a bug')\n\t\t\t\t\t\t\t\tAND TO_DAYS(NOW())-TO_DAYS(bugdb.ts2) > 30";
         break;
     case 'Not Assigned':
         $where_clause .= " AND bugdb.status NOT IN ('Closed', 'Duplicate', 'Not a bug', 'Assigned', 'Wont Fix', 'Suspended')";
         break;
     case 'OpenFeedback':
         $where_clause .= " AND bugdb.status IN ('Open', 'Re-Opened', 'Assigned','Analyzed', 'Critical', 'Verified', 'Feedback')";
         break;
     default:
     case 'Open':
         $where_clause .= " AND bugdb.status IN ('Open', 'Re-Opened', 'Assigned', 'Analyzed', 'Critical', 'Verified')";
 }
 if ($search_for != '') {
     list($sql_search, $ignored) = format_search_string($search_for, $boolean_search);
     $where_clause .= $sql_search;
     if (count($ignored) > 0) {
         $warnings[] = 'The following words were ignored: ' . implode(', ', array_unique($ignored));
     }
 }
 if ($bug_type != '') {
     if ($bug_type == 'Bugs') {
         $where_clause .= ' AND (bugdb.bug_type = "Bug" OR bugdb.bug_type="Documentation Problem")';
     } else {
         $where_clause .= ' AND bugdb.bug_type = ' . $dbh->quote($bug_type);
     }
 }
 if ($bug_age > 0) {
     $where_clause .= " AND bugdb.ts1 >= DATE_SUB(NOW(), INTERVAL {$bug_age} DAY)";
 }