Exemple #1
0
function conf($key)
{
    list($rc, $val) = ff_config($key, '');
    if ($rc) {
        exit;
    }
    // A special case for supporting fake PayPal in FOSS Factory sandboxes.
    if (substr($key, 0, 7) === 'paypal_' && substr($val, 0, 5) === 'fake-') {
        return "{$GLOBALS['SITE_URL']}{$val}";
    }
    return $val;
}
Exemple #2
0
        $rc1 = $rc1[0];
    }
    if ($rc1) {
        $backtrace = debug_backtrace();
        print "Error in line " . $backtrace[0][line] . ": {$rc1} {$rc2}<br>\n";
        exit;
    }
}
function get_FFC($money)
{
    return intval(currency_value($money, "FFC"));
}
$now = time();
print "now={$now}<br>\n";
// Get the secret
list($rc, $secret) = ff_config('secret');
checkerr($rc, $secret);
// Create a project lead user
list($rc, $projectlead) = ff_createmember('', $secret, "Project Lead {$now}", "lead-{$now}@gignac.org");
checkerr($rc, $projectlead);
// Put some money in our reserve
checkerr(ff_receivefunds($projectlead, "50000FFC"));
// Create a project
list($rc, $A) = ff_createproject($projectlead, "A-{$now}", "This project is for testing purposes only.  " . "Do not submit a solution unless you are a test script.");
checkerr($rc, $A);
// Sponsor the project
checkerr(ff_setsponsorship($A, $projectlead, "20000FFC"));
// Create a pure sponsor
list($rc, $sponsor) = ff_createmember('', $secret, "Sponsor {$now}", "sponsor-{$now}@gignac.org");
checkerr($rc, $sponsor);
// Put some money in the sponsor's reserve
Exemple #3
0
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Fossfactory-src is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with Fossfactory-src.  If not, see <http://www.gnu.org/licenses/>.
*/
$tab = scrub($_REQUEST["tab"]);
if (isset($_REQUEST["p"])) {
    $id = scrub($_REQUEST["p"]);
    list($rc, $niceurls) = ff_config("niceurls", "");
    if ($rc == 0 && $niceurls) {
        $query = substr(ereg_replace("&p=[^&]*", "", "&" . trim($_SERVER["QUERY_STRING"])), 1);
        header("HTTP/1.1 301 Moved Permanently");
        header("Location: {$GLOBALS['SITE_URL']}" . projurl($id, "{$query}"));
        exit;
    }
} else {
    $id = scrub(substr(getenv("PATH_INFO"), 1));
}
if (isset($_REQUEST["newname"])) {
    ff_renameproject($username, $id, $_REQUEST["newname"]);
    header("Location: {$GLOBALS['SITE_URL']}" . projurl($id, "tab=" . urlencode($tab)));
    exit;
} else {
    if (isset($_REQUEST["delete"])) {