Esempio n. 1
0
date_default_timezone_set('Europe/London');
require_once BASEPATH . 'lib/Venue.php';
require_once BASEPATH . 'lib/Event.php';
require_once BASEPATH . 'lib/User.php';
require_once BASEPATH . 'lib/Feeds.php';
require_once BASEPATH . 'lib/template_utils.php';
$options = parse_ini_file(BASEPATH . 'echo.ini', true);
define("READONLY", $options['db']['readonly']);
$f3->set('readonly', READONLY);
$f3->set('version', VERSION);
$f3->set('DEBUG', $options['general']['debug']);
$f3->set("domain", $options['general']['domain']);
$db = new DB\SQL("sqlite:" . BASEPATH . $options['general']['db']);
Events::init($db);
User::init($db);
Feeds::init($db);
$f3->set('appname', $options['general']['name']);
function admin_check($reroute = TRUE)
{
    global $f3;
    if (!isset($_SESSION['admin'])) {
        if ($reroute) {
            $f3->reroute("/admin/login");
            exit;
        }
    } else {
        $f3->set("admin", TRUE);
    }
}
function readonly_check()
{