blob: 96ca0cc31e64586b99bbb3e2d04ee1e234d1743b [file] [log] [blame]
<?php
$_PASSWORD = $_GET['password'];
if($_PASSWORD == "abc123") {
require_once "/home/data/httpd/eclipse-php-classes/system/dbconnection_bugs_ro.class.php";
/*
* Basic connection to Bugzilla and auto-select the "bugs" DB
*
*/
function bugzilla_connect() {
global $dbc;
$dbc = new DBConnectionBugs();
$dbh = $dbc->connect();
if (!$dbh) {
trigger_error("Couldn't connect to Bugzilla DB", E_USER_ERROR);
} else {
if ( !$tsProductId ) {
create_ts_globals($link);
}
return $link;
}
}
function create_ts_globals($dbh) {
// The main product name
global $tsProductId, $tsProductName;
echo "8r8looking up product ID</br>";
$result = mysql_query($dbh, "SELECT id, name FROM products WHERE products.name = \"Tigerstripe\"");
if(mysql_errno($dbh) > 0) {
echo "There was an error processing this request";
# For debugging purposes - don't display this stuff in a production page.
# echo mysql_error($dbh);
# Mysql disconnects automatically, but I like my disconnects to be explicit.
$dbc->disconnect();
exit;
}
while($row = mysql_fetch_assoc($result)) {
$tsProductId = $row['id'];
$tsProductName = $row['name'];
}
// all the milestones
global $milestones;
$result = mysql_query("SELECT value FROM milestones WHERE milestones.product_id = $tsProductId ORDER BY milestones.sortkey,milestones.value DESC", $dbh);
while($row = mysql_fetch_array($result)) {
$milestones[] = $row['value'];
}
}
/*
* Basic close for connection
*
*/
function bugzilla_close( $link ) {
$dbc->disconnect();
$dbc = null;
}
}
?>