- replaced mysql_query() with query_appdb()
- removed opendb() - removed query_userdb() - removed error handling from the code as it is done with query_appdb()
This commit is contained in:
7
TODO
7
TODO
@@ -11,13 +11,6 @@ RELATED TODO: how to handle deleting accounts that have comments? go through
|
||||
and assign them to a special account number that prints (account deleted due
|
||||
to inactivity)
|
||||
|
||||
# replace all mysql_query() by query_appdb() (available from include/db.php).
|
||||
When it's done we have to remove opendb() function call in incl.php and definition
|
||||
in util.php as query_appdb already does the connection when needed.
|
||||
|
||||
# we have to check if we really need to separate user database from appdb database
|
||||
(as seen in the config file and include/db.php)
|
||||
|
||||
# when deleting an application we should delete linked entries (screenshots, comments, etc.)
|
||||
|
||||
# when deleting a screenshot we should delete the image file as well
|
||||
|
||||
@@ -24,7 +24,7 @@ else
|
||||
$table = "appFamily";
|
||||
$query = "INSERT INTO $table VALUES(0, 'NONAME', 0, null, null, null, $catId)";
|
||||
|
||||
mysql_query("DELETE FROM $table WHERE appName = 'NONAME'");
|
||||
query_appdb("DELETE FROM $table WHERE appName = 'NONAME'");
|
||||
|
||||
if(debugging()) { echo "<p align=center><b>query:</b> $query </p>"; }
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ if($_REQUEST['sub'] == "Submit")
|
||||
addslashes($_REQUEST['noteTitle'])."', '".
|
||||
addslashes($_REQUEST['noteDesc'])."', ".
|
||||
"{$_REQUEST['appId']}, {$_REQUEST['versionId']})";
|
||||
if (mysql_query($query))
|
||||
if (query_appdb($query))
|
||||
{
|
||||
// successful
|
||||
$email = getNotifyEmailAddressList($_REQUEST['appId'], $_REQUEST['versionId']);
|
||||
|
||||
@@ -31,7 +31,7 @@ else
|
||||
$table = "appVersion";
|
||||
$query = "INSERT INTO $table VALUES(0, $appId, 'NONAME', null, null, null, 0.0, 0.0)";
|
||||
|
||||
mysql_query("DELETE FROM $table WHERE versionName = 'NONAME'");
|
||||
query_appdb("DELETE FROM $table WHERE versionName = 'NONAME'");
|
||||
|
||||
if(debugging())
|
||||
echo "$query <br /><br />\n";
|
||||
|
||||
@@ -28,7 +28,7 @@ else
|
||||
$table = "appCategory";
|
||||
$query = "INSERT INTO $table VALUES(0, 'NONAME', null, 0)";
|
||||
|
||||
mysql_query("DELETE FROM $table WHERE catName = 'NONAME'");
|
||||
query_appdb("DELETE FROM $table WHERE catName = 'NONAME'");
|
||||
|
||||
if(debugging())
|
||||
echo "$query <br /><br />\n";
|
||||
|
||||
@@ -28,7 +28,7 @@ else
|
||||
$table = "vendor";
|
||||
$query = "INSERT INTO $table VALUES(0, 'NONAME', null)";
|
||||
|
||||
mysql_query("DELETE FROM $table WHERE vendorName = 'NONAME'");
|
||||
query_appdb("DELETE FROM $table WHERE vendorName = 'NONAME'");
|
||||
|
||||
if(debugging())
|
||||
echo "$query <br /><br />\n";
|
||||
|
||||
@@ -22,10 +22,10 @@ if(!havepriv("admin"))
|
||||
if (!$_REQUEST['queueId'])
|
||||
{
|
||||
//get available appData
|
||||
$str_query = "SELECT * from appDataQueue;";
|
||||
$result = mysql_query($str_query);
|
||||
$sQuery = "SELECT * from appDataQueue;";
|
||||
$hResult = query_appdb($sQuery);
|
||||
|
||||
if(!$result || !mysql_num_rows($result))
|
||||
if(!$hResult || !mysql_num_rows($hResult))
|
||||
{
|
||||
//no appData in queue
|
||||
echo html_frame_start("","90%");
|
||||
@@ -55,7 +55,7 @@ if (!$_REQUEST['queueId'])
|
||||
echo "</tr>\n\n";
|
||||
|
||||
$c = 1;
|
||||
while($ob = mysql_fetch_object($result))
|
||||
while($ob = mysql_fetch_object($hResult))
|
||||
{
|
||||
if($_SESSION['current']->is_maintainer($ob->queueappId,
|
||||
$ob->queueversionId)
|
||||
@@ -90,9 +90,9 @@ if (!$_REQUEST['queueId'])
|
||||
exit;
|
||||
}
|
||||
|
||||
$str_request="SELECT * FROM appDataQueue WHERE queueId='".$_REQUEST['queueId']."'";
|
||||
$res_result=mysql_query($str_request);
|
||||
$obj_row=mysql_fetch_object($res_result);
|
||||
$sQuery="SELECT * FROM appDataQueue WHERE queueId='".$_REQUEST['queueId']."'";
|
||||
$hResult=query_appdb($sQuery);
|
||||
$obj_row=mysql_fetch_object($hResult);
|
||||
|
||||
if(!$_REQUEST['sub']=="inside_form")
|
||||
{
|
||||
@@ -168,16 +168,16 @@ if (!$_REQUEST['queueId'])
|
||||
|
||||
if($obj_row->type == "image")
|
||||
{
|
||||
$str_query = "INSERT INTO appData VALUES (null, ".$obj_row->appId.", ".$obj_row->versionId.", 'image', ".
|
||||
$sQuery = "INSERT INTO appData VALUES (null, ".$obj_row->appId.", ".$obj_row->versionId.", 'image', ".
|
||||
"'".addslashes($_REQUEST['description'])."', '')";
|
||||
mysql_query($str_query);
|
||||
query_appdb($sQuery);
|
||||
$int_id = mysql_insert_id();
|
||||
|
||||
// we move the content in the live directory
|
||||
rename("../data/queued/screenshots/".$obj_row->queueId, "../data/screenshots/".$int_id);
|
||||
|
||||
// we have to update the entry now that we know its name
|
||||
$str_query = "UPDATE appData SET url = '".$int_id."' WHERE id = '".$int_id."'";
|
||||
$sQuery = "UPDATE appData SET url = '".$int_id."' WHERE id = '".$int_id."'";
|
||||
|
||||
}
|
||||
elseif ($obj_row->type == "url") {
|
||||
@@ -187,22 +187,15 @@ if (!$_REQUEST['queueId'])
|
||||
|
||||
if(debugging()) addmsg("<p align=center><b>query:</b> $query </p>","green");
|
||||
|
||||
if (mysql_query($str_query))
|
||||
if (query_appdb($sQuery))
|
||||
{
|
||||
$statusMessage = "<p>The application data was successfully added into the database</p>\n";
|
||||
|
||||
//delete the item from the queue
|
||||
mysql_query("DELETE from appDataQueue where queueId = ".$obj_row->queueId.";");
|
||||
|
||||
$goodtogo = 1; /* set to 1 so we send the response email */
|
||||
} else
|
||||
{
|
||||
//error
|
||||
$statusMessage = "<p><b>Database Error!<br>".mysql_error()."</b></p>\n";
|
||||
}
|
||||
query_appdb("DELETE from appDataQueue where queueId = ".$obj_row->queueId.";");
|
||||
|
||||
//Send Status Email
|
||||
if (lookupEmail($obj_row->userId) && $goodtogo)
|
||||
if (lookupEmail($obj_row->userId))
|
||||
{
|
||||
$ms = "Application Data Request Report\n";
|
||||
$ms .= "----------------------------------\n\n";
|
||||
@@ -218,6 +211,7 @@ if (!$_REQUEST['queueId'])
|
||||
//done
|
||||
echo html_frame_start("Submit App Data","600");
|
||||
echo "<p><b>$statusMessage</b></p>\n";
|
||||
}
|
||||
} elseif ($_REQUEST['reject'])
|
||||
{
|
||||
if (lookupEmail($obj_row->userId))
|
||||
@@ -233,17 +227,12 @@ if (!$_REQUEST['queueId'])
|
||||
}
|
||||
|
||||
//delete main item
|
||||
$str_query = "DELETE from appDataQueue where queueId = ".$obj_row->queueId.";";
|
||||
$sQuery = "DELETE from appDataQueue where queueId = ".$obj_row->queueId.";";
|
||||
unlink("../data/queued/screenshots/".$obj_row->queueId);
|
||||
|
||||
$result = mysql_query($str_query);
|
||||
$hResult = query_appdb($sQuery);
|
||||
echo html_frame_start("Delete application data submission",400,"",0);
|
||||
if(!$result)
|
||||
{
|
||||
//error
|
||||
echo "<p>Internal Error: unable to delete selected maintainer application!</p>\n";
|
||||
}
|
||||
else
|
||||
if($result)
|
||||
{
|
||||
//success
|
||||
echo "<p>Application data was successfully deleted from the Queue.</p>\n";
|
||||
|
||||
@@ -27,7 +27,7 @@ if ($_REQUEST['sub'])
|
||||
{
|
||||
//get data
|
||||
$query = "SELECT * from appQueue where queueId = ".$_REQUEST['queueId'].";";
|
||||
$result = mysql_query($query);
|
||||
$result = query_appdb($query);
|
||||
$ob = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ if ($_REQUEST['sub'])
|
||||
//category
|
||||
|
||||
$query = "select * from appCategory where catId = '$ob->queueCatId';";
|
||||
$result = mysql_query($query);
|
||||
$result = query_appdb($query);
|
||||
if($result)
|
||||
{
|
||||
$ob2 = mysql_fetch_object($result);
|
||||
@@ -143,7 +143,7 @@ if ($_REQUEST['sub'])
|
||||
// Use the first match if we found one and clear out the vendor field,
|
||||
// otherwise don't pick a vendor
|
||||
$query = "select * from vendor where vendorname = '$ob->queueVendor';";
|
||||
$result = mysql_query($query);
|
||||
$result = query_appdb($query);
|
||||
$checkvendor = 0;
|
||||
if($result)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ if ($_REQUEST['sub'])
|
||||
{
|
||||
// try for a partial match
|
||||
$query = "select * from vendor where vendorname like '%$ob->queueVendor%';";
|
||||
$result = mysql_query($query);
|
||||
$result = query_appdb($query);
|
||||
if($result)
|
||||
{
|
||||
$ob2 = mysql_fetch_object($result);
|
||||
@@ -236,7 +236,7 @@ if ($_REQUEST['sub'])
|
||||
//get the id of the app just added
|
||||
$_REQUEST['appParent'] = mysql_insert_id();
|
||||
//delete queue item
|
||||
mysql_query("DELETE from appQueue where queueId = ".$_REQUEST['queueId'].";");
|
||||
query_appdb("DELETE from appQueue where queueId = ".$_REQUEST['queueId'].";");
|
||||
|
||||
//set ver if not set
|
||||
if (!$_REQUEST['queueVersion'])
|
||||
@@ -294,7 +294,7 @@ if ($_REQUEST['sub'])
|
||||
$_REQUEST['appVersion'] = mysql_insert_id();
|
||||
$statusMessage = "<p>The application ".$_REQUEST['queueName']." was successfully added into the database</p>\n";
|
||||
addmsg($statusMessage,"Green");
|
||||
mysql_query("DELETE from appQueue where queueId = ".$_REQUEST['queueId'].";");
|
||||
query_appdb("DELETE from appQueue where queueId = ".$_REQUEST['queueId'].";");
|
||||
$goodtogo = 1;
|
||||
|
||||
}
|
||||
@@ -360,11 +360,9 @@ if ($_REQUEST['sub'])
|
||||
{
|
||||
//delete main item
|
||||
$query = "DELETE from appQueue where queueId = ".$_REQUEST['queueId'].";";
|
||||
$result = mysql_query($query);
|
||||
$result = query_appdb($query, "unable to delete selected application!");
|
||||
if(!$result)
|
||||
{
|
||||
//error
|
||||
addmsg("Internal Error: unable to delete selected application!", "red");
|
||||
redirect(apidb_fullurl("admin/adminAppQueue.php?appId=".$_REQUEST['appId']."&versionId=".$_REQUEST['versionId']));
|
||||
}
|
||||
else
|
||||
@@ -413,7 +411,7 @@ else
|
||||
"queueVersion, queueEmail, queueCatId,".
|
||||
"UNIX_TIMESTAMP(submitTime) as submitTime ".
|
||||
"from appQueue;";
|
||||
$result = mysql_query($query);
|
||||
$result = query_appdb($query);
|
||||
|
||||
if(!$result || !mysql_num_rows($result))
|
||||
{
|
||||
@@ -454,7 +452,7 @@ else
|
||||
if ($ob->queueCatId == -1)
|
||||
{
|
||||
$query2 = "select * from appFamily where appId = '$ob->queueName';";
|
||||
$result2 = mysql_query($query2);
|
||||
$result2 = query_appdb($query2);
|
||||
if($result2)
|
||||
{
|
||||
$ob2 = mysql_fetch_object($result2);
|
||||
|
||||
@@ -93,14 +93,14 @@ echo "</center>";
|
||||
|
||||
/* query for all of the commentId's, ordering by their time in reverse order */
|
||||
$offset = $currentPage * $commentsPerPage;
|
||||
$commentIds = mysql_query("SELECT commentId from appComments ORDER BY ".
|
||||
$commentIds = query_appdb("SELECT commentId from appComments ORDER BY ".
|
||||
"appComments.time ASC LIMIT $offset, $commentsPerPage;");
|
||||
while ($ob = mysql_fetch_object($commentIds))
|
||||
{
|
||||
$qstring = "SELECT from_unixtime(unix_timestamp(time), \"%W %M %D %Y, %k:%i\") as time, ".
|
||||
"commentId, parentId, appId, versionId, userid, subject, body ".
|
||||
"FROM appComments WHERE commentId = $ob->commentId;";
|
||||
$result = mysql_query($qstring);
|
||||
$result = query_appdb($qstring);
|
||||
|
||||
/* call view_app_comment to display the comment */
|
||||
$comment_ob = mysql_fetch_object($result);
|
||||
|
||||
@@ -24,7 +24,7 @@ if ($_REQUEST['sub'])
|
||||
"userId, maintainReason, superMaintainer,".
|
||||
"UNIX_TIMESTAMP(submitTime) as submitTime ".
|
||||
"FROM appMaintainerQueue WHERE queueId = ".$_REQUEST['queueId'].";";
|
||||
$result = mysql_query($query);
|
||||
$result = query_appdb($query);
|
||||
$ob = mysql_fetch_object($result);
|
||||
mysql_free_result($result);
|
||||
}
|
||||
@@ -167,10 +167,6 @@ if ($_REQUEST['sub'])
|
||||
}
|
||||
else if ($_REQUEST['add'] && $_REQUEST['queueId'])
|
||||
{
|
||||
//add this user, app and version to the database
|
||||
$statusMessage = "";
|
||||
$goodtogo = 0;
|
||||
|
||||
// insert the new entry into the maintainers list
|
||||
$query = "INSERT into appMaintainers VALUES(null,".
|
||||
"$ob->appId,".
|
||||
@@ -179,22 +175,15 @@ if ($_REQUEST['sub'])
|
||||
"$ob->superMaintainer,".
|
||||
"NOW());";
|
||||
|
||||
if (mysql_query($query))
|
||||
if (query_appdb($query))
|
||||
{
|
||||
$statusMessage = "<p>The maintainer was successfully added into the database</p>\n";
|
||||
|
||||
//delete the item from the queue
|
||||
mysql_query("DELETE from appMaintainerQueue where queueId = ".$_REQUEST['queueId'].";");
|
||||
|
||||
$goodtogo = 1; /* set to 1 so we send the response email */
|
||||
} else
|
||||
{
|
||||
//error
|
||||
$statusMessage = "<p><b>Database Error!<br>".mysql_error()."</b></p>\n";
|
||||
}
|
||||
query_appdb("DELETE from appMaintainerQueue where queueId = ".$_REQUEST['queueId'].";");
|
||||
|
||||
//Send Status Email
|
||||
if (lookupEmail($ob->userId) && $goodtogo)
|
||||
if (lookupEmail($ob->userId))
|
||||
{
|
||||
$ms = "Application Maintainer Request Report\n";
|
||||
$ms .= "----------------------------------\n\n";
|
||||
@@ -210,6 +199,7 @@ if ($_REQUEST['sub'])
|
||||
//done
|
||||
addmsg("<p><b>$statusMessage</b></p>", 'green');
|
||||
}
|
||||
}
|
||||
else if (($_REQUEST['reject'] || ($_REQUEST['sub'] == 'reject')) && $_REQUEST['queueId'])
|
||||
{
|
||||
if (lookupEmail($ob->userId))
|
||||
@@ -226,14 +216,9 @@ if ($_REQUEST['sub'])
|
||||
|
||||
//delete main item
|
||||
$query = "DELETE from appMaintainerQueue where queueId = ".$_REQUEST['queueId'].";";
|
||||
$result = mysql_query($query);
|
||||
$result = query_appdb($query,"unable to delete selected maintainer application");
|
||||
echo html_frame_start("Delete maintainer application",400,"",0);
|
||||
if(!$result)
|
||||
{
|
||||
//error
|
||||
echo "<p>Internal Error: unable to delete selected maintainer application!</p>\n";
|
||||
}
|
||||
else
|
||||
if($result)
|
||||
{
|
||||
//success
|
||||
echo "<p>Maintainer application was successfully deleted from the Queue.</p>\n";
|
||||
@@ -258,7 +243,7 @@ if ($_REQUEST['sub'])
|
||||
"superMaintainer,".
|
||||
"UNIX_TIMESTAMP(submitTime) as submitTime ".
|
||||
"from appMaintainerQueue;";
|
||||
$result = mysql_query($query);
|
||||
$result = query_appdb($query);
|
||||
|
||||
if(!$result || !mysql_num_rows($result))
|
||||
{
|
||||
|
||||
@@ -250,7 +250,7 @@ else
|
||||
echo '<table border=0 cellpadding=6 cellspacing=0 width="100%">',"\n";
|
||||
|
||||
$i = 0;
|
||||
$result = mysql_query("SELECT * FROM appData WHERE appId = $ob->appId AND type = 'url' AND versionId = 0");
|
||||
$result = query_appdb("SELECT * FROM appData WHERE appId = $ob->appId AND type = 'url' AND versionId = 0");
|
||||
if($result && mysql_num_rows($result) > 0)
|
||||
{
|
||||
echo '<tr><td class=color1><b>Delete</b></td><td class=color1>',"\n";
|
||||
|
||||
@@ -11,7 +11,7 @@ if(!havepriv("admin"))
|
||||
|
||||
function build_app_list()
|
||||
{
|
||||
$result = mysql_query("SELECT appId, appName FROM appFamily ORDER BY appName");
|
||||
$result = query_appdb("SELECT appId, appName FROM appFamily ORDER BY appName");
|
||||
|
||||
echo "<select name=appId size=5 onChange='this.form.submit()'>\n";
|
||||
while($ob = mysql_fetch_object($result))
|
||||
@@ -26,7 +26,7 @@ if($cmd)
|
||||
{
|
||||
if($cmd == "delete")
|
||||
{
|
||||
$result = mysql_query("DELETE FROM appBundle WHERE appId = $appId AND bundleId = $bundleId");
|
||||
$result = query_appdb("DELETE FROM appBundle WHERE appId = $appId AND bundleId = $bundleId");
|
||||
if($result)
|
||||
addmsg("App deleted from bundle", "green");
|
||||
else
|
||||
@@ -34,7 +34,7 @@ if($cmd)
|
||||
}
|
||||
if($cmd == "add")
|
||||
{
|
||||
$result = mysql_query("INSERT INTO appBundle VALUES ($bundleId, $appId)");
|
||||
$result = query_appdb("INSERT INTO appBundle VALUES ($bundleId, $appId)");
|
||||
if($result)
|
||||
addmsg("App $appId added to Bundle $bundleId", "green");
|
||||
else
|
||||
@@ -47,7 +47,7 @@ else
|
||||
{
|
||||
apidb_header("Edit Application Bundle");
|
||||
|
||||
$result = mysql_query("SELECT bundleId, appBundle.appId, appName FROM appBundle, appFamily ".
|
||||
$result = query_appdb("SELECT bundleId, appBundle.appId, appName FROM appBundle, appFamily ".
|
||||
"WHERE bundleId = $bundleId AND appFamily.appId = appBundle.appId");
|
||||
|
||||
if($result && mysql_num_rows($result))
|
||||
|
||||
@@ -36,8 +36,6 @@ if(!$versionId) {
|
||||
$versionId = 0;
|
||||
}
|
||||
|
||||
opendb();
|
||||
|
||||
// We have input, but wrong input
|
||||
if( ( $width AND !is_numeric($width) ) || ( $height AND !is_numeric($height) ) )
|
||||
{
|
||||
|
||||
@@ -32,8 +32,6 @@ if(!havepriv("admin") &&
|
||||
exit;
|
||||
}
|
||||
|
||||
opendb();
|
||||
|
||||
/* retrieve the parentID of the comment we are deleting */
|
||||
/* so we can fix up the parentIds of this comments children */
|
||||
$result = query_appdb("SELECT parentId FROM appComments WHERE commentId = '".$_REQUEST['commentId']."'");
|
||||
|
||||
@@ -87,7 +87,7 @@ function grab_comments($appId, $versionId, $parentId = -1)
|
||||
$extra.
|
||||
"ORDER BY appComments.time ASC";
|
||||
|
||||
$result = mysql_query($qstring);
|
||||
$result = query_appdb($qstring);
|
||||
|
||||
return $result;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ function grab_comments($appId, $versionId, $parentId = -1)
|
||||
function count_comments($appId, $versionId)
|
||||
{
|
||||
$qstring = "SELECT count(commentId) as hits FROM appComments WHERE appId = $appId AND versionId = $versionId";
|
||||
$result = mysql_query($qstring);
|
||||
$result = query_appdb($qstring);
|
||||
$ob = mysql_fetch_object($result);
|
||||
return $ob->hits;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ function display_comments_flat($appId, $versionId)
|
||||
function view_app_comments($appId, $versionId, $threadId = 0)
|
||||
{
|
||||
// count posts
|
||||
$result = mysql_query("SELECT commentId FROM appComments WHERE appId = $appId AND versionId = $versionId");
|
||||
$result = query_appdb("SELECT commentId FROM appComments WHERE appId = $appId AND versionId = $versionId");
|
||||
$messageCount = mysql_num_rows($result);
|
||||
|
||||
//start comment format table
|
||||
|
||||
@@ -30,15 +30,6 @@ define("APPS_DBHOST","localhost");
|
||||
define("APPS_DB","apidb");
|
||||
|
||||
|
||||
/*
|
||||
* users database info
|
||||
*/
|
||||
define("USERS_DBUSER","wineowner");
|
||||
define("USERS_DBPASS","lemonade");
|
||||
define("USERS_DBHOST","localhost");
|
||||
define("USERS_DB","apidb");
|
||||
|
||||
|
||||
/*
|
||||
* bugzilla database info
|
||||
*/
|
||||
|
||||
@@ -14,21 +14,6 @@ function query_appdb($sQuery,$sComment="")
|
||||
}
|
||||
|
||||
|
||||
function query_userdb($sQuery)
|
||||
{
|
||||
global $hUserLink;
|
||||
|
||||
if(!$hUserLink)
|
||||
{
|
||||
$hUserLink = mysql_pconnect(USERS_DBHOST, USERS_DBUSER, USERS_DBPASS);
|
||||
mysql_select_db(USERS_DB);
|
||||
}
|
||||
$hResult = mysql_query($sQuery, $hUserLink);
|
||||
if(!$hResult) query_error($sComment);
|
||||
return $hResult;
|
||||
}
|
||||
|
||||
|
||||
function query_bugzilladb($sQuery,$sComment="")
|
||||
{
|
||||
global $hBugzillaLink;
|
||||
|
||||
@@ -210,13 +210,7 @@ function dumpmsgbuffer()
|
||||
query_appdb("DELETE FROM sessionMessages WHERE sessionId = '".session_id()."'");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Start DB Connection
|
||||
*/
|
||||
opendb();
|
||||
|
||||
/*
|
||||
/**
|
||||
* Init Session (stores user info and cart info in session)
|
||||
*/
|
||||
$session = new session("whq_appdb");
|
||||
|
||||
@@ -18,8 +18,6 @@ class TableVE {
|
||||
$this->titleField = "";
|
||||
$this->titleText = "";
|
||||
$this->numberedTitles = 0;
|
||||
|
||||
opendb();
|
||||
}
|
||||
|
||||
function test($query)
|
||||
|
||||
@@ -122,7 +122,7 @@ class User {
|
||||
$sFields = "({$aInsert['FIELDS']}, `password`, `stamp`, `created`)";
|
||||
$sValues = "({$aInsert['VALUES']}, password('".$sPassword."'), NOW(), NOW() )";
|
||||
|
||||
if (!query_userdb("INSERT INTO user_list $sFields VALUES $sValues"))
|
||||
if (!query_appdb("INSERT INTO user_list $sFields VALUES $sValues"))
|
||||
{
|
||||
return mysql_error();
|
||||
}
|
||||
|
||||
@@ -1,27 +1,4 @@
|
||||
<?php
|
||||
|
||||
$dbcon = null;
|
||||
$dbref = 0;
|
||||
|
||||
function opendb()
|
||||
{
|
||||
global $dbcon, $dbref;
|
||||
|
||||
$dbref++;
|
||||
|
||||
if($dbcon)
|
||||
return $dbcon;
|
||||
|
||||
$dbcon = mysql_connect(APPS_DBHOST, APPS_DBUSER, APPS_DBPASS);
|
||||
if(!$dbcon)
|
||||
{
|
||||
echo "An error occurred: ".mysql_error()."<p>\n";
|
||||
exit;
|
||||
}
|
||||
mysql_select_db(APPS_DB);
|
||||
return $dbcon;
|
||||
}
|
||||
|
||||
function build_urlarg($vars)
|
||||
{
|
||||
$arr = array();
|
||||
|
||||
@@ -17,8 +17,6 @@ if(!loggedin())
|
||||
exit;
|
||||
}
|
||||
|
||||
opendb();
|
||||
|
||||
$appId = strip_tags($_POST['appId']);
|
||||
$versionId = strip_tags($_POST['versionId']);
|
||||
$confirmed = strip_tags($_POST['confirmed']);
|
||||
|
||||
@@ -41,8 +41,6 @@ if(!loggedin())
|
||||
exit;
|
||||
}
|
||||
|
||||
opendb();
|
||||
|
||||
$appId = strip_tags($_POST['appId']);
|
||||
$versionId = strip_tags($_POST['versionId']);
|
||||
$superMaintainer = strip_tags($_POST['superMaintainer']);
|
||||
|
||||
@@ -17,8 +17,6 @@ if(!loggedin())
|
||||
|
||||
function build_prefs_list()
|
||||
{
|
||||
opendb();
|
||||
|
||||
$result = query_appdb("SELECT * FROM prefs_list ORDER BY id");
|
||||
while($r = mysql_fetch_object($result))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user