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; } $files = array(array("pathname" => $_FILES['patch']['tmp_name'], "filename" => "{$projectinfo['id']}.patch", "description" => "")); // Create the submission list($rc, $subid) = ff_submitcode($memberinfo["username"], $files, $comments, $projectinfo["id"]); if ($rc) { print "Error creating the submission: {$rc} {$error}\n"; exit; } if (ereg('^git@[-._a-z]+:([-_a-z0-9]+)(\\.git)?$', $origin, $regs)) { $origin = "/home/git/{$regs['1']}.git"; // Clone a similar repository, and rewind it back to the beginning. // We do this in order to have hard-linked copies of the objects. system("sudo -u git git clone --bare {$origin} /home/git/s{$subid}.git >/dev/null"); system("sudo -u git git --git-dir=/home/git/s{$subid}.git push /home/git/s{$subid}.git :master >/dev/null"); } else { // Create the repository system("sudo -u git mkdir /home/git/s{$subid}.git"); system("sudo -u git git --bare --git-dir=/home/git/s{$subid}.git init >/dev/null"); }
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"))); // Receive the first monthly sponsorship payment checkerr(ff_receivefunds( $sponsor, "950FFC", "$now-1", "50FFC", true, "Sponsor $now", "sponsor-$now@gignac.org", "CA", "N9H 2E5")); // Send a repeat payment event
$filenames = ''; if (isset($_REQUEST['submit'])) { foreach ($_FILES["thefile"]["error"] as $key => $error) { if (is_uploaded_file($_FILES['thefile']['tmp_name'][$key]) && $_FILES['thefile']['size'][$key] != 0) { $files[] = array('pathname' => $_FILES['thefile']['tmp_name'][$key], 'filename' => $_FILES['thefile']['name'][$key], 'description' => $_REQUEST['description'][$key]); $ferror[] = ''; } elseif ($_FILES['thefile']['name'][$key] == '') { $ferror[] = ''; } else { $iserror = true; $ferror[] = $_FILES['thefile']['error'][$key]; } } if (!$iserror) { //we only process the submission if no errors at all were encountered list($rc, $subid) = ff_submitcode($GLOBALS['username'], $files, $_REQUEST['comments'], $id); if (!$rc) { header("Location: subsuccess.php?id={$id}"); exit; } $msg = "There was a problem receiving your file: {$rc} {$subid}"; } else { $msg = "There was a problem in submitting your file(s)"; } } apply_template($projinfo["name"], array(array("name" => "Projects", "href" => "browse.php"), array("name" => $projinfo["name"], "href" => projurl($id)), array("name" => "submit code", "href" => "submission.php?id={$id}"))); ?> <h1>Make a Submission</h1> <?php if ($msg) { ?>