isLoggedIn())
{
// you must be logged in to submit app
apidb_header("Please login");
echo "To submit an application to the database you must be logged in. Please login now or create a new account.","\n";
exit;
}
// Check the input of a submitted form. And output with a list
// of errors. (
)
function checkInput($fields)
{
$errors = "";
if (strlen($fields['appName']) > 200 )
$errors .= "
Your application name is too long.
\n";
if (empty($fields['appName']) && !$fields['appId'])
$errors .= "
Please enter an application name.
\n";
if (empty($fields['versionName']))
$errors .= "
Please enter an application version.
\n";
// No vendor entered, and nothing in the list is selected
if (empty($fields['vendorName']) && !$fields['vendorId'] && !$fields['appId'])
$errors .= "
Please enter a vendor.
\n";
if (empty($fields['appDescription']) && !$fields['appId'])
$errors .= "
Please enter a description of your application.
\n";
if (empty($errors))
return "";
else
return $errors;
}
/*
* User submitted an application
*/
if (isset($_REQUEST['appName']))
{
// Check input and exit if we found errors
$errors = checkInput($_REQUEST);
if(!empty($errors))
{
errorpage("We found the following errors:","
$errors
Please go back and correct them.");
echo html_back_link(1);
exit;
}
if($vendorName) $_REQUEST['vendorId']="";
$oApplication = new Application();
$oApplication->create($_REQUEST['appName'], $_REQUEST['appDescription'], $_REQUEST['keywords']." *** ".$_REQUEST['vendorName'], $_REQUEST['webpage'],$_REQUEST['vendorId'], $_REQUEST['catId']);
$oVersion = new Version();
$oVersion->create($_REQUEST['versionName'], $_REQUEST['versionDescription'], null, null, $oApplication->iAppId);
redirect(apidb_fullurl("index.php"));
}
/*
* User submitted a version
*/
elseif (isset($_REQUEST['versionName']) && is_numeric($_REQUEST['appId']))
{
// Check input and exit if we found errors
$errors = checkInput($_REQUEST);
if(!empty($errors))
{
errorpage("We found the following errors:","
$errors
Please go back and correct them.");
echo html_back_link(1);
exit;
}
$oVersion = new Version();
$oVersion->create($_REQUEST['versionName'], $_REQUEST['versionDescription'], null, null, $_REQUEST['appId']);
redirect(apidb_fullurl("index.php"));
}
/*
* User wants to submit an application or version
*/
elseif (isset($_REQUEST['apptype']))
{
//FIXME: use absolute path in htmlarea_loader.js to avoid code duplication here
?>
Enter description here";
$sVersionDescription = "
This is a template; enter version-specific description here
Wine compatibility What works:
- settings
- help
What doesn't work:
- erasing
What was not tested:
- burning
Tested versions
App. version
Wine version
Installs?
Runs?
Rating
3.23
20050111
yes
yes
Gold
3.23
20041201
yes
yes
Silver
3.21
20040615
yes
yes
Bronze
";
// header
apidb_header("Submit Application");
// show add to queue form
echo '";
}
// new version
else
{
echo html_frame_start("New Version Form",400,"",0);
echo "
\n";
// app parent
$x = new TableVE("view");
echo '