Beispiel #1
0
        $bug = new BugReport();
        $bug->loaddb($_GET['bug']);
        $text = ereg_prepare($bug->text);
        $stack = ereg_prepare($bug->stack);
        $query = "INSERT INTO " . TBUGS . " (bug_error_regexp,bug_stack_regexp) VALUES ('" . mysql_real_escape_string($text) . "','" . mysql_real_escape_string($stack) . "')";
        $result = mysql_query($query) or die("MySQL Error: " . mysql_error());
        $bug->bug = mysql_insert_id();
        $bug->update2db();
        echo "<script type=\"text/javascript\">\n";
        echo "<!--\n";
        echo "window.opener.location='index.php?show=bug&id=" . $bug->bug . "'\n";
        echo "window.close()\n";
        echo "-->\n";
        echo "</script>";
    } else {
        $bug = new BugReport();
        $bug->loaddb($_GET['bug']);
        $bug->bug = $_GET['pick'];
        $bug->update2db();
        echo "<script type=\"text/javascript\">\n";
        echo "<!--\n";
        echo "window.opener.location.reload()\n";
        echo "window.close()\n";
        echo "-->\n";
        echo "</script>";
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
Beispiel #2
0
<?php

$id = $_GET['id'];
echo '<h2 style="text-align:center">Viewing Bug Report #' . $id . '</h2>';
$bug = new BugReport();
$bug->loaddb($id);
$bug->show();
Beispiel #3
0
if (isset($_GET['lang']) && is_readable("lang/" . $_GET['lang'])) {
    include "lang/" . $_GET['lang'];
}
if (!isset($_FILES['file']) && !isset($_POST['report'])) {
    die(text("nomessage"));
}
include '../libs/xml.class.php';
include '../libs/bugreport.class.php';
include '../libs/bug.class.php';
include '../libs/func.lib.php';
include '../config.inc.php';
include 'common.inc.php';
if (blocked($_SERVER['REMOTE_ADDR']) !== false) {
    die(text('blocked'));
}
$bugreport = new BugReport();
if (isset($_FILES['file'])) {
    $bugreport->load_report($_FILES['file']['tmp_name'], true);
} elseif (isset($_POST['report'])) {
    $bugreport->load_report(stripslashes($_POST['report']));
}
$r = $bugreport->check();
if (!$r) {
    die(text("invalid"));
}
$r = $bugreport->check_amsn_version();
if (!$r) {
    die(text("update"));
}
$r = $bugreport->supported();
if (!$r) {
Beispiel #4
0
 function actions()
 {
     if (isset($_POST['submit'])) {
         switch ($_POST['submit']) {
             case 'Save':
                 foreach ($_POST as $key => $value) {
                     $_POST[$key] = stripslashes($value);
                 }
                 $this->name = isset($_POST['name']) ? $_POST['name'] : $this->name;
                 if (isset($_POST['flag']) && $_POST['flag'] != $this->flag) {
                     $this->flag = $_POST['flag'];
                     $this->lastupdate = mktime();
                     foreach ($this->bugs as $id) {
                         $report = new BugReport();
                         $report->loaddb($id);
                         $report->updated($this->flag);
                     }
                 }
                 $this->developer = isset($_POST['developer']) ? $_POST['developer'] : $this->developer;
                 $this->desc = isset($_POST['desc']) ? $_POST['desc'] : $this->desc;
                 $this->error_regexp = isset($_POST['error_regexp']) ? $_POST['error_regexp'] : $this->error_regexp;
                 $this->stack_regexp = isset($_POST['stack_regexp']) ? $_POST['stack_regexp'] : $this->stack_regexp;
                 $this->update2db();
                 break;
             case 'Delete':
                 $this->deletedb();
                 $this->msg('Bug deleted!', true);
                 break;
             case 'Search':
                 $query = "UPDATE " . TBUGREPORTS . " SET bug_parent='0' WHERE bug_parent='" . $this->_id . "'";
                 mysql_query($query) or die('MySQL Query Error! ' . mysql_error());
                 $query = "SELECT bug_id,bug_text,bug_stack FROM " . TBUGREPORTS . " WHERE bug_parent='0'";
                 $result = mysql_query($query) or die('MySQL Query Error! ' . mysql_error());
                 $found = 0;
                 while ($row = mysql_fetch_array($result)) {
                     $bug_text = $this->xml_decode($row['bug_text']);
                     $bug_stack = $this->xml_decode($row['bug_stack']);
                     if (ereg($this->error_regexp, $bug_text) && ereg_mline($this->stack_regexp, $bug_stack)) {
                         $query = "UPDATE " . TBUGREPORTS . " SET bug_parent='" . $this->_id . "' WHERE bug_id='" . $row['bug_id'] . "'";
                         mysql_query($query) or die('MySQL Query Error! ' . mysql_error());
                         $this->bugs[] = $row['bug_id'];
                         $found++;
                     }
                 }
                 $this->msg("Found " . $found . " bug reports!", false);
                 break;
             case 'Preview':
                 $this->stack_regexp = stripslashes($_POST['stack_regexp']);
                 $this->error_regexp = stripslashes($_POST['error_regexp']);
                 $query = "SELECT bug_id,bug_text,bug_stack FROM " . TBUGREPORTS . " WHERE bug_parent='0' OR bug_parent='" . $this->_id . "'";
                 $result = mysql_query($query) or die('MySQL Query Error! ' . mysql_error());
                 $found = 0;
                 $bugs = array();
                 while ($row = mysql_fetch_array($result)) {
                     $bug_text = $this->xml_decode($row['bug_text']);
                     $bug_stack = $this->xml_decode($row['bug_stack']);
                     if (ereg($this->error_regexp, $bug_text) && ereg_mline($this->stack_regexp, $bug_stack)) {
                         if (count($bugs) < 10) {
                             $bugs[] = $row['bug_id'];
                         }
                         $found++;
                     }
                 }
                 $this->msg("Found " . $found . " bug reports!", false);
                 $str = '';
                 foreach ($bugs as $id) {
                     $str .= '<a href="?show=bugreport&amp;id=' . $id . '">' . $id . '</a> ';
                 }
                 $this->msg("Preview: " . $str, false);
                 break;
         }
     }
 }