Exemple #1
0
 static function authenticate($redirect = "/")
 {
     if ($_SESSION['auth'] == true) {
         return true;
     } elseif ($redirect) {
         \app\inc\Redirect::to($redirect);
         exit;
     } else {
         \app\inc\Redirect::to("/nosession.php");
         exit;
     }
 }
Exemple #2
0
    new \app\controllers\Wms();
} elseif (Input::getPath()->part(1) == "wmsc") {
    Session::start();
    new \app\controllers\Wmsc();
} elseif (Input::getPath()->part(1) == "wfs") {
    Session::start();
    $db = Input::getPath()->part(2);
    $dbSplit = explode("@", $db);
    if (sizeof($dbSplit) == 2) {
        $db = $dbSplit[1];
        $user = $dbSplit[0];
        $parentUser = false;
    } else {
        $user = $db;
        $parentUser = true;
    }
    Database::setDb($db);
    Connection::$param["postgisschema"] = Input::getPath()->part(3);
    include_once "app/wfs/server.php";
} elseif (!Input::getPath()->part(1)) {
    if (App::$param["redirectTo"]) {
        \app\inc\Redirect::to(App::$param["redirectTo"]);
    } else {
        \app\inc\Redirect::to("/user/login");
    }
} else {
    header('HTTP/1.0 404 Not Found');
    echo "<h1>404 Not Found</h1>";
    echo "The page that you have requested could not be found.";
    exit;
}