ini_set('session.use_only_cookies', true); session_set_cookie_params(0, $okt->config->app_path, '', isset($_SERVER['HTTPS']), true); } # Initialisation langues $okt->languages = new oktLanguages($okt); $okt->languages->load(); # Initialisation utilisateur courant $okt->user = new oktAuth($okt, OKT_COOKIE_AUTH_NAME, OKT_COOKIE_AUTH_FROM, $okt->config->app_path, '', isset($_SERVER['HTTPS'])); $okt->user->authentication(); $okt->user->initLanguage(OKT_COOKIE_LANGUAGE); # Initialisation localisation l10n::init(); l10n::set(OKT_LOCALES_PATH . '/' . $okt->user->language . '/main'); l10n::set(OKT_LOCALES_PATH . '/' . $okt->user->language . '/date'); # Défintion du fuseau horraire de l'utilisateur dt::setTZ($okt->user->timezone); # Initialisation navigations $okt->navigation = new oktNavigations($okt); # Initialisation du gestionnaire de modules $okt->modules = new oktModules($okt, OKT_MODULES_PATH, OKT_MODULES_URL); # initialisation du moteur de templates # enregistrement des répertoires de templates $okt->setTplDirectory(OKT_THEME_PATH . '/templates/%name%.php'); $okt->setTplDirectory(OKT_THEMES_PATH . '/default/templates/%name%.php'); # initialisation $okt->initTplEngine(); # assignation par défaut $okt->tpl->assign(array('okt' => $okt)); # Changement de langue utilisateur if (!empty($_REQUEST['switch_lang'])) { $okt->user->setUserLang($_REQUEST['switch_lang']);
} } } # Check if setting table exist $schema = dbSchema::init($core->con); if (in_array($core->prefix . 'setting', $schema->getTables())) { $blog_settings = new bpSettings($core, 'root'); $user_settings = null; /* Set backward compatibility */ if (!defined('BP_PLANET_URL')) { define('BP_PLANET_URL', $blog_settings->get('planet_url')); } # Set timezone $timezone_default = $blog_settings->get('planet_timezone'); if (!empty($timezone_default)) { dt::setTZ($timezone_default); } #date_default_timezone_set($timezone_default); # Set Locale $locale = $blog_settings->get('planet_lang'); # Set log level $log = $blog_settings->get('planet_log'); # Add the global values needed in template if (is_file(dirname(__FILE__) . '/../themes/' . $blog_settings->get('planet_theme') . '/index.tpl')) { $core->tpl->importFile('index', 'index.tpl', dirname(__FILE__) . '/../themes/' . $blog_settings->get('planet_theme')); $core->tpl->setVar('planet', array("url" => BP_PLANET_URL, "theme" => $blog_settings->get('planet_theme'), "title" => $blog_settings->get('planet_title'), "desc" => $blog_settings->get('planet_desc'), "keywords" => $blog_settings->get('planet_keywords'), "desc_meta" => $blog_settings->get('planet_desc_meta'), "msg_info" => $blog_settings->get('planet_msg_info'))); } else { print sprintf(T_("ERROR : The theme '%s' that is configured is not existing in the theme folder."), $blog_settings->get('planet_theme')); exit; } if ($core->auth->sessionExists()) {
# ***** END LICENSE BLOCK ***** /** @defgroup CLEARBRICKS Clearbricks classes */ define('CLEARBRICKS_VERSION', '0.8'); # Autoload $__autoload = array('crypt' => dirname(__FILE__) . '/lib.crypt.php', 'dt' => dirname(__FILE__) . '/lib.date.php', 'files' => dirname(__FILE__) . '/lib.files.php', 'path' => dirname(__FILE__) . '/lib.files.php', 'form' => dirname(__FILE__) . '/lib.form.php', 'formSelectOption' => dirname(__FILE__) . '/lib.form.php', 'html' => dirname(__FILE__) . '/lib.html.php', 'http' => dirname(__FILE__) . '/lib.http.php', 'text' => dirname(__FILE__) . '/lib.text.php'); # autoload for clearbricks function cb_autoload($name) { global $__autoload; if (isset($__autoload[$name])) { require_once $__autoload[$name]; } } # if php version >= 5.1.2, we can benefit from spl_autoload_register, # so other libraries can define their own independent autoload too if (function_exists("spl_autoload_register")) { spl_autoload_register("cb_autoload"); } else { # otherwise we define a classic autoload function for older php... function __autoload($name) { cb_autoload($name); } } # We only need l10n __() function #require_once dirname(__FILE__).'/lib.l10n.php'; # We set default timezone to avoid warning dt::setTZ('UTC');