// set default engine to imdb if not set if (empty($config['enginedefault'])) { $config['enginedefault'] = 'imdb'; } // check permissions again - they may have changed if (!check_permission(PERM_ADMIN)) { redirect('login.php'); } // destroy cookies if required if ($_COOKIE['VDBusername'] && !$config['multiuser']) { setcookie('VDBpassword', '', time() - 7200); setcookie('VDBusername', '', time() - 7200); setcookie('VDBuserid', '', time() - 7200); } // cache maintenance if ($cacheempty) { // clear thumbnail cache runSQL('DELETE FROM ' . TBL_CACHE); // clean HTTP cache cache_prune_folders(CACHE . '/' . CACHE_HTML . '/', 0, true, false, '*', (int) $config['hierarchical']); // clean Smarty as well $smarty->clearAllCache(); } // prepare options $setup = setup_mkOptions(false); // prepare templates tpl_page('configview'); $smarty->assign('setup', $setup); $smarty->assign('cacheclear', $cacheempty); // display templates tpl_display('setup.tpl');
$user_id = get_current_user_id(); // really shouldn't happen if (empty($user_id)) { errorpage('Access denied', 'You don\'t have enough permissions to access this ' . 'page. Please <a href="login.php">login</a> first. ' . '(This feature is not available in Single User Mode)'); } // save data if ($save) { // convert languages array back into string $languageflags = @join('::', $languages); // insert data foreach ($SETUP_USER as $opt) { $SQL = "REPLACE INTO " . TBL_USERCONFIG . " (user_id, opt, value) \n VALUES ('" . addslashes($user_id) . "', '{$opt}', '" . addslashes(${$opt}) . "')"; runSQL($SQL); } // update session variables update_session(); // reload config load_config(true); /* // clear compiled templates for new template AG: should not be required $smarty->clear_compiled_tpl(null, $config['cacheid']); */ } // prepare options $setup = setup_mkOptions(true); // prepare templates tpl_page('profile'); $smarty->assign('setup', $setup); // display templates tpl_display('profile.tpl');