Prefix all GPC variables according to our coding standard

This commit is contained in:
Jonathan Ernst
2006-07-06 17:27:54 +00:00
committed by WineHQ
parent bd19dc7a0b
commit 735a2bc65f
59 changed files with 794 additions and 799 deletions

View File

@@ -33,7 +33,7 @@ if(!$_SESSION['current']->hasPriv("admin") &&
//set link for version
if(is_numeric($aClean['iVersionId']) and !empty($aClean['iVersionId']))
{
$sVersionLink = "versionId={$aClean['iVersionId']}";
$sVersionLink = "iVersionId={$aClean['iVersionId']}";
}
else
exit;

View File

@@ -5,46 +5,46 @@ require(BASE."include/category.php");
$aClean = array(); //array of filtered user input
$aClean['catId'] = makeSafe($_REQUEST['catId']);
$aClean['name'] = makeSafe($_REQUEST['name']);
$aClean['description'] = makeSafe($_REQUEST['description']);
$aClean['parentId'] = makeSafe($_REQUEST['parentId']);
$aClean['submit'] = makeSafe($_REQUEST['submit']);
$aClean['iCatId'] = makeSafe($_REQUEST['iCatId']);
$aClean['sName'] = makeSafe($_REQUEST['sName']);
$aClean['sDescription'] = makeSafe($_REQUEST['sDescription']);
$aClean['iParentId'] = makeSafe($_REQUEST['iParentId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!$_SESSION['current']->hasPriv("admin"))
{
util_show_error_page();
exit;
}
$oCat = new Category($aClean['catId']);
if($aClean['submit'])
$oCat = new Category($aClean['iCatId']);
if($aClean['sSubmit'])
{
$oCat->update($aClean['name'],$aClean['description'],$aClean['parentId']);
redirect(apidb_fullurl("appbrowse.php?catId=".$oCat->iCatId));
$oCat->update($aClean['sName'],$aClean['sDescription'],$aClean['iParentId']);
redirect(apidb_fullurl("appbrowse.php?iCatId=".$oCat->iCatId));
}
else
{
apidb_header("Add Category");
$sQuery = "SELECT catId, catName FROM appCategory WHERE catId!='?'";
$hResult = query_parameters($sQuery, $aClean['catId']);
$hResult = query_parameters($sQuery, $aClean['iCatId']);
while($oRow = mysql_fetch_object($hResult))
{
$aCatsIds[]=$oRow->catId;
$aCatsNames[]=$oRow->catName;
}
echo "<form method=\"post\" action=\"addCategory.php\">
<input type=\"hidden\" name=\"catId\" value=\"".$oCat->iCatId."\" />
<input type=\"hidden\" name=\"iCatId\" value=\"".$oCat->iCatId."\" />
<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td width=\"15%\" class=\"box-label\"><b>Category name</b></td>
<td class=\"box-body\">
<input type=\"text\" size=\"50\" name=\"name\" value=\"".$oCat->sName."\" />
<input type=\"text\" size=\"50\" name=\"sName\" value=\"".$oCat->sName."\" />
</td>
</tr>
<tr>
<td width=\"15%\" class=\"box-label\"><b>Description</b></td>
<td class=\"box-body\">
<input type=\"text\" size=\"50\" name=\"description\" value=\"".$oCat->sDescription."\" />
<input type=\"text\" size=\"50\" name=\"sDescription\" value=\"".$oCat->sDescription."\" />
</td>
</tr>
<tr>
@@ -55,7 +55,7 @@ else
</tr>
<tr>
<td colspan=\"2\" class=\"box-body\">
<input type=\"submit\" name=\"submit\" value=\"Submit\" />
<input type=\"submit\" name=\"sSubmit\" value=\"Submit\" />
</td>
</tr>
</table>

View File

@@ -11,12 +11,12 @@ require(BASE."include/application.php");
$aClean = array(); //array of user input
$aClean['id'] = makeSafe($_REQUEST['id']);
$aClean['sub'] = makeSafe($_REQUEST['sub']);
$aClean['add'] = makeSafe($_REQUEST['add']);
$aClean['description'] = makeSafe($_REQUEST['description']);
$aClean['replyText'] = makeSafe($_REQUEST['replyText']);
$aClean['reject'] = makeSafe($_REQUEST['reject']);
$aClean['iId'] = makeSafe($_REQUEST['iId']);
$aClean['sSub'] = makeSafe($_REQUEST['sSub']);
$aClean['sAdd'] = makeSafe($_REQUEST['sAdd']);
$aClean['sDescription'] = makeSafe($_REQUEST['sDescription']);
$aClean['sReplyText'] = makeSafe($_REQUEST['sReplyText']);
$aClean['sReject'] = makeSafe($_REQUEST['sReject']);
// deny access if not admin or at least some kind of maintainer
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer())
@@ -26,7 +26,7 @@ if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintaine
}
// shows the list of appdata in queue
if (!$aClean['id'])
if (!$aClean['iId'])
{
apidb_header("Admin Application Data Queue");
@@ -76,7 +76,7 @@ if (!$aClean['id'])
echo "<td>".Application::lookup_name($oRow->appId)."</td>\n";
echo "<td>".Version::lookup_name($oRow->versionId)."</td>\n";
echo "<td>".$oRow->type."</td>\n";
echo "<td align=\"center\">[<a href='adminAppDataQueue.php?id=$oRow->id'>process</a>]</td>\n";
echo "<td align=\"center\">[<a href='adminAppDataQueue.php?iId=$oRow->id'>process</a>]</td>\n";
echo "</tr>\n\n";
$c++;
}
@@ -85,14 +85,14 @@ if (!$aClean['id'])
}
} else // shows a particular appdata
{
$hResult = $_SESSION['current']->getAppDataQuery($aClean['id'], false, false);
$hResult = $_SESSION['current']->getAppDataQuery($aClean['iId'], false, false);
$obj_row = mysql_fetch_object($hResult);
if(!$aClean['sub']=="inside_form")
if(!$aClean['sSub']=="inside_form")
{
apidb_header("Admin Application Data Queue");
echo '<form name="qform" action="adminAppDataQueue.php" method="post">',"\n";
echo '<form name="sQform" action="adminAppDataQueue.php" method="post">',"\n";
// help
echo "<div align=center><table width='90%' border=0 cellpadding=3 cellspacing=0><tr><td>\n\n";
echo "Please enter an accurate and personalized reply anytime a submitted scrrenshot is rejected.\n";
@@ -113,7 +113,7 @@ if (!$aClean['id'])
//dataDescription
echo '<tr valign=top><td class=color0><b>Description</b></td>',"\n";
echo '<td><textarea name="description" rows=10 cols=35>'.stripslashes($obj_row->description).'</textarea></td></tr>',"\n";
echo '<td><textarea name="sDescription" rows=10 cols=35>'.stripslashes($obj_row->description).'</textarea></td></tr>',"\n";
//data
if($obj_row->type == "image")
@@ -121,16 +121,16 @@ if (!$aClean['id'])
$oScreenshot = new Screenshot($obj_row->id);
echo '<tr valign=top><td class=color0><b>Submited image</b></td>',"\n";
echo '<td>';
$imgSRC = '<img width="'.$oScreenshot->oThumbnailImage->width.'" height="'.$oScreenshot->oThumbnailImage->height.'" src="../appimage.php?queued=true&id='.$obj_row->id.'" />';
$imgSRC = '<img width="'.$oScreenshot->oThumbnailImage->width.'" height="'.$oScreenshot->oThumbnailImage->height.'" src="../appimage.php?bQueued=true&iId='.$obj_row->id.'" />';
// generate random tag for popup window
$randName = User::generate_passwd(5);
// set image link based on user pref
$img = '<a href="javascript:openWin(\'../appimage.php?queued=true&id='.$obj_row->id.'\',\''.$randName.'\','.$oScreenshot->oScreenshotImage->width.','.($oScreenshot->oScreenshotImage->height+4).');">'.$imgSRC.'</a>';
$img = '<a href="javascript:openWin(\'../appimage.php?bQueued=true&iId='.$obj_row->id.'\',\''.$randName.'\','.$oScreenshot->oScreenshotImage->width.','.($oScreenshot->oScreenshotImage->height+4).');">'.$imgSRC.'</a>';
if ($_SESSION['current']->isLoggedIn())
{
if ($_SESSION['current']->getpref("window:screenshot") == "no")
{
$img = '<a href="../appimage.php?queued=true&id='.$obj_row->id.'">'.$imgSRC.'</a>';
$img = '<a href="../appimage.php?bQueued=true&iId='.$obj_row->id.'">'.$imgSRC.'</a>';
}
}
echo $img;
@@ -138,26 +138,26 @@ if (!$aClean['id'])
} elseif($obj_row->type == "url")
{
echo '<tr valign=top><td class=color0><b>Submitted link</b></td>',"\n";
echo '<td><textarea name="content" rows=10 cols=35>'.stripslashes($obj_row->url).'</textarea></td></tr>',"\n";
echo '<td><textarea name="sContent" rows=10 cols=35>'.stripslashes($obj_row->url).'</textarea></td></tr>',"\n";
}
//email response
echo '<tr valign=top><td class=color0><b>Email reply</b></td>',"\n";
echo "<td><textarea name='replyText' rows=10 cols=35>Enter a personalized reason for acceptance or rejection of the submitted application data here</textarea></td></tr>\n";
echo "<td><textarea name='sReplyText' rows=10 cols=35>Enter a personalized reason for acceptance or rejection of the submitted application data here</textarea></td></tr>\n";
/* Add button */
echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
echo '<input type=submit name=add value=" Add data to this application " class=button /> </td></tr>',"\n";
echo '<input type=submit name=sAdd value=" Add data to this application " class=button /> </td></tr>',"\n";
/* Reject button */
echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
echo '<input type=submit name=reject value=" Reject this request " class=button /></td></tr>',"\n";
echo '<input type=submit name=sReject value=" Reject this request " class=button /></td></tr>',"\n";
echo '</table>',"\n";
echo '<input type=hidden name="sub" value="inside_form" />',"\n";
echo '<input type=hidden name="id" value="'.$aClean['id'].'" />',"\n";
echo '<input type=hidden name="sSub" value="inside_form" />',"\n";
echo '<input type=hidden name="iId" value="'.$aClean['iId'].'" />',"\n";
echo '</form>';
} elseif ($aClean['add']) // we accepted the request
} elseif ($aClean['sAdd']) // we accepted the request
{
$statusMessage = "";
$goodtogo = 0;
@@ -172,7 +172,7 @@ if (!$aClean['id'])
$hResult = query_parameters("INSERT INTO appData (id, appId, versionId, type, ".
"description, url) VALUES (?, '?', '?', '?', '?', '?')",
"null", $obj_row->appId, $obj_row->versionId,
"url", $aClean['description'], $obj_row->url);
"url", $aClean['sDescription'], $obj_row->url);
if($hResult)
{
$statusMessage = "<p>The application data was successfully added into the database</p>\n";
@@ -186,7 +186,7 @@ if (!$aClean['id'])
{
$sSubject = "Application Data Request Report";
$sMsg = "Your submission of an application data for ".Application::lookup_name($obj_row->appId).Version::lookup_name($obj_row->versionId)." has been accepted. ";
$sMsg .= $aClean['replyText'];
$sMsg .= $aClean['sReplyText'];
$sMsg .= "We appreciate your help in making the Application Database better for all users.\r\n";
mail_appdb($oUser->sEmail, $sSubject ,$sMsg);
@@ -194,7 +194,7 @@ if (!$aClean['id'])
}
}
redirect(apidb_fullurl("admin/adminAppDataQueue.php"));
} elseif ($aClean['reject'])
} elseif ($aClean['sReject'])
{
if($obj_row->type == "image")
{
@@ -208,7 +208,7 @@ if (!$aClean['id'])
{
$sSubject = "Application Data Request Report";
$sMsg = "Your submission of an application data for ".Application::lookup_name($obj_row->appId).Version::lookup_name($obj_row->versionId)." was rejected. ";
$sMsg .= $aClean['replyText'];
$sMsg .= $aClean['sReplyText'];
mail_appdb($oUser->sEmail, $sSubject ,$sMsg);
}

View File

@@ -13,16 +13,16 @@ require_once(BASE."include/testResults.php");
$aClean = array(); //array of filtered user input
$aClean['iTestingId'] = makeSafe($_REQUEST['iTestingId']);
$aClean['sub'] = makeSafe($_REQUEST['sub'] );
$aClean['apptype'] = makeSafe($_REQUEST['apptype']);
$aClean['appId'] = makeSafe($_REQUEST['appId']);
$aClean['versionId'] = makeSafe($_REQUEST['versionId']);
$aClean['appVendorName'] = makeSafe($_REQUEST['appVendorName']);
$aClean['appVendorId'] = makeSafe($_REQUEST['appVendorId']);
$aClean['appWebpage'] = makeSafe($_REQUEST['appWebpage']);
$aClean['appIdMergeTo'] = makeSafe($_REQUEST['appIdMergeTo']);
$aClean['replyText'] = makeSafe($_REQUEST['replyText']);
$aClean['versionIdMergeTo'] = makeSafe($_REQUEST['versionIdMergeTo']);
$aClean['sSub'] = makeSafe($_REQUEST['sSub'] );
$aClean['sAppType'] = makeSafe($_REQUEST['sAppType']);
$aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
$aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
$aClean['sAppVendorName'] = makeSafe($_REQUEST['sAppVendorName']);
$aClean['iAppVendorId'] = makeSafe($_REQUEST['iAppVendorId']);
$aClean['sAppWebpage'] = makeSafe($_REQUEST['sAppWebpage']);
$aClean['iAppIdMergeTo'] = makeSafe($_REQUEST['iAppIdMergeTo']);
$aClean['sReplyText'] = makeSafe($_REQUEST['sReplyText']);
$aClean['iVersionIdMergeTo'] = makeSafe($_REQUEST['iVersionIdMergeTo']);
$aClean['sDistribution'] = makeSafe($_REQUEST['sDistribution']);
function get_vendor_from_keywords($sKeywords)
@@ -62,7 +62,7 @@ function outputSearchTableForDuplicateFlagging($currentAppId, $hResult)
//display row
echo "<tr class=$sBgColor>\n";
/* map the merging of the current app to the app we are displaying in the table */
echo " <td>".html_ahref($oRow->appName,"adminAppQueue.php?sub=duplicate&apptype=application&appId=".$currentAppId."&appIdMergeTo=".$oRow->appId)."</td>\n";
echo " <td>".html_ahref($oRow->appName,"adminAppQueue.php?sSub=duplicate&sAppType=application&iAppId=".$currentAppId."&appIdMergeTo=".$oRow->appId)."</td>\n";
echo " <td>$oVersionCount->versions versions &nbsp;</td>\n";
echo "</tr>\n\n";
@@ -113,7 +113,7 @@ function display_move_test_to_versions_table($aVersionsIds,$icurrentVersionId)
//display row
echo "<tr class=$sBgColor>\n";
echo " <td>".html_ahref($oVersion->sName,"adminAppQueue.php?sub=movetest&apptype=version&versionId=".$icurrentVersionId."&versionIdMergeTo=".$oVersion->iVersionId)."</td>\n";
echo " <td>".html_ahref($oVersion->sName,"adminAppQueue.php?sSub=movetest&sAppType=version&iVersionId=".$icurrentVersionId."&iVersionIdMergeTo=".$oVersion->iVersionId)."</td>\n";
echo " <td>".util_trim_description($oVersion->sDescription)."</td>\n";
echo " <td align=center>".$oVersion->sTestedRating."</td>\n";
@@ -138,9 +138,9 @@ if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isSuperMain
}
$oTest = new testData($aClean['iTestingId']);
if ($aClean['sub'])
if ($aClean['sSub'])
{
if($aClean['apptype'] == 'application')
if($aClean['sAppType'] == 'application')
{
/* make sure the user is authorized to view this application request */
if(!$_SESSION['current']->hasPriv("admin"))
@@ -149,20 +149,20 @@ if ($aClean['sub'])
exit;
}
$oApp = new Application($aClean['appId']);
$oApp = new Application($aClean['iAppId']);
// if we are processing a queued application there MUST be an implicitly queued
// version to go along with it.
$hResult = query_parameters("SELECT versionId from appVersion where appId='?';", $aClean['appId']);
$hResult = query_parameters("SELECT versionId from appVersion where appId='?';", $aClean['iAppId']);
$oVersionRow = mysql_fetch_object($hResult);
$oVersion = new Version($oVersionRow->versionId);
}
else if($aClean['apptype'] == 'version')
else if($aClean['sAppType'] == 'version')
{
/* make sure the user has permission to view this version */
$oVersion = new Version($aClean['versionId']);
$oVersion = new Version($aClean['iVersionId']);
if(!$_SESSION['current']->hasAppVersionModifyPermission($oVersion))
{
util_show_error_page("Insufficient privileges.");
@@ -188,21 +188,21 @@ if ($aClean['sub'])
$oTest = new testData();
}
if($aClean['sub'] == 'add')
if($aClean['sSub'] == 'add')
{
$oVersion = new Version($aClean['versionId']);
$oVersion = new Version($aClean['iVersionId']);
$oTest = new testData($aClean['iTestingId']);
$oVersion->GetOutputEditorValues();
$oTest->GetOutputEditorValues();
if ($aClean['apptype'] == "application") // application
if ($aClean['sAppType'] == "application") // application
{
$oApp = new Application($aClean['appId']);
$oApp = new Application($aClean['iAppId']);
$oApp->GetOutputEditorValues(); // load the values from $_REQUEST
// add new vendor
if($aClean['appVendorName'] and !$aClean['appVendorId'])
if($aClean['sAppVendorName'] and !$aClean['iAppVendorId'])
{
$oVendor = new Vendor();
$oVendor->create($aClean['appVendorName'],$aClean['appWebpage']);
$oVendor->create($aClean['sAppVendorName'],$aClean['sAppWebpage']);
$oApp->iVendorId = $oVendor->iVendorId;
}
$oApp->update(true);
@@ -214,16 +214,16 @@ if ($aClean['sub'])
$oTest->unQueue();
redirect($_SERVER['PHP_SELF']);
}
else if ($aClean['sub'] == 'duplicate')
else if ($aClean['sSub'] == 'duplicate')
{
if(is_numeric($aClean['appIdMergeTo']))
if(is_numeric($aClean['iAppIdMergeTo']))
{
/* move this version submission under the existing app */
$oVersion->iAppId = $aClean['appIdMergeTo'];
$oVersion->iAppId = $aClean['iAppIdMergeTo'];
$oVersion->update();
/* delete the appId that is the duplicate */
$aClean['replyText'] = "Your Vesion information was moved to an existing Application";
$aClean['sReplyText'] = "Your Vesion information was moved to an existing Application";
$oAppDelete = new Application($oApp->iAppId);
$oAppDelete->delete();
}
@@ -231,51 +231,51 @@ if ($aClean['sub'])
/* redirect back to the main page */
redirect(apidb_fullurl("admin/adminAppQueue.php"));
}
else if ($aClean['sub'] == 'movetest')
else if ($aClean['sSub'] == 'movetest')
{
if(is_numeric($aClean['versionIdMergeTo']))
if(is_numeric($aClean['iVersionIdMergeTo']))
{
// move this Test submission under the existing version
$oTest->iVersionId = $aClean['versionIdMergeTo'];
$oTest->iVersionId = $aClean['iVersionIdMergeTo'];
$oTest->update();
// delete the Version entry
$aClean['replyText'] = "Your Test results were moved to existing version";
$oVersion = new Version($aClean['versionId']);
$aClean['sReplyText'] = "Your Test results were moved to existing version";
$oVersion = new Version($aClean['iVersionId']);
$oVersion->delete();
}
// redirect back to the main page
redirect(apidb_fullurl("admin/adminAppQueue.php"));
}
else if ($aClean['sub'] == 'Delete')
else if ($aClean['sSub'] == 'Delete')
{
if (($aClean['apptype'] == "application") && is_numeric($aClean['appId'])) // application
if (($aClean['sAppType'] == "application") && is_numeric($aClean['iAppId'])) // application
{
// delete the application entry
$oApp = new Application($aClean['appId']);
$oApp = new Application($aClean['iAppId']);
$oApp->delete();
} else if(($aClean['apptype'] == "version") && is_numeric($aClean['versionId'])) // version
} else if(($aClean['sAppType'] == "version") && is_numeric($aClean['iVersionId'])) // version
{
// delete the Version entry
$oVersion = new Version($aClean['versionId']);
$oVersion = new Version($aClean['iVersionId']);
$oVersion->delete();
}
redirect(apidb_fullurl("admin/adminAppQueue.php"));
}
else if ($aClean['sub'] == 'Reject')
else if ($aClean['sSub'] == 'Reject')
{
$oVersion = new Version($aClean['versionId']);
$oVersion = new Version($aClean['iVersionId']);
$oTest = new testData($aClean['iTestingId']);
$oVersion->GetOutputEditorValues();
$oTest->GetOutputEditorValues();
if ($aClean['apptype'] == "application") // application
if ($aClean['sAppType'] == "application") // application
{
$oApp = new Application($aClean['appId']);
$oApp = new Application($aClean['iAppId']);
$oApp->GetOutputEditorValues(); // load the values from $_REQUEST
$oApp->update(true);
$oApp->reject();
@@ -288,13 +288,13 @@ if ($aClean['sub'])
}
//process according to sub flag
if ($aClean['sub'] == 'view')
if ($aClean['sSub'] == 'view')
{
$x = new TableVE("view");
apidb_header("Admin App Queue");
echo '<form name="qform" action="adminAppQueue.php" method="post" enctype="multipart/form-data">',"\n";
echo '<input type="hidden" name="sub" value="add">',"\n";
echo '<form name="sQform" action="adminAppQueue.php" method="post" enctype="multipart/form-data">',"\n";
echo '<input type="hidden" name="sSub" value="add">',"\n";
echo html_back_link(1,'adminAppQueue.php');
@@ -404,21 +404,21 @@ if ($aClean['sub'])
echo html_frame_start("Reply text", "90%", "", 0);
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
echo '<tr valign=top><td class="color0"><b>email Text</b></td>',"\n";
echo '<td><textarea name="replyText" style="width: 100%" cols="80" rows="10"></textarea></td></tr>',"\n";
echo '<td><textarea name="sReplyText" style="width: 100%" cols="80" rows="10"></textarea></td></tr>',"\n";
echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
if ($oApp) //application
{
echo '<input type="hidden" name="apptype" value="application" />';
echo '<input type="hidden" name="sAppType" value="application" />';
echo '<input type=submit value=" Submit App Into Database " class=button>&nbsp',"\n";
} else // app version
{
echo '<input type="hidden" name="apptype" value="version" />';
echo '<input type="hidden" name="sAppType" value="version" />';
echo '<input type="submit" value=" Submit Version Into Database " class="button">&nbsp',"\n";
}
echo '<input name="sub" type="submit" value="Delete" class="button" />',"\n";
echo '<input name="sub" type="submit" value="Reject" class="button" />',"\n";
echo '<input name="sSub" type="submit" value="Delete" class="button" />',"\n";
echo '<input name="sSub" type="submit" value="Reject" class="button" />',"\n";
echo '</td></tr>',"\n";
echo '</table>',"\n";
echo '</form>',"\n";
@@ -432,7 +432,7 @@ if ($aClean['sub'])
redirect(apidb_fullurl("admin/adminAppQueue.php"));
}
}
else /* if ($aClean['sub']) is not defined, display the main app queue page */
else /* if ($aClean['sSub']) is not defined, display the main app queue page */
{
apidb_header("Admin App Queue");

View File

@@ -13,11 +13,11 @@ require(BASE."include/mail.php");
$aClean = array(); //array of filtered user input
$aClean['sub'] = makeSafe($_REQUEST['sub']);
$aClean['buglinkId'] = makeSafe($_REQUEST['buglinkId']);
$aClean['ItemsPerPage'] = makeSafe($_REQUEST['ItemsPerPage']);
$aClean['QueuedOnly'] = makeSafe($_REQUEST['QueuedOnly']);
$aClean['page'] = makeSafe($_REQUEST['page']);
$aClean['sSub'] = makeSafe($_REQUEST['sSub']);
$aClean['iBuglinkId'] = makeSafe($_REQUEST['iBuglinkId']);
$aClean['iItemsPerPage'] = makeSafe($_REQUEST['iItemsPerPage']);
$aClean['sQueuedOnly'] = makeSafe($_REQUEST['sQueuedOnly']);
$aClean['iPage'] = makeSafe($_REQUEST['iPage']);
// deny access if not logged in
@@ -27,19 +27,19 @@ if(!$_SESSION['current']->hasPriv("admin"))
exit;
}
if ($aClean['sub'])
if ($aClean['sSub'])
{
if(($aClean['sub'] == 'delete' ) && ($aClean['buglinkId']))
if(($aClean['sSub'] == 'delete' ) && ($aClean['iBuglinkId']))
{
$oBuglink = new bug($aClean['buglinkId']);
$oBuglink = new bug($aClean['iBuglinkId']);
$oBuglink->delete();
}
if(($aClean['sub'] == 'unqueue' ) && ($aClean['buglinkId']))
if(($aClean['sSub'] == 'unqueue' ) && ($aClean['iBuglinkId']))
{
$oBuglink = new bug($aClean['buglinkId']);
$oBuglink = new bug($aClean['iBuglinkId']);
$oBuglink->unqueue();
}
redirect($_SERVER['PHP_SELF']."?ItemsPerPage=".$aClean['ItemsPerPage']."&QueuedOnly=".$aClean['QueuedOnly']."&page=".$aClean['page']);
redirect($_SERVER['PHP_SELF']."?iItemsPerPage=".$aClean['iItemsPerPage']."&sQueuedOnly=".$aClean['sQueuedOnly']."&ipage=".$aClean['iPage']);
exit;
}
@@ -49,13 +49,13 @@ if ($aClean['sub'])
$pageRange = 10;
$ItemsPerPage = 10;
$currentPage = 1;
$QueuedOnly = empty($aClean['QueuedOnly'])? NULL: $aClean['QueuedOnly'];
$QueuedOnly = empty($aClean['sQueuedOnly'])? NULL: $aClean['sQueuedOnly'];
$BugLinks = ($QueuedOnly == 'on')?getNumberOfQueuedBugLinks():getNumberOfBugLinks();
if($aClean['ItemsPerPage'])
$ItemsPerPage = $aClean['ItemsPerPage'];
if($aClean['iItemsPerPage'])
$ItemsPerPage = $aClean['iItemsPerPage'];
if($aClean['page'])
$currentPage = $aClean['page'];
if($aClean['iPage'])
$currentPage = $aClean['iPage'];
$ItemsPerPage = min($ItemsPerPage,100);
$totalPages = max(ceil($BugLinks/$ItemsPerPage),1);
@@ -63,18 +63,18 @@ if ($aClean['sub'])
$offset = (($currentPage-1) * $ItemsPerPage);
/* display page selection links */
echo '<form method="get" name="message" action="'.$_SERVER['PHP_SELF'].'">',"\n";
echo '<form method="get" name="sMessage" action="'.$_SERVER['PHP_SELF'].'">',"\n";
echo '<center>',"\n";
echo '<b>Page '.$currentPage.' of '.$totalPages.'</b><br />',"\n";
display_page_range($currentPage, $pageRange, $totalPages, $_SERVER['PHP_SELF']."?ItemsPerPage=".$ItemsPerPage."&QueuedOnly=".$QueuedOnly);
display_page_range($currentPage, $pageRange, $totalPages, $_SERVER['PHP_SELF']."?iItemsPerPage=".$ItemsPerPage."&sQueuedOnly=".$QueuedOnly);
echo '<br />',"\n";
echo '<br />',"\n";
/* display the option to choose how many comments per-page to display */
echo '<input type=hidden name=page value='.$currentPage.'>';
echo '<input type=hidden name=iPage value='.$currentPage.'>';
echo '<b>Number of Bug Links per page: </b>';
echo '<select name="ItemsPerPage">';
echo '<select name="iItemsPerPage">';
$ItemsPerPageArray = array(2 ,10, 20, 50, 100);
foreach($ItemsPerPageArray as $i => $value)
@@ -87,7 +87,7 @@ if ($aClean['sub'])
echo '</select>',"\n";
echo '<br />',"\n";
echo '<b>View queued links only: </b><input type=checkbox name="QueuedOnly" '.($QueuedOnly == "on"?" CHECKED":"").'>',"\n";
echo '<b>View queued links only: </b><input type=checkbox name="sQueuedOnly" '.($QueuedOnly == "on"?" CHECKED":"").'>',"\n";
echo '<br />',"\n";
echo '<input type=submit value="Refresh">',"\n";
@@ -144,26 +144,26 @@ if ($aClean['sub'])
echo ' <td align=center>'.$oRow->bug_status.'</td>',"\n";
echo ' <td>'.$oRow->short_desc.'</td>',"\n";
echo ' <td>',"\n";
echo ' <a href="'.apidb_fullurl('appview.php?appId='.$oRow->appId).'">'.$oRow->appName.'</a>',"\n";
echo ' <a href="'.apidb_fullurl('appview.php?iAppId='.$oRow->appId).'">'.$oRow->appName.'</a>',"\n";
echo ' </td>',"\n";
echo ' <td>'.$oRow->appDescription.'</td>',"\n";
echo ' <td>',"\n";
echo ' <a href="'.apidb_fullurl('appview.php?versionId='.$oRow->versionId).'">'.$oRow->versionName.'</a>',"\n";
echo ' <a href="'.apidb_fullurl('appview.php?iVersionId='.$oRow->versionId).'">'.$oRow->versionName.'</a>',"\n";
echo ' </td>',"\n";
echo ' <td align=center>[<a href="adminBugs.php?sub=delete',"\n";
echo '&buglinkId='.$oRow->linkId,"\n";
echo '&QueuedOnly='.$QueuedOnly,"\n";
echo '&ItemsPerPage='.$ItemsPerPage,"\n";
echo '&page='.$currentPage,"\n";
echo ' <td align=center>[<a href="adminBugs.php?sSub=delete',"\n";
echo '&iBuglinkId='.$oRow->linkId,"\n";
echo '&sQueuedOnly='.$QueuedOnly,"\n";
echo '&iItemsPerPage='.$ItemsPerPage,"\n";
echo '&iPage='.$currentPage,"\n";
echo '">delete</a>]</td>',"\n";
$bQueued = ($oRow->queued=="true")?true:false;
if ($bQueued)
{
echo '<td align=center>[<a href="adminBugs.php?sub=unqueue',"\n";
echo '&buglinkId='.$oRow->linkId,"\n";
echo '&QueuedOnly='.$QueuedOnly,"\n";
echo '&ItemsPerPage='.$ItemsPerPage,"\n";
echo '&page='.$currentPage,"\n";
echo '<td align=center>[<a href="adminBugs.php?sSub=unqueue',"\n";
echo '&iBuglinkId='.$oRow->linkId,"\n";
echo '&sQueuedOnly='.$QueuedOnly,"\n";
echo '&iItemsPerPage='.$ItemsPerPage,"\n";
echo '&iPage='.$currentPage,"\n";
echo '">OK</a>]</td>',"\n";
} else
{
@@ -176,7 +176,7 @@ if ($aClean['sub'])
echo "</table>","\n";
echo "<center>","\n";
display_page_range($currentPage, $pageRange, $totalPages, $_SERVER['PHP_SELF']."?ItemsPerPage=".$ItemsPerPage."&QueuedOnly=".$QueuedOnly);
display_page_range($currentPage, $pageRange, $totalPages, $_SERVER['PHP_SELF']."?iItemsPerPage=".$ItemsPerPage."&sQueuedOnly=".$QueuedOnly);
echo "</center>","\n";
apidb_footer();

View File

@@ -17,13 +17,13 @@ $currentPage = 1;
$aClean = array(); //array of filtered user input
$aClean['ItemsPerPage'] = makeSafe($_REQUEST['ItemsPerPage']);
$aClean['page'] = makeSafe($_REQUEST['page']);
$aClean['iItemsPerPage'] = makeSafe($_REQUEST['iItemsPerPage']);
$aClean['iPage'] = makeSafe($_REQUEST['iPage']);
if($aClean['ItemsPerPage'])
$ItemsPerPage = $aClean['ItemsPerPage'];
if($aClean['page'])
$currentPage = $aClean['page'];
if($aClean['iItemsPerPage'])
$ItemsPerPage = $aClean['iItemsPerPage'];
if($aClean['iPage'])
$currentPage = $aClean['iPage'];
$totalPages = ceil(getNumberOfComments()/$ItemsPerPage);
@@ -33,14 +33,14 @@ if($ItemsPerPage > 100) $ItemsPerPage = 100;
/* display page selection links */
echo "<center>";
echo "<b>Page $currentPage of $totalPages</b><br />";
display_page_range($currentPage, $pageRange, $totalPages, $_SERVER['PHP_SELF']."?ItemsPerPage=".$ItemsPerPage);
display_page_range($currentPage, $pageRange, $totalPages, $_SERVER['PHP_SELF']."?iItemsPerPage=".$ItemsPerPage);
echo "<br />";
echo "<br />";
/* display the option to choose how many comments per-page to display */
echo "<form method=\"get\" name=\"message\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<form method=\"get\" name=\"sMessage\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<b>Number of comments per page:</b>";
echo "&nbsp<select name='ItemsPerPage'>";
echo "&nbsp<select name='iItemsPerPage'>";
$ItemsPerPageArray = array(10, 20, 50, 100, 500);
foreach($ItemsPerPageArray as $i => $value)
@@ -52,7 +52,7 @@ foreach($ItemsPerPageArray as $i => $value)
}
echo "</select>";
echo "<input type=hidden name=page value=$currentPage>";
echo "<input type=hidden name=iPage value=$currentPage>";
echo "&nbsp<input type=submit value='Refresh'>";
echo "</form>";
@@ -76,7 +76,7 @@ while ($oRow = mysql_fetch_object($commentIds))
/* display page selection links */
echo "<center>";
display_page_range($currentPage, $pageRange, $totalPages, $_SERVER['PHP_SELF']."?ItemsPerPage=".$ItemsPerPage);
display_page_range($currentPage, $pageRange, $totalPages, $_SERVER['PHP_SELF']."?iItemsPerPage=".$ItemsPerPage);
echo "</center>";
apidb_footer();

View File

@@ -13,11 +13,11 @@ require(BASE."include/mail.php");
$aClean = array(); //array of filtered user input
$aClean['sub'] = makeSafe( $_REQUEST['sub'] );
$aClean['queueId'] = makeSafe( $_REQUEST['queueId'] );
$aClean['add'] = makeSafe( $_REQUEST['add'] );
$aClean['reject'] = makeSafe( $_REQUEST['reject'] );
$aClean['replyText'] = makeSafe( $_REQUEST['replyText'] );
$aClean['sSub'] = makeSafe( $_REQUEST['sSub'] );
$aClean['iQueueId'] = makeSafe( $_REQUEST['iQueueId'] );
$aClean['sAdd'] = makeSafe( $_REQUEST['sAdd'] );
$aClean['sReject'] = makeSafe( $_REQUEST['sReject'] );
$aClean['sReplyText'] = makeSafe( $_REQUEST['sReplyText'] );
if(!$_SESSION['current']->hasPriv("admin"))
{
@@ -25,16 +25,16 @@ if(!$_SESSION['current']->hasPriv("admin"))
exit;
}
if ($aClean['sub'])
if ($aClean['sSub'])
{
if ($aClean['queueId'])
if ($aClean['iQueueId'])
{
//get data
$sQuery = "SELECT queueId, appId, versionId,".
"userId, maintainReason, superMaintainer,".
"UNIX_TIMESTAMP(submitTime) as submitTime ".
"FROM appMaintainerQueue WHERE queueId = '?'";
$hResult = query_parameters($sQuery, $aClean['queueId']);
$hResult = query_parameters($sQuery, $aClean['iQueueId']);
$oRow = mysql_fetch_object($hResult);
$oUser = new User($oRow->userId);
mysql_free_result($hResult);
@@ -46,10 +46,10 @@ if ($aClean['sub'])
}
//process according to which request was submitted and optionally the sub flag
if (!$aClean['add'] && !$aClean['reject'] && $aClean['queueId'])
if (!$aClean['sAdd'] && !$aClean['sReject'] && $aClean['iQueueId'])
{
apidb_header("Admin Maintainer Queue");
echo '<form name="qform" action="adminMaintainerQueue.php" method="post" enctype="multipart/form-data">',"\n";
echo '<form name="sQform" action="adminMaintainerQueue.php" method="post" enctype="multipart/form-data">',"\n";
$x = new TableVE("view");
@@ -155,23 +155,23 @@ if ($aClean['sub'])
//maintainReason
echo '<tr valign=top><td class=color0><b>Maintainer request reason</b></td>',"\n";
echo '<td><textarea name="maintainReason" rows=10 cols=35>'.$oRow->maintainReason.'</textarea></td></tr>',"\n";
echo '<td><textarea name="sMaintainReason" rows=10 cols=35>'.$oRow->maintainReason.'</textarea></td></tr>',"\n";
//email response
echo '<tr valign=top><td class=color0><b>Email reply</b></td>',"\n";
echo "<td><textarea name='replyText' rows=10 cols=35>Enter a personalized reason for acceptance or rejection of the users maintainer request here</textarea></td></tr>\n";
echo "<td><textarea name='sReplyText' rows=10 cols=35>Enter a personalized reason for acceptance or rejection of the users maintainer request here</textarea></td></tr>\n";
/* Add button */
echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
echo '<input type=submit name=add value=" Add maintainer to this application " class=button /> </td></tr>',"\n";
echo '<input type=submit name=sAdd value=" Add maintainer to this application " class=button /> </td></tr>',"\n";
/* Reject button */
echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
echo '<input type=submit name=reject value=" Reject this request " class=button /></td></tr>',"\n";
echo '<input type=submit name=sReject value=" Reject this request " class=button /></td></tr>',"\n";
echo '</table>',"\n";
echo '<input type=hidden name="sub" value="inside_form" />',"\n";
echo '<input type=hidden name="queueId" value="'.$aClean['queueId'].'" />',"\n";
echo '<input type=hidden name="sSub" value="inside_form" />',"\n";
echo '<input type=hidden name="iQueueId" value="'.$aClean['iQueueId'].'" />',"\n";
echo html_frame_end("&nbsp;");
echo html_back_link(1,'adminMaintainerQueue.php');
@@ -180,7 +180,7 @@ if ($aClean['sub'])
exit;
}
else if ($aClean['add'] && $aClean['queueId'])
else if ($aClean['sAdd'] && $aClean['iQueueId'])
{
/* create a new user object for the maintainer */
$maintainerUser = new User($oRow->userId);
@@ -188,11 +188,11 @@ if ($aClean['sub'])
/* add the user as a maintainer and return the statusMessage */
$statusMessage = $maintainerUser->addAsMaintainer($oRow->appId, $oRow->versionId,
$oRow->superMaintainer,
$aClean['queueId']);
$aClean['iQueueId']);
//done
addmsg("<p><b>$statusMessage</b></p>", 'green');
}
else if (($aClean['reject'] || ($aClean['sub'] == 'reject')) && $aClean['queueId'])
else if (($aClean['sReject'] || ($aClean['sSub'] == 'sReject')) && $aClean['iQueueId'])
{
$sEmail = $oUser->sEmail;
if ($sEmail)
@@ -201,7 +201,7 @@ if ($aClean['sub'])
$oVersion = new Version($oRow->versionId);
$sSubject = "Application Maintainer Request Report";
$sMsg = "Your application to be the maintainer of ".$oApp->sName." ".$oVersion->sName." was rejected. ";
$sMsg .= $aClean['replyText'];
$sMsg .= $aClean['sReplyText'];
$sMsg .= "";
$sMsg .= "-The AppDB admins\n";
@@ -210,7 +210,7 @@ if ($aClean['sub'])
//delete main item
$sQuery = "DELETE from appMaintainerQueue where queueId = '?'";
$hResult = query_parameters($sQuery, $aClean['queueId']);
$hResult = query_parameters($sQuery, $aClean['iQueueId']);
if(!$hResult) addmsg("unable to delete selected maintainer application", "red");
echo html_frame_start("Delete maintainer application",400,"",0);
if($hResult)
@@ -230,7 +230,7 @@ if ($aClean['sub'])
/* display the list of all outstanding maintainer requests */
{
apidb_header("Admin Maintainer Queue");
echo '<form name="qform" action="adminMaintainerQueue.php" method="post" enctype="multipart/form-data">',"\n";
echo '<form name="sQform" action="adminMaintainerQueue.php" method="post" enctype="multipart/form-data">',"\n";
//get available maintainers
$sQuery = "SELECT queueId, appId, versionId,".
@@ -291,7 +291,7 @@ if ($aClean['sub'])
}
echo " <td><a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a></td>\n";
echo " <td>[<a href=\"adminMaintainerQueue.php?sub=view&queueId=$oRow->queueId\">answer</a>]</td>\n";
echo " <td>[<a href=\"adminMaintainerQueue.php?sSub=view&iQueueId=$oRow->queueId\">answer</a>]</td>\n";
echo "</tr>\n\n";
$c++;
}

View File

@@ -11,8 +11,8 @@ require(BASE."include/incl.php");
$aClean = array(); //array of filtered user input
$aClean['sub'] = makeSafe($_REQUEST['sub']);
$aClean['maintainerId'] = makeSafe($_REQUEST['maintainerId']);
$aClean['sSub'] = makeSafe($_REQUEST['sSub']);
$aClean['iMaintainerId'] = makeSafe($_REQUEST['iMaintainerId']);
// deny access if not logged in
if(!$_SESSION['current']->hasPriv("admin"))
@@ -22,15 +22,15 @@ if(!$_SESSION['current']->hasPriv("admin"))
}
apidb_header("Admin Maintainers");
echo '<form name="qform" action="adminMaintainers.php" method="post" enctype="multipart/form-data">',"\n";
echo '<form name="sQform" action="adminMaintainers.php" method="post" enctype="multipart/form-data">',"\n";
if ($aClean['sub'])
if ($aClean['sSub'])
{
if($aClean['sub'] == 'delete')
if($aClean['sSub'] == 'delete')
{
$sQuery = "DELETE FROM appMaintainers WHERE maintainerId = '?'";
$hResult = query_parameters($sQuery, $aClean['maintainerId']);
echo html_frame_start("Delete maintainer: ".$aClean['maintainerId'],400,"",0);
$hResult = query_parameters($sQuery, $aClean['iMaintainerId']);
echo html_frame_start("Delete maintainer: ".$aClean['iMaintainerId'],400,"",0);
if($hResult)
{
// success
@@ -115,14 +115,14 @@ if ($aClean['sub'])
echo " <td><a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a></td>\n";
if($oRow->superMaintainer)
{
echo " <td><a href='".BASE."appview.php?appId=$oRow->appId'>".Application::lookup_name($oRow->appId)."</a></td>\n";
echo " <td><a href='".BASE."appview.php?iAppId=$oRow->appId'>".Application::lookup_name($oRow->appId)."</a></td>\n";
echo " <td>*</td>\n";
} else
{
echo " <td><a href='".BASE."appview.php?appId=$oRow->appId'>".Application::lookup_name($oRow->appId)."</a></td>\n";
echo " <td><a href='".BASE."appview.php?versionId=$oRow->versionId'>".Version::lookup_name($oRow->versionId)."</a>&nbsp;</td>\n";
echo " <td><a href='".BASE."appview.php?iAppId=$oRow->appId'>".Application::lookup_name($oRow->appId)."</a></td>\n";
echo " <td><a href='".BASE."appview.php?iVersionId=$oRow->versionId'>".Version::lookup_name($oRow->versionId)."</a>&nbsp;</td>\n";
}
echo " <td align=\"center\">[<a href='adminMaintainers.php?sub=delete&maintainerId=$oRow->maintainerId'>delete</a>]</td>\n";
echo " <td align=\"center\">[<a href='adminMaintainers.php?sSub=delete&iMaintainerId=$oRow->maintainerId'>delete</a>]</td>\n";
echo "</tr>\n\n";
$c++;
}

View File

@@ -12,12 +12,12 @@ require(BASE."include/mail.php");
$aClean = array(); //array of filtered user input
$aClean['cmd'] = makeSafe($_REQUEST['cmd']);
$aClean['imageId'] = makeSafe($_REQUEST['imageId']);
$aClean['ItemsPerPage'] = makeSafe($_REQUEST['ItemsPerPage']);
$aClean['page'] = makeSafe($_REQUEST['page']);
$aClean['regenerate'] = makeSafe($_REQUEST['regenerate']);
$aClean['versionId'] = makeSafe($_REQUEST['versionId']);
$aClean['sCmd'] = makeSafe($_REQUEST['sCmd']);
$aClean['iImageId'] = makeSafe($_REQUEST['iImageId']);
$aClean['iItemsPerPage'] = makeSafe($_REQUEST['iItemsPerPage']);
$aClean['iPage'] = makeSafe($_REQUEST['iPage']);
$aClean['bRegenerate'] = makeSafe($_REQUEST['bRegenerate']);
$aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
// deny access if not admin
if(!$_SESSION['current']->hasPriv("admin"))
@@ -28,18 +28,18 @@ if(!$_SESSION['current']->hasPriv("admin"))
/*
* We issued a delete command.
*/
if($aClean['cmd'])
if($aClean['sCmd'])
{
// process screenshot deletion
if($aClean['cmd'] == "delete" && is_numeric($aClean['imageId']))
if($aClean['sCmd'] == "delete" && is_numeric($aClean['iImageId']))
{
$oScreenshot = new Screenshot($aClean['imageId']);
$oScreenshot = new Screenshot($aClean['iImageId']);
$oScreenshot->delete();
$oScreenshot->free();
}
redirect($_SERVER['PHP_SELF'].
"?ItemsPerPage=".$aClean['ItemsPerPage'].
"&page=".$aClean['page']);
"?iItemsPerPage=".$aClean['iItemsPerPage'].
"&iPage=".$aClean['iPage']);
exit;
}
@@ -47,7 +47,7 @@ if($aClean['cmd'])
apidb_header("Screenshots");
// regenerate all screenshots
if($aClean['regenerate'])
if($aClean['sRegenerate'])
{
$sQuery = "SELECT id FROM appData WHERE type = 'image'";
$hResult = query_parameters($sQuery);
@@ -62,7 +62,7 @@ if($aClean['regenerate'])
}
echo "<center>";
echo "<a href=\"".$_SERVER['PHP_SELF'].
"?regenerate=true\">Regenerate all screenshots ! ".
"?bRegenerate=true\">Regenerate all screenshots ! ".
"(use only if you know what you are doing)</a><br />";
echo "</center>";
@@ -72,10 +72,10 @@ $pageRange = 10;
$ItemsPerPage = 6;
$currentPage = 1;
if($aClean['ItemsPerPage'])
$ItemsPerPage = $aClean['ItemsPerPage'];
if($aClean['page'])
$currentPage = $aClean['page'];
if($aClean['iItemsPerPage'])
$ItemsPerPage = $aClean['iItemsPerPage'];
if($aClean['iPage'])
$currentPage = $aClean['iPage'];
$ItemsPerPage = min($ItemsPerPage,100);
$totalPages = ceil(getNumberOfImages()/$ItemsPerPage);
@@ -87,14 +87,14 @@ $offset = (($currentPage-1) * $ItemsPerPage);
echo "<center>";
echo "<b>Page $currentPage of $totalPages</b><br />";
display_page_range($currentPage, $pageRange, $totalPages,
$_SERVER['PHP_SELF']."?ItemsPerPage=".$ItemsPerPage);
$_SERVER['PHP_SELF']."?iItemsPerPage=".$ItemsPerPage);
echo "<br />";
echo "<br />";
/* display the option to choose how many screenshots per-page to display */
echo '<form method="get" name="message" action="'.$_SERVER['PHP_SELF'].'">';
echo '<b>Number of Screenshots per page:</b>';
echo "&nbsp<select name='ItemsPerPage'>";
echo "&nbsp<select name='iItemsPerPage'>";
$ItemsPerPageArray = array(6, 9, 12, 15, 18, 21, 24);
foreach($ItemsPerPageArray as $i => $value)
@@ -129,21 +129,21 @@ while ($oRow = mysql_fetch_object($Ids))
echo "<div align=center>". substr($oRow->description,0,20). "\n";
echo "<br />[<a href='".apidb_fullurl("appview.php");
echo "?appId=".$oApp->iAppId."'>";
echo "?iAppId=".$oApp->iAppId."'>";
echo $oApp->sName."</a>]";
echo "<br />[<a href='".apidb_fullurl("appview.php");
echo "?versionId=".$oVersion->iVersionId."'>";
echo "?iVersionId=".$oVersion->iVersionId."'>";
echo "Version: ".$oVersion->sName."</a>]";
//show admin delete link
if($_SESSION['current']->isLoggedIn() &&
($_SESSION['current']->hasPriv("admin") ||
$_SESSION['current']->isMaintainer($aClean['versionId'])))
$_SESSION['current']->isMaintainer($aClean['iVersionId'])))
{
echo "<br />[<a href='".$_SERVER['PHP_SELF'];
echo "?cmd=delete&imageId=$oRow->id";
echo "&page=".$currentPage."&ItemsPerPage=".$ItemsPerPage."'>";
echo "?sCmd=delete&iImageId=$oRow->id";
echo "&iPage=".$currentPage."&iItemsPerPage=".$ItemsPerPage."'>";
echo "Delete Image</a>]";
}
echo "</div></td>\n";
@@ -157,7 +157,7 @@ echo "</tr></table></div><br />\n";
/* display page selection links */
echo "<center>";
display_page_range($currentPage, $pageRange, $totalPages,
$_SERVER['PHP_SELF']."?ItemsPerPage=".$ItemsPerPage);
$_SERVER['PHP_SELF']."?iItemsPerPage=".$ItemsPerPage);
echo "</center>";
apidb_footer();

View File

@@ -13,10 +13,10 @@ require_once(BASE."include/distributions.php");
$aClean = array();
$aClean['sub'] = makeSafe($_REQUEST['sub']);
$aClean['sSub'] = makeSafe($_REQUEST['sSub']);
$aClean['iTestingId'] = makeSafe($_REQUEST['iTestingId']);
if ($aClean['sub'])
if ($aClean['sSub'])
{
$oTest = new testData($aClean['iTestingId']);
$oVersion = new Version($oTest->iVersionId);
@@ -26,26 +26,26 @@ if ($aClean['sub'])
exit;
}
if(($aClean['sub'] == 'Submit') || ($aClean['sub'] == 'Save') ||
($aClean['sub'] == 'Reject') || ($aClean['sub'] == 'Delete'))
if(($aClean['sSub'] == 'Submit') || ($aClean['sSub'] == 'Save') ||
($aClean['sSub'] == 'Reject') || ($aClean['sSub'] == 'Delete'))
{
if(is_numeric($aClean['iTestingId']))
{
$oTest = new testData($aClean['iTestingId']);
$oTest->GetOutputEditorValues();
if($aClean['sub'] == 'Submit') // submit the testing results
if($aClean['sSub'] == 'Submit') // submit the testing results
{
$oTest->update(true);
$oTest->unQueue();
} else if($aClean['sub'] == 'Save') // save the testing results
} else if($aClean['sSub'] == 'Save') // save the testing results
{
$oTest->update();
} else if($aClean['sub'] == 'Reject') // reject testing results
} else if($aClean['sSub'] == 'Reject') // reject testing results
{
$oTest->update(true);
$oTest->Reject();
} else if($aClean['sub'] == 'Delete') // delete testing results
} else if($aClean['sSub'] == 'Delete') // delete testing results
{
$oTest->delete();
}
@@ -62,7 +62,7 @@ if ($aClean['sub'])
$oApp = new application($oVersion->iAppId);
$sVersionInfo = $oApp->sName." ".$oVersion->sName;
if ($aClean['sub'] == 'view')
if ($aClean['sSub'] == 'view')
{
switch($oTest->sQueued)
{
@@ -76,7 +76,7 @@ if ($aClean['sub'])
apidb_header("Edit testing results for ".$sVersionInfo);
break;
}
echo '<form name="qform" action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">',"\n";
echo '<form name="sQform" action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">',"\n";
// View Testing Details
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
@@ -107,7 +107,7 @@ if ($aClean['sub'])
echo html_frame_start("Reply text", "90%", "", 0);
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
echo '<tr valign=top><td class="color0"><b>email Text</b></td>',"\n";
echo '<td><textarea name="replyText" style="width: 100%" cols="80" rows="10"></textarea></td></tr>',"\n";
echo '<td><textarea name="sReplyText" style="width: 100%" cols="80" rows="10"></textarea></td></tr>',"\n";
echo '<tr valign=top><td class=color3 align=center colspan=2>' ,"\n";
@@ -115,18 +115,18 @@ if ($aClean['sub'])
switch($oTest->sQueued)
{
case "false":
echo '<input name="sub" type="submit" value="Save" class="button" >&nbsp',"\n";
echo '<input name="sub" type="submit" value="Delete" class="button" >',"\n";
echo '<input name="sSub" type="submit" value="Save" class="button" >&nbsp',"\n";
echo '<input name="sSub" type="submit" value="Delete" class="button" >',"\n";
break;
case "true":
echo '<input name="sub" type="submit" value="Submit" class="button" >&nbsp',"\n";
echo '<input name="sub" type="submit" value="Reject" class="button" >&nbsp',"\n";
echo '<input name="sub" type="submit" value="Delete" class="button" >',"\n";
echo '<input name="sSub" type="submit" value="Submit" class="button" >&nbsp',"\n";
echo '<input name="sSub" type="submit" value="Reject" class="button" >&nbsp',"\n";
echo '<input name="sSub" type="submit" value="Delete" class="button" >',"\n";
break;
case "rejected":
echo '<input name="sub" type="submit" value="Submit" class="button" >&nbsp',"\n";
echo '<input name="sub" type="submit" value="Save" class="button" >&nbsp',"\n";
echo '<input name="sub" type="submit" value="Delete" class="button" >',"\n";
echo '<input name="sSub" type="submit" value="Submit" class="button" >&nbsp',"\n";
echo '<input name="sSub" type="submit" value="Save" class="button" >&nbsp',"\n";
echo '<input name="sSub" type="submit" value="Delete" class="button" >',"\n";
break;
}
echo '</td></tr>',"\n";
@@ -144,7 +144,7 @@ if ($aClean['sub'])
redirect($_SERVER['PHP_SELF']);
}
}
else // if ($aClean['sub']) is not defined, display the Testing results queue page
else // if ($aClean['sSub']) is not defined, display the Testing results queue page
{
$oTest = new TestData();
apidb_header("Testing Results");

View File

@@ -8,8 +8,8 @@ include(BASE."include/incl.php");
$aClean = array(); //filtered user input
$aClean['action'] = makeSafe($_REQUEST['action']);
$aClean['userId'] = makeSafe($_REQUEST['userId']);
$aClean['sAction'] = makeSafe($_REQUEST['sAction']);
$aClean['iUserId'] = makeSafe($_REQUEST['iUserId']);
$aClean['sSearch'] = makeSafe($_REQUEST['sSearch']);
$aClean['iLimit'] = makeSafe($_REQUEST['iLimit']);
$aClean['sOrderBy'] = makeSafe($_REQUEST['sOrderBy']);
@@ -24,9 +24,9 @@ if(!$_SESSION['current']->hasPriv("admin"))
}
// we want to delete a user
if($aClean['action'] == "delete" && is_numeric($aClean['userId']))
if($aClean['sAction'] == "delete" && is_numeric($aClean['iUserId']))
{
$oUser = new User($aClean['userId']);
$oUser = new User($aClean['iUserId']);
$oUser->delete();
}
@@ -103,7 +103,7 @@ if($aClean['sSubmit'])
if($oUser->hasPriv("admin")) echo "A";
if($oUser->isMaintainer()) echo "M";
echo " </td>\n";
echo " <td align=\"center\">[<a href=\"../preferences.php?userId=".$oRow->userid."&sSearch=".$sSearch."&iLimit=".$aClean['iLimit']."&sOrderBy=".$aClean['sOrderBy']."\">edit</a>]&nbsp;[<a onclick=\"if(!confirm('".$sAreYouSure."'))return false;\" \"href=\"".$_SERVER['PHP_SELF']."?action=delete&userId=".$oRow->userid."&sSearch=".$sSearch."&iLimit=".$aClean['iLimit']."&sOrderBy=".$aClean['sOrderBy']."&sSubmit=true\">delete</a>]</td>\n";
echo " <td align=\"center\">[<a href=\"../preferences.php?iUserId=".$oRow->userid."&sSearch=".$sSearch."&iLimit=".$aClean['iLimit']."&sOrderBy=".$aClean['sOrderBy']."\">edit</a>]&nbsp;[<a onclick=\"if(!confirm('".$sAreYouSure."'))return false;\" \"href=\"".$_SERVER['PHP_SELF']."?sAction=delete&iUserId=".$oRow->userid."&sSearch=".$sSearch."&iLimit=".$aClean['iLimit']."&sOrderBy=".$aClean['sOrderBy']."&sSubmit=true\">delete</a>]</td>\n";
echo "</tr>\n\n";
}
}

View File

@@ -16,13 +16,13 @@ require_once(BASE."include/testResults.php");
$aClean = array(); //filtered user input
$aClean['confirmed'] = makeSafe($_REQUEST['confirmed']);
$aClean['what'] = makeSafe($_REQUEST['what']);
$aClean['catId'] = makeSafe($_REQUEST['catId']);
$aClean['appId'] = makeSafe($_REQUEST['appId']);
$aClean['versionId'] = makeSafe($_REQUEST['versionId']);
$aClean['sConfirmed'] = makeSafe($_REQUEST['sConfirmed']);
$aClean['sWhat'] = makeSafe($_REQUEST['sWhat']);
$aClean['iCatId'] = makeSafe($_REQUEST['iCatId']);
$aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
$aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
if($aClean['confirmed'] != "yes")
if($aClean['sConfirmed'] != "yes")
{
// ask for confirmation
// could do some Real Damage if someone accidently hits the delete button on the main category :)
@@ -32,13 +32,13 @@ if($aClean['confirmed'] != "yes")
util_show_error_page("Not confirmed");
}
if($aClean['what'])
if($aClean['sWhat'])
{
switch($aClean['what'])
switch($aClean['sWhat'])
{
case "category":
// delete category and the apps in it
$oCategory = new Category($aClean['catId']);
$oCategory = new Category($aClean['iCatId']);
if(!$oCategory->delete())
util_show_error_page();
else
@@ -46,18 +46,18 @@ if($aClean['what'])
break;
case "appFamily":
// delete app family & all its versions
$oApp = new Application($aClean['appId']);
$oApp = new Application($aClean['iAppId']);
if(!$oApp->delete())
util_show_error_page();
else
redirect(BASE."appbrowse.php");
break;
case "appVersion":
$oVersion = new Version($aClean['versionId']);
$oVersion = new Version($aClean['iVersionId']);
if(!$oVersion->delete())
util_show_error_page();
else
redirect(BASE."appview.php?appId=".$aClean['appId']);
redirect(BASE."appview.php?iAppId=".$aClean['iAppId']);
break;
}
}

View File

@@ -12,25 +12,25 @@ require(BASE."include/mail.php");
$aClean = array(); //array of filtered user input
$aClean['appId'] = makeSafe($_REQUEST['appId']);
$aClean['submit'] = makeSafe($_REQUEST['submit']);
$aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!is_numeric($aClean['appId']))
if(!is_numeric($aClean['iAppId']))
{
util_show_error_page("Wrong ID");
exit;
}
if(!($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isSuperMaintainer($aClean['appId'])))
if(!($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isSuperMaintainer($aClean['iAppId'])))
{
util_show_error_page("Insufficient Privileges!");
exit;
}
if(!empty($aClean['submit']))
if(!empty($aClean['sSubmit']))
{
process_app_version_changes(false);
redirect(apidb_fullurl("appview.php?appId={$aClean['appId']}"));
redirect(apidb_fullurl("appview.php?iAppId={$aClean['iAppId']}"));
}
else
// Show the form for editing the Application Family
@@ -38,7 +38,7 @@ else
$family = new TableVE("edit");
$oApp = new Application($aClean['appId']);
$oApp = new Application($aClean['iAppId']);
if(!$oApp)
{
@@ -54,7 +54,7 @@ else
$oApp->OutputEditor("");
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">', "\n";
echo '<tr><td colspan=2 align=center><input type="submit" name=submit value="Update Database"></td></tr>',"\n";
echo '<tr><td colspan=2 align=center><input type="submit" name=sSubmit value="Update Database"></td></tr>',"\n";
echo '</table>', "\n";
echo "</form>";
@@ -62,7 +62,7 @@ else
// url edit form
echo '<form enctype="multipart/form-data" action="editAppFamily.php" method="post">',"\n";
echo '<input type=hidden name="appId" value='.$oApp->iAppId.'>';
echo '<input type=hidden name="iAppId" value='.$oApp->iAppId.'>';
echo html_frame_start("Edit URL","90%","",0);
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
@@ -95,18 +95,18 @@ else
echo '<td class=color1><b>URL</b></td></tr>',"\n";
}
echo "</td></tr>\n";
echo "<input type=hidden name='rows' value='$i'>";
echo "<input type=hidden name='iRows' value='$i'>";
echo '<tr><td class=color1>New</td><td class=color1><input size=45% type="text" name="url_desc"></td>',"\n";
echo '<td class=color1><input size=45% name="url" type="text"></td></tr>',"\n";
echo '<tr><td class=color1>New</td><td class=color1><input size=45% type="text" name="sUrlDesc"></td>',"\n";
echo '<td class=color1><input size=45% name="sUrl" type="text"></td></tr>',"\n";
echo '<tr><td colspan=3 align=center class=color3><input type="submit" name=submit value="Update URL"></td></tr>',"\n";
echo '<tr><td colspan=3 align=center class=color3><input type="submit" name=sSubmit value="Update URL"></td></tr>',"\n";
echo '</table>',"\n";
echo html_frame_end();
echo "</form>";
echo html_back_link(1,BASE."appview.php?appId=$oApp->iAppId");
echo html_back_link(1,BASE."appview.php?iAppId=$oApp->iAppId");
}
apidb_footer();

View File

@@ -43,7 +43,7 @@ if(!empty($aClean['sSub']))
{
$oNote->update();
}
redirect(apidb_fullurl("appview.php?versionId={$oNote->iVersionId}"));
redirect(apidb_fullurl("appview.php?iVersionId={$oNote->iVersionId}"));
} else /* display note */
{
// show form
@@ -67,7 +67,7 @@ if(!empty($aClean['sSub']))
echo '<input type="submit" name=sSub value="Delete"></td></tr>',"\n";
echo '</center>';
echo html_back_link(1,BASE."appview.php?versionId=".$oNote->iVersionId);
echo html_back_link(1,BASE."appview.php?iVersionId=".$oNote->iVersionId);
}
apidb_footer();

View File

@@ -7,32 +7,32 @@ require(BASE."include/mail.php");
$aClean = array(); //array of filtered user input
$aClean['appId'] = makeSafe($_REQUEST['appId']);
$aClean['versionId'] = makeSafe($_REQUEST['versionId']);
$aClean['submit'] = makeSafe($_REQUEST['submit']);
$aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
$aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!is_numeric($aClean['appId']) OR !is_numeric($aClean['versionId']))
if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId']))
{
util_show_error_page("Wrong ID");
exit;
}
/* Check for admin privs */
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($aClean['versionId']) && !$_SESSION['current']->isSuperMaintainer($aClean['appId']))
if(!$_SESSION['current']->hasPriv("admin") && !$_SESSION['current']->isMaintainer($aClean['iVersionId']) && !$_SESSION['current']->isSuperMaintainer($aClean['iAppId']))
{
util_show_error_page("Insufficient Privileges!");
exit;
}
/* process the changes the user entered into the web form */
if(!empty($aClean['submit']))
if(!empty($aClean['sSubmit']))
{
process_app_version_changes(true);
redirect(apidb_fullurl("appview.php?versionId=".$aClean['versionId']));
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
} else /* or display the webform for making changes */
{
$oVersion = new Version($aClean['versionId']);
$oVersion = new Version($aClean['iVersionId']);
apidb_header("Edit Application Version");
@@ -44,7 +44,7 @@ if(!empty($aClean['submit']))
$oVersion->OutputEditor(false, true); /* false = not allowing the user to modify the parent application */
echo '<table border=0 cellpadding=2 cellspacing=0 width="100%">',"\n";
echo '<tr><td colspan=2 align=center class=color2><input type="submit" name="submit" value="Update Database" /></td></tr>',"\n";
echo '<tr><td colspan=2 align=center class=color2><input type="submit" name="sSubmit" value="Update Database" /></td></tr>',"\n";
echo html_table_end();
echo "</form>";
@@ -53,8 +53,8 @@ if(!empty($aClean['submit']))
// url edit form
echo '<form enctype="multipart/form-data" action="editAppVersion.php" method="post">',"\n";
echo '<input type=hidden name="appId" value='.$oVersion->iAppId.'>';
echo '<input type=hidden name="versionId" value='.$oVersion->iVersionId.'>';
echo '<input type=hidden name="iAppId" value='.$oVersion->iAppId.'>';
echo '<input type=hidden name="iVersionId" value='.$oVersion->iVersionId.'>';
echo html_frame_start("Edit URL","90%","",0);
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
@@ -87,11 +87,11 @@ if(!empty($aClean['submit']))
echo '<td class=color1><b>URL</b></td></tr>',"\n";
}
echo "</td></tr>\n";
echo "<input type=hidden name='rows' value='$i'>";
echo '<tr><td class=color1>New</td><td class=color1><input size="45" type="text" name="url_desc"></td>',"\n";
echo '<td class=color1><input size=45% name="url" type="text"></td></tr>',"\n";
echo "<input type=hidden name='iRows' value='$i'>";
echo '<tr><td class=color1>New</td><td class=color1><input size="45" type="text" name="sUrlDesc"></td>',"\n";
echo '<td class=color1><input size=45% name="sUrl" type="text"></td></tr>',"\n";
echo '<tr><td colspan=3 align=center class="color3"><input type="submit" name="submit" value="Update URL"></td></tr>',"\n";
echo '<tr><td colspan=3 align=center class="color3"><input type="submit" name="sSubmit" value="Update URL"></td></tr>',"\n";
echo '</table>',"\n";
echo html_frame_end();
@@ -102,14 +102,14 @@ if(!empty($aClean['submit']))
{
// move version form
echo '<form enctype="multipart/form-data" action="moveAppVersion.php" method="post">',"\n";
echo '<input type=hidden name="appId" value='.$oVersion->iAppId.'>';
echo '<input type=hidden name="versionId" value='.$oVersion->iVersionId.'>';
echo '<input type=hidden name="iAppId" value='.$oVersion->iAppId.'>';
echo '<input type=hidden name="iVersionId" value='.$oVersion->iVersionId.'>';
echo html_frame_start("Move version to another application","90%","",0);
echo '<center><input type="submit" name="view" value="Move this version"></center>',"\n";
echo '<center><input type="submit" name="sView" value="Move this version"></center>',"\n";
echo html_frame_end();
}
echo html_back_link(1,BASE."appview.php?versionId=".$oVersion->iVersionId);
echo html_back_link(1,BASE."appview.php?iVersionId=".$oVersion->iVersionId);
apidb_footer();
}
?>

View File

@@ -13,7 +13,7 @@ function build_app_list()
{
$hResult = query_parameters("SELECT appId, appName FROM appFamily ORDER BY appName");
echo "<select name=appId size=5 onChange='this.form.submit()'>\n";
echo "<select name=iAppId size=5 onChange='this.form.submit()'>\n";
while($oRow = mysql_fetch_object($hResult))
{
echo "<option value=$oRow->appId>$oRow->appName</option>\n";
@@ -21,25 +21,25 @@ function build_app_list()
echo "</select>\n";
}
if($_REQUEST['cmd'])
if($_REQUEST['sCmd'])
{
if($_REQUEST['cmd'] == "delete")
if($_REQUEST['sCmd'] == "delete")
{
$hResult = query_parameters("DELETE FROM appBundle WHERE appId ='?' AND bundleId = '?'",
$_REQUEST['appId'], $_REQUEST['bundleId']);
$_REQUEST['iAppId'], $_REQUEST['iBundleId']);
if($hResult)
addmsg("App deleted from bundle", "green");
else
addmsg("Failed to delete app from bundle!", "red");
}
if($_REQUEST['cmd'] == "add")
if($_REQUEST['sCmd'] == "add")
{
$hResult = query_parameters("INSERT INTO appBundle (bundleId, appId) VALUES".
"('?', '?')",
$_REQUEST['bundleId'],
$_REQUEST['appId']);
$_REQUEST['iBundleId'],
$_REQUEST['iAppId']);
if($hResult)
addmsg("App $appId added to Bundle".$_REQUEST['bundleId'], "green");
addmsg("App $appId added to Bundle".$_REQUEST['iBundleId'], "green");
}
}
@@ -48,7 +48,7 @@ apidb_header("Edit Application Bundle");
$hResult = query_parameters("SELECT bundleId, appBundle.appId, appName FROM appBundle, appFamily ".
"WHERE bundleId = '?' AND appFamily.appId = appBundle.appId",
$_REQUEST['bundleId']);
$_REQUEST['iBundleId']);
echo html_frame_start("Apps in this Bundle","300",'',0);
echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
@@ -66,7 +66,7 @@ if($hResult && mysql_num_rows($hResult))
//set row color
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
$delete_link = "[<a href='editBundle.php?cmd=delete&bundleId=".$_REQUEST['bundleId']."&appId=$oRow->appId'>delete</a>]";
$delete_link = "[<a href='editBundle.php?sCmd=delete&iBundleId=".$_REQUEST['iBundleId']."&iAppId=$oRow->appId'>delete</a>]";
echo "<tr class=$bgcolor>\n";
echo " <td>$oRow->appName &nbsp;</td>\n";
@@ -92,8 +92,8 @@ echo html_frame_start("Application List (double click to add)","",'',2);
build_app_list();
echo html_frame_end();
echo "<input type=\"hidden\" name=\"bundleId\" value=\"".$_REQUEST['bundleId']."\">\n";
echo "<input type=\"hidden\" name=\"cmd\" value=\"add\">\n";
echo "<input type=\"hidden\" name=\"iBundleId\" value=\"".$_REQUEST['iBundleId']."\">\n";
echo "<input type=\"hidden\" name=\"sCmd\" value=\"add\">\n";
echo "</form>\n";
apidb_footer();

View File

@@ -6,7 +6,7 @@ require(BASE."include/distributions.php");
$aClean = array(); //array of filtered user input
$aClean['iDistributionId'] = makeSafe($_REQUEST['iDistributionId']);
$aClean['Submit'] = makeSafe($_REQUEST['Submit']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
if(!$_SESSION['current']->hasPriv("admin"))
{
@@ -16,7 +16,7 @@ if(!$_SESSION['current']->hasPriv("admin"))
$oDistribution = new distribution($aClean['iDistributionId']);
if($aClean['Submit'])
if($aClean['sSubmit'])
{
$oDistribution->GetOutputEditorValues();
@@ -37,12 +37,12 @@ else
else
apidb_header("Add Distribution");
echo '<form name="qform" action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">',"\n";
echo '<form name="sQform" action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">',"\n";
$oDistribution->OutputEditor();
echo '<tr valign=top><td class=color3 align=center colspan=2>',"\n";
echo '<input name="Submit" type="submit" value="Submit" class="button" >&nbsp',"\n";
echo '<input name="sSubmit" type="submit" value="Submit" class="button" >&nbsp',"\n";
echo '</td></tr>',"\n";
echo "</form>";

View File

@@ -5,7 +5,7 @@ require_once(BASE."include/vendor.php");
$aClean = array(); //array of filtered user input
$aClean['iVendorId'] = makeSafe($_REQUEST['iVendorId']);
$aClean['Submit'] = makeSafe($_REQUEST['Submit']);
$aClean['sSubmit'] = makeSafe($_REQUEST['sSubmit']);
$aClean['sName'] = makeSafe($_REQUEST['sName']);
$aClean['sWebpage'] = makeSafe($_REQUEST['sWebpage']);
@@ -16,7 +16,7 @@ if(!$_SESSION['current']->hasPriv("admin"))
}
$oVendor = new Vendor($aClean['iVendorId']);
if($aClean['Submit'])
if($aClean['sSubmit'])
{
$oVendor->update($aClean['sName'],$aClean['sWebpage']);
redirect(apidb_fullurl("vendorview.php"));
@@ -29,12 +29,12 @@ else
apidb_header("Add Vendor");
// Show the form
echo '<form name="qform" action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">',"\n";
echo '<form name="sQform" action="'.$_SERVER['PHP_SELF'].'" method="post" enctype="multipart/form-data">',"\n";
$oVendor->OutputEditor();
echo '<tr valign=top><td class=color3 align=center colspan=2>',"\n";
echo '<input name="Submit" type="submit" value="Submit" class="button" >&nbsp',"\n";
echo '<input name="sSubmit" type="submit" value="Submit" class="button" >&nbsp',"\n";
echo '</td></tr>',"\n";
echo "</form>";

View File

@@ -7,11 +7,11 @@ require(BASE."include/mail.php");
$aClean = array(); //array of filtered user input
$aClean['appId'] = makeSafe($_REQUEST['appId']);
$aClean['versionId'] = makeSafe($_REQUEST['versionId']);
$aClean['action'] = makeSafe($_REQUEST['action']);
$aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
$aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
$aClean['sAction'] = makeSafe($_REQUEST['sAction']);
if(!is_numeric($aClean['appId']) OR !is_numeric($aClean['versionId']))
if(!is_numeric($aClean['iAppId']) OR !is_numeric($aClean['iVersionId']))
{
util_show_error_page("Wrong ID");
exit;
@@ -24,28 +24,28 @@ if(!$_SESSION['current']->hasPriv("admin"))
exit;
}
if(!empty($aClean['action']))
if(!empty($aClean['sAction']))
{
/* move this version to the given application */
$oVersion = new Version($aClean['versionId']);
$oVersion->update(null, null, null, null, $aClean['appId']);
$oVersion = new Version($aClean['iVersionId']);
$oVersion->update(null, null, null, null, $aClean['iAppId']);
/* redirect to the application we just moved this version to */
redirect(apidb_fullurl("appview.php?appId=".$aClean['appId']));
redirect(apidb_fullurl("appview.php?iAppId=".$aClean['iAppId']));
} else /* or display the webform for making changes */
{
?>
<link rel="stylesheet" href="./application.css" type="text/css">
<?php
$oVersion = new Version($aClean['versionId']);
$oVersion = new Version($aClean['iVersionId']);
$oApp = new Application($oVersion->iAppId);
apidb_header("Choose application to move this version under");
echo "<form method=post action='moveAppVersion.php'>\n";
echo html_frame_start("Move ".$oApp->sName." ".$oVersion->sName, "90%","",0);
echo '<input type="hidden" name="appId" value='.$oVersion->iAppId.' />';
echo '<input type="hidden" name="versionId" value='.$oVersion->iVersionId.' />';
echo '<input type="hidden" name="iAppId" value='.$oVersion->iAppId.' />';
echo '<input type="hidden" name="iVersionId" value='.$oVersion->iVersionId.' />';
/* build a table of applications and their versions */
@@ -65,9 +65,9 @@ if(!empty($aClean['action']))
{
$currentAppId = $oRow->appId;
echo '<tr style="background: #CCDDFF; border: thin solid; font-weight:bold;"><td align="left" style="padding-left:20px;">';
$url = BASE."appview.php?appId=".$oRow->appId;
$url = BASE."appview.php?iAppId=".$oRow->appId;
echo '<a href="'.$url.'">'.substr($oRow->appName, 0, 30).'</a></td><td> - '.$oRow->appId.'</td>';
echo "<td style='padding-left:20px;'><a href='moveAppVersion.php?action=move&versionId=$oVersion->iVersionId&appId=$oRow->appId'>Move here</a></td></tr>";
echo "<td style='padding-left:20px;'><a href='moveAppVersion.php?sAction=move&iVersionId=$oVersion->iVersionId&iAppId=$oRow->appId'>Move here</a></td></tr>";
echo '<tr style="border-left: thin solid; border-right:thin solid; background: #FAFBE2;"><td style="padding-left:40px;" colspan="3" align="left">'.$oRow->versionName.'</td></tr>';
} else /* just add another version */
{
@@ -79,7 +79,7 @@ if(!empty($aClean['action']))
echo html_table_end();
echo html_frame_end();
echo "</form>";
echo html_back_link(1, BASE."appview.php?versionId=".$oVersion->iVersionId);
echo html_back_link(1, BASE."appview.php?iVersionId=".$oVersion->iVersionId);
apidb_footer();
}
?>