Security fix in adminAppQueue.php
This commit is contained in:
@@ -17,6 +17,12 @@ if(!havepriv("admin"))
|
|||||||
|
|
||||||
if ($_REQUEST['sub'])
|
if ($_REQUEST['sub'])
|
||||||
{
|
{
|
||||||
|
if(!is_numeric($_REQUEST['queueId']))
|
||||||
|
{
|
||||||
|
errorpage("Wrong ID");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ($_REQUEST['queueId'])
|
if ($_REQUEST['queueId'])
|
||||||
{
|
{
|
||||||
//get data
|
//get data
|
||||||
@@ -212,16 +218,20 @@ if ($_REQUEST['sub'])
|
|||||||
if ($_REQUEST['altvendor'] == 0 && $_REQUEST['queueVendor'])
|
if ($_REQUEST['altvendor'] == 0 && $_REQUEST['queueVendor'])
|
||||||
{
|
{
|
||||||
//add new vendor
|
//add new vendor
|
||||||
mysql_query("INSERT into vendor VALUES (null, '".addslashes($_REQUEST['queueVendor'])."', '');");
|
$aInsert = compile_insert_string( array('vendorName' => $_REQUEST['queueVendor'],
|
||||||
|
'vendorURL' => $_REQUEST['queueURL']));
|
||||||
|
|
||||||
|
query_appdb("INSERT INTO `vendor` ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})");
|
||||||
$_REQUEST['altvendor'] = mysql_insert_id();
|
$_REQUEST['altvendor'] = mysql_insert_id();
|
||||||
}
|
}
|
||||||
|
$aInsert = compile_insert_string( array('AppName' => $_REQUEST['queueName'],
|
||||||
$query = "INSERT into appFamily VALUES (null, '".
|
'vendorId' => $_REQUEST['altvendor'],
|
||||||
addslashes($_REQUEST['queueName'])."', ".$_REQUEST['altvendor'].", '', '".
|
'description' => $_REQUEST['queueDesc'],
|
||||||
addslashes($_REQUEST['queueDesc'])."', '".
|
'webPage' => $_REQUEST['queueURL'],
|
||||||
addslashes($_REQUEST['queueURL'])."', ".$_REQUEST['cat'].");";
|
'keywords' => "",
|
||||||
|
'catId' => $_REQUEST['cat']));
|
||||||
if (mysql_query($query))
|
|
||||||
|
if (query_appdb("INSERT INTO `appFamily` ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})"))
|
||||||
{
|
{
|
||||||
//get the id of the app just added
|
//get the id of the app just added
|
||||||
$_REQUEST['appParent'] = mysql_insert_id();
|
$_REQUEST['appParent'] = mysql_insert_id();
|
||||||
@@ -234,13 +244,15 @@ if ($_REQUEST['sub'])
|
|||||||
if (!$_REQUEST['queueDesc'])
|
if (!$_REQUEST['queueDesc'])
|
||||||
$_REQUEST['queueDesc'] = 'released version';
|
$_REQUEST['queueDesc'] = 'released version';
|
||||||
|
|
||||||
$verQuery = "INSERT into appVersion VALUES (null, ".$_REQUEST['appParent'].", '".
|
|
||||||
addslashes($_REQUEST['queueVersion'])."', '', '".
|
|
||||||
addslashes($_REQUEST['queueDesc'])."', '".
|
|
||||||
addslashes($_REQUEST['queueURL'])."', 0.0, 0.0);";
|
|
||||||
|
|
||||||
//Now add a version
|
//Now add a version
|
||||||
if (mysql_query($verQuery))
|
$aInsert = compile_insert_string( array('appId' => $_REQUEST['appParent'],
|
||||||
|
'versionName' => $_REQUEST['queueVersion'],
|
||||||
|
'description' => $_REQUEST['queueDesc'],
|
||||||
|
'webPage' => $_REQUEST['queueURL'],
|
||||||
|
'keywords' => "",
|
||||||
|
'maintainer_rating' => "",
|
||||||
|
'maintainer_release' => ""));
|
||||||
|
if (query_appdb("INSERT INTO `appVersion` ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})"))
|
||||||
{
|
{
|
||||||
//successful
|
//successful
|
||||||
$_REQUEST['appVersion'] = mysql_insert_id();
|
$_REQUEST['appVersion'] = mysql_insert_id();
|
||||||
@@ -268,12 +280,15 @@ if ($_REQUEST['sub'])
|
|||||||
//process as application version
|
//process as application version
|
||||||
if ($_REQUEST['appParent'])
|
if ($_REQUEST['appParent'])
|
||||||
{
|
{
|
||||||
$query = "INSERT into appVersion VALUES (null, ".$_REQUEST['appParent'].", '".
|
$aInsert = compile_insert_string( array('appId' => $_REQUEST['appParent'],
|
||||||
addslashes($_REQUEST['queueVersion'])."', '', '".
|
'versionName' => $_REQUEST['queueVersion'],
|
||||||
addslashes($_REQUEST['queueDesc'])."', '".
|
'description' => $_REQUEST['queueDesc'],
|
||||||
addslashes($_REQUEST['queueURL'])."', 0.0, 0.0);";
|
'webPage' => $_REQUEST['queueURL'],
|
||||||
|
'keywords' => "",
|
||||||
if (mysql_query($query))
|
'maintainer_rating' => "",
|
||||||
|
'maintainer_release' => ""));
|
||||||
|
|
||||||
|
if (query_appdb("INSERT INTO `appVersion` ({$aInsert['FIELDS']}) VALUES ({$aInsert['VALUES']})"))
|
||||||
{
|
{
|
||||||
//successful
|
//successful
|
||||||
$_REQUEST['appVersion'] = mysql_insert_id();
|
$_REQUEST['appVersion'] = mysql_insert_id();
|
||||||
|
|||||||
Reference in New Issue
Block a user