Fix several small bugs in the devcp.

git-svn-id: svn://10.0.0.236/trunk@166650 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
psychoticwolf%carolina.rr.com 2004-12-13 05:40:59 +00:00
parent 9fe7947603
commit c5d9f8356e
6 changed files with 40 additions and 186 deletions

View File

@ -63,7 +63,7 @@ $filename = escape_string($_POST["filename"]);
$filesize = escape_string($_POST["filesize"]);
$uploadedfile="$websitepath/files/temp/$filename";
}
$zip = zip_open("$uploadedfile");
$zip = @zip_open("$uploadedfile");
if ($zip) {
while ($zip_entry = zip_read($zip)) {
@ -156,7 +156,7 @@ $sql = "SELECT ID, GUID from `main` WHERE `GUID` = '".escape_string($manifestdat
$mode = "update";
$row = mysql_fetch_array($sql_result);
$item_id = $row["ID"];
if ($_POST["legacy"]=="TRUE") {$item_id = $_POST["existingitems"]; }
if ($_POST["legacy"]=="TRUE") {$item_id = escape_string($_POST["existingitems"]); }
$sql = "SELECT `UserID` from `authorxref` WHERE `ID`='$item_id' AND `UserID` = '$_SESSION[uid]' LIMIT 1";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
if (mysql_num_rows($sql_result)=="1" or ($_SESSION["level"]="admin" or $_SESSION["level"]="editor")) {
@ -228,7 +228,7 @@ $sql = "SELECT TM.ID, TM.Name FROM `main` TM
LEFT JOIN authorxref TAX ON TM.ID = TAX.ID
INNER JOIN userprofiles TU ON TAX.UserID = TU.UserID
WHERE TM.Type = '$type'";
if ($_GET["admin"] =="true" AND $_SESSION[level] =="admin") {} else{ $sql .= "AND TU.UserEmail = '$_SESSION[email]'"; }
if ($_SESSION["level"] =="editor" OR $_SESSION["level"] =="admin") {} else { $sql .= "AND TU.UserEmail = '$_SESSION[email]'"; }
$sql .="GROUP BY `name` ORDER BY `Name` ASC ";
$sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result)) {
@ -611,7 +611,7 @@ $uri = ""; //we don't have all the parts to set a uri, leave blank and fix when
$notes = escape_string($_POST["notes"]);
//If a record for this item's exact version, OS, and app already exists, find it and delete it, before inserting
$sql3 = "SELECT `vID` from `version` TV INNER JOIN `applications` TA ON TA.AppID=TV.AppID WHERE `OSID`='$osid' AND `AppName` = '$appname' AND TV.Version='$version' ORDER BY `vID` ASC";
$sql3 = "SELECT `vID` from `version` TV INNER JOIN `applications` TA ON TA.AppID=TV.AppID WHERE TV.ID = `$id` AND `OSID`='$osid' AND `AppName` = '$appname' AND TV.Version='$version' ORDER BY `vID` ASC";
$sql_result3 = mysql_query($sql3, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
while ($row = mysql_fetch_array($sql_result3)) {
$sql = "DELETE FROM `version` WHERE `vID`='$row[vID]' LIMIT 1";

View File

@ -136,22 +136,9 @@ WHERE `approved` = '?' GROUP BY TV.URI ORDER BY TV.DateUpdated ASC";
$row2 = mysql_fetch_array($sql_result2);
if ($row2[date]) {$date = $row2[date]; } else { $date = $row[DateUpdated]; }
$date = date("l, F d, Y, g:i:sa", strtotime("$date"));
echo"<TR><TD COLSPAN=4><h3><a href=\"listmanager.php?function=editversion&id=$row[ID]&vid=$row[vID]\">$row[Name] $row[Version]</a> by $authors</h3></TD></TR>\n";
echo"<TR><TD COLSPAN=4><h2><a href=\"listmanager.php?function=editversion&id=$row[ID]&vid=$row[vID]\">$row[Name] $row[Version]</a> by $authors</h2></TD></TR>\n";
if ($type=="T") {
$installink = "javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$row[URI]','$row[Name] $row[Version]'))";
} else if ($type=="E") {
$installink = "javascript:void(InstallTrigger.install({'$row[Name] $row[Version]':'$row[URI]'}))";
}
echo"<TR><TD COLSPAN=4 style=\"font-size: 8pt;\"><a href=\"$installink\">( Install Now )</a> $row[Description] ($categories)</TD></TR>\n";
echo"<TR>\n";
if ($row2[UserName]) {
echo"<TD COLSPAN=2 style=\"font-size: 8pt;\"><strong>Requested by:</strong> <a href=\"mailto:$row2[UserEmail]\">$row2[UserName]</a> on $date</TD>\n";
} else {
echo"<TD COLSPAN=2></TD>\n";
}
echo"</TR>\n<TR>";
echo"<TR>";
echo"<TD style=\"font-size: 8pt;\"><strong>Works with: </strong>";
$sql3 = "SELECT `shortname`, `MinAppVer`, `MaxAppVer` FROM `version` TV INNER JOIN `applications` TA ON TV.AppID = TA.AppID WHERE `URI`='$row[URI]' ORDER BY `AppName` ASC";
$sql_result3 = mysql_query($sql3, $connection) or trigger_error("MySQL Error ".mysql_errno().": ".mysql_error()."", E_USER_NOTICE);
@ -159,10 +146,38 @@ WHERE `approved` = '?' GROUP BY TV.URI ORDER BY TV.DateUpdated ASC";
echo"".ucwords($row3[shortname])." $row3[MinAppVer]-$row3[MaxAppVer] \n";
}
if($row[OSName] != "ALL") { echo" ($row[OSName])"; }
if ($type=="T") {
$installink = "javascript:void(InstallTrigger.installChrome(InstallTrigger.SKIN,'$row[URI]','$row[Name] $row[Version]'))";
} else if ($type=="E") {
$installink = "javascript:void(InstallTrigger.install({'$row[Name] $row[Version]':'$row[URI]'}))";
}
echo"<SPAN><a href=\"$installink\">( Install Now )</a></span>\n";
echo"</TD>\n";
echo"</TR>\n";
echo"<TR><TD style=\"font-size: 8pt;\">".nl2br($row[Description])." ($categories)</TD></TR>\n";
echo"<TR>\n";
if ($row2[UserName]) {
echo"<TD COLSPAN=2 style=\"font-size: 8pt;\"><strong>Requested by:</strong> <a href=\"mailto:$row2[UserEmail]\">$row2[UserName]</a> on $date</TD>\n";
} else {
echo"<TD COLSPAN=2></TD>\n";
}
echo"</TR>\n";
//Approval Form for this Extension Item
echo"<TR><TD COLSPAN=4><h3 style=\"margin-top: 0px\">Tested On:</h3></TD></TR>\n";
echo"<TR><TD COLSPAN=4 style=\"font-size: 8pt\">\n";
echo"<input name=\"type_$i\" type=\"hidden\" value=\"$type\">\n";
echo"<input name=\"file_$i\" type=\"hidden\" value=\"$uri\">\n";
echo"<input name=\"name_$i\" type=\"hidden\" value=\"$row[Name]\">\n";
echo"<input name=\"version_$i\" type=\"hidden\" value=\"$row[Version]\">\n";
echo"OSes: <input name=\"testos_$i\" type=\"text\" size=10 title=\"What OS(es) did you test in? Windows, Linux, MacOSX, etc\">\n";
echo"Apps: <input name=\"testbuild_$i\" type=\"text\" size=10 title=\"What app(s) version(s)/buildid(s)? (Ex. Firefox 1.0RC1 or 0.10+ 20041010)\">\n";
echo"Comments: <input name=\"comments_$i\" type=\"text\" size=\"35\" title=\"Comments to Author (Will Be E-Mailed w/ Notice of your Action)\">";
echo"</TD></TR>\n";
echo"<TR><TD COLSPAN=4 style=\"font-size: 8pt\">\n";
echo"<input name=\"installation_$i\" type=\"checkbox\" value=\"YES\" TITLE=\"Installs OK?\">Install?\n";
echo"<input name=\"uninstallation_$i\" type=\"checkbox\" value=\"YES\" TITLE=\"Uninstalls OK?\">Uninstall?\n";
@ -176,20 +191,11 @@ if ($type=="E") {
echo"<input name=\"allelementsthemed_$i\" type=\"checkbox\" value=\"YES\" TITLE=\"All Components Themed? (Including No Missing Icons?)\">Theme Complete?\n";
}
echo"</TD></TR>\n";
echo"<TR><TD COLSPAN=4 style=\"font-size: 8pt\">\n";
echo"<input name=\"type_$i\" type=\"hidden\" value=\"$type\">\n";
echo"<input name=\"file_$i\" type=\"hidden\" value=\"$uri\">\n";
echo"<input name=\"name_$i\" type=\"hidden\" value=\"$row[Name]\">\n";
echo"<input name=\"version_$i\" type=\"hidden\" value=\"$row[Version]\">\n";
echo"Tested On: OSes: <input name=\"testos_$i\" type=\"text\" size=10 title=\"What OS(es) did you test in? Windows, Linux, MacOSX, etc\">\n";
echo"Apps: <input name=\"testbuild_$i\" type=\"text\" size=10 title=\"What app(s) version(s)/buildid(s)? (Ex. Firefox 1.0RC1 or 0.10+ 20041010)\">\n";
echo"Comments: <input name=\"comments_$i\" type=\"text\" size=\"35\" title=\"Comments to Author (Will Be E-Mailed w/ Notice of your Action)\">";
echo"</TD></TR>\n";
echo"<TR><TD COLSPAN=4 style=\"font-size: 8pt\">\n";
echo"<TR><TD COLSPAN=4 style=\"font-size: 8pt\"><strong>Action:</strong> \n";
echo"<input name=\"approval_$i\" type=\"radio\" value=\"YES\">Approve&nbsp;&nbsp;";
echo"<input name=\"approval_$i\" type=\"radio\" value=\"NO\">Deny&nbsp;&nbsp;";
echo"<input name=\"approval_$i\" type=\"radio\" checked=\"checked\" VALUE=\"noaction\">No Action?\n";
echo"<input name=\"approval_$i\" type=\"radio\" checked=\"checked\" VALUE=\"noaction\">No Action\n";
echo"</TD></TR>\n";
}

View File

@ -1,152 +0,0 @@
/* MozUpdates :: Admin Stylesheet */
/* Positioning */
html, body {
height: 100%;
margin: 0px;
padding: 0px;
margin-bottom : 10px;
}
#container {
position: relative;
min-height: 100%;
height: 100%;
voice-family: "\"}\"";
voice-family: inherit;
height: auto;
}
html > body #container {
height: auto;
}
/* #footer {
position: absolute;
bottom: 0px;
} */
/* Appearance */
body {
font-family: Verdana, sans-serif;
}
p.skipLink {
display: none;
}
#header h1 {
background-color: rgb(217, 184, 127);
color: white;
height: 30px;
padding: 10px;
margin: 0px;
font-size: 1.5em;
}
#header h2 {
background-color: rgb(241, 215, 158);
color: rgb(165, 123, 70);
height: 20px;
padding: 2px 15px;
margin: 0px;
font-size: 0.75em;
}
#footer {
font-weight: bold;
border: 1px solid black;
background-color: rgb(255,255,192);
width: 90%;
margin: 15px;
}
#footer p {
padding: 0px;
margin: 2px 5px;
}
#mainContent {
margin-bottom: 50px;
}
/* Old Stylesheet Values */
/*
body {
background-color : #FFFFFF;
font-family : Times New Roman;
color : #000000;
margin-left : 5px;
margin-right : 5px;
margin-top : 5px;
}
*/
A, A:visited {
color : #00129C;
text-decoration: none;
}
A:hover {
color: #FC5900;
}
/* Administration Section Classes */
table.listing {
width: 90%;
/* border-collapse: collapse;
margin: 5px; */
}
table.listing th {
text-align: left;
/* padding: 3px 10px; */
margin: 0px;
border-bottom:4px solid #2E64FF;
}
table.listing tr td {
background-color : #BFE0FB;
/* padding: 3px 10px; */
font-weight: bold;
margin: 1px;
/* border: 2px solid white; */
}
.tablehighlight {
background-color : #BFE0FB;
}
.hline {
border-bottom:4px solid #2E64FF;
height: 4px;
}
div.error {
color: #FF0000;
font-weight: bold;
}
div.success {
width: 550px;
font-size: 14pt;
font-weight: bold;
text-align:center;
margin: auto;
}
div.editbox {
border: solid 1px #000000;
width: 450px;
margin-left: 15px;
padding: 10px;
}
div.editbox h3 {
font-size: 14pt;
font-weight: bold;
border-bottom: solid 1px #000000;
padding: 0px;
}

View File

@ -5,7 +5,7 @@ session_start();
if ($_SESSION["logoncheck"] !=="YES" && strpos($_SERVER["SCRIPT_NAME"],"login.php")===false && strpos($_SERVER["SCRIPT_NAME"],"index.php")===false) {
$return_path="developers/index.php";
header("Location: http://$_SERVER[HTTP_HOST]/$return_path");
header("Location: http://$sitehostname/$return_path");
exit;
}
?>

View File

@ -37,13 +37,13 @@ $_SESSION["logoncheck"] = "$logoncheck";
$return_path="developers/main.php";
header("Location: https://$_SERVER[SERVER_NAME]/$return_path");
header("Location: http://$_SERVER[SERVER_NAME]/$return_path");
exit;
} else {
$return_path ="developers/index.php?login=failed";
header("Location: https://$_SERVER[SERVER_NAME]/$return_path");
header("Location: http://$_SERVER[SERVER_NAME]/$return_path");
exit;
}
?>

View File

@ -23,7 +23,7 @@ WHERE `approved` = '?' GROUP BY `URI` ORDER BY TV.DateUpdated ASC";
$num_result = mysql_num_rows($sql_result);
?>
<P>
<SPAN STYLE="font-weight:bold">Approval Queue Status: <A HREF="approval.php?function=approvalqueue"><?php echo"$num_result"; ?> Pending Approval</A></SPAN>
<SPAN STYLE="font-weight:bold">Approval Queue Status: <A HREF="approval.php"><?php echo"$num_result"; ?> Pending Approval</A></SPAN>
</P>
<?php } ?>