|
From: Jon O. <jon...@us...> - 2005-05-01 15:41:15
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv857/admin Modified Files: admin_mx_gen_cache.php index.php pagestart.php Log Message: merging with my latest cache rewrites hey? should session_start be removed from gen_cache? Index: pagestart.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/pagestart.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pagestart.php 28 Apr 2005 04:13:50 -0000 1.11 --- pagestart.php 1 May 2005 15:41:06 -0000 1.12 *************** *** 54,68 **** // Security - used for block_edits // ! $block_id = $mx_request_vars->post('block_id', MX_TYPE_INT, 0); ! $block_config = read_block_config($block_id, false); ! $block_edit_auth = block_auth(AUTH_EDIT, $block_id, $userdata, $block_config[$block_id]['auth_edit'], $block_config[$block_id]['auth_edit_group']); ! if( !$userdata['session_logged_in'] ) { mx_redirect(append_sid("login.php?redirect=admin/index.$phpEx", true)); } ! if( !($userdata['user_level'] == ADMIN || $block_edit_auth['auth_edit']) ) { mx_message_die(GENERAL_MESSAGE, $lang['Not_admin']); --- 54,77 ---- // Security - used for block_edits // ! $block_id = $mx_request_vars->post('block_id', MX_TYPE_INT, '0'); ! if ( !empty( $block_id ) ) ! { ! $block_config = read_block_config( $block_id, false ); ! $block_edit_auth = array(); ! $block_edit_auth = block_auth( AUTH_EDIT, $block_id , $userdata, $block_config[$block_id][auth_edit], $block_config[$block_id][auth_edit_group] ); ! } ! else ! { ! $block_edit_auth['auth_edit'] = false; ! } ! ! if ( !$userdata['session_logged_in'] ) { mx_redirect(append_sid("login.php?redirect=admin/index.$phpEx", true)); } ! if ( !($userdata['user_level'] == ADMIN || $block_edit_auth['auth_edit'] ) ) { mx_message_die(GENERAL_MESSAGE, $lang['Not_admin']); Index: admin_mx_gen_cache.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_gen_cache.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** admin_mx_gen_cache.php 28 Apr 2005 04:13:49 -0000 1.16 --- admin_mx_gen_cache.php 1 May 2005 15:41:06 -0000 1.17 *************** *** 60,134 **** else { ! $HTTP_SESSION_VARS['cache_read'] = false; ! $cache_dir = $mx_root_path . 'cache/'; ! ! @mkdir($cache_dir, 0777); ! @chmod($cache_dir, 0777); ! ! if( !is_writable($cache_dir) ) ! { ! $message = $lang['Cache_dir_write_protect']; ! mx_message_die(GENERAL_MESSAGE, $message); ! } ! ! /* ! // Generate block data ! $sql = "SELECT blk.block_id ! , blk.block_title ! , blk.block_desc ! , blk.show_block ! , blk.show_title ! , blk.show_stats ! , blk.block_time ! , blk.block_editor_id ! , blk.function_id ! , blk.auth_view ! , blk.auth_edit ! , blk.auth_delete ! , blk.auth_view_group ! , blk.auth_edit_group ! , blk.auth_delete_group ! , blk.auth_moderator_group ! FROM " . BLOCK_TABLE . " blk"; ! ! db2xml($sql, $cache_dir . 'block_config.xml'); ! */ ! ! // Generate block parameter data ! $sql = "SELECT sys.parameter_id, ! sys.block_id, ! par.parameter_name, ! sys.parameter_value, ! sys.bbcode_uid ! FROM " . BLOCK_SYSTEM_PARAMETER_TABLE . " sys, ! " . PARAMETER_TABLE . " par ! WHERE sys.parameter_id = par.parameter_id ! ORDER BY sys.block_id, sys.parameter_id"; ! ! db2xml_all($sql, $cache_dir . 'block_'); ! ! /* ! // Generate page_blocks data ! $sql = "SELECT col.page_id, pag.page_name, pag.page_icon, pag.page_header, pag.page_graph_border, pag.auth_view AS pag_auth_view, pag.auth_view_group AS pag_auth_view_group, pag.auth_moderator_group AS pag_auth_moderator_group, bct.column_id, col.column_title, col.column_order, col.column_size, blk.block_id, blk.auth_view, blk.auth_view_group, blk.auth_edit, blk.auth_edit_group, blk.show_block, blk.show_title, blk.show_stats, blk.block_time, blk.block_editor_id, bct.column_id AS block_col_id, module_path, function_file, function_admin ! FROM " . COLUMN_BLOCK_TABLE . " bct, ! " . BLOCK_TABLE . " blk, ! " . FUNCTION_TABLE . " fnc, ! " . MODULE_TABLE . " mdl, ! " . PAGE_TABLE . " pag, ! " . COLUMN_TABLE . " col ! WHERE blk.function_id = fnc.function_id ! AND pag.page_id = col.page_id ! AND blk.block_id = bct.block_id ! AND fnc.module_id = mdl.module_id ! AND bct.column_id = col.column_id ! ORDER BY col.page_id, column_id, column_order, block_order"; ! ! db2xml($sql, $cache_dir . 'page_config.xml'); ! */ ! // ! // Update cache ! // ! update_session_cache($block_id); $message = $lang['Cache_generate']; --- 60,67 ---- else { ! // @session_start(); ??? Markus, should this be removed?? ! // Update mxBB cache ! $mx_cache->update( ); $message = $lang['Cache_generate']; Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/index.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** index.php 28 Apr 2005 04:15:13 -0000 1.7 --- index.php 1 May 2005 15:41:06 -0000 1.8 *************** *** 58,62 **** function read_admin($dir_module) { ! global $phpEx, $template; $module = array(); --- 58,62 ---- function read_admin($dir_module) { ! global $phpEx, $template, $lang; $module = array(); |