⌈⌋ branch:  freshcode


Artifact [9bc8bb30cd]

Artifact 9bc8bb30cd7f5aa9e6054567169c0c5c3df27602:

  • File index.php — part of check-in [2e1e35664b] at 2014-06-25 06:10:43 on branch trunk — Initial website implementation: project submit, index listing, projects/ page, and moderation flags. (user: mario size: 945)

<?php
/**
 * api: php
 * title: Freshcode.club
 * description: FLOSS software release tracking website
 * version: 0.1
 * author: mario
 * license: MITL
 * 
 * Implements a freshmeat/freecode-like directory for open source
 * release publishing / tracking.
 *
 */


#-- init
include("config.php");


#-- dispatch
switch ($page = $_GET->id["page"]) {

    case "index":
    case "projects":
    case "feed":
    case "links":
    case "tags":
        include("page_$page.php");
        break;

    case "flag":
    case "submit":
        if (LOGIN_REQUIRED and empty($_SESSION["openid"])) {
            exit(include("page_login.php"));
        }
        include("page_$page.php");
        break;

    case "admin":
        if (!in_array($_SESSION["openid"], $moderator_ids)) {
            exit(include("page_login.php"));
        }
        include("page_admin.php");
        break;

    default:
        include("page_error.php");
        
}


?>