Beispiel #1
0
function load_view($id)
{
    global $cp;
    $objQueue = new Queue();
    $objQueue->setUid($id);
    if ($objQueue->load()) {
        $cp->set_data(nl2br($objQueue->getBbs('description')));
    } else {
        $cp->set_data('item not found!');
    }
    return;
}
Beispiel #2
0
function saveQueue($testbed, $suite)
{
    $simple = new Queue();
    $_GET['build'] = $_REQUEST['versionBuild'];
    $_GET['suite'] = $suite;
    $_GET['command'] = 1;
    $_GET['testbed'] = $testbed;
    $_GET['dbResults'] = "on";
    $_GET['description'] = "Automatically queue'd from Nightly Build Server";
    $_GET['userName'] = "******";
    $_GET['tftpIP'] = 1;
    $simple->setAuto($_GET);
    $simple->setUid('');
    $simple->load();
    $simple->add();
    sleep(6);
}
Beispiel #3
0
function saveQueue($testbed, $suite)
{
    $linkID = mysql_connect('10.65.102.22', 'root', '123456');
    if (!$linkID) {
        die('Could not connect: ' . mysql_error());
    }
    $db = mysql_select_db('autoSmoke', $linkID);
    $queryPrefix = "";
    if ($_GET['prefix'] != "") {
        $queryPrefix = "prefix = '" . $_GET['prefix'] . "' and ";
    }
    $threeMinAgo = date('Y-m-d H:i:s', mktime(date("H"), date("i") - 2, date("s"), date("n"), date("j"), date("Y")));
    $sql = "select * " . "from " . "queue " . "where " . "userName='******' and " . "command regexp '1' and " . "description='Automatically queue\\'d from Nightly Build Server' and " . $queryPrefix . "testbed regexp '" . $testbed . "' and " . "build regexp '" . $_GET['versionBuild'] . "' and " . "suite = 'DD:" . $suite . "' and " . "status = 2 and '" . $threeMinAgo . "' <= creationDate";
    $rs = mysql_query($sql);
    if (!mysql_num_rows($rs)) {
        $simple = new Queue();
        if ($_GET['prefix'] == "C_" || $_GET['prefix'] == "T_") {
            $_GET['prefix'] = $_GET[prefix];
        }
        $_GET['build'] = $_GET['versionBuild'];
        $_GET['suite'] = $suite;
        $_GET['command'] = 1;
        $_GET['testbed'] = $testbed;
        $_GET['dbResults'] = "on";
        $_GET['description'] = "Automatically queue'd from Nightly Build Server";
        $_GET['userName'] = "******";
        $_GET['tftpIP'] = 1;
        //   	if (!preg_match ("/^5.0/", $_GET['versionBuild']) && !preg_match ("/^6.0/", $_GET['versionBuild']))
        //		$_GET['loadAlcatel'] = 'on';
        $simple->setAuto($_GET);
        $simple->setUid('');
        $simple->load();
        $simple->add();
        sleep(1);
    }
    mysql_close($linkID);
}
Beispiel #4
0
            } else {
                $hasErrors = 2;
            }
        }
    }
    if ($_POST['editQualys']) {
        $simple = new Queue();
        $_GET['build'] = $_POST['build'] ? $_POST['build'] : $_POST['build2'];
        $_GET['suite'] = "D";
        $_GET['command'] = 1;
        $_GET['testbed'] = "autoqualys";
        $_GET['dbResults'] = "on";
        $_GET['userName'] = "******";
        $_GET['tftpIP'] = 1;
        $simple->setAuto($_GET);
        $simple->setUid('');
        $simple->load();
        $simple->add();
    }
}
// --- LOAD Queue -----------------------------------------------
$objItemList = new Queue();
$objItemList->addWhere('((status != 5 and DATE_SUB(CURDATE(),INTERVAL 3 DAY) <= creationDate) or ' . '(status = 5 and DATE_SUB(CURDATE(),INTERVAL 3 DAY) <= creationDate))');
if ($_REQUEST['sTestbed']) {
    $pUserName = get_magic_quotes_gpc() ? stripslashes($_REQUEST['sTestbed']) : $_REQUEST['sTestbed'];
    $objItemList->addWhere('testbed = \'' . addslashes($pUserName) . '\'');
}
if ($_REQUEST['sSuite']) {
    $pSuite = $_REQUEST['sSuite'];
    $objItemList->addWhere('suite = \'' . $pSuite . '\'');
}