|
From: FlorinCB <ory...@us...> - 2008-09-06 17:01:29
|
Update of /cvsroot/mxbb/mx_phpbb/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32655 Modified Files: forum_hack.php Log Message: fix Index: forum_hack.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpbb/includes/forum_hack.php,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** forum_hack.php 1 Sep 2008 02:23:38 -0000 1.63 --- forum_hack.php 6 Sep 2008 17:01:25 -0000 1.64 *************** *** 226,230 **** global $mx_root_path, $db, $phpEx, $board_config; ! if ( defined( 'PHPBB_URL' ) && defined( 'PORTAL_URL' ) ) { $this->phpbb_url = PHPBB_URL; --- 226,230 ---- global $mx_root_path, $db, $phpEx, $board_config; ! if (defined('PHPBB_URL') && defined('PORTAL_URL')) { $this->phpbb_url = PHPBB_URL; *************** *** 233,239 **** else { ! $PORTAL_TABLE = $this->_get_mx_table_name( 'portal' ); $sql = "SELECT * FROM $PORTAL_TABLE WHERE portal_id = 1"; ! if ( !( $result = $db->sql_query( $sql, 300 ) ) ) { $this->phpbb_url = ''; --- 233,239 ---- else { ! $PORTAL_TABLE = $this->_get_mx_table_name('portal'); $sql = "SELECT * FROM $PORTAL_TABLE WHERE portal_id = 1"; ! if (!($result = $db->sql_query($sql))) { $this->phpbb_url = ''; *************** *** 242,246 **** else { ! $row = $db->sql_fetchrow( $result ); if (file_exists($mx_root_path . 'includes/sessions/phpbb3/index.htm')) { --- 242,246 ---- else { ! $row = $db->sql_fetchrow($result); if (file_exists($mx_root_path . 'includes/sessions/phpbb3/index.htm')) { *************** *** 255,264 **** $server_url = $server_protocol . str_replace("//", "/", $server_name . $server_port . $script_name . '/'); //On some server the slash is not added and this trick will fix it ! define('PORTAL_URL', $server_url); $script_name_phpbb = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path'])) . '/'; $server_url_phpbb = $server_protocol . $server_name . $server_port . $script_name_phpbb; ! define('PHPBB_URL', $server_url_phpbb); $this->phpbb_url = PHPBB_URL; --- 255,264 ---- $server_url = $server_protocol . str_replace("//", "/", $server_name . $server_port . $script_name . '/'); //On some server the slash is not added and this trick will fix it ! @define('PORTAL_URL', $server_url); $script_name_phpbb = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path'])) . '/'; $server_url_phpbb = $server_protocol . $server_name . $server_port . $script_name_phpbb; ! @define('PHPBB_URL', $server_url_phpbb); $this->phpbb_url = PHPBB_URL; *************** *** 509,513 **** global $phpEx, $mx_root_path, $HTTP_GET_VARS, $userdata; ! $script_name = $this->_validate_redirection( $url, $by_http_vars ); // --- 509,513 ---- global $phpEx, $mx_root_path, $HTTP_GET_VARS, $userdata; ! $script_name = $this->_validate_redirection($url, $by_http_vars); // *************** *** 623,635 **** // // -------------------------------------------------------------------------------- ! function _validate_redirection( $url, $by_http_vars ) { ! if ( ( $pos = strpos( $url, '.' ) ) === false ) { return 'index'; } - $script_name = substr( $url, 0, $pos ); ! switch ( $script_name ) { case 'posting': --- 623,638 ---- // // -------------------------------------------------------------------------------- ! function _validate_redirection($url, $by_http_vars) { ! if (!$pos = strrpos($url, ".")) { return 'index'; } ! $script_name = substr($url, 0, $pos); ! $script_name = substr($script_name, strrpos($script_name, "/")); ! $script_name = str_replace("/", "", $script_name); ! ! switch ($script_name) { case 'posting': *************** *** 735,739 **** 'U_PHPBB_ROOT_PATH' => $this->phpbb_url, 'L_INDEX' => sprintf( $lang['Forum_Index'], $board_config['sitename'] ), ! 'U_INDEX' => $this->append_sid( "index.$phpEx" ), 'S_TIMEZONE' => sprintf( $lang['All_times'], $l_timezone ), 'L_USERNAME' => $lang['Username'] --- 738,742 ---- 'U_PHPBB_ROOT_PATH' => $this->phpbb_url, 'L_INDEX' => sprintf( $lang['Forum_Index'], $board_config['sitename'] ), ! 'U_INDEX' => $this->append_sid("index.$phpEx"), 'S_TIMEZONE' => sprintf( $lang['All_times'], $l_timezone ), 'L_USERNAME' => $lang['Username'] *************** *** 850,857 **** function append_sid( $url, $non_html_amp = false, $portal_url = false) { // // Replaces same function in sessions.php // ! return mx_append_sid( $this->full_url( $url, $non_html_amp, $portal_url ), $non_html_amp ); } --- 853,869 ---- function append_sid( $url, $non_html_amp = false, $portal_url = false) { + global $phpEx; + // // Replaces same function in sessions.php // ! $return_url = mx_append_sid($this->full_url($url, $non_html_amp, $portal_url), $non_html_amp); ! ! //Old Mod-Rewrite Module ? ! if (strpos($return_url, '.htm') && !strpos($phpEx, 'htm')) ! { ! return $this->full_url($url, $non_html_amp, $portal_url); ! } ! return $return_url; } *************** *** 909,913 **** // // -------------------------------------------------------------------------------- ! function redirect( $url ) { // --- 921,925 ---- // // -------------------------------------------------------------------------------- ! function redirect($url) { // *************** *** 916,920 **** global $db; ! if ( !empty( $db ) ) { $db->sql_close(); --- 928,932 ---- global $db; ! if (!empty($db)) { $db->sql_close(); *************** *** 946,950 **** function make_jumpbox($action, $match_forum_id = 0) { ! global $mx_backend; // // Replaces same function in function.php --- 958,962 ---- function make_jumpbox($action, $match_forum_id = 0) { ! //global $mx_backend; // // Replaces same function in function.php *************** *** 952,956 **** //make_jumpbox( $this->phpbb_url . $action, $match_forum_id ); ! $mx_backend->make_jumpbox($this->phpbb_url . $action, $match_forum_id); } --- 964,968 ---- //make_jumpbox( $this->phpbb_url . $action, $match_forum_id ); ! phpBB2::make_jumpbox($this->phpbb_url . $action, $match_forum_id); } *************** *** 1691,1695 **** // Main method // ! function read_file( $phpbb_file, $sub_call = false ) { global $phpbb_root_path, $mx_root_path, $phpEx, $template, $HTTP_POST_VARS, $HTTP_POST_FILES, $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $db, $userdata, $mode, $theme, $lang, $table_prefix, $mx_table_prefix, $board_config, $portal_config; --- 1703,1707 ---- // Main method // ! function read_file($phpbb_file, $sub_call = false) { global $phpbb_root_path, $mx_root_path, $phpEx, $template, $HTTP_POST_VARS, $HTTP_POST_FILES, $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $db, $userdata, $mode, $theme, $lang, $table_prefix, $mx_table_prefix, $board_config, $portal_config; *************** *** 1985,1998 **** if ($mx_forum->phpbb_config['enable_module']) { ! if ( isset( $HTTP_POST_FILES ) && !empty( $HTTP_POST_FILES ) ) ! { ! $up_files_keys = array_keys( $HTTP_POST_FILES ); ! foreach( $up_files_keys as $up_file ) ! { ! @rename( $HTTP_POST_FILES[$up_file]['tmp_name'], $HTTP_POST_FILES[$up_file]['tmp_name'] . '.mxbb' ); ! $HTTP_POST_FILES[$up_file]['tmp_name'] .= '.mxbb'; ! $_FILES[$up_file]['tmp_name'] .= '.mxbb'; ! } ! } $http_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; $http_server = preg_replace( '#^\/?(.*?)\/?$#', '\1', trim( $board_config['server_name'] ) ); --- 1997,2011 ---- if ($mx_forum->phpbb_config['enable_module']) { ! if ( isset($HTTP_POST_FILES) && !empty( $HTTP_POST_FILES ) ) ! { ! $up_files_keys = array_keys( $HTTP_POST_FILES ); ! foreach( $up_files_keys as $up_file ) ! { ! @rename($HTTP_POST_FILES[$up_file]['tmp_name'], $HTTP_POST_FILES[$up_file]['tmp_name'] . '.mxbb'); ! $HTTP_POST_FILES[$up_file]['tmp_name'] .= '.mxbb'; ! $_FILES[$up_file]['tmp_name'] .= '.mxbb'; ! } ! } ! $http_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://'; $http_server = preg_replace( '#^\/?(.*?)\/?$#', '\1', trim( $board_config['server_name'] ) ); *************** *** 2011,2015 **** // If no page is defined for this phpBB script, we have nothing else to do. // ! if ( empty( $portal_url ) ) { return; --- 2024,2028 ---- // If no page is defined for this phpBB script, we have nothing else to do. // ! if (empty($portal_url)) { return; *************** *** 2026,2030 **** // Actually, redirection takes place here :-) // ! $mx_forum->redirect( $portal_url ); } } --- 2039,2043 ---- // Actually, redirection takes place here :-) // ! $mx_forum->redirect($portal_url); } } |