Exemplo n.º 1
0
 public function create($productID, $branch = '', $extras = '')
 {
     $pubuConfig = $this->loadModel('pubu')->getConfig();
     //todo if create send notification to pubuim
     if (!empty($_POST) and !isset($_POST['stepIDList']) && $pubuConfig->webhook) {
         $result = @$this->loadModel('pubu')->sendNotification($pubuConfig->webhook, array("type" => "BUG.CREATE", "operator" => $this->app->user->account, "data" => $_POST));
     }
     parent::create($productID, $branch, $extras);
 }
Exemplo n.º 2
0
 public function resolve()
 {
     $pubuConfig = $this->loadModel('pubu')->getConfig();
     //todo if create send notification to pubuim
     if (!empty($_POST) && $pubuConfig->webhook) {
         $this->loadModel('pubu')->sendNotification($pubuConfig->webhook, array("type" => "BUG.RESOLVE", "operator" => $this->app->user->account, "data" => $_POST));
     }
     parent::resolve();
 }
Exemplo n.º 3
0
<?php

useScript("sorttable.js");
useScript("tablehover.js");
$Count = $PAGE_MAX_COUNT;
if (isset($argv[2])) {
    $class = htmlentities($argv[1], ENT_QUOTES);
    $id = htmlentities($argv[2], ENT_QUOTES);
    // echo "Getting $id bugs filtering by $class";
}
$b = new bug();
$b->getAll();
$u = new user();
$p = new project();
$TITLE = "Latest {$Count} bugs";
$i = 0;
$CONTENT .= "<h1>Last {$Count} bugs filed</h1>";
$CONTENT .= "\n<table class = 'sortable' >\n\t<tr class = 'nobg' >\n\t\t<th>ID</th> <th> Status </th> <th> Severity </th> <th>Owner</th> <th>Project</th> <th>Private</th> <th>Title</th>\n\t</tr>\n";
while ($row = $b->getNext()) {
    $u->getAllByPK($row['owner']);
    $owner = $u->getNext();
    if ($owner['uID'] <= 0) {
        $owner['real_name'] = "Nobody";
    }
    $p->getAllByPK($row['package']);
    $package = $p->getNext();
    if (isset($_SESSION['id'])) {
        $id = $_SESSION['id'];
    } else {
        $id = -1;
        // NOT -10000!!!!!!
Exemplo n.º 4
0
<?php

$p = new project();
$b = new bug();
$p->getByCol("project_name", $argv[1]);
// this is goddamn awesome
$row = $p->getNext();
$b->getByCol("package", $row['pID']);
// this is goddamn awesome
$booboos = $b->numrows();
$critical = 0;
// doh // $b->specialSelect( "bug_status != 1" );
if (isset($row['pID'])) {
    $TITLE = $row['project_name'] . ", one of the fantastic projects on Whube";
    $CONTENT = "\n<h1>" . $row['project_name'] . "</h1>\n" . $row['descr'] . "<br />\n<br />\nThere are " . $booboos . " bugs in the tracker on this package. " . $critical . " are critical.\n";
} else {
    $_SESSION['err'] = "Project " . $argv[1] . " does not exist!";
    header("Location: {$SITE_PREFIX}" . "t/home");
    exit(0);
}
Exemplo n.º 5
0
/*
 *  License:     GPLv3
 *  Author:      Paul Tagliamonte <*****@*****.**>
 *  Description:
 *    You POST against this file
 */
session_start();
include "conf/site.php";
include "libs/php/globals.php";
requireLogin();
if (isset($_POST['project']) && isset($_POST['title']) && isset($_POST['descr'])) {
    include "model/user.php";
    include "model/project.php";
    include "model/bug.php";
    $b = new bug();
    $u = new user();
    $p = new project();
    // let's first verify the project.
    $pname = htmlentities($_POST['project'], ENT_QUOTES);
    $title = htmlentities($_POST['title'], ENT_QUOTES);
    $descr = htmlentities($_POST['descr'], ENT_QUOTES);
    $p->getByCol("project_name", $pname);
    $project = $p->getNext();
    if ($project != NULL && $project['pID'] > 0) {
        $fields = array("package" => $project['pID'], "reporter" => $_SESSION['id'], "title" => $title, "descr" => $descr);
        $id = $b->createNew($fields);
        $_SESSION['msg'] = "New bug created!";
        header("Location: {$SITE_PREFIX}" . "t/bug/{$id}");
        exit(0);
    } else {
Exemplo n.º 6
0
function checkBugViewAuth($bugID, $requester)
{
    $b = new bug();
    $u = new user();
    $p = new project();
    $b->getAllByPK($bugID);
    $bug = $b->getNext();
    if (isset($bug['bID'])) {
        if (isset($_SESSION['patrick_stewart']) && $_SESSION['patrick_stewart']) {
            // see gate for context
            return array(true, $bug['private']);
            // public bug, dummy
        }
        $whoami = $requester;
        if ($bug['private']) {
            // good query.
            $u->getAllByPK($bug['owner']);
            $owner = $u->getNext();
            $u->getAllByPK($bug['reporter']);
            $reporter = $u->getNext();
            $p->getAllByPK($bug['package']);
            $project = $p->getNext();
            $oid = -10000;
            $rid = -10000;
            $pid = -10000;
            if (isset($owner['uID'])) {
                $oid = $owner['uID'];
            }
            if (isset($reporter['uID'])) {
                $rid = $reporter['uID'];
            }
            if (isset($project['oID'])) {
                $pid = $project['oID'];
            }
            if ($oid != $whoami && $rid != $whoami && $pid != $whoami) {
                return array(false, $bug['private']);
            } else {
                return array(true, $bug['private']);
            }
        } else {
            return array(true, $bug['private']);
            // public bug, dummy
        }
    } else {
        return array(false, false);
        // bug iz no good
    }
    /* 
    
    if bug.private:
    	check if is owner
    	check if is reporter
    	check if is asignee
    	check if is project owner
    	check if site administrator / staff
    
    	any of the above: Yes, otherwise, no
    else:
    	Yes
    Query bug, if it's public, don't give a shit.
    */
}
Exemplo n.º 7
0
        if ($bug->Alta()) {
            $bug->Reportar();
            echo "OK";
        } else {
            echo "ERROR";
        }
        exit;
        break;
    case "avisobug":
        $titulo = CleanText($_POST["titulo"]);
        $quedonde = CleanText($_POST["quedonde"]);
        $queesperaba = CleanText($_POST["queesperaba"]);
        $categoria = CleanText($_POST["categoria"]);
        $queocurrio = CleanText($_POST["queocurrio"]);
        $urgencia = CleanID($_POST["urgencia"]);
        $bug = new bug();
        $bug->Fallo($titulo, $quedonde, $queesperaba, $categoria, $queocurrio, $urgencia);
        if ($bug->Alta()) {
            $bug->Reportar();
            echo "OK";
        } else {
            echo "ERROR";
        }
        exit;
        break;
}
StartXul("Reporte");
?>
<box flex="1" class="frameExtra" style="overflow: auto">
<spacer flex="1" class="frameExtra"/>
   <vbox>
Exemplo n.º 8
0
<?php

/*
 *  License:     GPLv3
 *  Author:      Paul Tagliamonte <*****@*****.**>
 *  Description:
 *    Where you post a bug against
 */
session_start();
include "conf/site.php";
include "libs/php/globals.php";
requireLogin();
include "model/bug.php";
include "model/user.php";
include "model/project.php";
$b = new bug();
/*

 --> get shiz via $_POST all like:

Array (
	[bID] => 1
	[project] => whube_docs
	[title] => Whube is not done yet
	[status] => 1
	[severity] => 1
	[owner] => raidsong
)
*/
// print_r( $_POST ); // data sent to us
if (isset($_POST['bID']) && $_POST['bID'] != "") {
Exemplo n.º 9
0
 *  License:     AGPLv3
 *  Author:      Paul Tagliamonte <*****@*****.**>
 *  Description:
 *    For the email daemon.
 */
$d['errors'] = true;
$d['message'] = "Unknown Error";
$ip = $_SERVER['REMOTE_ADDR'];
include "conf/site.php";
include "libs/php/globals.php";
if (requireLocalIP()) {
    // check list
    include "model/bug.php";
    include "model/user.php";
    include "model/project.php";
    $b = new bug();
    $o = new user();
    $p = new project();
    $meta = array();
    foreach ($_POST as $key => $value) {
        $meta[clean($key)] = clean($value);
        // f**k you, user
    }
    if (isset($meta['email']) && isset($meta['project']) && isset($meta['title']) && isset($meta['body'])) {
        $o->getByCol("email", $meta['email']);
        $submitter = $o->getNext();
        if (isset($submitter['uID'])) {
            // OK to insert
            $fields = array("reporter" => $submitter['uID'], "owner" => $submitter['uID'], "title" => $meta['title'], "descr" => $meta['body']);
            $id = $b->createNew($fields);
            $d['errors'] = false;
Exemplo n.º 10
0
<?php

$p = new project();
$b = new bug();
$u = new user();
$u->getByCol("username", $argv[1]);
$user = $u->getNext();
$RIGHTS_OBJECT->getAllByPK($user['uID']);
$user_rights = $RIGHTS_OBJECT->getNext();
$p->getAll("owner", $user['uID']);
// this is goddamn awesome
$projects = $p->numrows();
$b->getByCol("package", $user["uID"]);
// this is goddamn awesome
$booboos = $b->numrows();
$critical = 0;
// doh // $b->specialSelect( "bug_status != 1" );
if (isset($user["username"])) {
    $projectList = "";
    $i = 0;
    while ($row = $p->getNext()) {
        $projectList .= "<li><a href='../project/" . $row['project_name'] . "'>" . $row['project_name'] . "</a></li>";
        $i++;
    }
    $TITLE = $user["username"] . ", one of the fantastic users on Whube";
    $CONTENT = "\n<h1>" . $user["username"] . "</h1>\nThis here be " . $user['real_name'] . ".<br />\nThere are " . $booboos . " bugs filed by " . $user['username'] . ". " . $critical . " are critical.<br />\n<br />\n" . $user_rights['admin'] . " - Admin<br />\n" . $user_rights['staff'] . " - Staff<br />\n" . $user_rights['doner'] . " - Doner<br />\n" . $user_rights['member'] . " - Member<br />\n" . $user_rights['banned'] . " - Banned<br />\n<br />\n\n" . ucwords($user['username']) . " is owner of " . $projects . " projects. These projects are: \n<ul>" . $projectList . "</ul>\n";
} else {
    $_SESSION['err'] = "User " . $argv[1] . " does not exist!";
    header("Location: {$SITE_PREFIX}" . "t/home");
    exit(0);
}
Exemplo n.º 11
0
Arquivo: index.php Projeto: Bobtnt/PCG
int(11)
int(12)
int(100)
*/
echo '<hr>';
/**
 * $bug_collection->get('id == 99') is memory pointer to $otherBug
 * $bug_collection->get('id == 99')->getSubject() return 'my test'
 */
$otherBug->setSubject('my test');
echo $bug_collection->get('id == 99')->getSubject();
$bug_collection->save();
echo '<hr>';
unset($otherBug);
unset($bug_collection);
$mybug = new bug(100);
echo $mybug->getSubject();
echo '<hr>';
$bug = new bug(rand(10, 100));
Zend_Debug::Dump($bug->getId());
$categoryName = $bug->category->getName();
// return "hardware"
$categoryId = $bug->category->getId();
// return 1
$bug->setCategoryId(3)->save();
$categoryId = $bug->category->getId();
// return 3
$categoryName = $bug->category->getName();
// return "between the chair and the keyboard"
$bug = new bug(50);
$bug->reportedBy->getId();