Replace direct mysql_xxx() calls with query_xxx() calls. Replace calls to mysql_insert_id()
with calls specific to the appdb or bugzilla database. Fixes a bug where a call to mysql_insert_id() can potentially retrieve an id from either the bugzilla or appdb database, depending on whichever database was last opened by mysql_connect().
This commit is contained in:
@@ -48,7 +48,7 @@ if(!empty($aClean['sBody']))
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT * FROM appComments WHERE commentId = '?'",
|
$hResult = query_parameters("SELECT * FROM appComments WHERE commentId = '?'",
|
||||||
$aClean['iThread']);
|
$aClean['iThread']);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($oRow)
|
if($oRow)
|
||||||
{
|
{
|
||||||
$mesTitle = "<b>Replying To ...</b> $oRow->subject\n";
|
$mesTitle = "<b>Replying To ...</b> $oRow->subject\n";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ require_once(BASE."include/note.php");
|
|||||||
//FIXME: get rid of appId references everywhere, as version is enough.
|
//FIXME: get rid of appId references everywhere, as version is enough.
|
||||||
$sQuery = "SELECT appId FROM appVersion WHERE versionId = '?'";
|
$sQuery = "SELECT appId FROM appVersion WHERE versionId = '?'";
|
||||||
$hResult = query_parameters($sQuery, $aClean['iVersionId']);
|
$hResult = query_parameters($sQuery, $aClean['iVersionId']);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$appId = $oRow->appId;
|
$appId = $oRow->appId;
|
||||||
|
|
||||||
//check for admin privs
|
//check for admin privs
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ else
|
|||||||
apidb_header("Add Category");
|
apidb_header("Add Category");
|
||||||
$sQuery = "SELECT catId, catName FROM appCategory WHERE catId!='?'";
|
$sQuery = "SELECT catId, catName FROM appCategory WHERE catId!='?'";
|
||||||
$hResult = query_parameters($sQuery, $aClean['iCatId']);
|
$hResult = query_parameters($sQuery, $aClean['iCatId']);
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$aCatsIds[]=$oRow->catId;
|
$aCatsIds[]=$oRow->catId;
|
||||||
$aCatsNames[]=$oRow->catName;
|
$aCatsNames[]=$oRow->catName;
|
||||||
|
|||||||
@@ -111,13 +111,13 @@ if (isset($aClean['sSub']))
|
|||||||
FROM appFamily, appVersion, buglinks, bugs.bugs
|
FROM appFamily, appVersion, buglinks, bugs.bugs
|
||||||
".$sWhere."
|
".$sWhere."
|
||||||
ORDER BY buglinks.bug_id, appName, versionName
|
ORDER BY buglinks.bug_id, appName, versionName
|
||||||
LIMIT ".mysql_real_escape_string($offset).", ".mysql_real_escape_string($ItemsPerPage).";";
|
LIMIT ".query_escape_string($offset).", ".query_escape_string($ItemsPerPage).";";
|
||||||
|
|
||||||
$c = 0;
|
$c = 0;
|
||||||
|
|
||||||
if($hResult = query_parameters($sQuery))
|
if($hResult = query_parameters($sQuery))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oApp = new application($oRow->appId);
|
$oApp = new application($oRow->appId);
|
||||||
$oVersion = new version($oRow->versionId);
|
$oVersion = new version($oRow->versionId);
|
||||||
|
|||||||
@@ -52,14 +52,14 @@ echo "</center>";
|
|||||||
$offset = (($currentPage-1) * $ItemsPerPage);
|
$offset = (($currentPage-1) * $ItemsPerPage);
|
||||||
$commentIds = query_parameters("SELECT commentId from appComments ORDER BY ".
|
$commentIds = query_parameters("SELECT commentId from appComments ORDER BY ".
|
||||||
"appComments.time ASC LIMIT ?, ?", $offset, $ItemsPerPage);
|
"appComments.time ASC LIMIT ?, ?", $offset, $ItemsPerPage);
|
||||||
while ($oRow = mysql_fetch_object($commentIds))
|
while ($oRow = query_fetch_object($commentIds))
|
||||||
{
|
{
|
||||||
$sQuery = "SELECT from_unixtime(unix_timestamp(time), \"%W %M %D %Y, %k:%i\") as time, ".
|
$sQuery = "SELECT from_unixtime(unix_timestamp(time), \"%W %M %D %Y, %k:%i\") as time, ".
|
||||||
"commentId, parentId, versionId, userid, subject, body ".
|
"commentId, parentId, versionId, userid, subject, body ".
|
||||||
"FROM appComments WHERE commentId = '?'";
|
"FROM appComments WHERE commentId = '?'";
|
||||||
$hResult = query_parameters($sQuery, $oRow->commentId);
|
$hResult = query_parameters($sQuery, $oRow->commentId);
|
||||||
/* call view_app_comment to display the comment */
|
/* call view_app_comment to display the comment */
|
||||||
$oComment_row = mysql_fetch_object($hResult);
|
$oComment_row = query_fetch_object($hResult);
|
||||||
Comment::view_app_comment($oComment_row);
|
Comment::view_app_comment($oComment_row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ if (isset($aClean['sSub']))
|
|||||||
$sQuery.= " AND queued='false' ORDER BY realname;";
|
$sQuery.= " AND queued='false' ORDER BY realname;";
|
||||||
$hResult = query_parameters($sQuery);
|
$hResult = query_parameters($sQuery);
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !query_num_rows($hResult))
|
||||||
{
|
{
|
||||||
// no apps
|
// no apps
|
||||||
echo html_frame_start("","90%");
|
echo html_frame_start("","90%");
|
||||||
@@ -61,7 +61,7 @@ if (isset($aClean['sSub']))
|
|||||||
|
|
||||||
$c = 1;
|
$c = 1;
|
||||||
$oldUserId = 0;
|
$oldUserId = 0;
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oUser = new User($oRow->userId);
|
$oUser = new User($oRow->userId);
|
||||||
$oApp = new application($oRow->appId);
|
$oApp = new application($oRow->appId);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ if(isset($aClean['sRegenerate']))
|
|||||||
{
|
{
|
||||||
$sQuery = "SELECT id FROM appData WHERE type = 'screenshot'";
|
$sQuery = "SELECT id FROM appData WHERE type = 'screenshot'";
|
||||||
$hResult = query_parameters($sQuery);
|
$hResult = query_parameters($sQuery);
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
echo "REGENERATING IMAGE ".$oRow->id."<br/>";
|
echo "REGENERATING IMAGE ".$oRow->id."<br/>";
|
||||||
$screenshot = new Screenshot($oRow->id);
|
$screenshot = new Screenshot($oRow->id);
|
||||||
@@ -100,7 +100,7 @@ $Ids = query_parameters("SELECT * from appData
|
|||||||
ORDER BY id ASC LIMIT ?, ?", $offset, $ItemsPerPage);
|
ORDER BY id ASC LIMIT ?, ?", $offset, $ItemsPerPage);
|
||||||
$c = 1;
|
$c = 1;
|
||||||
echo "<div align=center><table><tr>\n";
|
echo "<div align=center><table><tr>\n";
|
||||||
while ($oRow = mysql_fetch_object($Ids))
|
while ($oRow = query_fetch_object($Ids))
|
||||||
{
|
{
|
||||||
// display thumbnail
|
// display thumbnail
|
||||||
$oVersion = new Version($oRow->versionId);
|
$oVersion = new Version($oRow->versionId);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ if(isset($aClean['sSubmit']))
|
|||||||
$hResult = query_parameters($sQuery, $sSearch, $sSearch, $aClean['sOrderBy'],
|
$hResult = query_parameters($sQuery, $sSearch, $sSearch, $aClean['sOrderBy'],
|
||||||
$aClean['iLimit']);
|
$aClean['iLimit']);
|
||||||
$i=0;
|
$i=0;
|
||||||
while($hResult && $oRow = mysql_fetch_object($hResult))
|
while($hResult && $oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oUser = new User($oRow->userid);
|
$oUser = new User($oRow->userid);
|
||||||
$sAreYouSure = "Are you sure that you want to delete user ".addslashes($oUser->sRealname)." ?";
|
$sAreYouSure = "Are you sure that you want to delete user ".addslashes($oUser->sRealname)." ?";
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ function build_app_list()
|
|||||||
$hResult = query_parameters("SELECT appId, appName FROM appFamily ORDER BY appName");
|
$hResult = query_parameters("SELECT appId, appName FROM appFamily ORDER BY appName");
|
||||||
|
|
||||||
echo "<select name=iAppId size=5 onChange='this.form.submit()'>\n";
|
echo "<select name=iAppId size=5 onChange='this.form.submit()'>\n";
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
echo "<option value=$oRow->appId>$oRow->appName</option>\n";
|
echo "<option value=$oRow->appId>$oRow->appName</option>\n";
|
||||||
}
|
}
|
||||||
@@ -55,10 +55,10 @@ echo " <td><font color=white> Application Name </font></td>\n";
|
|||||||
echo " <td><font color=white> Delete </font></td>\n";
|
echo " <td><font color=white> Delete </font></td>\n";
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
if($hResult && mysql_num_rows($hResult))
|
if($hResult && query_num_rows($hResult))
|
||||||
{
|
{
|
||||||
$c = 1;
|
$c = 1;
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
//set row color
|
//set row color
|
||||||
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
|
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
|
||||||
@@ -72,7 +72,7 @@ if($hResult && mysql_num_rows($hResult))
|
|||||||
|
|
||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
} else if($hResult && !mysql_num_rows($hResult))
|
} else if($hResult && !query_num_rows($hResult))
|
||||||
{
|
{
|
||||||
/* indicate to the user that there are no apps in this bundle at the moment */
|
/* indicate to the user that there are no apps in this bundle at the moment */
|
||||||
echo "<tr>\n";
|
echo "<tr>\n";
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ $hResult = maintainer::objectGetEntries(false, false);
|
|||||||
echo "Maintainers with a non-zero notification level<br />\n";
|
echo "Maintainers with a non-zero notification level<br />\n";
|
||||||
|
|
||||||
$bFoundNonZero = false;
|
$bFoundNonZero = false;
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oMaintainer = new maintainer(null, $oRow);
|
$oMaintainer = new maintainer(null, $oRow);
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ echo "<br />\n";
|
|||||||
// retrieve all of the maintainers
|
// retrieve all of the maintainers
|
||||||
echo "Maintainers with notification iTargetLevel != 0<br />\n";
|
echo "Maintainers with notification iTargetLevel != 0<br />\n";
|
||||||
$hResult = maintainer::objectGetEntries(false, false);
|
$hResult = maintainer::objectGetEntries(false, false);
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oMaintainer = new maintainer(null, $oRow);
|
$oMaintainer = new maintainer(null, $oRow);
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ if(!empty($aClean['sAction']))
|
|||||||
$sQuery.= "on appVersion.appId = appFamily.appId ORDER BY appFamily.appName, appFamily.appId, appVersion.versionName;";
|
$sQuery.= "on appVersion.appId = appFamily.appId ORDER BY appFamily.appName, appFamily.appId, appVersion.versionName;";
|
||||||
$hResult = query_parameters($sQuery);
|
$hResult = query_parameters($sQuery);
|
||||||
$currentAppId = 0;
|
$currentAppId = 0;
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
/* if the version ids differ then we should start a row with a new application */
|
/* if the version ids differ then we should start a row with a new application */
|
||||||
/* and the version that matches with it */
|
/* and the version that matches with it */
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ function display_bundle($iAppId)
|
|||||||
$hResult = query_parameters("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
$hResult = query_parameters("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
||||||
"WHERE appFamily.queued='false' AND bundleId = '?' AND appBundle.appId = appFamily.appId",
|
"WHERE appFamily.queued='false' AND bundleId = '?' AND appBundle.appId = appFamily.appId",
|
||||||
$iAppId);
|
$iAppId);
|
||||||
if(!$hResult || mysql_num_rows($hResult) == 0)
|
if(!$hResult || query_num_rows($hResult) == 0)
|
||||||
{
|
{
|
||||||
return; // do nothing
|
return; // do nothing
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ function display_bundle($iAppId)
|
|||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
$c = 0;
|
$c = 0;
|
||||||
while($ob = mysql_fetch_object($hResult))
|
while($ob = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oApp = new application($ob->appId);
|
$oApp = new application($ob->appId);
|
||||||
//set row color
|
//set row color
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ else
|
|||||||
$hResult = query_parameters($sQuery, "downloadurl", $sLicense);
|
$hResult = query_parameters($sQuery, "downloadurl", $sLicense);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($hResult && mysql_num_rows($hResult))
|
if($hResult && query_num_rows($hResult))
|
||||||
$num = mysql_num_rows($hResult);
|
$num = query_num_rows($hResult);
|
||||||
|
|
||||||
$iNumPages = isset($num) ? ceil($num/$aClean['iNumVersions']) : 0;
|
$iNumPages = isset($num) ? ceil($num/$aClean['iNumVersions']) : 0;
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ if(!$sLicense)
|
|||||||
$aClean['iNumVersions']);
|
$aClean['iNumVersions']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($hResult && mysql_num_rows($hResult))
|
if($hResult && query_num_rows($hResult))
|
||||||
{
|
{
|
||||||
echo html_frame_start("", "90%");
|
echo html_frame_start("", "90%");
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ if($hResult && mysql_num_rows($hResult))
|
|||||||
$oTableRow->SetClass("color4");
|
$oTableRow->SetClass("color4");
|
||||||
$oTable->AddRow($oTableRow);
|
$oTable->AddRow($oTableRow);
|
||||||
|
|
||||||
for($iIndex = 1; $oRow = mysql_fetch_object($hResult); $iIndex++)
|
for($iIndex = 1; $oRow = query_fetch_object($hResult); $iIndex++)
|
||||||
{
|
{
|
||||||
$oVersion = new version($oRow->versionId);
|
$oVersion = new version($oRow->versionId);
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ function inactiveUserCheck()
|
|||||||
$hUsersToWarn = unwarnedAndInactiveSince(6);
|
$hUsersToWarn = unwarnedAndInactiveSince(6);
|
||||||
if($hUsersToWarn)
|
if($hUsersToWarn)
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hUsersToWarn))
|
while($oRow = query_fetch_object($hUsersToWarn))
|
||||||
{
|
{
|
||||||
$oUser = new User($oRow->userid);
|
$oUser = new User($oRow->userid);
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ function inactiveUserCheck()
|
|||||||
$hUsersToDelete = warnedSince(1);
|
$hUsersToDelete = warnedSince(1);
|
||||||
if($hUsersToDelete)
|
if($hUsersToDelete)
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hUsersToDelete))
|
while($oRow = query_fetch_object($hUsersToDelete))
|
||||||
{
|
{
|
||||||
$oUser = new User($oRow->userid);
|
$oUser = new User($oRow->userid);
|
||||||
if(!$oUser->hasDataAssociated())
|
if(!$oUser->hasDataAssociated())
|
||||||
@@ -179,11 +179,11 @@ function orphanVersionCheck()
|
|||||||
$sMsg.= "this sql command '".$sQuery."'\r\n";
|
$sMsg.= "this sql command '".$sQuery."'\r\n";
|
||||||
|
|
||||||
/* don't report anything if no orphans are found */
|
/* don't report anything if no orphans are found */
|
||||||
if(mysql_num_rows($hResult) == 0)
|
if(query_num_rows($hResult) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$sMsg .= "versionId/name\r\n";
|
$sMsg .= "versionId/name\r\n";
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$sMsg .= $oRow->versionId."/".$oRow->versionName."\r\n";
|
$sMsg .= $oRow->versionId."/".$oRow->versionName."\r\n";
|
||||||
}
|
}
|
||||||
@@ -209,7 +209,7 @@ function orphanSessionMessagesCheck()
|
|||||||
$sQuery = "SELECT count(*) as cnt from sessionMessages where TO_DAYS(NOW()) - TO_DAYS(time) > ?";
|
$sQuery = "SELECT count(*) as cnt from sessionMessages where TO_DAYS(NOW()) - TO_DAYS(time) > ?";
|
||||||
$hResult = query_parameters($sQuery, $iSessionMessageDayLimit);
|
$hResult = query_parameters($sQuery, $iSessionMessageDayLimit);
|
||||||
|
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$iMessages = $oRow->cnt;
|
$iMessages = $oRow->cnt;
|
||||||
|
|
||||||
$sMsg = "Found ".$iMessages." that have been orphaned in the sessionMessages table for longer than ".$iSessionMessageDayLimit." days\r\n";
|
$sMsg = "Found ".$iMessages." that have been orphaned in the sessionMessages table for longer than ".$iSessionMessageDayLimit." days\r\n";
|
||||||
@@ -237,7 +237,7 @@ function orphanSessionListCheck()
|
|||||||
$sQuery = "SELECT count(*) as cnt from session_list where TO_DAYS(NOW()) - TO_DAYS(stamp) > ?";
|
$sQuery = "SELECT count(*) as cnt from session_list where TO_DAYS(NOW()) - TO_DAYS(stamp) > ?";
|
||||||
$hResult = query_parameters($sQuery, SESSION_DAYS_TO_EXPIRE + 2);
|
$hResult = query_parameters($sQuery, SESSION_DAYS_TO_EXPIRE + 2);
|
||||||
|
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$iMessages = $oRow->cnt;
|
$iMessages = $oRow->cnt;
|
||||||
|
|
||||||
$sMsg = "Found ".$iMessages." sessions that have expired after ".(SESSION_DAYS_TO_EXPIRE + 2)." days\r\n";
|
$sMsg = "Found ".$iMessages." sessions that have expired after ".(SESSION_DAYS_TO_EXPIRE + 2)." days\r\n";
|
||||||
@@ -272,7 +272,7 @@ function getMissingScreenshotArray()
|
|||||||
$hResult = Screenshot::objectGetEntries(false, false);
|
$hResult = Screenshot::objectGetEntries(false, false);
|
||||||
|
|
||||||
// go through each screenshot
|
// go through each screenshot
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$iScreenshotId = $oRow->id;
|
$iScreenshotId = $oRow->id;
|
||||||
$oScreenshot = new Screenshot($iScreenshotId);
|
$oScreenshot = new Screenshot($iScreenshotId);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class appData
|
|||||||
if(!$oRow)
|
if(!$oRow)
|
||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT * FROM appData WHERE id = '?'", $iId);
|
$hResult = query_parameters("SELECT * FROM appData WHERE id = '?'", $iId);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -126,7 +126,7 @@ class appData
|
|||||||
ORDER BY appData.id",
|
ORDER BY appData.id",
|
||||||
$iUserId, $bQueued ? "true" : "false");
|
$iUserId, $bQueued ? "true" : "false");
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !query_num_rows($hResult))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$sReturn = html_table_begin("width=\"100%\" align=\"center\"");
|
$sReturn = html_table_begin("width=\"100%\" align=\"center\"");
|
||||||
@@ -137,7 +137,7 @@ class appData
|
|||||||
"Submission Date"),
|
"Submission Date"),
|
||||||
"color4");
|
"color4");
|
||||||
|
|
||||||
for($i = 1; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 1; $oRow = query_fetch_object($hResult); $i++)
|
||||||
{
|
{
|
||||||
if($oRow->versionId)
|
if($oRow->versionId)
|
||||||
{
|
{
|
||||||
@@ -180,7 +180,7 @@ class appData
|
|||||||
versionId = '?' AND TYPE = '?' AND queued = '?'",
|
versionId = '?' AND TYPE = '?' AND queued = '?'",
|
||||||
$iAppId, $iVersionId, $sType, $sQueued);
|
$iAppId, $iVersionId, $sType, $sQueued);
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !query_num_rows($hResult))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return $hResult;
|
return $hResult;
|
||||||
@@ -297,7 +297,7 @@ class appData
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
for($iCount = 0; $oRow = mysql_fetch_object($hResult);)
|
for($iCount = 0; $oRow = query_fetch_object($hResult);)
|
||||||
$iCount += $oRow->count;
|
$iCount += $oRow->count;
|
||||||
|
|
||||||
return $iCount;
|
return $iCount;
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ function log_category_visit($catId)
|
|||||||
|
|
||||||
$result = query_parameters("SELECT * FROM catHitStats WHERE ip = '?' AND catId = '?'",
|
$result = query_parameters("SELECT * FROM catHitStats WHERE ip = '?' AND catId = '?'",
|
||||||
$REMOTE_ADDR, $catId);
|
$REMOTE_ADDR, $catId);
|
||||||
if($result && mysql_num_rows($result) == 1)
|
if($result && query_num_rows($result) == 1)
|
||||||
{
|
{
|
||||||
$oStatsRow = mysql_fetch_object($result);
|
$oStatsRow = query_fetch_object($result);
|
||||||
query_parameters("UPDATE catHitStats SET count = count + 1 WHERE catHitId = '?'",
|
query_parameters("UPDATE catHitStats SET count = count + 1 WHERE catHitId = '?'",
|
||||||
$oStatsRow->catHitId);
|
$oStatsRow->catHitId);
|
||||||
} else
|
} else
|
||||||
@@ -25,9 +25,9 @@ function log_application_visit($appId)
|
|||||||
|
|
||||||
$result = query_parameters("SELECT * FROM appHitStats WHERE ip = '?' AND appId = '?'",
|
$result = query_parameters("SELECT * FROM appHitStats WHERE ip = '?' AND appId = '?'",
|
||||||
$REMOTE_ADDR, $appId);
|
$REMOTE_ADDR, $appId);
|
||||||
if($result && mysql_num_rows($result) == 1)
|
if($result && query_num_rows($result) == 1)
|
||||||
{
|
{
|
||||||
$stats = mysql_fetch_object($result);
|
$stats = query_fetch_object($result);
|
||||||
query_parameters("UPDATE appHitStats SET count = count + 1 WHERE appHitId = '?'",
|
query_parameters("UPDATE appHitStats SET count = count + 1 WHERE appHitId = '?'",
|
||||||
$stats->appHitId);
|
$stats->appHitId);
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class Application {
|
|||||||
FROM appFamily
|
FROM appFamily
|
||||||
WHERE appId = '?'";
|
WHERE appId = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $iAppId))
|
if($hResult = query_parameters($sQuery, $iAppId))
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -89,7 +89,7 @@ class Application {
|
|||||||
}
|
}
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$this->aVersionsIds[] = $oRow->versionId;
|
$this->aVersionsIds[] = $oRow->versionId;
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ class Application {
|
|||||||
$this->mustBeQueued() ? "true" : "false");
|
$this->mustBeQueued() ? "true" : "false");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iAppId = mysql_insert_id();
|
$this->iAppId = query_appdb_insert_id();
|
||||||
$this->application($this->iAppId);
|
$this->application($this->iAppId);
|
||||||
$this->SendNotificationMail(); // Only administrators will be mailed as no supermaintainers exist for this app.
|
$this->SendNotificationMail(); // Only administrators will be mailed as no supermaintainers exist for this app.
|
||||||
|
|
||||||
@@ -246,7 +246,7 @@ class Application {
|
|||||||
//FIXME: how to deal with concurrency issues such as
|
//FIXME: how to deal with concurrency issues such as
|
||||||
// if a new version was added during this deletion?
|
// if a new version was added during this deletion?
|
||||||
$hResult = $this->_internal_retrieve_all_versions();
|
$hResult = $this->_internal_retrieve_all_versions();
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$iVersionId = $oRow->versionId;
|
$iVersionId = $oRow->versionId;
|
||||||
$oVersion = new Version($iVersionId);
|
$oVersion = new Version($iVersionId);
|
||||||
@@ -263,7 +263,7 @@ class Application {
|
|||||||
|
|
||||||
if($hResult = query_parameters($sQuery, $this->iAppId))
|
if($hResult = query_parameters($sQuery, $this->iAppId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$aUrlsIds[] = $oRow->id;
|
$aUrlsIds[] = $oRow->id;
|
||||||
}
|
}
|
||||||
@@ -315,9 +315,9 @@ class Application {
|
|||||||
|
|
||||||
/* Unqueue matching super maintainer request */
|
/* Unqueue matching super maintainer request */
|
||||||
$hResultMaint = query_parameters("SELECT maintainerId FROM appMaintainers WHERE userId = '?' AND appId = '?'", $this->iSubmitterId, $this->iAppId);
|
$hResultMaint = query_parameters("SELECT maintainerId FROM appMaintainers WHERE userId = '?' AND appId = '?'", $this->iSubmitterId, $this->iAppId);
|
||||||
if($hResultMaint && mysql_num_rows($hResultMaint))
|
if($hResultMaint && query_num_rows($hResultMaint))
|
||||||
{
|
{
|
||||||
$oMaintainerRow = mysql_fetch_object($hResultMaint);
|
$oMaintainerRow = query_fetch_object($hResultMaint);
|
||||||
$oMaintainer = new Maintainer($oMaintainerRow->maintainerId);
|
$oMaintainer = new Maintainer($oMaintainerRow->maintainerId);
|
||||||
$oMaintainer->unQueue("OK");
|
$oMaintainer->unQueue("OK");
|
||||||
}
|
}
|
||||||
@@ -420,7 +420,7 @@ class Application {
|
|||||||
|
|
||||||
if($hResult = query_parameters($sQuery, $sRating))
|
if($hResult = query_parameters($sQuery, $sRating))
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
return $oRow->total;
|
return $oRow->total;
|
||||||
}
|
}
|
||||||
@@ -436,7 +436,7 @@ class Application {
|
|||||||
|
|
||||||
if($hResult = query_parameters($sQuery, $sRating, $iOffset, $iItemsPerPage))
|
if($hResult = query_parameters($sQuery, $sRating, $iOffset, $iItemsPerPage))
|
||||||
{
|
{
|
||||||
while($aRow = mysql_fetch_row($hResult))
|
while($aRow = query_fetch_row($hResult))
|
||||||
{
|
{
|
||||||
array_push($aApps, $aRow[0]);
|
array_push($aApps, $aRow[0]);
|
||||||
}
|
}
|
||||||
@@ -764,9 +764,9 @@ class Application {
|
|||||||
if(!$appId) return null;
|
if(!$appId) return null;
|
||||||
$result = query_parameters("SELECT appName FROM appFamily WHERE appId = '?'",
|
$result = query_parameters("SELECT appName FROM appFamily WHERE appId = '?'",
|
||||||
$appId);
|
$appId);
|
||||||
if(!$result || mysql_num_rows($result) != 1)
|
if(!$result || query_num_rows($result) != 1)
|
||||||
return null;
|
return null;
|
||||||
$ob = mysql_fetch_object($result);
|
$ob = query_fetch_object($result);
|
||||||
return $ob->appName;
|
return $ob->appName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -781,7 +781,7 @@ class Application {
|
|||||||
queued = '?'
|
queued = '?'
|
||||||
ORDER BY appId", $iUserId, $bQueued ? "true" : "false");
|
ORDER BY appId", $iUserId, $bQueued ? "true" : "false");
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !query_num_rows($hResult))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$oTable = new Table();
|
$oTable = new Table();
|
||||||
@@ -796,7 +796,7 @@ class Application {
|
|||||||
$oTableRow->SetClass("color4");
|
$oTableRow->SetClass("color4");
|
||||||
$oTable->SetHeader($oTableRow);
|
$oTable->SetHeader($oTableRow);
|
||||||
|
|
||||||
for($i = 1; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 1; $oRow = query_fetch_object($hResult); $i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
$oVendor = new vendor($oRow->vendorId);
|
$oVendor = new vendor($oRow->vendorId);
|
||||||
@@ -1013,7 +1013,7 @@ class Application {
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(!$oRow = mysql_fetch_object($hResult))
|
if(!$oRow = query_fetch_object($hResult))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return $oRow->count;
|
return $oRow->count;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class application_queue
|
|||||||
$hResult = query_parameters($sQuery, $this->oApp->iAppId);
|
$hResult = query_parameters($sQuery, $this->oApp->iAppId);
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
if($oRow = mysql_fetch_object($hResult))
|
if($oRow = query_fetch_object($hResult))
|
||||||
$iVersionId = $oRow->versionId;
|
$iVersionId = $oRow->versionId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -230,7 +230,7 @@ class application_queue
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* There's no point in displaying an empty table */
|
/* There's no point in displaying an empty table */
|
||||||
if($hResult === null ||mysql_num_rows($hResult) == 0)
|
if($hResult === null || (query_num_rows($hResult) == 0))
|
||||||
{
|
{
|
||||||
echo "No matches.<br />\n";
|
echo "No matches.<br />\n";
|
||||||
return;
|
return;
|
||||||
@@ -256,7 +256,7 @@ class application_queue
|
|||||||
echo "<table cellpadding='5px'>";
|
echo "<table cellpadding='5px'>";
|
||||||
echo html_tr($aHeader, "color4");
|
echo html_tr($aHeader, "color4");
|
||||||
|
|
||||||
for($i = 0; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 0; $oRow = query_fetch_object($hResult); $i++)
|
||||||
{
|
{
|
||||||
$oApp = new application($oRow->appId);
|
$oApp = new application($oRow->appId);
|
||||||
$aCells = array(
|
$aCells = array(
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class Bug {
|
|||||||
AND linkid = '?'";
|
AND linkid = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $iLinkId))
|
if($hResult = query_parameters($sQuery, $iLinkId))
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$this->iLinkId = $iLinkId;
|
$this->iLinkId = $iLinkId;
|
||||||
$this->iAppId = $oRow->appId;
|
$this->iAppId = $oRow->appId;
|
||||||
$this->iBug_id = $oRow->bug_id;
|
$this->iBug_id = $oRow->bug_id;
|
||||||
@@ -55,7 +55,7 @@ class Bug {
|
|||||||
WHERE bug_id = ".$this->iBug_id;
|
WHERE bug_id = ".$this->iBug_id;
|
||||||
if($hResult = query_bugzilladb($sQuery))
|
if($hResult = query_bugzilladb($sQuery))
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$this->sShort_desc = $oRow->short_desc;
|
$this->sShort_desc = $oRow->short_desc;
|
||||||
$this->sBug_status = $oRow->bug_status;
|
$this->sBug_status = $oRow->bug_status;
|
||||||
$this->sResolution = $oRow->resolution;
|
$this->sResolution = $oRow->resolution;
|
||||||
@@ -95,7 +95,7 @@ class Bug {
|
|||||||
$sQuery = "SELECT *
|
$sQuery = "SELECT *
|
||||||
FROM bugs
|
FROM bugs
|
||||||
WHERE bug_id = ".$this->iBug_id;
|
WHERE bug_id = ".$this->iBug_id;
|
||||||
if(mysql_num_rows(query_bugzilladb($sQuery, "checking bugzilla")) == 0)
|
if(query_num_rows(query_bugzilladb($sQuery, "checking bugzilla")) == 0)
|
||||||
{
|
{
|
||||||
addmsg("There is no bug in Bugzilla with that bug number.", "red");
|
addmsg("There is no bug in Bugzilla with that bug number.", "red");
|
||||||
return false;
|
return false;
|
||||||
@@ -108,7 +108,7 @@ class Bug {
|
|||||||
WHERE versionId = '?'";
|
WHERE versionId = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
if($oRow->bug_id == $this->iBug_id)
|
if($oRow->bug_id == $this->iBug_id)
|
||||||
{
|
{
|
||||||
@@ -129,7 +129,7 @@ class Bug {
|
|||||||
$this->bQueued ? "true":"false");
|
$this->bQueued ? "true":"false");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iLinkId = mysql_insert_id();
|
$this->iLinkId = query_bugzilla_insert_id();
|
||||||
|
|
||||||
$this->SendNotificationMail();
|
$this->SendNotificationMail();
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ class Bug {
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT appFamily.appName, buglinks.versionId, appVersion.versionName, buglinks.submitTime, buglinks.bug_id FROM buglinks, appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND buglinks.versionId = appVersion.versionId AND buglinks.queued = '?' AND buglinks.submitterId = '?' ORDER BY buglinks.versionId", $bQueued ? "true" : "false", $iUserId);
|
$hResult = query_parameters("SELECT appFamily.appName, buglinks.versionId, appVersion.versionName, buglinks.submitTime, buglinks.bug_id FROM buglinks, appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND buglinks.versionId = appVersion.versionId AND buglinks.queued = '?' AND buglinks.submitterId = '?' ORDER BY buglinks.versionId", $bQueued ? "true" : "false", $iUserId);
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !query_num_rows($hResult))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
$sReturn = html_table_begin("width=\"100%\" align=\"center\"");
|
$sReturn = html_table_begin("width=\"100%\" align=\"center\"");
|
||||||
@@ -272,7 +272,7 @@ class Bug {
|
|||||||
"Submit time"),
|
"Submit time"),
|
||||||
"color4");
|
"color4");
|
||||||
|
|
||||||
for($i = 1; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 1; $oRow = query_fetch_object($hResult); $i++)
|
||||||
{
|
{
|
||||||
$oBug = new Bug($oRow->bug_id);
|
$oBug = new Bug($oRow->bug_id);
|
||||||
$sReturn .= html_tr(array(
|
$sReturn .= html_tr(array(
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Category {
|
|||||||
WHERE catId = '?' ORDER BY catName;";
|
WHERE catId = '?' ORDER BY catName;";
|
||||||
if($hResult = query_parameters($sQuery, $iCatId))
|
if($hResult = query_parameters($sQuery, $iCatId))
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($oRow)
|
if($oRow)
|
||||||
{
|
{
|
||||||
$this->iCatId = $iCatId;
|
$this->iCatId = $iCatId;
|
||||||
@@ -50,7 +50,7 @@ class Category {
|
|||||||
AND queued = 'false' ORDER BY appName";
|
AND queued = 'false' ORDER BY appName";
|
||||||
if($hResult = query_parameters($sQuery, $iCatId))
|
if($hResult = query_parameters($sQuery, $iCatId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$this->aApplicationsIds[] = $oRow->appId;
|
$this->aApplicationsIds[] = $oRow->appId;
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ class Category {
|
|||||||
WHERE catParent = '?' ORDER BY catName;";
|
WHERE catParent = '?' ORDER BY catName;";
|
||||||
if($hResult = query_parameters($sQuery, $iCatId))
|
if($hResult = query_parameters($sQuery, $iCatId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$this->aSubcatsIds[] = $oRow->catId;
|
$this->aSubcatsIds[] = $oRow->catId;
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@ class Category {
|
|||||||
$sName, $sDescription, $iParentId);
|
$sName, $sDescription, $iParentId);
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iCatId = mysql_insert_id();
|
$this->iCatId = query_appdb_insert_id();
|
||||||
$this->category($this->iCatId);
|
$this->category($this->iCatId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -171,9 +171,9 @@ class Category {
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT catName, catId, catParent FROM appCategory WHERE catId = '?'",
|
$hResult = query_parameters("SELECT catName, catId, catParent FROM appCategory WHERE catId = '?'",
|
||||||
$iCatId);
|
$iCatId);
|
||||||
if(!$hResult || mysql_num_rows($hResult) != 1)
|
if(!$hResult || query_num_rows($hResult) != 1)
|
||||||
break;
|
break;
|
||||||
$oCatRow = mysql_fetch_object($hResult);
|
$oCatRow = query_fetch_object($hResult);
|
||||||
$aPath[] = array($oCatRow->catId, $oCatRow->catName);
|
$aPath[] = array($oCatRow->catId, $oCatRow->catName);
|
||||||
$iCatId = $oCatRow->catParent;
|
$iCatId = $oCatRow->catParent;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class Comment {
|
|||||||
WHERE appComments.versionId = appVersion.versionId
|
WHERE appComments.versionId = appVersion.versionId
|
||||||
AND commentId = '?'";
|
AND commentId = '?'";
|
||||||
$hResult = query_parameters($sQuery, $iCommentId);
|
$hResult = query_parameters($sQuery, $iCommentId);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$this->iCommentId = $oRow->commentId;
|
$this->iCommentId = $oRow->commentId;
|
||||||
$this->iParentId = $oRow->parentId;
|
$this->iParentId = $oRow->parentId;
|
||||||
$this->iAppId = $oRow->appId;
|
$this->iAppId = $oRow->appId;
|
||||||
@@ -68,7 +68,7 @@ class Comment {
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->comment(mysql_insert_id());
|
$this->comment(query_appdb_insert_id());
|
||||||
$sEmail = User::get_notify_email_address_list($this->iAppId, $this->iVersionId);
|
$sEmail = User::get_notify_email_address_list($this->iAppId, $this->iVersionId);
|
||||||
$sEmail .= $this->oOwner->sEmail." ";
|
$sEmail .= $this->oOwner->sEmail." ";
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ class Comment {
|
|||||||
$hResult = query_parameters($sQuery, $iVersionId);
|
$hResult = query_parameters($sQuery, $iVersionId);
|
||||||
if(!$hResult) return 0;
|
if(!$hResult) return 0;
|
||||||
|
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->cnt;
|
return $oRow->cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,8 +275,8 @@ class Comment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* escape input so we can use query_appdb() without concern */
|
/* escape input so we can use query_appdb() without concern */
|
||||||
$iVersionId = mysql_real_escape_string($iVersionId);
|
$iVersionId = query_escape_string($iVersionId);
|
||||||
$iParentId = mysql_real_escape_string($iParentId);
|
$iParentId = query_escape_string($iParentId);
|
||||||
|
|
||||||
$sExtra = "";
|
$sExtra = "";
|
||||||
|
|
||||||
@@ -300,11 +300,11 @@ class Comment {
|
|||||||
*/
|
*/
|
||||||
function do_display_comments_nested($hResult)
|
function do_display_comments_nested($hResult)
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
Comment::view_app_comment($oRow);
|
Comment::view_app_comment($oRow);
|
||||||
$hResult2 = Comment::grab_comments($oRow->versionId, $oRow->commentId);
|
$hResult2 = Comment::grab_comments($oRow->versionId, $oRow->commentId);
|
||||||
if($hResult && mysql_num_rows($hResult2))
|
if($hResult && query_num_rows($hResult2))
|
||||||
{
|
{
|
||||||
echo "<blockquote>\n";
|
echo "<blockquote>\n";
|
||||||
Comment::do_display_comments_nested($hResult2);
|
Comment::do_display_comments_nested($hResult2);
|
||||||
@@ -328,7 +328,7 @@ class Comment {
|
|||||||
if (!$is_main)
|
if (!$is_main)
|
||||||
echo "<ul>\n";
|
echo "<ul>\n";
|
||||||
|
|
||||||
while ($oRow = mysql_fetch_object($hResult))
|
while ($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
if ($is_main)
|
if ($is_main)
|
||||||
{
|
{
|
||||||
@@ -340,7 +340,7 @@ class Comment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$hResult2 = Comment::grab_comments($oRow->versionId, $oRow->commentId);
|
$hResult2 = Comment::grab_comments($oRow->versionId, $oRow->commentId);
|
||||||
if ($hResult2 && mysql_num_rows($hResult2))
|
if ($hResult2 && query_num_rows($hResult2))
|
||||||
{
|
{
|
||||||
echo "<blockquote>\n";
|
echo "<blockquote>\n";
|
||||||
Comment::do_display_comments_threaded($hResult2, 0);
|
Comment::do_display_comments_threaded($hResult2, 0);
|
||||||
@@ -367,7 +367,7 @@ class Comment {
|
|||||||
$hResult = Comment::grab_comments($versionId);
|
$hResult = Comment::grab_comments($versionId);
|
||||||
if ($hResult)
|
if ($hResult)
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
Comment::view_app_comment($oRow);
|
Comment::view_app_comment($oRow);
|
||||||
}
|
}
|
||||||
@@ -380,7 +380,7 @@ class Comment {
|
|||||||
|
|
||||||
// count posts
|
// count posts
|
||||||
$hResult = query_parameters("SELECT commentId FROM appComments WHERE versionId = '?'", $versionId);
|
$hResult = query_parameters("SELECT commentId FROM appComments WHERE versionId = '?'", $versionId);
|
||||||
$messageCount = mysql_num_rows($hResult);
|
$messageCount = query_num_rows($hResult);
|
||||||
|
|
||||||
//start comment format table
|
//start comment format table
|
||||||
echo html_frame_start("","98%",'',0);
|
echo html_frame_start("","98%",'',0);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class distribution {
|
|||||||
FROM distributions
|
FROM distributions
|
||||||
WHERE distributionId = '?'";
|
WHERE distributionId = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $iDistributionId))
|
if($hResult = query_parameters($sQuery, $iDistributionId))
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -69,7 +69,7 @@ class distribution {
|
|||||||
|
|
||||||
if($hResult = query_parameters($sQuery, $this->iDistributionId))
|
if($hResult = query_parameters($sQuery, $this->iDistributionId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$this->aTestingIds[] = $oRow->testingId;
|
$this->aTestingIds[] = $oRow->testingId;
|
||||||
}
|
}
|
||||||
@@ -85,9 +85,9 @@ class distribution {
|
|||||||
WHERE name = '?'";
|
WHERE name = '?'";
|
||||||
$hResult = query_parameters($sQuery, $this->sName);
|
$hResult = query_parameters($sQuery, $this->sName);
|
||||||
|
|
||||||
if($hResult && $oRow = mysql_fetch_object($hResult))
|
if($hResult && $oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
if(mysql_num_rows($hResult))
|
if(query_num_rows($hResult))
|
||||||
{
|
{
|
||||||
addmsg("There was an existing distribution called ".$this->sName.".", "red");
|
addmsg("There was an existing distribution called ".$this->sName.".", "red");
|
||||||
$this->distribution($oRow->distributionId);
|
$this->distribution($oRow->distributionId);
|
||||||
@@ -108,7 +108,7 @@ class distribution {
|
|||||||
$this->mustBeQueued() ? "true" : "false");
|
$this->mustBeQueued() ? "true" : "false");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iDistributionId = mysql_insert_id();
|
$this->iDistributionId = query_appdb_insert_id();
|
||||||
$this->distribution($this->iDistributionId);
|
$this->distribution($this->iDistributionId);
|
||||||
$this->SendNotificationMail();
|
$this->SendNotificationMail();
|
||||||
return true;
|
return true;
|
||||||
@@ -397,7 +397,7 @@ class distribution {
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->num_dists;
|
return $oRow->num_dists;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -414,7 +414,7 @@ class distribution {
|
|||||||
|
|
||||||
echo "<select name='$varname'>\n";
|
echo "<select name='$varname'>\n";
|
||||||
echo "<option value=\"\">Choose ...</option>\n";
|
echo "<option value=\"\">Choose ...</option>\n";
|
||||||
while(list($name, $value) = mysql_fetch_row($hResult))
|
while(list($name, $value) = query_fetch_row($hResult))
|
||||||
{
|
{
|
||||||
if($value == $cvalue)
|
if($value == $cvalue)
|
||||||
echo "<option value=$value selected>$name\n";
|
echo "<option value=$value selected>$name\n";
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ class downloadurl
|
|||||||
submitTime, submitterId, queued FROM appData WHERE id = '?'",
|
submitTime, submitterId, queued FROM appData WHERE id = '?'",
|
||||||
$iId);
|
$iId);
|
||||||
|
|
||||||
if($hResult && mysql_num_rows($hResult))
|
if($hResult && query_num_rows($hResult))
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -52,7 +52,7 @@ class downloadurl
|
|||||||
|
|
||||||
// we're appending, so initialize it
|
// we're appending, so initialize it
|
||||||
$sReturn = '';
|
$sReturn = '';
|
||||||
for($i = 0; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 0; $oRow = query_fetch_object($hResult); $i++)
|
||||||
{
|
{
|
||||||
$sReturn .= html_tr(array(
|
$sReturn .= html_tr(array(
|
||||||
"<b>Free Download</b>",
|
"<b>Free Download</b>",
|
||||||
@@ -104,7 +104,7 @@ class downloadurl
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
for($i = 1; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 1; $oRow = query_fetch_object($hResult); $i++)
|
||||||
{
|
{
|
||||||
$sReturn .= html_tr(array(
|
$sReturn .= html_tr(array(
|
||||||
"<input type=\"checkbox\" name=\"bRemove$oRow->id\" ".
|
"<input type=\"checkbox\" name=\"bRemove$oRow->id\" ".
|
||||||
@@ -146,7 +146,7 @@ class downloadurl
|
|||||||
"downloadurl", $aValues["iVersionId"])))
|
"downloadurl", $aValues["iVersionId"])))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(!($oRow = mysql_fetch_object($hResult)))
|
if(!($oRow = query_fetch_object($hResult)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
$num = $oRow->num;
|
$num = $oRow->num;
|
||||||
@@ -157,7 +157,7 @@ class downloadurl
|
|||||||
if(!$hResult = appData::getData($aValues["iVersionId"], "downloadurl"))
|
if(!$hResult = appData::getData($aValues["iVersionId"], "downloadurl"))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oDownloadurl = new downloadurl($oRow->id);
|
$oDownloadurl = new downloadurl($oRow->id);
|
||||||
|
|
||||||
@@ -258,7 +258,7 @@ class downloadurl
|
|||||||
$hResult = appData::getData($iVersionId, "downloadurl",
|
$hResult = appData::getData($iVersionId, "downloadurl",
|
||||||
TRUE, TRUE, TRUE))
|
TRUE, TRUE, TRUE))
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$sDownloadUrlUrl = $oRow->url;
|
$sDownloadUrlUrl = $oRow->url;
|
||||||
$sDownloadUrlDescription = $oRow->description;
|
$sDownloadUrlDescription = $oRow->description;
|
||||||
}
|
}
|
||||||
@@ -305,7 +305,7 @@ class downloadurl
|
|||||||
"NOW()",
|
"NOW()",
|
||||||
$_SESSION['current']->iUserId);
|
$_SESSION['current']->iUserId);
|
||||||
|
|
||||||
$this->iId = mysql_insert_id();
|
$this->iId = query_appdb_insert_id();
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@ class downloadurl
|
|||||||
$iId = null;
|
$iId = null;
|
||||||
if($hResult = appData::getData($iVersionId, "downloadurl", TRUE, TRUE))
|
if($hResult = appData::getData($iVersionId, "downloadurl", TRUE, TRUE))
|
||||||
{
|
{
|
||||||
$oObject = mysql_fetch_object($hResult);
|
$oObject = query_fetch_object($hResult);
|
||||||
$iId = $oObject->id;
|
$iId = $oObject->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class error_log
|
|||||||
{
|
{
|
||||||
$sQuery = "SELECT count(*) as cnt FROM error_log WHERE deleted = '0'";
|
$sQuery = "SELECT count(*) as cnt FROM error_log WHERE deleted = '0'";
|
||||||
$hResult = query_parameters($sQuery);
|
$hResult = query_parameters($sQuery);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->cnt;
|
return $oRow->cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ class error_log
|
|||||||
$hResult = query_parameters($sQuery);
|
$hResult = query_parameters($sQuery);
|
||||||
|
|
||||||
$bEmpty = false;
|
$bEmpty = false;
|
||||||
if(mysql_num_rows($hResult) == 0)
|
if(query_num_rows($hResult) == 0)
|
||||||
$bEmpty = true;
|
$bEmpty = true;
|
||||||
|
|
||||||
$sMsg = "Log entries:\r\n";
|
$sMsg = "Log entries:\r\n";
|
||||||
@@ -82,7 +82,7 @@ class error_log
|
|||||||
$sMsg.="----------------------------------\r\n\r\n";
|
$sMsg.="----------------------------------\r\n\r\n";
|
||||||
|
|
||||||
/* append each log entry to $sMsg */
|
/* append each log entry to $sMsg */
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$sMsg.=$oRow->submitTime." ".$oRow->userid." ".$oRow->type."\r\n";
|
$sMsg.=$oRow->submitTime." ".$oRow->userid." ".$oRow->type."\r\n";
|
||||||
$sMsg.= "---------------------\r\n";
|
$sMsg.= "---------------------\r\n";
|
||||||
|
|||||||
@@ -28,12 +28,12 @@ if(get_magic_quotes_gpc())
|
|||||||
echo "if magic quotes is enabled. ";
|
echo "if magic quotes is enabled. ";
|
||||||
echo "Ooooooh you say.<br/>";
|
echo "Ooooooh you say.<br/>";
|
||||||
echo "<i>\"Aren't magic quotes a convienent way to protect my php code from sql injection attacks?\"</i><br/><br/>";
|
echo "<i>\"Aren't magic quotes a convienent way to protect my php code from sql injection attacks?\"</i><br/><br/>";
|
||||||
echo "No! <b>addslashes()</b> isn't adequate. You should use <b>mysql_real_escape_string()</b> or some other function";
|
echo "No! <b>addslashes()</b> isn't adequate. You should use <b>query_escape_string()</b> or some other function";
|
||||||
echo " that will handle multi-byte characters. See <a href=\"http://shiflett.org/archive/184\">this article</a>";
|
echo " that will handle multi-byte characters. See <a href=\"http://shiflett.org/archive/184\">this article</a>";
|
||||||
echo " for a way to exploit <b>addslash()</b>ed parameters.<br/><br/>";
|
echo " for a way to exploit <b>addslash()</b>ed parameters.<br/><br/>";
|
||||||
echo "A second reason is that with magic quotes enabled, due to the use of <b>mysql_real_escape_string()</b> to";
|
echo "A second reason is that with magic quotes enabled, due to the use of <b>query_escape_string()</b> to";
|
||||||
echo " protect from sql injection attacks we'll end up with variables that have been addslash()ed and";
|
echo " protect from sql injection attacks we'll end up with variables that have been addslash()ed and";
|
||||||
echo " <b>mysql_real_escape_string()</b>ed. So you end up having to call stripslashes() on EVERY variable. ";
|
echo " <b>query_escape_string()</b>ed. So you end up having to call stripslashes() on EVERY variable. ";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,25 +250,16 @@ function pHttpDate($sDate) {
|
|||||||
/**
|
/**
|
||||||
* msgs will be displayed on the Next page view of the same user
|
* msgs will be displayed on the Next page view of the same user
|
||||||
*/
|
*/
|
||||||
function addmsg($text, $color = "black")
|
function addmsg($shText, $color = "black")
|
||||||
{
|
{
|
||||||
global $hAppdbLink;
|
|
||||||
|
|
||||||
if(!is_resource($hAppdbLink))
|
|
||||||
{
|
|
||||||
// The last argument makes sure we are really opening a new connection
|
|
||||||
$hAppdbLink = mysql_connect(APPS_DBHOST, APPS_DBUSER, APPS_DBPASS,true);
|
|
||||||
mysql_select_db(APPS_DB, $hAppdbLink);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($color)
|
if($color)
|
||||||
$text = "<font color='$color'> $text </font>\n";
|
$shText = "<font color='$color'> $shText </font>\n";
|
||||||
|
|
||||||
$sQuery = "INSERT INTO sessionMessages VALUES (null, ?, '?', '?')";
|
$sQuery = "INSERT INTO sessionMessages VALUES (null, ?, '?', '?')";
|
||||||
if (!query_parameters($sQuery, "NOW()", session_id(), $text))
|
if (!query_parameters($sQuery, "NOW()", session_id(), $shText))
|
||||||
{
|
{
|
||||||
echo "An error has occurred in addmsg()";
|
echo "An error has occurred in addmsg()";
|
||||||
echo $text;
|
echo $shText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,7 +280,7 @@ function dumpmsgbuffer()
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
echo html_frame_start("","300","",5);
|
echo html_frame_start("","300","",5);
|
||||||
echo "<div align=center> $oRow->message </div>";
|
echo "<div align=center> $oRow->message </div>";
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class queuedEntries
|
|||||||
// this application or unqueued versions depending on which user we were
|
// this application or unqueued versions depending on which user we were
|
||||||
$hResult = $oApp->_internal_retrieve_all_versions();
|
$hResult = $oApp->_internal_retrieve_all_versions();
|
||||||
|
|
||||||
while($oVersionRow = mysql_fetch_object($hResult))
|
while($oVersionRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
if($bDebugOutputEnabled)
|
if($bDebugOutputEnabled)
|
||||||
{
|
{
|
||||||
@@ -108,7 +108,7 @@ class queuedEntries
|
|||||||
$hResult = query_parameters($sQuery, $iVersionId, "true");
|
$hResult = query_parameters($sQuery, $iVersionId, "true");
|
||||||
|
|
||||||
// go through the test results looking for the oldest queued data
|
// go through the test results looking for the oldest queued data
|
||||||
while($oTestingRow = mysql_fetch_object($hResult))
|
while($oTestingRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
if($bDebugOutputEnabled)
|
if($bDebugOutputEnabled)
|
||||||
echo "\tQueued TestData found\n";
|
echo "\tQueued TestData found\n";
|
||||||
@@ -124,7 +124,7 @@ class queuedEntries
|
|||||||
// queued screenshots
|
// queued screenshots
|
||||||
$sQuery = "select * from appData where type = 'screenshot' and versionId = '?' and queued = '?'";
|
$sQuery = "select * from appData where type = 'screenshot' and versionId = '?' and queued = '?'";
|
||||||
$hResult = query_parameters($sQuery, $iVersionId, "true");
|
$hResult = query_parameters($sQuery, $iVersionId, "true");
|
||||||
while($oScreenshotRow = mysql_fetch_object($hResult))
|
while($oScreenshotRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oScreenshot = new Screenshot(null, $oScreenshotRow);
|
$oScreenshot = new Screenshot(null, $oScreenshotRow);
|
||||||
|
|
||||||
@@ -187,7 +187,7 @@ class maintainer
|
|||||||
$sQuery = "SELECT * FROM appMaintainers WHERE maintainerId = '?'";
|
$sQuery = "SELECT * FROM appMaintainers WHERE maintainerId = '?'";
|
||||||
$hResult = query_parameters($sQuery, $iMaintainerId);
|
$hResult = query_parameters($sQuery, $iMaintainerId);
|
||||||
if($hResult)
|
if($hResult)
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -219,8 +219,8 @@ class maintainer
|
|||||||
$this->iUserId, $this->sMaintainReason,
|
$this->iUserId, $this->sMaintainReason,
|
||||||
$this->bSuperMaintainer, "NOW()", $this->mustBeQueued() ? "true" : "false");
|
$this->bSuperMaintainer, "NOW()", $this->mustBeQueued() ? "true" : "false");
|
||||||
|
|
||||||
/* this objects id is the insert id returned by mysql */
|
/* this objects id is the insert id returned by the database */
|
||||||
$this->iMaintainerId = mysql_insert_id();
|
$this->iMaintainerId = query_appdb_insert_id();
|
||||||
|
|
||||||
/* If this is a non-queued maintainer submission, remove the user's non-
|
/* If this is a non-queued maintainer submission, remove the user's non-
|
||||||
super maintainer entries for the application's versions. This check is
|
super maintainer entries for the application's versions. This check is
|
||||||
@@ -469,7 +469,7 @@ class maintainer
|
|||||||
$hResult = query_parameters($sQuery, $oUser->iUserId, $bSuperMaintainer ? "1" : "0", "false");
|
$hResult = query_parameters($sQuery, $oUser->iUserId, $bSuperMaintainer ? "1" : "0", "false");
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return 0;
|
return 0;
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->cnt;
|
return $oRow->cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,12 +483,12 @@ class maintainer
|
|||||||
"appFamily, appMaintainers WHERE appFamily.appId = appMaintainers.appId ".
|
"appFamily, appMaintainers WHERE appFamily.appId = appMaintainers.appId ".
|
||||||
"AND userId = '?' AND appMaintainers.queued = '?' ORDER BY appName",
|
"AND userId = '?' AND appMaintainers.queued = '?' ORDER BY appName",
|
||||||
$oUser->iUserId, "false");
|
$oUser->iUserId, "false");
|
||||||
if(!$hResult || mysql_num_rows($hResult) == 0)
|
if(!$hResult || query_num_rows($hResult) == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
$aAppsMaintained = array();
|
$aAppsMaintained = array();
|
||||||
$c = 0;
|
$c = 0;
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$aAppsMaintained[$c] = array($oRow->appId, $oRow->versionId, $oRow->superMaintainer);
|
$aAppsMaintained[$c] = array($oRow->appId, $oRow->versionId, $oRow->superMaintainer);
|
||||||
$c++;
|
$c++;
|
||||||
@@ -528,7 +528,7 @@ class maintainer
|
|||||||
$bQueued ? "true" : "false")))
|
$bQueued ? "true" : "false")))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
for($iCount = 0; $oRow = mysql_fetch_object($hResult);)
|
for($iCount = 0; $oRow = query_fetch_object($hResult);)
|
||||||
$iCount += $oRow->count;
|
$iCount += $oRow->count;
|
||||||
|
|
||||||
return $iCount;
|
return $iCount;
|
||||||
@@ -539,7 +539,7 @@ class maintainer
|
|||||||
{
|
{
|
||||||
$sQuery = "SELECT count(*) as maintainers FROM appMaintainers where queued='false'";
|
$sQuery = "SELECT count(*) as maintainers FROM appMaintainers where queued='false'";
|
||||||
$hResult = query_parameters($sQuery);
|
$hResult = query_parameters($sQuery);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->maintainers;
|
return $oRow->maintainers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -547,7 +547,7 @@ class maintainer
|
|||||||
function getNumberOfMaintainers()
|
function getNumberOfMaintainers()
|
||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT DISTINCT userId FROM appMaintainers WHERE queued='false';");
|
$hResult = query_parameters("SELECT DISTINCT userId FROM appMaintainers WHERE queued='false';");
|
||||||
return mysql_num_rows($hResult);
|
return query_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isUserMaintainer($oUser, $iVersionId = null)
|
function isUserMaintainer($oUser, $iVersionId = null)
|
||||||
@@ -570,7 +570,7 @@ class maintainer
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return mysql_num_rows($hResult);
|
return query_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isUserSuperMaintainer($oUser, $iAppId = null)
|
function isUserSuperMaintainer($oUser, $iAppId = null)
|
||||||
@@ -586,7 +586,7 @@ class maintainer
|
|||||||
}
|
}
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return false;
|
return false;
|
||||||
return mysql_num_rows($hResult);
|
return query_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if given an appid or a version id return a handle for a query that has */
|
/* if given an appid or a version id return a handle for a query that has */
|
||||||
@@ -637,7 +637,7 @@ class maintainer
|
|||||||
$hResult = query_parameters($sQuery, $iAppId, "false");
|
$hResult = query_parameters($sQuery, $iAppId, "false");
|
||||||
$aUserIds = array();
|
$aUserIds = array();
|
||||||
$c = 0;
|
$c = 0;
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$aUserIds[$c] = $oRow->userId;
|
$aUserIds[$c] = $oRow->userId;
|
||||||
$c++;
|
$c++;
|
||||||
@@ -1182,10 +1182,10 @@ class maintainer
|
|||||||
// retrieve all of the maintainers
|
// retrieve all of the maintainers
|
||||||
$hResult = maintainer::objectGetEntries(false, false);
|
$hResult = maintainer::objectGetEntries(false, false);
|
||||||
|
|
||||||
// echo "Processing ".mysql_num_rows($hResult)." maintainers\n";
|
// echo "Processing ".query_num_rows($hResult)." maintainers\n";
|
||||||
|
|
||||||
// notify this user, the maintainer, of queued data, if any exists
|
// notify this user, the maintainer, of queued data, if any exists
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oMaintainer = new maintainer(null, $oRow);
|
$oMaintainer = new maintainer(null, $oRow);
|
||||||
$oMaintainer->notifyMaintainerOfQueuedData();
|
$oMaintainer->notifyMaintainerOfQueuedData();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class Monitor {
|
|||||||
FROM appMonitors
|
FROM appMonitors
|
||||||
WHERE monitorId = '".$iMonitorId."'";
|
WHERE monitorId = '".$iMonitorId."'";
|
||||||
$hResult = query_appdb($sQuery);
|
$hResult = query_appdb($sQuery);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -51,7 +51,7 @@ class Monitor {
|
|||||||
WHERE userId = '".$iUserId."'
|
WHERE userId = '".$iUserId."'
|
||||||
AND versionId = '".$iVersionId."'";
|
AND versionId = '".$iVersionId."'";
|
||||||
$hResult = query_appdb($sQuery);
|
$hResult = query_appdb($sQuery);
|
||||||
if( $oRow = mysql_fetch_object($hResult) )
|
if( $oRow = query_fetch_object($hResult) )
|
||||||
{
|
{
|
||||||
$this->iMonitorId = $oRow->monitorId;
|
$this->iMonitorId = $oRow->monitorId;
|
||||||
$this->iAppId = $oRow->appId;
|
$this->iAppId = $oRow->appId;
|
||||||
@@ -83,7 +83,7 @@ class Monitor {
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->Monitor(mysql_insert_id());
|
$this->Monitor(query_appdb_insert_id());
|
||||||
$sWhatChanged = "New monitor\n\n";
|
$sWhatChanged = "New monitor\n\n";
|
||||||
$this->SendNotificationMail("add", $sWhatChanged);
|
$this->SendNotificationMail("add", $sWhatChanged);
|
||||||
return true;
|
return true;
|
||||||
@@ -228,7 +228,7 @@ class Monitor {
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
|
|
||||||
if(!$oRow)
|
if(!$oRow)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -247,12 +247,12 @@ class Monitor {
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT appId, versionId FROM appMonitors WHERE userId = '?'", $oUser->iUserId);
|
$hResult = query_parameters("SELECT appId, versionId FROM appMonitors WHERE userId = '?'", $oUser->iUserId);
|
||||||
|
|
||||||
if(!$hResult || mysql_num_rows($hResult) == 0)
|
if(!$hResult || query_num_rows($hResult) == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
$aVersionsMonitored = array();
|
$aVersionsMonitored = array();
|
||||||
|
|
||||||
for($i = 0; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 0; $oRow = query_fetch_object($hResult); $i++)
|
||||||
$aVersionsMonitored[$i] = array($oRow->appId, $oRow->versionId);
|
$aVersionsMonitored[$i] = array($oRow->appId, $oRow->versionId);
|
||||||
|
|
||||||
return $aVersionsMonitored;
|
return $aVersionsMonitored;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Note {
|
|||||||
{
|
{
|
||||||
$sQuery = "SELECT * FROM appNotes WHERE noteId = '?'";
|
$sQuery = "SELECT * FROM appNotes WHERE noteId = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $iNoteId))
|
if($hResult = query_parameters($sQuery, $iNoteId))
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -64,7 +64,7 @@ class Note {
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->note(mysql_insert_id());
|
$this->note(query_appdb_insert_id());
|
||||||
$sWhatChanged = "Description is:\n".$this->shDescription.".\n\n";
|
$sWhatChanged = "Description is:\n".$this->shDescription.".\n\n";
|
||||||
$this->SendNotificationMail("add", $sWhatChanged);
|
$this->SendNotificationMail("add", $sWhatChanged);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class ObjectManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* did we get any entries? */
|
/* did we get any entries? */
|
||||||
if(!$hResult || mysql_num_rows($hResult) == 0)
|
if(!$hResult || query_num_rows($hResult) == 0)
|
||||||
{
|
{
|
||||||
switch($this->getQueueString($this->bIsQueue, $this->bIsRejected))
|
switch($this->getQueueString($this->bIsQueue, $this->bIsRejected))
|
||||||
{
|
{
|
||||||
@@ -142,7 +142,7 @@ class ObjectManager
|
|||||||
$this->outputHeader("color4");
|
$this->outputHeader("color4");
|
||||||
|
|
||||||
/* output each entry */
|
/* output each entry */
|
||||||
for($iCount = 0; $oRow = mysql_fetch_object($hResult); $iCount++)
|
for($iCount = 0; $oRow = query_fetch_object($hResult); $iCount++)
|
||||||
{
|
{
|
||||||
$oObject = new $this->sClass(null, $oRow);
|
$oObject = new $this->sClass(null, $oRow);
|
||||||
|
|
||||||
@@ -392,7 +392,7 @@ class ObjectManager
|
|||||||
"Move here"),
|
"Move here"),
|
||||||
"color4");
|
"color4");
|
||||||
|
|
||||||
for($i = 0; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 0; $oRow = query_fetch_object($hResult); $i++)
|
||||||
{
|
{
|
||||||
$oCandidate = new $this->sClass(null, $oRow);
|
$oCandidate = new $this->sClass(null, $oRow);
|
||||||
if($oCandidate->objectGetId() == $this->iId)
|
if($oCandidate->objectGetId() == $this->iId)
|
||||||
|
|||||||
@@ -4,14 +4,14 @@ $hBugzillaLink = null;
|
|||||||
|
|
||||||
define("MYSQL_DEADLOCK_ERRNO", 1213);
|
define("MYSQL_DEADLOCK_ERRNO", 1213);
|
||||||
|
|
||||||
function query_appdb($sQuery,$sComment="")
|
function query_appdb($sQuery, $sComment="")
|
||||||
{
|
{
|
||||||
global $hAppdbLink;
|
global $hAppdbLink;
|
||||||
|
|
||||||
if(!is_resource($hAppdbLink))
|
if(!is_resource($hAppdbLink))
|
||||||
{
|
{
|
||||||
// The last argument makes sure we are really opening a new connection
|
// The last argument makes sure we are really opening a new connection
|
||||||
$hAppdbLink = mysql_connect(APPS_DBHOST, APPS_DBUSER, APPS_DBPASS,true);
|
$hAppdbLink = mysql_connect(APPS_DBHOST, APPS_DBUSER, APPS_DBPASS, true);
|
||||||
mysql_select_db(APPS_DB, $hAppdbLink);
|
mysql_select_db(APPS_DB, $hAppdbLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ function query_parameters()
|
|||||||
if(!is_resource($hAppdbLink))
|
if(!is_resource($hAppdbLink))
|
||||||
{
|
{
|
||||||
// The last argument makes sure we are really opening a new connection
|
// The last argument makes sure we are really opening a new connection
|
||||||
$hAppdbLink = mysql_connect(APPS_DBHOST, APPS_DBUSER, APPS_DBPASS,true);
|
$hAppdbLink = mysql_connect(APPS_DBHOST, APPS_DBUSER, APPS_DBPASS, true);
|
||||||
mysql_select_db(APPS_DB, $hAppdbLink);
|
mysql_select_db(APPS_DB, $hAppdbLink);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,4 +159,61 @@ function query_error($sQuery, $sComment="")
|
|||||||
$bInQueryError = false; // clear variable upon exit
|
$bInQueryError = false; // clear variable upon exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function query_fetch_row($hResult)
|
||||||
|
{
|
||||||
|
return mysql_fetch_row($hResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_fetch_object($hResult)
|
||||||
|
{
|
||||||
|
return mysql_fetch_object($hResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_appdb_insert_id()
|
||||||
|
{
|
||||||
|
global $hAppdbLink;
|
||||||
|
return mysql_insert_id($hAppdbLink);
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_bugzilla_insert_id()
|
||||||
|
{
|
||||||
|
global $hBugzillaLink;
|
||||||
|
return mysql_insert_id($hBugzillaLink);
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_num_rows($hResult)
|
||||||
|
{
|
||||||
|
return mysql_num_rows($hResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_escape_string($sString)
|
||||||
|
{
|
||||||
|
return mysql_real_escape_string($sString);
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_field_type($hResult, $iFieldOffset)
|
||||||
|
{
|
||||||
|
return mysql_field_type($hResult, $iFieldOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_field_name($hResult, $iFieldOffset)
|
||||||
|
{
|
||||||
|
return mysql_field_name($hResult, $iFieldOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_field_len($hResult, $ifieldOffset)
|
||||||
|
{
|
||||||
|
return mysql_field_len($hResult, $iFieldOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_field_flags($hResult, $iFieldOffset)
|
||||||
|
{
|
||||||
|
return mysql_field_flags($hResult, $iFieldOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
function query_fetch_field($hResult, $iFieldOffset)
|
||||||
|
{
|
||||||
|
return mysql_fetch_field($hResult, $iFieldOffset);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class screenshot
|
|||||||
AND id = '?'
|
AND id = '?'
|
||||||
AND type = 'screenshot'", $iScreenshotId);
|
AND type = 'screenshot'", $iScreenshotId);
|
||||||
if($hResult)
|
if($hResult)
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -80,7 +80,7 @@ class screenshot
|
|||||||
$_SESSION['current']->iUserId);
|
$_SESSION['current']->iUserId);
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iScreenshotId = mysql_insert_id();
|
$this->iScreenshotId = query_appdb_insert_id();
|
||||||
|
|
||||||
/* make sure we supply the full path to move_uploaded_file() */
|
/* make sure we supply the full path to move_uploaded_file() */
|
||||||
$moveToPath = appdb_fullpath("data/screenshots/originals/").$this->iScreenshotId;
|
$moveToPath = appdb_fullpath("data/screenshots/originals/").$this->iScreenshotId;
|
||||||
@@ -432,12 +432,12 @@ class screenshot
|
|||||||
if($bFormatting)
|
if($bFormatting)
|
||||||
$sImgFile .= '<center>';
|
$sImgFile .= '<center>';
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !query_num_rows($hResult))
|
||||||
{
|
{
|
||||||
$sImgFile.= '<img src="images/no_screenshot.png" alt="No Screenshot" />';
|
$sImgFile.= '<img src="images/no_screenshot.png" alt="No Screenshot" />';
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$sImgFile.= '<img src="appimage.php?bThumbnail=true&iId='.$oRow->id.'" alt="'.$oRow->description.'" />';
|
$sImgFile.= '<img src="appimage.php?bThumbnail=true&iId='.$oRow->id.'" alt="'.$oRow->description.'" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ class screenshot
|
|||||||
$sZoomIcon = Screenshot::get_zoomicon_overlay();
|
$sZoomIcon = Screenshot::get_zoomicon_overlay();
|
||||||
|
|
||||||
/* we have screenshots */
|
/* we have screenshots */
|
||||||
if(mysql_num_rows($hResult))
|
if(query_num_rows($hResult))
|
||||||
{
|
{
|
||||||
if($iVersionId)
|
if($iVersionId)
|
||||||
$sImg .= "<a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<center>View/Submit Screenshot</center></a>";
|
$sImg .= "<a href='screenshots.php?iAppId=$iAppId&iVersionId=$iVersionId'>".$sImgFile.$sZoomIcon."<center>View/Submit Screenshot</center></a>";
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* session.php - session handler functions
|
* session.php - session handler functions
|
||||||
* sessions are stored in a mysql table
|
* sessions are stored in a database table
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* the number of days a session cookie is flaged to last */
|
/* the number of days a session cookie is flaged to last */
|
||||||
@@ -72,7 +72,7 @@ class session
|
|||||||
{
|
{
|
||||||
$result = query_parameters("SELECT data FROM session_list WHERE session_id = '?'", $key);
|
$result = query_parameters("SELECT data FROM session_list WHERE session_id = '?'", $key);
|
||||||
if (!$result) { return null; }
|
if (!$result) { return null; }
|
||||||
$oRow = mysql_fetch_object($result);
|
$oRow = query_fetch_object($result);
|
||||||
if($oRow)
|
if($oRow)
|
||||||
return $oRow->data;
|
return $oRow->data;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -20,19 +20,19 @@ class TableVE {
|
|||||||
function test($query)
|
function test($query)
|
||||||
{
|
{
|
||||||
$hResult = query_appdb($query);
|
$hResult = query_appdb($query);
|
||||||
$nfields = mysql_num_fields($hResult);
|
$nfields = query_num_fields($hResult);
|
||||||
$nrows = mysql_num_rows($hResult);
|
$nrows = query_num_rows($hResult);
|
||||||
$table = mysql_field_table($hResult, 0);
|
$table = query_field_table($hResult, 0);
|
||||||
|
|
||||||
echo "Table: $table <br> Fields: $nfields <br> Rows: $nrows <br> <br>\n";
|
echo "Table: $table <br> Fields: $nfields <br> Rows: $nrows <br> <br>\n";
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while($i < $nfields)
|
while($i < $nfields)
|
||||||
{
|
{
|
||||||
$type = mysql_field_type($hResult, $i);
|
$type = query_field_type($hResult, $i);
|
||||||
$name = mysql_field_name($hResult, $i);
|
$name = query_field_name($hResult, $i);
|
||||||
$len = mysql_field_len($hResult, $i);
|
$len = query_field_len($hResult, $i);
|
||||||
$flags = mysql_field_flags($hResult, $i);
|
$flags = query_field_flags($hResult, $i);
|
||||||
|
|
||||||
echo "$type | $name | $len | $flags <br>\n";
|
echo "$type | $name | $len | $flags <br>\n";
|
||||||
$i++;
|
$i++;
|
||||||
@@ -46,7 +46,7 @@ class TableVE {
|
|||||||
function create($query, $table, $idcolumn)
|
function create($query, $table, $idcolumn)
|
||||||
{
|
{
|
||||||
$hResult = query_appdb($query);
|
$hResult = query_appdb($query);
|
||||||
$id = mysql_insert_id();
|
$id = query_appdb_insert_id();
|
||||||
|
|
||||||
$new_query = "SELECT * FROM $table WHERE $idcolumn = $id";
|
$new_query = "SELECT * FROM $table WHERE $idcolumn = $id";
|
||||||
$this->edit($new_query);
|
$this->edit($new_query);
|
||||||
@@ -60,7 +60,7 @@ class TableVE {
|
|||||||
$nrows = 0;
|
$nrows = 0;
|
||||||
|
|
||||||
$hResult = query_appdb($query);
|
$hResult = query_appdb($query);
|
||||||
$nrows = mysql_num_rows($hResult);
|
$nrows = query_num_rows($hResult);
|
||||||
|
|
||||||
if(debugging())
|
if(debugging())
|
||||||
{
|
{
|
||||||
@@ -76,8 +76,8 @@ class TableVE {
|
|||||||
|
|
||||||
function view_entry($hResult, $num)
|
function view_entry($hResult, $num)
|
||||||
{
|
{
|
||||||
$nfields = mysql_num_fields($hResult);
|
$nfields = query_num_fields($hResult);
|
||||||
$fields = mysql_fetch_array($hResult, MYSQL_BOTH);
|
$fields = query_fetch_array($hResult, MYSQL_BOTH);
|
||||||
|
|
||||||
$titleValue = $fields[$this->titleField];
|
$titleValue = $fields[$this->titleField];
|
||||||
$titleText = $this->titleText;
|
$titleText = $this->titleText;
|
||||||
@@ -98,7 +98,7 @@ class TableVE {
|
|||||||
|
|
||||||
for($i = 0; $i < $nfields; $i++)
|
for($i = 0; $i < $nfields; $i++)
|
||||||
{
|
{
|
||||||
$field = mysql_fetch_field($hResult, $i);
|
$field = query_fetch_field($hResult, $i);
|
||||||
|
|
||||||
if(ereg("^impl_(.+)$", $field->table, $arr))
|
if(ereg("^impl_(.+)$", $field->table, $arr))
|
||||||
{
|
{
|
||||||
@@ -121,7 +121,7 @@ class TableVE {
|
|||||||
function edit($query)
|
function edit($query)
|
||||||
{
|
{
|
||||||
$hResult = query_appdb($query);
|
$hResult = query_appdb($query);
|
||||||
$nrows = mysql_num_rows($hResult);
|
$nrows = query_num_rows($hResult);
|
||||||
|
|
||||||
echo "<form method=post action='".$_SERVER['PHP_SELF']."'>\n";
|
echo "<form method=post action='".$_SERVER['PHP_SELF']."'>\n";
|
||||||
|
|
||||||
@@ -141,8 +141,8 @@ class TableVE {
|
|||||||
|
|
||||||
function edit_entry($hResult)
|
function edit_entry($hResult)
|
||||||
{
|
{
|
||||||
$nfields = mysql_num_fields($hResult);
|
$nfields = query_num_fields($hResult);
|
||||||
$fields = mysql_fetch_array($hResult);
|
$fields = query_fetch_array($hResult);
|
||||||
|
|
||||||
echo html_frame_start(ucfirst($this->mode),"80%","",0);
|
echo html_frame_start(ucfirst($this->mode),"80%","",0);
|
||||||
echo "<table border=0 width='100%' cellspacing=0 cellpadding=2>\n";
|
echo "<table border=0 width='100%' cellspacing=0 cellpadding=2>\n";
|
||||||
@@ -151,8 +151,8 @@ class TableVE {
|
|||||||
for($i = 0; $i < $nfields; $i++)
|
for($i = 0; $i < $nfields; $i++)
|
||||||
{
|
{
|
||||||
global $testvar;
|
global $testvar;
|
||||||
$field = mysql_fetch_field($hResult, $i);
|
$field = query_fetch_field($hResult, $i);
|
||||||
$len = mysql_field_len($hResult, $i);
|
$len = query_field_len($hResult, $i);
|
||||||
|
|
||||||
if(ereg("^impl_(.+)$", $field->table, $arr))
|
if(ereg("^impl_(.+)$", $field->table, $arr))
|
||||||
{
|
{
|
||||||
@@ -189,7 +189,7 @@ class TableVE {
|
|||||||
|
|
||||||
$sStr.= "<select name='$sVarname'>\n";
|
$sStr.= "<select name='$sVarname'>\n";
|
||||||
$sStr.= "<option value=0>Choose ...</option>\n";
|
$sStr.= "<option value=0>Choose ...</option>\n";
|
||||||
while(list($iId, $sName) = mysql_fetch_row($hResult))
|
while(list($iId, $sName) = query_fetch_row($hResult))
|
||||||
{
|
{
|
||||||
if ($sName == "NONAME")
|
if ($sName == "NONAME")
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class testData{
|
|||||||
FROM testResults
|
FROM testResults
|
||||||
WHERE testingId = '?'";
|
WHERE testingId = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $iTestingId))
|
if($hResult = query_parameters($sQuery, $iTestingId))
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -83,7 +83,7 @@ class testData{
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iTestingId = mysql_insert_id();
|
$this->iTestingId = query_appdb_insert_id();
|
||||||
$this->testData($this->iTestingId);
|
$this->testData($this->iTestingId);
|
||||||
$this->SendNotificationMail();
|
$this->SendNotificationMail();
|
||||||
return true;
|
return true;
|
||||||
@@ -446,8 +446,8 @@ class testData{
|
|||||||
global $aClean;
|
global $aClean;
|
||||||
|
|
||||||
/* escape input parameters */
|
/* escape input parameters */
|
||||||
$link = mysql_real_escape_string($link);
|
$link = query_escape_string($link);
|
||||||
$iDisplayLimit = mysql_real_escape_string($iDisplayLimit);
|
$iDisplayLimit = query_escape_string($iDisplayLimit);
|
||||||
|
|
||||||
$sShowAll = isset($aClean['sShowAll']) ? $aClean['sShowAll'] : false;
|
$sShowAll = isset($aClean['sShowAll']) ? $aClean['sShowAll'] : false;
|
||||||
|
|
||||||
@@ -465,7 +465,7 @@ class testData{
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$rowsUsed = mysql_num_rows($hResult);
|
$rowsUsed = query_num_rows($hResult);
|
||||||
|
|
||||||
if($rowsUsed == 0)
|
if($rowsUsed == 0)
|
||||||
return;
|
return;
|
||||||
@@ -493,7 +493,7 @@ class testData{
|
|||||||
$oTable->SetHeader($oTableRowHeader);
|
$oTable->SetHeader($oTableRowHeader);
|
||||||
|
|
||||||
$iIndex = 0;
|
$iIndex = 0;
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oTest = new testData($oRow->testingId);
|
$oTest = new testData($oRow->testingId);
|
||||||
$oVersion = new Version($oTest->iVersionId);
|
$oVersion = new Version($oTest->iVersionId);
|
||||||
@@ -601,7 +601,7 @@ class testData{
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if(!$oRow = mysql_fetch_object($hResult))
|
if(!$oRow = query_fetch_object($hResult))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return $oRow->testingId;
|
return $oRow->testingId;
|
||||||
@@ -799,7 +799,7 @@ class testData{
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT testResults.versionId, testResults.testedDate, testResults.testedRelease, testResults.testedRating, testResults.submitTime, appFamily.appName, appVersion.versionName from testResults, appFamily, appVersion WHERE testResults.versionId = appVersion.versionId AND appVersion.appId = appFamily.appId AND (appFamily.queued = '?' OR appVersion.queued = '?') AND testResults.submitterId = '?' AND testResults.queued = '?' ORDER BY testResults.testingId", "false", "false", $iUserId, $bQueued ? "true" : "false");
|
$hResult = query_parameters("SELECT testResults.versionId, testResults.testedDate, testResults.testedRelease, testResults.testedRating, testResults.submitTime, appFamily.appName, appVersion.versionName from testResults, appFamily, appVersion WHERE testResults.versionId = appVersion.versionId AND appVersion.appId = appFamily.appId AND (appFamily.queued = '?' OR appVersion.queued = '?') AND testResults.submitterId = '?' AND testResults.queued = '?' ORDER BY testResults.testingId", "false", "false", $iUserId, $bQueued ? "true" : "false");
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !query_num_rows($hResult))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$sReturn = html_table_begin("width=\"100%\" align=\"center\"");
|
$sReturn = html_table_begin("width=\"100%\" align=\"center\"");
|
||||||
@@ -810,7 +810,7 @@ class testData{
|
|||||||
"Submission Date"),
|
"Submission Date"),
|
||||||
"color4");
|
"color4");
|
||||||
|
|
||||||
for($i = 1; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 1; $oRow = query_fetch_object($hResult); $i++)
|
||||||
$sReturn .= html_tr(array(
|
$sReturn .= html_tr(array(
|
||||||
version::fullNameLink($oRow->versionId),
|
version::fullNameLink($oRow->versionId),
|
||||||
$oRow->testedRating,
|
$oRow->testedRating,
|
||||||
@@ -834,7 +834,7 @@ class testData{
|
|||||||
|
|
||||||
$hResult = query_parameters($sQuery, $iVersionId, 'false');
|
$hResult = query_parameters($sQuery, $iVersionId, 'false');
|
||||||
|
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->cnt;
|
return $oRow->cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -901,7 +901,7 @@ class testData{
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(!$oRow = mysql_fetch_object($hResult))
|
if(!$oRow = query_fetch_object($hResult))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return $oRow->count;
|
return $oRow->count;
|
||||||
@@ -1014,7 +1014,7 @@ class testData{
|
|||||||
$oUser = new user($this->iSubmitterId);
|
$oUser = new user($this->iSubmitterId);
|
||||||
|
|
||||||
$hMaintainers = maintainer::getMaintainersForAppIdVersionId(null, $this->iVersionId);
|
$hMaintainers = maintainer::getMaintainersForAppIdVersionId(null, $this->iVersionId);
|
||||||
$bHasMaintainer = (mysql_num_rows($hMaintainers) == 0) ? false : true;
|
$bHasMaintainer = (query_num_rows($hMaintainers) == 0) ? false : true;
|
||||||
|
|
||||||
$oTableRow = new TableRow();
|
$oTableRow = new TableRow();
|
||||||
$oTableRow->AddCell(new TableCell(print_date(mysqldatetime_to_unixtimestamp($this->sSubmitTime))));
|
$oTableRow->AddCell(new TableCell(print_date(mysqldatetime_to_unixtimestamp($this->sSubmitTime))));
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Url {
|
|||||||
WHERE type = 'url'
|
WHERE type = 'url'
|
||||||
AND id = '?'";
|
AND id = '?'";
|
||||||
$hResult = query_parameters($sQuery, $iUrlId);
|
$hResult = query_parameters($sQuery, $iUrlId);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
// we are working on an existing url
|
// we are working on an existing url
|
||||||
@@ -77,7 +77,7 @@ class Url {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->iUrlId = mysql_insert_id();
|
$this->iUrlId = query_appdb_insert_id();
|
||||||
$this->url($this->iUrlId,$this->bQueued);
|
$this->url($this->iUrlId,$this->bQueued);
|
||||||
|
|
||||||
if(!$bSilent)
|
if(!$bSilent)
|
||||||
@@ -299,7 +299,7 @@ class Url {
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
for($i = 1; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 1; $oRow = query_fetch_object($hResult); $i++)
|
||||||
{
|
{
|
||||||
$sReturn .= html_tr(array(
|
$sReturn .= html_tr(array(
|
||||||
"<input type=\"checkbox\" name=\"bRemove$oRow->id\" ".
|
"<input type=\"checkbox\" name=\"bRemove$oRow->id\" ".
|
||||||
@@ -360,7 +360,7 @@ class Url {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!($oRow = mysql_fetch_object($hResult)))
|
if(!($oRow = query_fetch_object($hResult)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
$num = $oRow->num;
|
$num = $oRow->num;
|
||||||
@@ -378,7 +378,7 @@ class Url {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$url = new url($oRow->id);
|
$url = new url($oRow->id);
|
||||||
|
|
||||||
@@ -485,7 +485,7 @@ class Url {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for($i = 0; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 0; $oRow = query_fetch_object($hResult); $i++)
|
||||||
{
|
{
|
||||||
// create a url object
|
// create a url object
|
||||||
$oUrl = new Url(null, $oRow);
|
$oUrl = new Url(null, $oRow);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class User {
|
|||||||
FROM user_list
|
FROM user_list
|
||||||
WHERE userId = '?'";
|
WHERE userId = '?'";
|
||||||
$hResult = query_parameters($sQuery, $iUserId);
|
$hResult = query_parameters($sQuery, $iUserId);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($oRow)
|
if($oRow)
|
||||||
{
|
{
|
||||||
$this->iUserId = $oRow->userid;
|
$this->iUserId = $oRow->userid;
|
||||||
@@ -81,7 +81,7 @@ class User {
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters($sQuery.$sMysqlSHAPasswordPart,
|
$hResult = query_parameters($sQuery.$sMysqlSHAPasswordPart,
|
||||||
$sEmail, $sPassword);
|
$sEmail, $sPassword);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we aren't logged in yet
|
// if we aren't logged in yet
|
||||||
@@ -90,7 +90,7 @@ class User {
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters($sQuery.$sMysqlPasswordPart,
|
$hResult = query_parameters($sQuery.$sMysqlPasswordPart,
|
||||||
$sEmail, $sPassword);
|
$sEmail, $sPassword);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($oRow) $bUsedOldStylePassword = true;
|
if($oRow) $bUsedOldStylePassword = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ class User {
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters($sQuery.$sMysql40xPasswordPart,
|
$hResult = query_parameters($sQuery.$sMysql40xPasswordPart,
|
||||||
$sEmail, $sPassword);
|
$sEmail, $sPassword);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($oRow) $bUsedOldStylePassword = true;
|
if($oRow) $bUsedOldStylePassword = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -265,9 +265,9 @@ class User {
|
|||||||
|
|
||||||
$hResult = query_parameters("SELECT * FROM user_prefs WHERE userid = '?' AND name = '?'",
|
$hResult = query_parameters("SELECT * FROM user_prefs WHERE userid = '?' AND name = '?'",
|
||||||
$this->iUserId, $sKey);
|
$this->iUserId, $sKey);
|
||||||
if(!$hResult || mysql_num_rows($hResult) == 0)
|
if(!$hResult || query_num_rows($hResult) == 0)
|
||||||
return $sDef;
|
return $sDef;
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->value;
|
return $oRow->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ class User {
|
|||||||
$this->iUserId, $sPriv);
|
$this->iUserId, $sPriv);
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return false;
|
return false;
|
||||||
return mysql_num_rows($hResult);
|
return query_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -373,7 +373,7 @@ class User {
|
|||||||
WHERE submitterId = '?'
|
WHERE submitterId = '?'
|
||||||
AND appId = '?'",
|
AND appId = '?'",
|
||||||
$this->iUserId, $iAppId);
|
$this->iUserId, $iAppId);
|
||||||
if(mysql_num_rows($hResult))
|
if(query_num_rows($hResult))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
@@ -386,7 +386,7 @@ class User {
|
|||||||
AND appVersion.submitterId = '?'
|
AND appVersion.submitterId = '?'
|
||||||
AND appVersion.versionId = '?'",
|
AND appVersion.versionId = '?'",
|
||||||
$this->iUserId, $iVersionId);
|
$this->iUserId, $iVersionId);
|
||||||
if(mysql_num_rows($hResult))
|
if(query_num_rows($hResult))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
@@ -398,7 +398,7 @@ class User {
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT count(userId) as c FROM appComments WHERE userId = '?'",
|
$hResult = query_parameters("SELECT count(userId) as c FROM appComments WHERE userId = '?'",
|
||||||
$this->iUserId);
|
$this->iUserId);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($oRow->c != 0) return true;
|
if($oRow->c != 0) return true;
|
||||||
|
|
||||||
if($this->isMaintainer() || $this->isSuperMaintainer())
|
if($this->isMaintainer() || $this->isSuperMaintainer())
|
||||||
@@ -406,7 +406,7 @@ class User {
|
|||||||
|
|
||||||
$hResult = query_parameters("SELECT count(userId) as c FROM appVotes WHERE userId = '?'",
|
$hResult = query_parameters("SELECT count(userId) as c FROM appVotes WHERE userId = '?'",
|
||||||
$this->iUserId);
|
$this->iUserId);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($oRow->c != 0) return true;
|
if($oRow->c != 0) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -468,12 +468,12 @@ class User {
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT userid FROM user_list WHERE email = '?'",
|
$hResult = query_parameters("SELECT userid FROM user_list WHERE email = '?'",
|
||||||
$sEmail);
|
$sEmail);
|
||||||
if(!$hResult || mysql_num_rows($hResult) != 1)
|
if(!$hResult || query_num_rows($hResult) != 1)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->userid;
|
return $oRow->userid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -485,7 +485,7 @@ class User {
|
|||||||
function objectGetEntriesCount($bQueued = null, $bRejected = null)
|
function objectGetEntriesCount($bQueued = null, $bRejected = null)
|
||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT count(*) as num_users FROM user_list;");
|
$hResult = query_parameters("SELECT count(*) as num_users FROM user_list;");
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->num_users;
|
return $oRow->num_users;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -496,7 +496,7 @@ class User {
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT count(*) as num_users FROM user_list WHERE stamp >= DATE_SUB(CURDATE(), interval '?' day);",
|
$hResult = query_parameters("SELECT count(*) as num_users FROM user_list WHERE stamp >= DATE_SUB(CURDATE(), interval '?' day);",
|
||||||
$days);
|
$days);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->num_users;
|
return $oRow->num_users;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,7 +508,7 @@ class User {
|
|||||||
{
|
{
|
||||||
/* retrieve the number of users that have been warned and are pending deletion */
|
/* retrieve the number of users that have been warned and are pending deletion */
|
||||||
$hResult = query_parameters("select count(*) as count from user_list where inactivity_warned = 'true'");
|
$hResult = query_parameters("select count(*) as count from user_list where inactivity_warned = 'true'");
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->count;
|
return $oRow->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,9 +527,9 @@ class User {
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
if(mysql_num_rows($hResult) > 0)
|
if(query_num_rows($hResult) > 0)
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
$aUserId[] = $oRow->userId;
|
$aUserId[] = $oRow->userId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -560,9 +560,9 @@ class User {
|
|||||||
}
|
}
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
if(mysql_num_rows($hResult) > 0)
|
if(query_num_rows($hResult) > 0)
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
$aUserId[] = $oRow->userId;
|
$aUserId[] = $oRow->userId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -571,9 +571,9 @@ class User {
|
|||||||
* Retrieve administrators.
|
* Retrieve administrators.
|
||||||
*/
|
*/
|
||||||
$hResult = query_parameters("SELECT * FROM user_privs WHERE priv = 'admin'");
|
$hResult = query_parameters("SELECT * FROM user_privs WHERE priv = 'admin'");
|
||||||
if(mysql_num_rows($hResult) > 0)
|
if(query_num_rows($hResult) > 0)
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$i = array_search($oRow->userid, $aUserId);
|
$i = array_search($oRow->userid, $aUserId);
|
||||||
|
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ function make_bugzilla_version_list($sVarname, $sSelectedValue)
|
|||||||
// TODO: if we ever get a reasonable way to order the list replace this code
|
// TODO: if we ever get a reasonable way to order the list replace this code
|
||||||
// with that
|
// with that
|
||||||
$aVersions = array();
|
$aVersions = array();
|
||||||
while(list($sValue) = mysql_fetch_row($hResult))
|
while(list($sValue) = query_fetch_row($hResult))
|
||||||
{
|
{
|
||||||
// exclude unspecified versions and the "CVS" version
|
// exclude unspecified versions and the "CVS" version
|
||||||
if(($sValue != "unspecified") && ($sValue != "CVS"))
|
if(($sValue != "unspecified") && ($sValue != "CVS"))
|
||||||
@@ -246,7 +246,7 @@ function make_maintainer_rating_list($varname, $cvalue)
|
|||||||
function getNumberOfComments()
|
function getNumberOfComments()
|
||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT count(*) as num_comments FROM appComments;");
|
$hResult = query_parameters("SELECT count(*) as num_comments FROM appComments;");
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->num_comments;
|
return $oRow->num_comments;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ function getNumberOfQueuedBugLinks()
|
|||||||
$hResult = query_parameters("SELECT count(*) as num_buglinks FROM buglinks WHERE queued='true';");
|
$hResult = query_parameters("SELECT count(*) as num_buglinks FROM buglinks WHERE queued='true';");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->num_buglinks;
|
return $oRow->num_buglinks;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -268,7 +268,7 @@ function getNumberOfBugLinks()
|
|||||||
$hResult = query_parameters("SELECT count(*) as num_buglinks FROM buglinks;");
|
$hResult = query_parameters("SELECT count(*) as num_buglinks FROM buglinks;");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return $oRow->num_buglinks;
|
return $oRow->num_buglinks;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -316,8 +316,8 @@ function outputTopXRow($oRow)
|
|||||||
function outputTopXRowAppsFromRating($sRating, $iNumApps)
|
function outputTopXRowAppsFromRating($sRating, $iNumApps)
|
||||||
{
|
{
|
||||||
/* clean the input values so we can continue to use query_appdb() */
|
/* clean the input values so we can continue to use query_appdb() */
|
||||||
$sRating = mysql_real_escape_string($sRating);
|
$sRating = query_escape_string($sRating);
|
||||||
$iNumApps = mysql_real_escape_string($iNumApps);
|
$iNumApps = query_escape_string($iNumApps);
|
||||||
|
|
||||||
/* list of versionIds we've already output, so we don't output */
|
/* list of versionIds we've already output, so we don't output */
|
||||||
/* them again when filling in any empty spots in the list */
|
/* them again when filling in any empty spots in the list */
|
||||||
@@ -331,8 +331,8 @@ function outputTopXRowAppsFromRating($sRating, $iNumApps)
|
|||||||
ORDER BY c DESC
|
ORDER BY c DESC
|
||||||
LIMIT ?";
|
LIMIT ?";
|
||||||
$hResult = query_parameters($sQuery, $sRating, $iNumApps);
|
$hResult = query_parameters($sQuery, $sRating, $iNumApps);
|
||||||
$iNumApps -= mysql_num_rows($hResult); /* take away the rows we are outputting here */
|
$iNumApps -= query_num_rows($hResult); /* take away the rows we are outputting here */
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
/* keep track of the apps we've already output */
|
/* keep track of the apps we've already output */
|
||||||
$aVersionId[] = $oRow->versionId;
|
$aVersionId[] = $oRow->versionId;
|
||||||
@@ -358,7 +358,7 @@ function outputTopXRowAppsFromRating($sRating, $iNumApps)
|
|||||||
|
|
||||||
/* get the list that will fill the empty spots */
|
/* get the list that will fill the empty spots */
|
||||||
$hResult = query_appdb($sQuery);
|
$hResult = query_appdb($sQuery);
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
outputTopXRow($oRow);
|
outputTopXRow($oRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -457,13 +457,13 @@ function searchForApplication($search_words)
|
|||||||
$sQuery = "SELECT vendorId from vendor where vendorName LIKE '%?%'
|
$sQuery = "SELECT vendorId from vendor where vendorName LIKE '%?%'
|
||||||
OR vendorURL LIKE '%?%'";
|
OR vendorURL LIKE '%?%'";
|
||||||
$hResult = query_parameters($sQuery, $value, $value);
|
$hResult = query_parameters($sQuery, $value, $value);
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
array_push($vendorIdArray, $oRow->vendorId);
|
array_push($vendorIdArray, $oRow->vendorId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$search_words = str_replace(' ', '%', mysql_real_escape_string($search_words));
|
$search_words = str_replace(' ', '%', query_escape_string($search_words));
|
||||||
|
|
||||||
/* base query */
|
/* base query */
|
||||||
$sQuery = "SELECT *
|
$sQuery = "SELECT *
|
||||||
@@ -477,7 +477,7 @@ function searchForApplication($search_words)
|
|||||||
/* append to the query any vendors that we matched with */
|
/* append to the query any vendors that we matched with */
|
||||||
foreach($vendorIdArray as $key=>$value)
|
foreach($vendorIdArray as $key=>$value)
|
||||||
{
|
{
|
||||||
$sQuery.=" OR appFamily.vendorId=".mysql_real_escape_string($value);
|
$sQuery.=" OR appFamily.vendorId=".query_escape_string($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sQuery.=" ) ORDER BY appName";
|
$sQuery.=" ) ORDER BY appName";
|
||||||
@@ -497,7 +497,7 @@ function searchForApplicationFuzzy($search_words, $minMatchingPercent)
|
|||||||
|
|
||||||
/* add on all of the like matches that we can find */
|
/* add on all of the like matches that we can find */
|
||||||
$hResult = searchForApplication($search_words);
|
$hResult = searchForApplication($search_words);
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
array_push($excludeAppIdArray, $oRow->appId);
|
array_push($excludeAppIdArray, $oRow->appId);
|
||||||
}
|
}
|
||||||
@@ -506,7 +506,7 @@ function searchForApplicationFuzzy($search_words, $minMatchingPercent)
|
|||||||
$sQuery = "SELECT appName, appId FROM appFamily WHERE queued = 'false'";
|
$sQuery = "SELECT appName, appId FROM appFamily WHERE queued = 'false'";
|
||||||
foreach ($excludeAppIdArray as $key=>$value)
|
foreach ($excludeAppIdArray as $key=>$value)
|
||||||
{
|
{
|
||||||
$sQuery.=" AND appId != '".mysql_real_escape_string($value)."'";
|
$sQuery.=" AND appId != '".query_escape_string($value)."'";
|
||||||
}
|
}
|
||||||
$sQuery.=";";
|
$sQuery.=";";
|
||||||
|
|
||||||
@@ -514,7 +514,7 @@ function searchForApplicationFuzzy($search_words, $minMatchingPercent)
|
|||||||
$search_words = strtoupper($search_words);
|
$search_words = strtoupper($search_words);
|
||||||
|
|
||||||
$hResult = query_appdb($sQuery);
|
$hResult = query_appdb($sQuery);
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oRow->appName = strtoupper($oRow->appName); /* convert the appname to upper case */
|
$oRow->appName = strtoupper($oRow->appName); /* convert the appname to upper case */
|
||||||
similar_text($oRow->appName, $search_words, $similarity_pst);
|
similar_text($oRow->appName, $search_words, $similarity_pst);
|
||||||
@@ -535,11 +535,11 @@ function searchForApplicationFuzzy($search_words, $minMatchingPercent)
|
|||||||
{
|
{
|
||||||
if($firstEntry == true)
|
if($firstEntry == true)
|
||||||
{
|
{
|
||||||
$sQuery.="appId='".mysql_real_escape_string($value)."'";
|
$sQuery.="appId='".query_escape_string($value)."'";
|
||||||
$firstEntry = false;
|
$firstEntry = false;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
$sQuery.=" OR appId='".mysql_real_escape_string($value)."'";
|
$sQuery.=" OR appId='".query_escape_string($value)."'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sQuery.=" ORDER BY appName;";
|
$sQuery.=" ORDER BY appName;";
|
||||||
@@ -550,7 +550,7 @@ function searchForApplicationFuzzy($search_words, $minMatchingPercent)
|
|||||||
|
|
||||||
function outputSearchTableForhResult($search_words, $hResult)
|
function outputSearchTableForhResult($search_words, $hResult)
|
||||||
{
|
{
|
||||||
if(($hResult == null) || (mysql_num_rows($hResult) == 0))
|
if(($hResult == null) || (query_num_rows($hResult) == 0))
|
||||||
{
|
{
|
||||||
// do something
|
// do something
|
||||||
echo html_frame_start("","98%");
|
echo html_frame_start("","98%");
|
||||||
@@ -568,7 +568,7 @@ function outputSearchTableForhResult($search_words, $hResult)
|
|||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|
||||||
$c = 0;
|
$c = 0;
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oApp = new application($oRow->appId);
|
$oApp = new application($oRow->appId);
|
||||||
//skip if a NONAME
|
//skip if a NONAME
|
||||||
@@ -580,7 +580,7 @@ function outputSearchTableForhResult($search_words, $hResult)
|
|||||||
//count versions
|
//count versions
|
||||||
$hResult2 = query_parameters("SELECT count(*) as versions FROM appVersion WHERE appId = '?' AND versionName != 'NONAME' and queued = 'false'",
|
$hResult2 = query_parameters("SELECT count(*) as versions FROM appVersion WHERE appId = '?' AND versionName != 'NONAME' and queued = 'false'",
|
||||||
$oRow->appId);
|
$oRow->appId);
|
||||||
$y = mysql_fetch_object($hResult2);
|
$y = query_fetch_object($hResult2);
|
||||||
|
|
||||||
//display row
|
//display row
|
||||||
echo "<tr class=$bgcolor>\n";
|
echo "<tr class=$bgcolor>\n";
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Vendor {
|
|||||||
FROM vendor
|
FROM vendor
|
||||||
WHERE vendorId = '?'";
|
WHERE vendorId = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $iVendorId))
|
if($hResult = query_parameters($sQuery, $iVendorId))
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -50,7 +50,7 @@ class Vendor {
|
|||||||
WHERE vendorId = '?'";
|
WHERE vendorId = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $this->iVendorId))
|
if($hResult = query_parameters($sQuery, $this->iVendorId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$this->aApplicationsIds[] = $oRow->appId;
|
$this->aApplicationsIds[] = $oRow->appId;
|
||||||
}
|
}
|
||||||
@@ -71,9 +71,9 @@ class Vendor {
|
|||||||
/* Check for duplicates */
|
/* Check for duplicates */
|
||||||
$hResult = query_parameters("SELECT * FROM vendor WHERE vendorName = '?'",
|
$hResult = query_parameters("SELECT * FROM vendor WHERE vendorName = '?'",
|
||||||
$this->sName);
|
$this->sName);
|
||||||
if($hResult && $oRow = mysql_fetch_object($hResult))
|
if($hResult && $oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
if(mysql_num_rows($hResult))
|
if(query_num_rows($hResult))
|
||||||
{
|
{
|
||||||
$this->vendor($oRow->vendorId);
|
$this->vendor($oRow->vendorId);
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ class Vendor {
|
|||||||
$this->mustBeQueued() ? "true" : "false");
|
$this->mustBeQueued() ? "true" : "false");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iVendorId = mysql_insert_id();
|
$this->iVendorId = query_appdb_insert_id();
|
||||||
$this->vendor($this->iVendorId);
|
$this->vendor($this->iVendorId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -355,7 +355,7 @@ class Vendor {
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(!$oRow = mysql_fetch_object($hResult))
|
if(!$oRow = query_fetch_object($hResult))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return $oRow->count;
|
return $oRow->count;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class version {
|
|||||||
FROM appVersion
|
FROM appVersion
|
||||||
WHERE versionId = '?'";
|
WHERE versionId = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $iVersionId))
|
if($hResult = query_parameters($sQuery, $iVersionId))
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($oRow)
|
if($oRow)
|
||||||
@@ -96,7 +96,7 @@ class version {
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$this->iVersionId = mysql_insert_id();
|
$this->iVersionId = query_appdb_insert_id();
|
||||||
$this->Version($this->iVersionId);
|
$this->Version($this->iVersionId);
|
||||||
$this->SendNotificationMail();
|
$this->SendNotificationMail();
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ class version {
|
|||||||
WHERE versionId = '?'";
|
WHERE versionId = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$aNotesIds[] = $oRow->noteId;
|
$aNotesIds[] = $oRow->noteId;
|
||||||
}
|
}
|
||||||
@@ -247,7 +247,7 @@ class version {
|
|||||||
WHERE versionId = '?'";
|
WHERE versionId = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$aCommentsIds[] = $oRow->commentId;
|
$aCommentsIds[] = $oRow->commentId;
|
||||||
}
|
}
|
||||||
@@ -269,7 +269,7 @@ class version {
|
|||||||
|
|
||||||
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
if($oRow->type="image")
|
if($oRow->type="image")
|
||||||
$aScreenshotsIds[] = $oRow->id;
|
$aScreenshotsIds[] = $oRow->id;
|
||||||
@@ -307,7 +307,7 @@ class version {
|
|||||||
ORDER BY testingId";
|
ORDER BY testingId";
|
||||||
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$aTestingIds[] = $oRow->testingId;
|
$aTestingIds[] = $oRow->testingId;
|
||||||
}
|
}
|
||||||
@@ -328,7 +328,7 @@ class version {
|
|||||||
ORDER BY monitorId";
|
ORDER BY monitorId";
|
||||||
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$aMonitorIds[] = $oRow->monitorId;
|
$aMonitorIds[] = $oRow->monitorId;
|
||||||
}
|
}
|
||||||
@@ -391,9 +391,9 @@ class version {
|
|||||||
appMaintainers WHERE userId = '?' AND versionId = '?'",
|
appMaintainers WHERE userId = '?' AND versionId = '?'",
|
||||||
$this->iSubmitterId, $this->iVersionId);
|
$this->iSubmitterId, $this->iVersionId);
|
||||||
|
|
||||||
if($hResultMaint && mysql_num_rows($hResultMaint))
|
if($hResultMaint && query_num_rows($hResultMaint))
|
||||||
{
|
{
|
||||||
$oMaintainerRow = mysql_fetch_object($hResultMaint);
|
$oMaintainerRow = query_fetch_object($hResultMaint);
|
||||||
$oMaintainer = new Maintainer($oMaintainerRow->maintainerId);
|
$oMaintainer = new Maintainer($oMaintainerRow->maintainerId);
|
||||||
$oMaintainer->unQueue("OK");
|
$oMaintainer->unQueue("OK");
|
||||||
}
|
}
|
||||||
@@ -569,7 +569,7 @@ class version {
|
|||||||
ORDER BY bug_id";
|
ORDER BY bug_id";
|
||||||
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
if($hResult = query_parameters($sQuery, $this->iVersionId))
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$aBuglinkIds[] = $oRow->linkId;
|
$aBuglinkIds[] = $oRow->linkId;
|
||||||
}
|
}
|
||||||
@@ -1014,7 +1014,7 @@ class version {
|
|||||||
$hNotes = query_parameters("SELECT noteId FROM appNotes WHERE versionId = '?'",
|
$hNotes = query_parameters("SELECT noteId FROM appNotes WHERE versionId = '?'",
|
||||||
$this->iVersionId);
|
$this->iVersionId);
|
||||||
|
|
||||||
while( $oRow = mysql_fetch_object($hNotes) )
|
while( $oRow = query_fetch_object($hNotes) )
|
||||||
{
|
{
|
||||||
$oNote = new Note($oRow->noteId);
|
$oNote = new Note($oRow->noteId);
|
||||||
$oNote->display();
|
$oNote->display();
|
||||||
@@ -1029,9 +1029,9 @@ class version {
|
|||||||
if(!$versionId) return null;
|
if(!$versionId) return null;
|
||||||
$result = query_parameters("SELECT versionName FROM appVersion WHERE versionId = '?'",
|
$result = query_parameters("SELECT versionName FROM appVersion WHERE versionId = '?'",
|
||||||
$versionId);
|
$versionId);
|
||||||
if(!$result || mysql_num_rows($result) != 1)
|
if(!$result || query_num_rows($result) != 1)
|
||||||
return null;
|
return null;
|
||||||
$ob = mysql_fetch_object($result);
|
$ob = query_fetch_object($result);
|
||||||
return $ob->versionName;
|
return $ob->versionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1046,10 +1046,10 @@ class version {
|
|||||||
AND versionId = '?'",
|
AND versionId = '?'",
|
||||||
$iVersionId);
|
$iVersionId);
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !query_num_rows($hResult))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
return "$oRow->appName $oRow->versionName";
|
return "$oRow->appName $oRow->versionName";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1183,7 +1183,7 @@ class version {
|
|||||||
|
|
||||||
$hResult = Maintainer::getMaintainersForAppIdVersionId(null, $this->iVersionId);
|
$hResult = Maintainer::getMaintainersForAppIdVersionId(null, $this->iVersionId);
|
||||||
$iCount = 0;
|
$iCount = 0;
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$aMaintainers[$iCount] = $oRow->userId;
|
$aMaintainers[$iCount] = $oRow->userId;
|
||||||
$iCount++;
|
$iCount++;
|
||||||
@@ -1197,7 +1197,7 @@ class version {
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT appFamily.appName, appVersion.versionName, appVersion.description, appVersion.versionId, appVersion.submitTime FROM appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND appVersion.submitterId = '?' AND appVersion.queued = '?' AND appFamily.queued = '?'", $iUserId, $bQueued ? "true" : "false", "false");
|
$hResult = query_parameters("SELECT appFamily.appName, appVersion.versionName, appVersion.description, appVersion.versionId, appVersion.submitTime FROM appFamily, appVersion WHERE appFamily.appId = appVersion.appId AND appVersion.submitterId = '?' AND appVersion.queued = '?' AND appFamily.queued = '?'", $iUserId, $bQueued ? "true" : "false", "false");
|
||||||
|
|
||||||
if(!$hResult || !mysql_num_rows($hResult))
|
if(!$hResult || !query_num_rows($hResult))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$oTable = new Table();
|
$oTable = new Table();
|
||||||
@@ -1212,7 +1212,7 @@ class version {
|
|||||||
$oTableRow->SetClass("color4");
|
$oTableRow->SetClass("color4");
|
||||||
$oTable->SetHeader($oTableRow);
|
$oTable->SetHeader($oTableRow);
|
||||||
|
|
||||||
for($i = 1; $oRow = mysql_fetch_object($hResult); $i++)
|
for($i = 1; $oRow = query_fetch_object($hResult); $i++)
|
||||||
{
|
{
|
||||||
$oTableRow = new TableRow();
|
$oTableRow = new TableRow();
|
||||||
$oTableRow->AddTextCell(version::fullNameLink($oRow->versionId));
|
$oTableRow->AddTextCell(version::fullNameLink($oRow->versionId));
|
||||||
@@ -1343,7 +1343,7 @@ class version {
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(!$oRow = mysql_fetch_object($hResult))
|
if(!$oRow = query_fetch_object($hResult))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return $oRow->count;
|
return $oRow->count;
|
||||||
@@ -1546,7 +1546,7 @@ class version {
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oTestData = new testData($oRow->testingId);
|
$oTestData = new testData($oRow->testingId);
|
||||||
$oTestData->iVersionId = $iNewId;
|
$oTestData->iVersionId = $iNewId;
|
||||||
@@ -1563,7 +1563,7 @@ class version {
|
|||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oAppData = new appData($oRow->testingId);
|
$oAppData = new appData($oRow->testingId);
|
||||||
$oAppData->iVersionId = $iNewId;
|
$oAppData->iVersionId = $iNewId;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class version_queue
|
|||||||
$hResult = appData::getData($iVersionId, "downloadurl",
|
$hResult = appData::getData($iVersionId, "downloadurl",
|
||||||
TRUE, TRUE, TRUE))
|
TRUE, TRUE, TRUE))
|
||||||
{
|
{
|
||||||
if($oRow = mysql_fetch_object($hResult))
|
if($oRow = query_fetch_object($hResult))
|
||||||
$iDownloadUrlId = $oRow->id;
|
$iDownloadUrlId = $oRow->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ function vote_count($iVersionId, $iUserId = null)
|
|||||||
}
|
}
|
||||||
$hResult = query_parameters("SELECT * FROM appVotes WHERE versionId = '?' AND userId = '?'",
|
$hResult = query_parameters("SELECT * FROM appVotes WHERE versionId = '?' AND userId = '?'",
|
||||||
$iVersionId, $iUserId);
|
$iVersionId, $iUserId);
|
||||||
return mysql_num_rows($hResult);
|
return query_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ function vote_count_user_total($iUserId = null)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$hResult = query_parameters("SELECT * FROM appVotes WHERE userId = '?'", $iUserId);
|
$hResult = query_parameters("SELECT * FROM appVotes WHERE userId = '?'", $iUserId);
|
||||||
return mysql_num_rows($hResult);
|
return query_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ function vote_count_version_total($iVersionId)
|
|||||||
{
|
{
|
||||||
$hResult = query_parameters("SELECT * FROM appVotes WHERE versionId = '?'",
|
$hResult = query_parameters("SELECT * FROM appVotes WHERE versionId = '?'",
|
||||||
$iVersionId);
|
$iVersionId);
|
||||||
return mysql_num_rows($hResult);
|
return query_num_rows($hResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ function vote_get_user_votes($iUserId = null)
|
|||||||
return array();
|
return array();
|
||||||
|
|
||||||
$obs = array();
|
$obs = array();
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
$obs[$oRow->slot] = $oRow;
|
$obs[$oRow->slot] = $oRow;
|
||||||
return $obs;
|
return $obs;
|
||||||
}
|
}
|
||||||
@@ -198,7 +198,7 @@ function is_vote_in_slot($iSlot, $iUserId = null)
|
|||||||
$sQuery = "SELECT COUNT(*) as count from appVotes WHERE userId = '?' AND slot = '?'";
|
$sQuery = "SELECT COUNT(*) as count from appVotes WHERE userId = '?' AND slot = '?'";
|
||||||
if($hResult = query_parameters($sQuery, $iUserId, $iSlot))
|
if($hResult = query_parameters($sQuery, $iUserId, $iSlot))
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($oRow->count != 0)
|
if($oRow->count != 0)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ if(!$_SESSION['current']->isLoggedIn())
|
|||||||
"FROM appVotes ".
|
"FROM appVotes ".
|
||||||
"GROUP BY versionId ORDER BY count DESC LIMIT 1";
|
"GROUP BY versionId ORDER BY count DESC LIMIT 1";
|
||||||
$hResult = query_parameters($voteQuery);
|
$hResult = query_parameters($voteQuery);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
|
|
||||||
echo "There are <b>$iNumApps</b> applications currently in the database";
|
echo "There are <b>$iNumApps</b> applications currently in the database";
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ function build_prefs_list($oUser)
|
|||||||
$aTableRows = array();
|
$aTableRows = array();
|
||||||
|
|
||||||
$hResult = query_parameters("SELECT * FROM prefs_list ORDER BY id");
|
$hResult = query_parameters("SELECT * FROM prefs_list ORDER BY id");
|
||||||
while($hResult && $r = mysql_fetch_object($hResult))
|
while($hResult && $r = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
// skip admin options
|
// skip admin options
|
||||||
if(!$_SESSION['current']->hasPriv("admin"))
|
if(!$_SESSION['current']->hasPriv("admin"))
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ apidb_header("Screenshots");
|
|||||||
$oApp = new Application($aClean['iAppId']);
|
$oApp = new Application($aClean['iAppId']);
|
||||||
$oVersion = new Version($aClean['iVersionId']);
|
$oVersion = new Version($aClean['iVersionId']);
|
||||||
|
|
||||||
if($hResult && mysql_num_rows($hResult))
|
if($hResult && query_num_rows($hResult))
|
||||||
{
|
{
|
||||||
echo html_frame_start("Screenshot Gallery for ".$oApp->sName." ".$oVersion->sName,500);
|
echo html_frame_start("Screenshot Gallery for ".$oApp->sName." ".$oVersion->sName,500);
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ if($hResult && mysql_num_rows($hResult))
|
|||||||
$bUserIsMaintainerOfVersion = false;
|
$bUserIsMaintainerOfVersion = false;
|
||||||
|
|
||||||
echo "<div align=center><table><tr>\n";
|
echo "<div align=center><table><tr>\n";
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
// if the current version changed then update the current version
|
// if the current version changed then update the current version
|
||||||
// and close the previous html frame if this isn't the
|
// and close the previous html frame if this isn't the
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ class table_counts
|
|||||||
{
|
{
|
||||||
$sQuery = "select count(*) as cnt from ?;";
|
$sQuery = "select count(*) as cnt from ?;";
|
||||||
$hResult = query_parameters($sQuery, $sTable);
|
$hResult = query_parameters($sQuery, $sTable);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
|
|
||||||
$this->aTableCounts[] = $oRow->cnt;
|
$this->aTableCounts[] = $oRow->cnt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ function test_application_delete()
|
|||||||
|
|
||||||
if($hResult = query_parameters($sQuery, $iAppId))
|
if($hResult = query_parameters($sQuery, $iAppId))
|
||||||
{
|
{
|
||||||
$iRows = mysql_num_rows($hResult);
|
$iRows = query_num_rows($hResult);
|
||||||
if($iRows > 0)
|
if($iRows > 0)
|
||||||
{
|
{
|
||||||
echo "Found '".$iRows."' versions for this application left over!";
|
echo "Found '".$iRows."' versions for this application left over!";
|
||||||
|
|||||||
@@ -555,7 +555,7 @@ function test_maintainer_getMaintainersForAppIdVersionId()
|
|||||||
|
|
||||||
/* The application should have one maintainer */
|
/* The application should have one maintainer */
|
||||||
$iExpected = 1;
|
$iExpected = 1;
|
||||||
$iReceived = mysql_num_rows($hResult);
|
$iReceived = query_num_rows($hResult);
|
||||||
if($iExpected != $iReceived)
|
if($iExpected != $iReceived)
|
||||||
{
|
{
|
||||||
error("Got super maintainer count of $iReceived instead of $iExpected!");
|
error("Got super maintainer count of $iReceived instead of $iExpected!");
|
||||||
@@ -575,7 +575,7 @@ function test_maintainer_getMaintainersForAppIdVersionId()
|
|||||||
|
|
||||||
/* The version should have one maintainer */
|
/* The version should have one maintainer */
|
||||||
$iExpected = 1;
|
$iExpected = 1;
|
||||||
$iReceived = mysql_num_rows($hResult);
|
$iReceived = query_num_rows($hResult);
|
||||||
if($iExpected != $iReceived)
|
if($iExpected != $iReceived)
|
||||||
{
|
{
|
||||||
error("Got maintainer count of $iReceived instead of $iExpected!");
|
error("Got maintainer count of $iReceived instead of $iExpected!");
|
||||||
@@ -614,7 +614,7 @@ function test_maintainer_getMaintainersForAppIdVersionId()
|
|||||||
|
|
||||||
/* The first version should have one maintainer */
|
/* The first version should have one maintainer */
|
||||||
$iExpected = 1;
|
$iExpected = 1;
|
||||||
$iReceived = mysql_num_rows($hResult);
|
$iReceived = query_num_rows($hResult);
|
||||||
if($iExpected != $iReceived)
|
if($iExpected != $iReceived)
|
||||||
{
|
{
|
||||||
error("Got maintainer count of $iReceived instead of $iExpected!");
|
error("Got maintainer count of $iReceived instead of $iExpected!");
|
||||||
@@ -634,7 +634,7 @@ function test_maintainer_getMaintainersForAppIdVersionId()
|
|||||||
|
|
||||||
/* The second version should have 1 maintainer */
|
/* The second version should have 1 maintainer */
|
||||||
$iExpected = 1;
|
$iExpected = 1;
|
||||||
$iReceived = mysql_num_rows($hResult);
|
$iReceived = query_num_rows($hResult);
|
||||||
if($iExpected != $iReceived)
|
if($iExpected != $iReceived)
|
||||||
{
|
{
|
||||||
error("Got maintainer count of $iReceived instead of $iExpected!");
|
error("Got maintainer count of $iReceived instead of $iExpected!");
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ class notifyContainer
|
|||||||
{
|
{
|
||||||
$sQuery2 = "select * from appMaintainers where maintainerId = '?'";
|
$sQuery2 = "select * from appMaintainers where maintainerId = '?'";
|
||||||
$hResult = query_parameters($sQuery2, $this->oMaintainer->iMaintainerId);
|
$hResult = query_parameters($sQuery2, $this->oMaintainer->iMaintainerId);
|
||||||
$oObject = mysql_fetch_object($hResult);
|
$oObject = query_fetch_object($hResult);
|
||||||
print_r($oObject);
|
print_r($oObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -317,7 +317,7 @@ function test_maintainer_notifyLevel_2_to_3($bTestAsMaintainer)
|
|||||||
// check to make sure the maintainer doesn't exist
|
// check to make sure the maintainer doesn't exist
|
||||||
$sQuery = "select count(*) as cnt from appMaintainers where maintainerId = '?'";
|
$sQuery = "select count(*) as cnt from appMaintainers where maintainerId = '?'";
|
||||||
$hResult = query_parameters($sQuery, $oNotifyContainer->oMaintainer->iMaintainerId);
|
$hResult = query_parameters($sQuery, $oNotifyContainer->oMaintainer->iMaintainerId);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($oRow->cnt != 0)
|
if($oRow->cnt != 0)
|
||||||
{
|
{
|
||||||
$bSuccess = false;
|
$bSuccess = false;
|
||||||
|
|||||||
@@ -54,15 +54,15 @@ function test_class($sClassName, $aTestMethods)
|
|||||||
|
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
{
|
{
|
||||||
error("Got '$hResult' instead of a valid MySQL handle");
|
error("Got '$hResult' instead of a valid query handle");
|
||||||
error("FAILED\t\t$sClassName::$sClassName");
|
error("FAILED\t\t$sClassName::$sClassName");
|
||||||
$oTestObject->delete();
|
$oTestObject->delete();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!($oRow = mysql_fetch_object($hResult)))
|
if(!($oRow = query_fetch_object($hResult)))
|
||||||
{
|
{
|
||||||
error("Failed to fetch MySQL object");
|
error("Failed to fetch query object");
|
||||||
error("FAILED\t\t$sClassName::$sClassName");
|
error("FAILED\t\t$sClassName::$sClassName");
|
||||||
$oTestObject->delete();
|
$oTestObject->delete();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -111,7 +111,7 @@ function test_class($sClassName, $aTestMethods)
|
|||||||
/* Should return 1 or more, since there may be entries present already */
|
/* Should return 1 or more, since there may be entries present already */
|
||||||
$iExpected = 1;
|
$iExpected = 1;
|
||||||
$hResult = $oTestObject->objectGetEntries(false, false);
|
$hResult = $oTestObject->objectGetEntries(false, false);
|
||||||
$iReceived = mysql_num_rows($hResult);
|
$iReceived = query_num_rows($hResult);
|
||||||
if($iExpected > $iReceived)
|
if($iExpected > $iReceived)
|
||||||
{
|
{
|
||||||
error("Got $iReceived instead of >= $iExpected");
|
error("Got $iReceived instead of >= $iExpected");
|
||||||
@@ -223,7 +223,7 @@ function create_object($sClassName, $oUser)
|
|||||||
error("FAILED\t\t$sClassName to create screenshot entry");
|
error("FAILED\t\t$sClassName to create screenshot entry");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
$oTestObject->iScreenshotId = mysql_insert_id();
|
$oTestObject->iScreenshotId = query_appdb_insert_id();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $oTestObject;
|
return $oTestObject;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function test_query_parameters()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$iUserCount = $oRow->count;
|
$iUserCount = $oRow->count;
|
||||||
|
|
||||||
/* see that '~' strings are replaced with parameters */
|
/* see that '~' strings are replaced with parameters */
|
||||||
@@ -41,7 +41,7 @@ function test_query_parameters()
|
|||||||
$hResult = query_parameters($sQuery, "user_list", "1' OR 1='1");
|
$hResult = query_parameters($sQuery, "user_list", "1' OR 1='1");
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($iUserCount != $oRow->count)
|
if($iUserCount != $oRow->count)
|
||||||
{
|
{
|
||||||
echo "sQuery of '".$sQuery."' returned ".$oRow->count." entries instead of the expected ".$iUserCount."\n";
|
echo "sQuery of '".$sQuery."' returned ".$oRow->count." entries instead of the expected ".$iUserCount."\n";
|
||||||
@@ -88,7 +88,7 @@ function test_query_parameters()
|
|||||||
* properly with slashes in the query, they were incorrectly being recognized
|
* properly with slashes in the query, they were incorrectly being recognized
|
||||||
* as tokens that should be replaced with parameters
|
* as tokens that should be replaced with parameters
|
||||||
*/
|
*/
|
||||||
$sQuery = "SELECT count(*) as count, '".mysql_real_escape_string("\r\n")."' as x from ?";
|
$sQuery = "SELECT count(*) as count, '".query_escape_string("\r\n")."' as x from ?";
|
||||||
$hResult = query_parameters($sQuery, "user_list");
|
$hResult = query_parameters($sQuery, "user_list");
|
||||||
if(!$hResult)
|
if(!$hResult)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ function test_user_password_migration()
|
|||||||
// generate the SHA1() of the users password
|
// generate the SHA1() of the users password
|
||||||
$sQuery = "select SHA1('?') as password;";
|
$sQuery = "select SHA1('?') as password;";
|
||||||
$hResult = query_parameters($sQuery, $sTestPassword);
|
$hResult = query_parameters($sQuery, $sTestPassword);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$sTestUserPasswordSHA1 = $oRow->password;
|
$sTestUserPasswordSHA1 = $oRow->password;
|
||||||
|
|
||||||
// test that the user was created with the sha1 hash of their password
|
// test that the user was created with the sha1 hash of their password
|
||||||
$sQuery = "select password from user_list where userid = '?';";
|
$sQuery = "select password from user_list where userid = '?';";
|
||||||
$hResult = query_parameters($sQuery, $oUser->iUserId);
|
$hResult = query_parameters($sQuery, $oUser->iUserId);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($sTestUserPasswordSHA1 != $oRow->password)
|
if($sTestUserPasswordSHA1 != $oRow->password)
|
||||||
{
|
{
|
||||||
error("sTestUserPasswordSHA1 $sTestUserPasswordSHA1 doesn't match oRow->password of $oRow->password after user::create()");
|
error("sTestUserPasswordSHA1 $sTestUserPasswordSHA1 doesn't match oRow->password of $oRow->password after user::create()");
|
||||||
@@ -56,7 +56,7 @@ function test_user_password_migration()
|
|||||||
// after the user was logged in
|
// after the user was logged in
|
||||||
$sQuery = "select password from user_list where userid = '?';";
|
$sQuery = "select password from user_list where userid = '?';";
|
||||||
$hResult = query_parameters($sQuery, $oUser->iUserId);
|
$hResult = query_parameters($sQuery, $oUser->iUserId);
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
if($sTestUserPasswordSHA1 != $oRow->password)
|
if($sTestUserPasswordSHA1 != $oRow->password)
|
||||||
{
|
{
|
||||||
error("sTestUserPasswordSHA1 $sTestUserPasswordSHA1 doesn't match oRow->password of $oRow->password");
|
error("sTestUserPasswordSHA1 $sTestUserPasswordSHA1 doesn't match oRow->password of $oRow->password");
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ echo "</center>";
|
|||||||
$Ids = appData::objectGetEntries(false, false, $ItemsPerPage, $offset, "screenshot");
|
$Ids = appData::objectGetEntries(false, false, $ItemsPerPage, $offset, "screenshot");
|
||||||
$c = 1;
|
$c = 1;
|
||||||
echo "<div align=center><table><tr>\n";
|
echo "<div align=center><table><tr>\n";
|
||||||
while ($oRow = mysql_fetch_object($Ids))
|
while ($oRow = query_fetch_object($Ids))
|
||||||
{
|
{
|
||||||
// display thumbnail
|
// display thumbnail
|
||||||
$oVersion = new version($oRow->versionId);
|
$oVersion = new version($oRow->versionId);
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ if(!is_numeric($aClean['iBugId']))
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$oApp = new application($oRow->appId);
|
$oApp = new application($oRow->appId);
|
||||||
$oVersion = new version($oRow->versionId);
|
$oVersion = new version($oRow->versionId);
|
||||||
$sDownloadUrls = "";
|
$sDownloadUrls = "";
|
||||||
if($hDownloadUrls = appData::getData($oRow->versionId, "downloadurl"))
|
if($hDownloadUrls = appData::getData($oRow->versionId, "downloadurl"))
|
||||||
{
|
{
|
||||||
while($oDownloadUrl = mysql_fetch_object($hDownloadUrls))
|
while($oDownloadUrl = query_fetch_object($hDownloadUrls))
|
||||||
$sDownloadUrls .= "<a href=\"$oDownloadUrl->url\">".
|
$sDownloadUrls .= "<a href=\"$oDownloadUrl->url\">".
|
||||||
"$oDownloadUrl->description</a><br />";
|
"$oDownloadUrl->description</a><br />";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ if(!empty($aClean['iCategoryId']))
|
|||||||
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = query_fetch_object($hResult);
|
||||||
$catParent = $oRow->catParent;
|
$catParent = $oRow->catParent;
|
||||||
|
|
||||||
array_push($cat_array, "$currentCatId");
|
array_push($cat_array, "$currentCatId");
|
||||||
@@ -174,7 +174,7 @@ if($hResult)
|
|||||||
$oTable->AddRow($oTableRow);
|
$oTable->AddRow($oTableRow);
|
||||||
|
|
||||||
$c = 1;
|
$c = 1;
|
||||||
while($oRow = mysql_fetch_object($hResult))
|
while($oRow = query_fetch_object($hResult))
|
||||||
{
|
{
|
||||||
$sColor = ($c % 2) ? "color0" : "color1";
|
$sColor = ($c % 2) ? "color0" : "color1";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user