Exemplo n.º 1
0
///////////////////////////////////////////////////
if ($_GET['uilang']) {
    $page->setUILanguage($_GET['uilang']);
    $url = $_GET['okURL'];
    if (!$url) {
        $url = $config['localPrefix'];
    }
    $page->redirect($url);
    exit;
}
// we need trick for making pages indexed by Google
// therefore we pass some parameters in pathinfo
// after this call getParameter can be used to get these parameters as well
$pathinfoParamExceptions = array('getIcon', 'getJingle', 'getUserFile');
if (!in_array($page->action, $pathinfoParamExceptions)) {
    sotf_Utils::collectPathinfoParams();
}
// permissions object is for managing and asking for permissions
$permissions = new sotf_Permission();
//$permissions->debug = true;
// the repository of radio stations
$repository = new sotf_Repository($config['repositoryDir'], $db);
// all controlled vocabularies
$vocabularies = new sotf_Vocabularies($db);
// now you have the following global objects: $config, $db, $userdb, $smarty, $page, $repository, $user, $permission
// is that too many?
// forwarding all $config to smarty is a security risk
// $smarty->assign("CONFIG", $config);
// add basic variables to Smarty
$smarty->assign("NODEID", $config['nodeId']);
$smarty->assign("NODE_NAME", $config['nodeName']);