|
From: OryNider <ory...@us...> - 2008-02-03 10:21:29
|
Update of /cvsroot/mxbb/core/includes/shared/phpbb3/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25234 Modified Files: functions.php functions_hook.php functions_module.php Log Message: changes needed by Culpit. Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions.php 18 Jan 2008 10:39:05 -0000 1.4 --- functions.php 3 Feb 2008 10:21:25 -0000 1.5 *************** *** 594,597 **** --- 594,617 ---- } + /** + * Add a secret token to the form (requires the S_FORM_TOKEN template variable) + * @param string $form_name The name of the form; has to match the name used in check_form_key, otherwise no restrictions apply + */ + function add_form_key($form_name) + { + global $config, $template, $user; + $now = time(); + $token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : ''; + $token = sha1($now . $user->data['user_form_salt'] . $form_name . $token_sid); + + $s_fields = build_hidden_fields(array( + 'creation_time' => $now, + 'form_token' => $token, + )); + $template->assign_vars(array( + 'S_FORM_TOKEN' => $s_fields, + )); + } + } // Compatibility functions *************** *** 4668,4670 **** --- 4688,4743 ---- } + + /** + * Little helper for the build_hidden_fields function + */ + function _build_hidden_fields($key, $value, $specialchar, $stripslashes) + { + $hidden_fields = ''; + + if (!is_array($value)) + { + $value = ($stripslashes) ? stripslashes($value) : $value; + $value = ($specialchar) ? htmlspecialchars($value, ENT_COMPAT, 'UTF-8') : $value; + + $hidden_fields .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n"; + } + else + { + foreach ($value as $_key => $_value) + { + $_key = ($stripslashes) ? stripslashes($_key) : $_key; + $_key = ($specialchar) ? htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') : $_key; + + $hidden_fields .= _build_hidden_fields($key . '[' . $_key . ']', $_value, $specialchar, $stripslashes); + } + } + + return $hidden_fields; + } + + /** + * Build simple hidden fields from array + * + * @param array $field_ary an array of values to build the hidden field from + * @param bool $specialchar if true, keys and values get specialchared + * @param bool $stripslashes if true, keys and values get stripslashed + * + * @return string the hidden fields + */ + function build_hidden_fields($field_ary, $specialchar = false, $stripslashes = false) + { + $s_hidden_fields = ''; + + foreach ($field_ary as $name => $vars) + { + $name = ($stripslashes) ? stripslashes($name) : $name; + $name = ($specialchar) ? htmlspecialchars($name, ENT_COMPAT, 'UTF-8') : $name; + + $s_hidden_fields .= _build_hidden_fields($name, $vars, $specialchar, $stripslashes); + } + + return $s_hidden_fields; + } + ?> \ No newline at end of file Index: functions_hook.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions_hook.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions_hook.php 18 Jan 2008 10:39:05 -0000 1.4 --- functions_hook.php 3 Feb 2008 10:21:25 -0000 1.5 *************** *** 15,183 **** // error_reporting( E_ALL | !E_NOTICE); // include_once( $phpbb_root_path . 'adm/index.'. $phpEx); ! include_once( $mx_root_path . 'includes/shared/phpbb3/includes/functions.' . $phpEx ); ! include_once( $mx_root_path . 'includes/shared/phpbb3/includes/functions_module.' . $phpEx ); ! include_once( $mx_root_path . 'includes/sessions/phpbb3/auth.' . $phpEx ); ! include_once( $mx_root_path . 'includes/sessions/phpbb3/session.' . $phpEx ); ! ! if ( !function_exists( 'function phpbb_user_session_handler' ) ) ! { ! function phpbb_user_session_handler() ! { ! global $phpbb_hook; ! ! if ( !empty( $phpbb_hook ) && $phpbb_hook->call_hook( __FUNCTION__ ) ) ! { ! if ( $phpbb_hook->hook_return( __FUNCTION__ ) ) ! { ! return $phpbb_hook->hook_return_result( __FUNCTION__ ); ! } ! } ! ! return; ! } ! } ! ! if ( !function_exists( 'request_var' ) ) ! { ! function request_var( $p1, $p2 = '', $p3 = false, $p4 = false ) ! { ! global $mx_request_vars; ! return $mx_request_vars->request( $p1, $p2, $p3, $p4 ); ! } ! } ! if ( !function_exists( 'append_sid' ) ) ! { ! function append_sid( $url ) ! { ! return mx_append_sid( $url ); ! } ! } ! ! if ( !function_exists( 'adm_page_header' ) ) ! { ! function adm_page_header( $page_title ) ! { ! global $board_config, $db, $user, $template; ! global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; ! ! if ( defined( 'HEADER_INC' ) ) ! { ! return; ! } ! ! define( 'HEADER_INC', true ); ! // gzip_compression ! if ( $board_config['gzip_compress'] ) ! { ! if ( @extension_loaded( 'zlib' ) && !headers_sent() ) ! { ! ob_start( 'ob_gzhandler' ); ! } ! } ! ! $template->assign_vars( array( 'PAGE_TITLE' => $page_title, ! 'USERNAME' => $user->data['username'], ! ! 'SID' => $SID, ! '_SID' => $_SID, ! 'SESSION_ID' => $user->session_id, ! 'ROOT_PATH' => $phpbb_admin_path, ! ! 'U_LOGOUT' => append_sid( "{$phpbb_root_path}ucp.$phpEx", 'mode=logout' ), ! 'U_ADM_INDEX' => append_sid( "{$phpbb_admin_path}index.$phpEx" ), ! 'U_INDEX' => append_sid( "{$phpbb_root_path}index.$phpEx" ), ! ! 'T_IMAGES_PATH' => "{$phpbb_root_path}images/", ! 'T_SMILIES_PATH' => "{$phpbb_root_path}{$board_config['smilies_path']}/", ! 'T_AVATAR_PATH' => "{$phpbb_root_path}{$board_config['avatar_path']}/", ! 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$board_config['avatar_gallery_path']}/", ! 'T_ICONS_PATH' => "{$phpbb_root_path}{$board_config['icons_path']}/", ! 'T_RANKS_PATH' => "{$phpbb_root_path}{$board_config['ranks_path']}/", ! 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$board_config['upload_path']}/", ! ! 'ICON_MOVE_UP' => '<img src="' . $phpbb_admin_path . 'images/icon_up.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', ! 'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', ! 'ICON_MOVE_DOWN' => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />', ! 'ICON_MOVE_DOWN_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />', ! 'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', ! 'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', ! 'ICON_DELETE' => '<img src="' . $phpbb_admin_path . 'images/icon_delete.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />', ! 'ICON_DELETE_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_delete_disabled.gif" alt="' . $user->lang['DELETE'] . '" title="' . $user->lang['DELETE'] . '" />', ! 'ICON_SYNC' => '<img src="' . $phpbb_admin_path . 'images/icon_sync.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />', ! 'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />', ! ! 'S_USER_LANG' => $user->lang['USER_LANG'], ! 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], ! 'S_CONTENT_ENCODING' => 'UTF-8', ! 'S_CONTENT_FLOW_BEGIN' => ( $user->lang['DIRECTION'] == 'ltr' ) ? 'left' : 'right', ! 'S_CONTENT_FLOW_END' => ( $user->lang['DIRECTION'] == 'ltr' ) ? 'right' : 'left', ! ) ); ! // application/xhtml+xml not used because of IE ! header( 'Content-type: text/html; charset=UTF-8' ); ! ! header( 'Cache-Control: private, no-cache="set-cookie"' ); ! header( 'Expires: 0' ); ! header( 'Pragma: no-cache' ); ! ! return; ! } ! } ! ! if ( !function_exists( 'adm_page_footer' ) ) ! { ! function adm_page_footer( $copyright_html = true ) ! { ! global $db, $board_config, $template, $user, $auth, $cache; ! global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; ! // Output page creation time ! if ( defined( 'DEBUG' ) ) ! { ! $mtime = explode( ' ', microtime() ); ! $totaltime = $mtime[0] + $mtime[1] - $starttime; ! ! if ( !empty( $_REQUEST['explain'] ) && $auth->acl_get( 'a_' ) && defined( 'DEBUG_EXTRA' ) && method_exists( $db, 'sql_report' ) ) ! { ! $db->sql_report( 'display' ); ! } ! ! $debug_output = sprintf( 'Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . ( ( $board_config['gzip_compress'] ) ? 'On' : 'Off' ) . ( ( $user->load ) ? ' | Load : ' . $user->load : '' ), $totaltime ); ! ! if ( $auth->acl_get( 'a_' ) && defined( 'DEBUG_EXTRA' ) ) ! { ! if ( function_exists( 'memory_get_usage' ) ) ! { ! if ( $memory_usage = memory_get_usage() ) ! { ! global $base_memory_usage; ! $memory_usage -= $base_memory_usage; ! $memory_usage = ( $memory_usage >= 1048576 ) ? round( ( round( $memory_usage / 1048576 * 100 ) / 100 ), 2 ) . ' ' . $user->lang['MB'] : ( ( $memory_usage >= 1024 ) ? round( ( round( $memory_usage / 1024 * 100 ) / 100 ), 2 ) . ' ' . $user->lang['KB'] : $memory_usage . ' ' . $user->lang['BYTES'] ); ! ! $debug_output .= ' | Memory Usage: ' . $memory_usage; ! } ! } ! ! $debug_output .= ' | <a href="' . build_url() . '&explain=1">Explain</a>'; ! } ! } ! ! $template->assign_vars( array( 'DEBUG_OUTPUT' => ( defined( 'DEBUG' ) ) ? $debug_output : '', ! 'TRANSLATION_INFO' => ( !empty( $user->lang['TRANSLATION_INFO'] ) ) ? $user->lang['TRANSLATION_INFO'] : '', ! 'S_COPYRIGHT_HTML' => $copyright_html, ! 'VERSION' => $board_config['version'] ) ! ); ! ! $template->display( 'body' ); ! ! phpBB3::garbage_collection(); ! // phpBB3::exit_handler(); ! } ! } ! class phpbb3_hook { var $main_part = ''; var $current_tab = ''; ! function phpbb3_hook() { } --- 15,37 ---- // error_reporting( E_ALL | !E_NOTICE); // include_once( $phpbb_root_path . 'adm/index.'. $phpEx); ! // include_once( $mx_root_path . 'includes/shared/phpbb3/includes/functions.' . $phpEx ); ! mx_page::load_file( 'functions', 'phpbb3'); ! mx_page::load_file( 'functions_module', 'phpbb3'); ! //include_once( $mx_root_path . 'includes/shared/phpbb3/includes/functions_module.' . $phpEx ); ! // include_once( $mx_root_path . 'includes/sessions/phpbb3/auth.' . $phpEx ); ! // include_once( $mx_root_path . 'includes/sessions/phpbb3/session.' . $phpEx ); ! class mx_phpbb3_admin { var $main_part = ''; var $current_tab = ''; + var $id_tabs = ''; + var $complete_menu = array(); ! var $action_scripts = array(); ! ! var $p_master = null; ! ! function mx_phpbb3_admin() { } *************** *** 215,218 **** --- 69,218 ---- } + /** + * new hook + */ + function get_tabs( $current_tab = 1 ) + { + global $lang, $mx_user, $user, $db; + + $sql = "SELECT m1.*, count(m2.module_id) AS subcount + FROM " . MODULES_TABLE . " AS m1 LEFT OUTER JOIN " . MODULES_TABLE . " AS m2 ON m1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1 + WHERE m1.parent_id = 0 AND m1.module_class = 'acp' + GROUP BY m1.module_id + HAVING count(m2.module_id) > 0 + ORDER BY m1.left_id"; + + if ( !( $rs = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Could not obtain tabs data form phpbb3 modules', 'Error', __LINE__, __FILE__, $sql ); + } + + $return_category = ''; + + $tabs = array(); + while ( $row = $db->sql_fetchrow( $rs ) ) + { + if ( isset( $mx_user->lang[$row['module_langname']] ) ) + { + $l_mx_phpbb = $mx_user->lang[$row['module_langname']]; + } + else if ( isset( $lang[$row['module_langname']] ) ) + { + $l_mx_phpbb = $lang[$row['module_langname']]; + } + else + { + $l_mx_phpbb = $row['module_langname']; + } + + if ( $row['module_id'] == $current_tab ) + { + $return_category = $l_mx_phpbb; + } + $tabs[] = array( // # + 'ACTIVE_TAB' => $row['module_id'] == $current_tab?'activetab':'', + 'CATEGORY' => OLYMPUS_CATEGORY, + 'PARAMS' => '&i=' . $row['module_id'] , + 'L_TAB' => $l_mx_phpbb, + ); + $this->id_tabs .= ', ' . $row['module_id'] . ' '; + } + $this->id_tabs = trim( substr( $this->id_tabs, 1 ) ); + $db->sql_freeresult( $rs ); + return array( 'CATEGORY_TITLE' => $return_category, 'TABS' => $tabs ); + } + + function get_menu_complete() + { + global $db, $phpbb_root_path, $phpEx; + $sql = "SELECT m1.parent_id AS m1_parent, m1.module_langname AS m1_langname, m2.module_langname AS m2_langname, m2.module_basename AS m2_basename, m2.module_mode AS m2_mode + FROM " . MODULES_TABLE . " AS m1 RIGHT OUTER JOIN phpbb3_modules AS m2 ON m1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1 + WHERE m1.parent_id IN (" . $this->id_tabs . ") AND m1.module_class = 'acp' + ORDER BY m1.left_id"; + + if ( !( $rs = $db->sql_query( $sql ) ) ) + { + mx_message_die( GENERAL_ERROR, 'Could not obtain menu data from phpbb3 modules', 'Error', __LINE__, __FILE__, $sql ); + } + + $header = ''; + $this->menu_complete = array(); + + while ( $row = $db->sql_fetchrow( $rs ) ) + { + if ( $header != $row['m1_langname'] ) + { + $header = $row['m1_langname']; + $this->menu_complete[$row['m1_parent']][$header] = array(); + } + $this->action_scripts[$row['m2_langname']] = $row['m2_basename']; + $this->menu_complete[$row['m1_parent']][$header][$row['m2_langname']] = "adm/index.$phpEx?i=" . $row['m1_parent'] . '&panel=' . $row['m2_basename'] . ( !empty( $row['m2_mode'] )?'&mode=' . $row['m2_mode']:'' ) ; + } + $db->sql_freeresult( $rs ); + return $this->menu_complete; + } + + function get_menu( $category ) + { + return $this->menu_complete[$category]; + } + + function prepare_action_script( $panel ) + { + global $phpbb_root_path, $phpEx, $mx_request_vars, $phpbb_admin_path, $template; + $admin_panel_script_path = $phpbb_root_path . 'includes/acp/acp_'. $this->action_scripts[$panel] . '.' . $phpEx; + + if ( !file_exists( $admin_panel_script_path )) + { + return "echo '<div class=\"errorbox\">phpbb3 admin nanel not found<br/>$admin_panel_script_path</div>';"; + } + $script = trim( file_get_contents( $phpbb_root_path . 'adm/index.' . $phpEx ) ); + $preg_array = array( '#(<\?(php)?|\?>)#si' => '', + '#\$php(Ex|bb_root_path|bb_admin_path) = [^;]*;#si' => '// MX_ACP_REPLACE \0', + '#(include|require)\(([^)]*)\)[^;]*#s' => 'mx_page::load_file(\2)', + '#\$user#si' => '$mx_user', + '#\$auth#si' => '$phpbb_auth', + '#([^_])append_sid#si' => '\1mx_append_sid', + '#\$module_id[ \t][^;]*;#si' => "\$module_id = '" . $this->action_scripts[$panel] . "';", + '#\$mode[ \t][^;]*;#si' => "\$mode = '" . $mx_request_vars->request( 'mode') . "';", + '#request_var#si' => '$mx_request_vars->request', + '#login_box\(#si' => '// login_box(', + '#\$cache#si' => '$mx_cache', + '#trigger_error\(#si' => '// trigger_error(', + '#\'body\' => \$module#si' => '\'panel\' => $module', + '#([ \t\n])define#si' => '\1@define', + '#display\(\'body\'\);#si' => "display('panel');", + '#(garbage_collection|exit_handler)\(\);#si' => 'phpBB3::\1();', + '#\$template->#si' => '$mx_acp->template->', + '#adm_page_footer\(\);#si' => '$mx_acp->_template_assign_vars();$mx_acp->template->pparse(\'panel\');', + '#global #si' => 'global $mx_acp, ', + ); + $func_cnt = preg_match_all( "#\nfunction ([^(]*)\\(#si", $script, $func_match ); + + mx_page::load_file( 'utf/utf_tools', 'phpbb3'); + for( $i = 0; $i < $func_cnt; $i++ ) + { + if ( function_exists( $func_match[1][$i] ) ) + { + $preg_array = array_merge( $preg_array, array( // # + "#\nfunction " . $func_match[1][$i] . '#si' => "\nfunction " . $func_match[1][$i] . '_defined', + ) ); + } + } + $script = preg_replace( array_keys( $preg_array ), array_values( $preg_array ), $script ); + return $script; + } + + function assign_content_acp( $html) + { + //$html = preg_replace( '#.*\<div id="page-body"\>#si', '', $html); + + $html = trim(preg_replace('#(.*\<div id="page-body"\>|</div>[^<]*?<div id="page-footer">.*)#si', '', $html)); + return $html; + } + + /** + * OLD HOOK + */ function admin_menu( $part ) { *************** *** 226,231 **** $sql = "SELECT m1.module_langname AS m1_langname, m2.module_langname AS m2_langname, m2.module_basename AS m2_basename, m2.module_mode AS m2_mode FROM " . MODULES_TABLE . " AS m1 RIGHT OUTER JOIN phpbb3_modules AS m2 ON m1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1 ! WHERE m1.parent_id = '$part' AND m1.module_class = 'acp' ! ORDER BY m1.left_id "; if ( !( $rs = $db->sql_query( $sql ) ) ) --- 226,231 ---- $sql = "SELECT m1.module_langname AS m1_langname, m2.module_langname AS m2_langname, m2.module_basename AS m2_basename, m2.module_mode AS m2_mode FROM " . MODULES_TABLE . " AS m1 RIGHT OUTER JOIN phpbb3_modules AS m2 ON m1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1 ! WHERE m1.parent_id = '$part' AND m1.module_class = 'acp' ! ORDER BY m1.left_id "; if ( !( $rs = $db->sql_query( $sql ) ) ) *************** *** 261,265 **** $this->current_tab = $curr_tab; // This sintax is not correct - /* $sql = "SELECT m1.*, count(m2.module_id) AS subcount FROM " . MODULES_TABLE . " AS m1 LEFT OUTER JOIN phpbb3_modules AS m2 ON m1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1 --- 261,264 ---- *************** *** 269,295 **** ORDER BY m1.left_id "; - */ - $sql = 'SELECT * - FROM ' . MODULES_TABLE . " - WHERE module_class = '" . $db->sql_escape('acp') . "' - AND module_enabled = 1 - AND module_display = 1 - GROUP BY module_id - ORDER BY left_id ASC"; /* ! $sql_array = array(); ! $sql_array['SELECT'] = 'm1.*, count(m2.module_id) AS subcount'; ! $sql_array['FROM'][MODULES_TABLE] = 'AS m1'; ! $sql_array['LEFT_JOIN'][] = array( 'FROM' => array( MODULES_TABLE => 'AS m2' ), 'ON' => 'm1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1', ); ! $sql_array['GROUP_BY'] = 'm1.module_id'; ! $sql_array['WHERE'] = "m1.parent_id = 0 AND m1.module_class = 'acp'"; ! $sql_array['ORDER_BY'] = 'm1.left_id ASC'; ! $sql = $db->sql_build_query( 'SELECT', $sql_array ); ! */ if ( !( $rs = $db->sql_query( $sql ) ) ) --- 268,295 ---- ORDER BY m1.left_id "; /* ! $sql = 'SELECT DISTINCT * ! FROM ' . MODULES_TABLE . " ! WHERE module_enabled = 1 ! AND module_display = 1 ! AND parent_id = 0 ! GROUP BY module_id ! ORDER BY left_id ASC"; ! */ ! /* ! $sql_array = array(); ! $sql_array['SELECT'] = 'm1.*, count(m2.module_id) AS subcount'; ! $sql_array['FROM'][MODULES_TABLE] = 'AS m1'; ! $sql_array['LEFT_JOIN'][] = array( 'FROM' => array( MODULES_TABLE => 'AS m2' ), 'ON' => 'm1.module_id = m2.parent_id AND m2.module_enabled = 1 AND m2.module_display = 1', ); ! $sql_array['GROUP_BY'] = 'm1.module_id'; ! $sql_array['WHERE'] = "m1.parent_id = 0 AND m1.module_class = 'acp'"; ! $sql_array['ORDER_BY'] = 'm1.left_id ASC'; ! $sql = $db->sql_build_query( 'SELECT', $sql_array ); ! */ if ( !( $rs = $db->sql_query( $sql ) ) ) *************** *** 300,326 **** while ( $row = $db->sql_fetchrow( $rs ) ) { - if ( isset( $mx_user->lang[$row['module_langname']] ) ) - { - $l_mx_phpbb = $mx_user->lang[$row['module_langname']]; - } - else if ( isset( $lang[$row['module_langname']] ) ) - { - $l_mx_phpbb = $lang[$row['module_langname']]; - } - else - { - $l_mx_phpbb = $row['module_langname']; - } - - if ( $row['module_id'] == $curr_tab ) - { - $return_category = $l_mx_phpbb; - } - $template->assign_block_vars( 'module_phpbb', array( - 'ACTIVETAB' => $row['module_id'] == $curr_tab?' id="activetab"':'', - 'CATEGORY' => PORTAL_BACKEND, - 'PARAMS' => '&i=' . $row['module_id'], - 'L_MX_PHPBB' => $l_mx_phpbb, - ) ); } --- 300,303 ---- *************** *** 341,354 **** $user = $mx_user; $auth = $phpbb_auth; ! // $auth = new phpbb_auth_base(); ! // $user->session_begin(); ! // $auth->acl($user->data); ! // $user->setup('acp/common'); ! // $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : 'adm/'; $module_id = $acp_panel; $user->theme['template_storedb'] = false; // $template->set_custom_template($phpbb_admin_path . 'style', 'admin'); - $module = new p_master(); // Instantiate new module $module = new p_master(); --- 318,328 ---- $user = $mx_user; $auth = $phpbb_auth; ! $auth->acl( $user->data ); ! $user->setup( 'acp/common' ); ! $module_id = $acp_panel; $user->theme['template_storedb'] = false; // $template->set_custom_template($phpbb_admin_path . 'style', 'admin'); // Instantiate new module $module = new p_master(); *************** *** 367,371 **** adm_page_header( $module->get_page_title() ); $template->set_filenames( array( 'body' => $phpbb_root_path . 'adm/style/acp_' . $acp_panel . '.html', ! ) ); adm_page_footer(); $phpbb_admin_html .= ob_get_contents(); --- 341,345 ---- adm_page_header( $module->get_page_title() ); $template->set_filenames( array( 'body' => $phpbb_root_path . 'adm/style/acp_' . $acp_panel . '.html', ! ) ); adm_page_footer(); $phpbb_admin_html .= ob_get_contents(); Index: functions_module.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/shared/phpbb3/includes/functions_module.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions_module.php 18 Jan 2008 10:39:05 -0000 1.4 --- functions_module.php 3 Feb 2008 10:21:25 -0000 1.5 *************** *** 433,439 **** $modulecode = str_replace('append_sid(', 'mx3_append_sid(', $modulecode); $modulecode = str_replace('get_username_string(', 'mx_get_username_string(', $modulecode); ! $mx_user = new mx_user(); ! eval($modulecode); --- 433,442 ---- $modulecode = str_replace('append_sid(', 'mx3_append_sid(', $modulecode); $modulecode = str_replace('get_username_string(', 'mx_get_username_string(', $modulecode); ! ! $modulecode = str_replace('request_var(', 'phpBB3::request_var(', $modulecode); ! $modulecode = str_replace('add_form_key(', 'phpBB3::add_form_key(', $modulecode); ! $mx_user = new mx_user(); ! //print htmlentities( $modulecode);die(); eval($modulecode); |