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; } /* * User submitted an application */ if (isset($_REQUEST['appName'])) { $errors = ""; // Check input and exit if we found errors $oApplication = new Application(); $errors .= $oApplication->CheckOutputEditorInput(); $oVersion = new Version(); $errors .= $oVersion->CheckOutputEditorInput(); if(empty($errors)) { if($_REQUEST['appVendorName']) { $_REQUEST['vendorId']=""; //FIXME: fix this when we fix vendor submission if($_SESSION['current']->hasPriv("admin")) { $oVendor = new Vendor(); $oVendor->create($_REQUEST['appVendorName'],$_REQUEST['appWebpage']); } } $oApplication->GetOutputEditorValues(); /* load the values from $_REQUEST */ //FIXME: remove this when we fix vendor submission $oApplication->sKeywords = $_REQUEST['appKeywords']." *** ".$_REQUEST['appVendorName']; $oApplication->create(); $oVersion->GetOutputEditorValues(); $oVersion->iAppId = $oApplication->iAppId; /* get the iAppId from the application that was just created */ $oVersion->create(); 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 $oVersion = new Version(); $errors = $oVersion->CheckOutputEditorInput(); if(empty($errors)) { $oVersion->GetOutputEditorValues(); $oVersion->create(); redirect(apidb_fullurl("index.php")); } } /* * User wants to submit an application or version */ if (isset($_REQUEST['apptype'])) { // header apidb_header("Submit Application"); // show add to queue form echo '
"; } apidb_footer(); ?>