if (trim($name) && trim($reqmts)) { if ($_REQUEST["stopspam"] !== 'yes') { exit; } $tempdir = "{$GLOBALS['DATADIR']}/tempattachments/{$sid}"; $attachments = array(); foreach ($_REQUEST as $key => $filename) { if (!ereg("^attachment_filename_([a-zA-Z0-9]+)\$", $key, $parts)) { continue; } $basename = $parts[1]; $attachments[] = array('filename' => $filename, 'pathname' => "{$tempdir}/{$basename}", 'description' => ''); } $reqmts = trim($reqmts); $lead = $_REQUEST["makemelead"] ? $username : ($parent['lead'] ? $parent['lead'] : ''); list($rc, $id) = ff_createproject($username, $name, $reqmts, $p, $attachments, false, 'subproject', $lead, isset($_REQUEST["allotment"]) ? round(floatval($_REQUEST["allotment"]) * 10) : false); if (!$rc) { ff_setfundinggoal($username, $id, (int) ($fundgoal * 100) . $GLOBALS['pref_currency']); header("Location: " . projurl($id)); exit; } $err = $id; } apply_template("New Project", array(array("name" => "New Project", "href" => "newsubproject.php?p={$p}"))); if ($err) { print "<div class=error>" . htmlentities($err) . "</div>\n"; } ?> <h1>Create a New Subproject</h1> <?php if ($username == '') {
$currency = $currencies[$GLOBALS["pref_currency"]]; if (!$err && isset($_REQUEST["name"])) { $name = trim($name); $reqmts = trim($reqmts); $fundgoal2 = (int) ($fundgoal * 100); if ($_REQUEST["newproject_action"] === 'savedraft') { list($rc, $err) = ff_saveprojectdraft($username, $name, $fundgoal2, $reqmts, $draftid === '' ? false : $draftid); if ($rc) { header("Location: newproject.php?draft={$draftid}&name=" . urlencode($name) . "&reqmts=" . urlencode($reqmts) . "&err=1"); exit; } $draftid = $err; header("Location: account.php?tab=drafts"); exit; } list($rc, $id) = ff_createproject($username, $name, $reqmts, '', false, empty($draftid) ? false : $draftid); if (!$rc) { ff_setfundinggoal($username, $id, $fundgoal2 . $GLOBALS['pref_currency']); header("Location: " . projurl($id)); exit; } header("Location: newproject.php?draft={$draftid}&name=" . urlencode($name) . "&reqmts=" . urlencode($reqmts) . "&fundgoal=" . urlencode($fundgoal) . "&err=1"); exit; } apply_template("New Project", array(array("name" => "New Project", "href" => "newproject.php"))); if ($err) { print "<div class=error>" . htmlentities($err) . "</div>\n"; } ?> <h1>Create a New Project</h1> <script>
if (trim($reqmts)) { if ($_REQUEST["stopspam"] !== 'yes') { exit; } $tempdir = "{$GLOBALS['DATADIR']}/tempattachments/{$sid}"; $attachments = array(); foreach ($_REQUEST as $key => $filename) { if (!ereg("^attachment_filename_([a-zA-Z0-9]+)\$", $key, $parts)) { continue; } $basename = $parts[1]; $attachments[] = array('filename' => $filename, 'pathname' => "{$tempdir}/{$basename}", 'description' => ''); } $reqmts = trim($reqmts); $lead = "{$parent['lead']}"; list($rc, $id) = ff_createproject($username, '', $reqmts, $p, $attachments, false, $priority, $lead, isset($_REQUEST["allotment"]) ? round($allotment * 10) : false); if (!$rc) { if ($username !== '') { al_createwatch("{$id}-news", $username); } header("Location: " . projurl($p, "tab=subprojects")); exit; } $err = $id; } apply_template("Report a Bug", array(array("name" => "Report a Bug", "href" => "newbug.php?p={$p}"))); if ($err) { print "<div class=error>" . htmlentities($err) . "</div>\n"; } ?> <h1>Report a Bug</h1>
checkerr(ff_receivefunds($sponsor8, "1000000USD")); checkerr(ff_receivefunds($sponsor9, "1000000USD")); checkerr(ff_receivefunds($sponsor10, "1000000USD")); // Now set up sponsorships checkerr(ff_setsponsorship($E, $sponsor1, "535801CAD")); checkerr(ff_setsponsorship($E, $sponsor2, "1882CAD")); checkerr(ff_setsponsorship($E, $sponsor3, "3105CAD")); checkerr(ff_setsponsorship($E, $sponsor4, "1887EUR")); checkerr(ff_setsponsorship($E, $sponsor5, "111EUR")); checkerr(ff_setsponsorship($E, $sponsor6, "450USD")); checkerr(ff_setsponsorship($E, $sponsor7, "11538USD")); checkerr(ff_setsponsorship($E, $sponsor8, "7191USD")); checkerr(ff_setsponsorship($E, $sponsor9, "3854USD")); checkerr(ff_setsponsorship($E, $sponsor10, "67USD")); // Create a subproject list($rc, $F) = ff_createproject($sponsor1, "F-{$now}", "This project is for testing purposes only. " . "Do not submit a solution unless you are a test script.", $E); checkerr($rc, $F); // Allot funds to the subproject checkerr(ff_setallotment($sponsor1, $E, $F, 700)); // Create a submission list($rc, $sub_F1) = ff_submitcode($developer, array(array("pathname" => realpath("./test-payout.php"), "filename" => "test-payout.php", "description" => "")), "", $F); checkerr($rc, $sub_F1); // Accept the submission checkerr(ff_acceptsubmission($sponsor1, $sub_F1)); // Set the payout time to be immediately and execute the payout. checkerr(admin_expedite_payout($F)); /* // Set up a monthly sponsorship checkerr(ff_setsubscription($sponsor,"1000FFC","monthly", array($A => "100FFC", $D => "50000FFC")));
$userid = "{$_REQUEST['u']}"; $password = "******"; $name = "{$_REQUEST['name']}"; $reqmts = "{$_REQUEST['reqmts']}"; $hostname = $_SERVER["HTTP_HOST"]; if ($hostname === "www.fossfactory.org") { $hostname = "git.fossfactory.org"; } list($rc, $projectinfo) = ff_getprojectinfo("{$_REQUEST['id']}"); if ($rc) { print $rc == 2 ? "No such project: {$_REQUEST['id']}\n" : "System Error.\n"; exit; } // Do some basic validation list($rc, $memberinfo) = ff_getmemberinfo($userid); if ($rc) { print $rc == 2 ? "Login Incorrect.\n" : "System Error.\n"; exit; } list($rc, $err) = ff_checkpassword($memberinfo["encpwd"], $password); if ($rc) { print $rc == 5 ? "Login Incorrect.\n" : "System Error.\n"; exit; } // Create the subproject list($rc, $id) = ff_createproject($memberinfo["username"], $name, $reqmts, $projectinfo['id']); if ($rc) { print "Error creating the subproject: {$rc} {$error}\n"; exit; } print "{$id}\n";