|
From: Markus P. <mar...@us...> - 2005-04-19 21:36:46
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20438 Modified Files: page_footer_admin.php page_header_admin.php pagestart.php Log Message: Admin page header/footer synchronized with phpBB 2.0.14 Index: pagestart.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/pagestart.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pagestart.php 12 Apr 2005 17:38:36 -0000 1.9 --- pagestart.php 19 Apr 2005 21:36:37 -0000 1.10 *************** *** 19,66 **** */ /** * MX Notes: ! * This file is borrowed from phpBB, with some modifications ! * Also, the BLOCK_EDIT switch makes this file accessible when editing blocks in portal mode */ ! if ( !defined( 'IN_PORTAL' ) ) { ! die( "Hacking attempt" ); } ! define( 'IN_ADMIN', true ); ! include_once( $mx_root_path . 'extension.inc' ); ! include_once( $mx_root_path . 'common.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_admincp.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_admin.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_post.' . $phpEx ); // Start session management ! ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); ! // End session management // 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 = array(); ! $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'] ) { //die(append_sid( $mx_root_path . "login.php?redirect=admin/" . $mx_admin_file, true )); ! mx_redirect( append_sid( "login.php?redirect=admin/" . $mx_admin_file, true ) ); } ! if ( !($userdata['user_level'] == ADMIN || $block_edit_auth[auth_edit] ) ) { ! mx_message_die( GENERAL_MESSAGE, $lang['Not_admin'] ); } --- 19,71 ---- */ + // ================================================================================ + // The following code is based on admin/pagestart.php (phpBB 2.0.14) + // ================================================================================ + /** * MX Notes: ! * The BLOCK_EDIT switch makes this file accessible when editing blocks in portal mode. */ ! if ( !defined('IN_PORTAL') ) { ! die("Hacking attempt"); } ! define('IN_ADMIN', true); ! include_once($mx_root_path . 'extension.inc'); ! include_once($mx_root_path . 'common.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_admincp.' . $phpEx); ! include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); ! include_once($phpbb_root_path . 'includes/functions_post.' . $phpEx); + // // Start session management ! // ! $userdata = session_pagestart($user_ip, PAGE_INDEX); ! mx_init_userprefs($userdata); ! // // End session management + // + // // 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'] ) { //die(append_sid( $mx_root_path . "login.php?redirect=admin/" . $mx_admin_file, true )); ! mx_redirect(append_sid("login.php?redirect=admin/" . $mx_admin_file, true)); } ! if ( !($userdata['user_level'] == ADMIN || $block_edit_auth['auth_edit'] ) ) { ! mx_message_die(GENERAL_MESSAGE, $lang['Not_admin']); } *************** *** 74,85 **** $url .= ( ( strpos( $url, '?' ) ) ? '&' : '?' ) . 'sid=' . $userdata['session_id']; ! mx_redirect( "index.$phpEx?sid=" . $userdata['session_id'] ); } ! if ( empty( $no_page_header ) ) ! { // Not including the pageheader can be neccesarry if META tags are // needed in the calling script. ! include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } --- 79,90 ---- $url .= ( ( strpos( $url, '?' ) ) ? '&' : '?' ) . 'sid=' . $userdata['session_id']; ! mx_redirect("index.$phpEx?sid=" . $userdata['session_id']); } ! if ( empty($no_page_header) ) ! { // Not including the pageheader can be neccesarry if META tags are // needed in the calling script. ! include($mx_root_path . 'admin/page_header_admin.' . $phpEx); } Index: page_header_admin.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/page_header_admin.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** page_header_admin.php 14 Mar 2005 20:56:21 -0000 1.6 --- page_header_admin.php 19 Apr 2005 21:36:37 -0000 1.7 *************** *** 19,62 **** */ ! /** ! * MX Notes: ! * This file is borrowed from phpBB, with some commented modifications ! */ ! if ( !defined( 'IN_PORTAL' ) ) { ! die( "Hacking attempt" ); } ! define( 'HEADER_INC', true ); // gzip_compression ! ! $do_gzip_compress = false; if ( $board_config['gzip_compress'] ) { $phpver = phpversion(); ! $useragent = ( isset( $_SERVER["HTTP_USER_AGENT"] ) ) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT; ! if ( $phpver >= '4.0.4pl1' && ( strstr( $useragent, 'compatible' ) || strstr( $useragent, 'Gecko' ) ) ) { ! if ( extension_loaded( 'zlib' ) ) { @ob_end_clean(); ! ob_start( 'ob_gzhandler' ); } } else if ( $phpver > '4.0' ) { ! if ( strstr( $HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip' ) ) { ! if ( extension_loaded( 'zlib' ) ) { ! $do_gzip_compress = true; ob_start(); ! ob_implicit_flush( 0 ); ! header( 'Content-Encoding: gzip' ); } } --- 19,62 ---- */ ! // ================================================================================ ! // The following code is based on admin/page_header_admin.php (phpBB 2.0.14) ! // ================================================================================ ! if ( !defined('IN_PORTAL') ) { ! die("Hacking attempt"); } ! define('HEADER_INC', true); + // // gzip_compression ! // ! $do_gzip_compress = FALSE; if ( $board_config['gzip_compress'] ) { $phpver = phpversion(); ! $useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT'); ! if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) ) { ! if ( extension_loaded('zlib') ) { @ob_end_clean(); ! ob_start('ob_gzhandler'); } } else if ( $phpver > '4.0' ) { ! if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') ) { ! if ( extension_loaded('zlib') ) { ! $do_gzip_compress = TRUE; ob_start(); ! ob_implicit_flush(0); ! header('Content-Encoding: gzip'); } } *************** *** 64,140 **** } ! $template->set_filenames( array( 'header' => 'admin/page_header.tpl' ) ! ); // Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility ! $l_timezone = explode( '.', $board_config['board_timezone'] ); ! $l_timezone = ( count( $l_timezone ) > 1 && $l_timezone[count( $l_timezone )-1] != 0 ) ? $lang[sprintf( '%.1f', $board_config['board_timezone'] )] : $lang[number_format( $board_config['board_timezone'] )]; // The following assigns all _common_ variables that may be used at any point // in a template. Note that all URL's should be wrapped in append_sid, as // should all S_x_ACTIONS for forms. ! $template->assign_vars( array( 'SITENAME' => $board_config['sitename'], ! 'PAGE_TITLE' => $page_title, ! ! 'L_ADMIN' => $lang['Admin'], ! 'L_INDEX' => sprintf( $lang['Forum_Index'], $board_config['sitename'] ), ! 'L_FAQ' => $lang['FAQ'], ! 'U_INDEX' => append_sid( '../index.' . $phpEx ), ! 'S_TIMEZONE' => sprintf( $lang['All_times'], $l_timezone ), ! 'S_LOGIN_ACTION' => append_sid( '../login.' . $phpEx ), ! 'S_JUMPBOX_ACTION' => append_sid( '../viewforum.' . $phpEx ), ! 'S_CURRENT_TIME' => sprintf( $lang['Current_time'], create_date( $board_config['default_dateformat'], time(), $board_config['board_timezone'] ) ), ! 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], ! 'S_CONTENT_ENCODING' => $lang['ENCODING'], ! 'S_CONTENT_DIR_LEFT' => $lang['LEFT'], ! 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], ! // MX ADDON ! 'L_MX_ADMIN' => 'MX-System Portal Administration', ! 'U_PHPBB_ROOT_PATH' => PHPBB_URL, ! 'U_PORTAL_ROOT_PATH' => PORTAL_URL, ! 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, ! // END ! 'T_HEAD_STYLESHEET' => $theme['head_stylesheet'], ! 'T_BODY_BACKGROUND' => $theme['body_background'], ! 'T_BODY_BGCOLOR' => '#' . $theme['body_bgcolor'], ! 'T_BODY_TEXT' => '#' . $theme['body_text'], ! 'T_BODY_LINK' => '#' . $theme['body_link'], ! 'T_BODY_VLINK' => '#' . $theme['body_vlink'], ! 'T_BODY_ALINK' => '#' . $theme['body_alink'], ! 'T_BODY_HLINK' => '#' . $theme['body_hlink'], ! 'T_TR_COLOR1' => '#' . $theme['tr_color1'], ! 'T_TR_COLOR2' => '#' . $theme['tr_color2'], ! 'T_TR_COLOR3' => '#' . $theme['tr_color3'], ! 'T_TR_CLASS1' => $theme['tr_class1'], ! 'T_TR_CLASS2' => $theme['tr_class2'], ! 'T_TR_CLASS3' => $theme['tr_class3'], ! 'T_TH_COLOR1' => '#' . $theme['th_color1'], ! 'T_TH_COLOR2' => '#' . $theme['th_color2'], ! 'T_TH_COLOR3' => '#' . $theme['th_color3'], ! 'T_TH_CLASS1' => $theme['th_class1'], ! 'T_TH_CLASS2' => $theme['th_class2'], ! 'T_TH_CLASS3' => $theme['th_class3'], ! 'T_TD_COLOR1' => '#' . $theme['td_color1'], ! 'T_TD_COLOR2' => '#' . $theme['td_color2'], ! 'T_TD_COLOR3' => '#' . $theme['td_color3'], ! 'T_TD_CLASS1' => $theme['td_class1'], ! 'T_TD_CLASS2' => $theme['td_class2'], ! 'T_TD_CLASS3' => $theme['td_class3'], ! 'T_FONTFACE1' => $theme['fontface1'], ! 'T_FONTFACE2' => $theme['fontface2'], ! 'T_FONTFACE3' => $theme['fontface3'], ! 'T_FONTSIZE1' => $theme['fontsize1'], ! 'T_FONTSIZE2' => $theme['fontsize2'], ! 'T_FONTSIZE3' => $theme['fontsize3'], ! 'T_FONTCOLOR1' => '#' . $theme['fontcolor1'], ! 'T_FONTCOLOR2' => '#' . $theme['fontcolor2'], ! 'T_FONTCOLOR3' => '#' . $theme['fontcolor3'], ! 'T_SPAN_CLASS1' => $theme['span_class1'], ! 'T_SPAN_CLASS2' => $theme['span_class2'], ! 'T_SPAN_CLASS3' => $theme['span_class3'] ! ) ); ! $template->pparse( 'header' ); ?> \ No newline at end of file --- 64,144 ---- } ! $template->set_filenames(array( ! 'header' => 'admin/page_header.tpl') ! ); ! // Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility ! $l_timezone = explode('.', $board_config['board_timezone']); ! $l_timezone = (count($l_timezone) > 1 && $l_timezone[count($l_timezone)-1] != 0) ? $lang[sprintf('%.1f', $board_config['board_timezone'])] : $lang[number_format($board_config['board_timezone'])]; + // // The following assigns all _common_ variables that may be used at any point // in a template. Note that all URL's should be wrapped in append_sid, as // should all S_x_ACTIONS for forms. + // + $template->assign_vars(array( + 'SITENAME' => $board_config['sitename'], + 'PAGE_TITLE' => $page_title, ! 'L_ADMIN' => $lang['Admin'], ! 'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']), ! 'L_FAQ' => $lang['FAQ'], ! 'U_INDEX' => append_sid('../index.'.$phpEx), ! 'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone), ! 'S_LOGIN_ACTION' => append_sid('../login.'.$phpEx), ! 'S_JUMPBOX_ACTION' => append_sid('../viewforum.'.$phpEx), ! 'S_CURRENT_TIME' => sprintf($lang['Current_time'], create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), ! 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], ! 'S_CONTENT_ENCODING' => $lang['ENCODING'], ! 'S_CONTENT_DIR_LEFT' => $lang['LEFT'], ! 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], ! // MX ADDON ! 'L_MX_ADMIN' => 'mxBB-Portal Administration', ! 'U_PHPBB_ROOT_PATH' => PHPBB_URL, ! 'U_PORTAL_ROOT_PATH' => PORTAL_URL, ! 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, ! // END ! 'T_HEAD_STYLESHEET' => $theme['head_stylesheet'], ! 'T_BODY_BACKGROUND' => $theme['body_background'], ! 'T_BODY_BGCOLOR' => '#'.$theme['body_bgcolor'], ! 'T_BODY_TEXT' => '#'.$theme['body_text'], ! 'T_BODY_LINK' => '#'.$theme['body_link'], ! 'T_BODY_VLINK' => '#'.$theme['body_vlink'], ! 'T_BODY_ALINK' => '#'.$theme['body_alink'], ! 'T_BODY_HLINK' => '#'.$theme['body_hlink'], ! 'T_TR_COLOR1' => '#'.$theme['tr_color1'], ! 'T_TR_COLOR2' => '#'.$theme['tr_color2'], ! 'T_TR_COLOR3' => '#'.$theme['tr_color3'], ! 'T_TR_CLASS1' => $theme['tr_class1'], ! 'T_TR_CLASS2' => $theme['tr_class2'], ! 'T_TR_CLASS3' => $theme['tr_class3'], ! 'T_TH_COLOR1' => '#'.$theme['th_color1'], ! 'T_TH_COLOR2' => '#'.$theme['th_color2'], ! 'T_TH_COLOR3' => '#'.$theme['th_color3'], ! 'T_TH_CLASS1' => $theme['th_class1'], ! 'T_TH_CLASS2' => $theme['th_class2'], ! 'T_TH_CLASS3' => $theme['th_class3'], ! 'T_TD_COLOR1' => '#'.$theme['td_color1'], ! 'T_TD_COLOR2' => '#'.$theme['td_color2'], ! 'T_TD_COLOR3' => '#'.$theme['td_color3'], ! 'T_TD_CLASS1' => $theme['td_class1'], ! 'T_TD_CLASS2' => $theme['td_class2'], ! 'T_TD_CLASS3' => $theme['td_class3'], ! 'T_FONTFACE1' => $theme['fontface1'], ! 'T_FONTFACE2' => $theme['fontface2'], ! 'T_FONTFACE3' => $theme['fontface3'], ! 'T_FONTSIZE1' => $theme['fontsize1'], ! 'T_FONTSIZE2' => $theme['fontsize2'], ! 'T_FONTSIZE3' => $theme['fontsize3'], ! 'T_FONTCOLOR1' => '#'.$theme['fontcolor1'], ! 'T_FONTCOLOR2' => '#'.$theme['fontcolor2'], ! 'T_FONTCOLOR3' => '#'.$theme['fontcolor3'], ! 'T_SPAN_CLASS1' => $theme['span_class1'], ! 'T_SPAN_CLASS2' => $theme['span_class2'], ! 'T_SPAN_CLASS3' => $theme['span_class3']) ! ); ! $template->pparse('header'); ?> \ No newline at end of file Index: page_footer_admin.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/page_footer_admin.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** page_footer_admin.php 11 Feb 2005 22:39:51 -0000 1.4 --- page_footer_admin.php 19 Apr 2005 21:36:37 -0000 1.5 *************** *** 19,69 **** */ ! /** ! * MX Notes: ! * This file is borrowed from phpBB, with some commented modifications ! */ ! if ( !defined( 'IN_PHPBB' ) ) { ! die( "Hacking attempt" ); } // Show the overall footer. ! $template->set_filenames( array( 'page_footer' => 'admin/page_footer.tpl' ) ! ); ! ! $template->assign_vars( array( 'PHPBB_VERSION' => '2' . $board_config['version'], ! 'MX_VERSION' => PORTAL_VERSION, ! 'TRANSLATION_INFO' => '' ) ! ); ! $template->pparse( 'page_footer' ); // Close our DB connection. ! $db->sql_close(); // Compress buffered output if required // and send to browser ! ! if ( $do_gzip_compress ) { ! // Borrowed from php.net! ! $gzip_contents = ob_get_contents(); ob_end_clean(); ! $gzip_size = strlen( $gzip_contents ); ! $gzip_crc = crc32( $gzip_contents ); ! $gzip_contents = gzcompress( $gzip_contents, 9 ); ! $gzip_contents = substr( $gzip_contents, 0, strlen( $gzip_contents ) - 4 ); echo "\x1f\x8b\x08\x00\x00\x00\x00\x00"; echo $gzip_contents; ! echo pack( 'V', $gzip_crc ); ! echo pack( 'V', $gzip_size ); } --- 19,73 ---- */ ! // ================================================================================ ! // The following code is based on admin/page_footer_admin.php (phpBB 2.0.14) ! // ================================================================================ ! if ( !defined('IN_PHPBB') ) { ! die("Hacking attempt"); } + // // Show the overall footer. + // + $template->set_filenames(array( + 'page_footer' => 'admin/page_footer.tpl') + ); ! $template->assign_vars(array( ! 'PHPBB_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? '2' . $board_config['version'] : '', ! 'MX_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? PORTAL_VERSION : '', ! 'TRANSLATION_INFO' => $lang['TRANSLATION_INFO']) ! ); ! $template->pparse('page_footer'); + // // Close our DB connection. ! // $db->sql_close(); + // // Compress buffered output if required // and send to browser ! // ! if( $do_gzip_compress ) { ! // // Borrowed from php.net! ! // $gzip_contents = ob_get_contents(); ob_end_clean(); ! $gzip_size = strlen($gzip_contents); ! $gzip_crc = crc32($gzip_contents); ! $gzip_contents = gzcompress($gzip_contents, 9); ! $gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4); echo "\x1f\x8b\x08\x00\x00\x00\x00\x00"; echo $gzip_contents; ! echo pack('V', $gzip_crc); ! echo pack('V', $gzip_size); } |