Example #1
0
<?php

include 'core/common.php';
// decide which controller, action, ident
$runtime['url'] = parse_request($_SERVER['REQUEST_URI']);
include PATH_TO_ROUTES;
// decide which format
$runtime['format'] = parse_format(parse_request($_SERVER['REQUEST_URI'], false));
// revert to defaults if necessary
if (empty($runtime['controller'])) {
    $runtime['controller'] = $defaults['controller'];
}
if (empty($runtime['action'])) {
    $runtime['action'] = 'index';
}
// this will be included from wrapper.php
$runtime['view'] = PATH_TO_VIEWS . "{$runtime['format']}/{$runtime['controller']}/{$runtime['action']}.php";
$runtime['layout'] = PATH_TO_VIEWS . "{$runtime['format']}/layout.php";
// FIXME: this next line is ugly...
if ($runtime['action'] == 'list') {
    $runtime['action'] = 'all';
}
// 'list' is already a php function
// load, initialize the main class (if it's there and it's not a crazy url)
$controller_path = PATH_TO_CONTROLLERS . "{$runtime['controller']}-controller.php";
if (file_exists($controller_path)) {
    include $controller_path;
    eval("\$main_controller = new {$runtime['controller']}" . "_controller();");
    eval("\$main_controller -> {$runtime['action']}();");
} else {
    $runtime['notfound'] = true;
Example #2
0
<?php

ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '../lib');
require_once 'init.php';
require_once 'data.php';
require_once 'output.php';
list($response_format, $response_mime_type) = parse_format($_GET['format'], 'html');
$dbh =& get_db_connection();
if (get_request_user()) {
    // auth stuff here
}
$dbh = null;
$sm = get_smarty_instance();
if (get_request_user()) {
    // secure template vars here
}
header("Content-Type: {$response_mime_type}; charset=UTF-8");
print $sm->fetch("index.{$response_format}.tpl");
Example #3
0
$syndication_method = request_var('format', '');
$number_items = request_var('items', (int) $config['syndication_items']);
$global = $content != 'topic_posts' ? request_var('global', false) : false;
$folder = request_var('folder', '');
$http_auth = isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW']) ? true : false;
// do we have a guest and HTTP AUTH present?
if (($http_auth || $content == 'pm') && $user->data['user_id'] == ANONYMOUS) {
    if ($http_auth) {
        phpbb_login();
    } else {
        http_auth();
    }
}
// do not exceed the limit
$number_items > $config['syndication_items'] || $number_items < 0 ? $number_items = (int) $config['syndication_items'] : '';
$syndication_method = parse_format($syndication_method);
switch ($content) {
    case 'pm':
        if (!$config['allow_privmsg'] || !$auth->acl_get('u_readpm')) {
            $user->add_lang('ucp');
            trigger_error('PM_DISABLED');
        }
        switch ($folder) {
            case PRIVMSGS_INBOX:
                $folder = 'inbox';
                break;
            case PRIVMSGS_OUTBOX:
                $folder = 'outbox';
                break;
            case PRIVMSGS_SENTBOX:
                $folder = 'sentbox';