$approval_result = process_approval($type, $file, "deny"); } else { echo "Error: Denial cannot be processed because of missing data. Fill in the required fields and try again.<br>\n"; } } } else { if ($type == "E") { if ($approval == "YES") { if ($installation == "YES" and $uninstallation == "YES" and $appworks == "YES" and $cleanprofile == "YES" and $newchrome == "YES" and $worksasdescribed == "YES" and $testos and $testbuild) { $approval_result = process_approval($type, $file, "approve"); } else { echo "Error: Approval cannot be processed because of missing data. Fill in the required fields and try again.<br>\n"; } } else { if ($testos and $testbuild and $comments) { $approval_result = process_approval($type, $file, "deny"); } else { echo "Error: Denial cannot be processed because of missing data. Fill in the required fields and try again.<br>\n"; } } } } //Approval for this file was successful, print the output message. $name = escape_string($_POST["name_{$i}"]); $version = escape_string($_POST["version_{$i}"]); if ($approval_result) { if ($approval == "YES") { echo "{$name} {$version} was granted approval<br>\n"; } else { if ($approval == "NO") { echo "{$name} {$version} was denied approval<br>\n";
foreach ($vid_array as $vid) { $sql = "UPDATE `version` SET `URI`='{$uri}' WHERE `vID`='{$vid}'"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error " . mysql_errno() . ": " . mysql_error() . "", E_USER_NOTICE); } //Approval Queue //Check if the item belongs to the user, (special case for where admins are trusted, the trust only applies to their own work.) $sql = "SELECT `UserID` from `authorxref` WHERE `ID`='{$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" and $_SESSION["trusted"] == "TRUE") { //User is trusted and the item they're modifying inheirits that trust. include "inc_approval.php"; //Get the resuable process_approval() function. $action = "Approval+"; $file = $uri; $comments = "Auto-Approval for Trusted User"; $approval_result = process_approval($type, $file, "approve"); } else { $action = "Approval?"; $comments = ""; } //Firstly, log the comments and action taken.. $userid = $_SESSION["uid"]; if (!$vid_array) { $vid_array = array(); } foreach ($vid_array as $vid) { $sql = "INSERT INTO `approvallog` (`ID`, `vID`, `UserID`, `action`, `date`, `comments`) VALUES ('{$id}', '{$vid}', '{$userid}', '{$action}', NOW(NULL), '{$comments}');"; $sql_result = mysql_query($sql, $connection) or trigger_error("MySQL Error " . mysql_errno() . ": " . mysql_error() . "", E_USER_NOTICE); } echo "Process Complete...<br><br>\n"; echo "{$name} version {$version} has been added to the Mozilla Update database";