Ejemplo n.º 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}" : ""));
Ejemplo n.º 2
0
        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);
    }
    // Get all of our current donations