示例#1
0
function auth_filter($req, $pipeline)
{
    if (isset($_SESSION['authenticated']) and is_equal($_SESSION['authenticated'], true)) {
        return next_func($req, $pipeline);
    } else {
        return array('template' => 'error', 'error_msg' => "You don't seem to be logged in. Go back, login and try again.");
    }
}
示例#2
0
function map_request_to_handler($req, $routes)
{
    if ($route = route_match($routes, $req)) {
        $req['path'] = $route['path_matches'];
        exit_with_mojo_flush_response($req, next_func($req, $route['funcs']));
    }
    exit_with_404_plain('Not Found');
}