⌈⌋ branch:  freshcode


Artifact Content

  • File index.php — part of check-in [5b7b92d159] at 2016-05-05 02:12:22 on branch trunk — Raise version to 0.8.3, add freshfoss.com as toplink. (user: mario

Artifact 2f6eeb0449eb1e862b0b9ce1962c331a0d3a0fe3:


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

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

#-- dispatch
$page = $_GET->id["page"];
switch (isset($page_alias[$page]) ? $page_alias[$page] : $page) {

    case "names":
    case "index":
    case "projects":
    case "feed":
    case "links":
    case "tags":
    case "search":
    case "rc":
    case "drchangelog":
    case "githubreleases":
    case "launchpadreleases":
    case "login":
    case "redir":
        include("page_$page.php");
        break;

    case "forum":
    case "meta":
        include("page_forum.php");
        break;

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

    case "api":
        $api = new FreeCode_API();
        $api->dispatch();
        break;

    case "ssl":
        if (HTTP_HOST === "test.freshcode.club") {
            include("page_test_ssl.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");
        
}


?>