Example #1
0
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/>.
*/
$id = scrub($_REQUEST["id"]);
$tab = scrub($_REQUEST["tab"]);
$stop = intval($_REQUEST["stop"]);
if ($GLOBALS["username"]) {
    // Get a list of the current watches
    list($rc, $watches) = al_getwatches($GLOBALS["username"], "{$id}-news");
    if (!$rc) {
        if ($stop) {
            // Make sure the user isn't the project lead.
            // This is just a sanity check since the project lead
            // doesn't have any UI to stop watching.  It still doesn't
            // prevent all possible race conditions, but it should be fine.
            list($rc, $projinfo) = ff_getprojectinfo($id);
            if (!$rc && $projinfo['lead'] !== $GLOBALS["username"]) {
                foreach ($watches as $watch) {
                    al_destroywatch($watch["watchid"]);
                }
            }
        } else {
            if (sizeof($watches) == 0) {
                al_createwatch("{$id}-news", $GLOBALS["username"]);
            }
        }
    }
}
header("Location: " . projurl($id, $tab ? "tab={$tab}" : ""));
Example #2
0
    }
    $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>
<script>
function checkAllot() {
    f = document.form;
Example #3
0
        }
        header("Location: " . projurl($id, "post={$postid}" . ($parent ? "#p{$parent}" : "")));
        exit;
    }
} elseif (substr($topicid, 0, 5) == 'spect') {
    $disputeid = scrub($_REQUEST['disputeid']);
    $id = substr($topicid, 5);
    if (isset($_REQUEST["subject"])) {
        list($rc, $postid) = ff_createpost("{$topicid}", "{$_REQUEST['subject']}", "{$_REQUEST['body']}", $parent, $_REQUEST["anonymous"] ? '' : $username, '', $attachments, $_REQUEST["watchthread"] ? 1 : 0, "dispute.php?id={$disputeid}");
        header("Location: dispute.php?id={$disputeid}&post={$postid}" . ($parent ? "#p{$parent}" : ""));
        exit;
    }
} elseif (substr($topicid, 0, 4) == 'proj') {
    $id = substr($topicid, 4);
    if ($username !== '' && $_REQUEST["watchproject"]) {
        al_createwatch('$id-news', $username);
    }
    if (isset($_REQUEST["subject"])) {
        list($rc, $postid) = ff_createpost("{$topicid}", "{$_REQUEST['subject']}", "{$_REQUEST['body']}", $parent, $_REQUEST["anonymous"] ? '' : $username, '', $attachments, $_REQUEST["watchthread"] ? 1 : 0, projurl($id));
        header("Location: " . projurl($id, "post={$postid}" . ($parent ? "#p{$parent}" : "")));
        exit;
    }
} elseif (substr($topicid, 0, 8) == 'feedback') {
    if (isset($_REQUEST["subject"])) {
        $tab = substr($topicid, 8);
        list($rc, $postid) = ff_createpost("{$topicid}", "{$_REQUEST['subject']}", "{$_REQUEST['body']}", $parent, $_REQUEST["anonymous"] ? '' : $username, '', $attachments, $_REQUEST["watchthread"] ? 1 : 0, "feedback.php" . ($tab ? "?tab={$tab}" : ""));
        header("Location: feedback.php?post={$postid}" . ($tab ? "&tab={$tab}" : "") . ($parent ? "#p{$parent}" : ""));
        exit;
    }
} elseif (substr($topicid, 0, 4) == 'subm') {
    $id = substr($topicid, 4);
Example #4
0
    if ($rc[0]) {
        print "{$rc['0']} {$rc['1']}";
        exit;
        header("Location: account.php?tab=prefs&err=1");
        exit;
    }
    if (sizeof($news) > 0 != ("{$_REQUEST['news']}" === "1")) {
        if ($_REQUEST["news"]) {
            al_createwatch("news", $username);
        } else {
            al_destroywatch($news[0]["watchid"]);
        }
    }
    if (sizeof($promos) > 0 != ("{$_REQUEST['promos']}" === "1")) {
        if ($_REQUEST["promos"]) {
            al_createwatch("promos", $username);
        } else {
            al_destroywatch($promos[0]["watchid"]);
        }
    }
    header("Location: account.php?tab=prefs");
    exit;
}
if (isset($_REQUEST['assigncredits'])) {
    // Get a list of the sponsorships keyed by project ID.
    $donations = array();
    foreach ($_REQUEST as $key => $value) {
        if (substr($key, 0, 6) !== 'assign') {
            continue;
        }
        $donations[substr($key, 6)] = floor($value * 100);