|
From: Jon O. <jon...@us...> - 2008-10-31 18:54:30
|
Update of /cvsroot/mxbb/core/includes/sessions/phpbb3 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6117/phpbb3 Modified Files: bbcode.php constants.php core.php login.php session.php Log Message: http://www.mx-publisher.com/phpBB2/viewtopic.php?p=65197#65197 Massive update. Index: login.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/phpbb3/login.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** login.php 9 Oct 2008 18:31:28 -0000 1.8 --- login.php 31 Oct 2008 18:54:23 -0000 1.9 *************** *** 17,21 **** if($mx_request_vars->is_request('login') && ($userdata['user_id'] == ANONYMOUS || $mx_request_vars->is_post('admin')) ) { ! $username = $mx_request_vars->is_post('username') ? $phpBB2->phpbb_clean_username($mx_request_vars->post('username', MX_TYPE_NO_TAGS)) : ''; $password = $mx_request_vars->post('password', MX_TYPE_NO_TAGS); --- 17,21 ---- if($mx_request_vars->is_request('login') && ($userdata['user_id'] == ANONYMOUS || $mx_request_vars->is_post('admin')) ) { ! $username = $mx_request_vars->is_post('username') ? phpBB2::phpbb_clean_username($mx_request_vars->post('username', MX_TYPE_NO_TAGS)) : ''; $password = $mx_request_vars->post('password', MX_TYPE_NO_TAGS); *************** *** 63,67 **** $password_new_format = ''; ! $phpBB3->set_var($password_new_format, stripslashes($password_old_format), 'string'); //mx_message_die(CRITICAL_ERROR, "Couldn't start session : login", $password_new_format, ''); --- 63,67 ---- $password_new_format = ''; ! phpBB3::set_var($password_new_format, stripslashes($password_old_format), 'string'); //mx_message_die(CRITICAL_ERROR, "Couldn't start session : login", $password_new_format, ''); *************** *** 78,82 **** if (md5($password_old_format) == $row['user_password'] || md5(utf8_to_cp1252($password_old_format)) == $row['user_password']) { ! $hash = $phpBB3->phpbb_hash($password_new_format); // Update the password in the users table to the new format and remove user_pass_convert flag --- 78,82 ---- if (md5($password_old_format) == $row['user_password'] || md5(utf8_to_cp1252($password_old_format)) == $row['user_password']) { ! $hash = phpBB3::phpbb_hash($password_new_format); // Update the password in the users table to the new format and remove user_pass_convert flag *************** *** 105,109 **** ); } ! } } else --- 105,109 ---- ); } ! } } else *************** *** 113,117 **** $password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format; $password_new_format = ''; ! $phpBB3->set_var($password_new_format, stripslashes($password_old_format), 'string'); //mx_message_die(CRITICAL_ERROR, "Couldn't start session : login", $password_new_format, ''); --- 113,117 ---- $password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format; $password_new_format = ''; ! phpBB3::set_var($password_new_format, stripslashes($password_old_format), 'string'); //mx_message_die(CRITICAL_ERROR, "Couldn't start session : login", $password_new_format, ''); *************** *** 123,129 **** include_once($mx_root_path . 'includes/utf/data/recode_basic.' . $phpEx); } ! // cp1252 is phpBB2's default encoding, characters outside ASCII range might work when converted into that encoding ! if (md5($password_old_format) == $row['user_password'] || md5($password) == $row['user_password'] || $phpBB3->phpbb_check_hash($password, $row['user_password'])) { $autologin = $mx_request_vars->is_post('autologin'); --- 123,129 ---- include_once($mx_root_path . 'includes/utf/data/recode_basic.' . $phpEx); } ! // cp1252 is phpBB2's default encoding, characters outside ASCII range might work when converted into that encoding ! if (md5($password_old_format) == $row['user_password'] || md5($password) == $row['user_password'] || phpBB3::phpbb_check_hash($password, $row['user_password'])) { $autologin = $mx_request_vars->is_post('autologin'); *************** *** 131,135 **** $mx_user->session_create($row['user_id'], $admin, $autologin, $viewonline = true); $session_id = $mx_user->session_id; ! // Reset login tries --- 131,135 ---- $mx_user->session_create($row['user_id'], $admin, $autologin, $viewonline = true); $session_id = $mx_user->session_id; ! // Reset login tries *************** *** 175,179 **** } // Check password ... ! if (!$row['user_pass_convert'] && $phpBB3->phpbb_check_hash($password, $row['user_password'])) { if ($row['user_login_attempts'] != 0) --- 175,179 ---- } // Check password ... ! if (!$row['user_pass_convert'] && phpBB3::phpbb_check_hash($password, $row['user_password'])) { if ($row['user_login_attempts'] != 0) *************** *** 202,206 **** mx_message_die(CRITICAL_ERROR, "Couldn't start session : login", "", __LINE__, __FILE__); } ! } } } --- 202,206 ---- mx_message_die(CRITICAL_ERROR, "Couldn't start session : login", "", __LINE__, __FILE__); } ! } } } Index: core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/phpbb3/core.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** core.php 28 Oct 2008 04:48:26 -0000 1.17 --- core.php 31 Oct 2008 18:54:23 -0000 1.18 *************** *** 712,723 **** } else ! { if (!defined('CONFIG_TABLE')) { global $table_prefix, $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/sessions/phpbb3/constants.' . $phpEx); } ! $sql = "SELECT * FROM " . CONFIG_TABLE; --- 712,723 ---- } else ! { if (!defined('CONFIG_TABLE')) { global $table_prefix, $mx_root_path, $phpEx; ! include($mx_root_path . 'includes/sessions/phpbb3/constants.' . $phpEx); } ! $sql = "SELECT * FROM " . CONFIG_TABLE; *************** *** 751,754 **** --- 751,959 ---- /** + * Obtain ranks + */ + function obtain_ranks() + { + global $mx_cache; + + if (($ranks = $mx_cache->get('_ranks')) === false) + { + global $db; + + $sql = 'SELECT * + FROM ' . RANKS_TABLE . ' + ORDER BY rank_min DESC'; + $result = $db->sql_query($sql); + + $ranks = array(); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['rank_special']) + { + $ranks['special'][$row['rank_id']] = array( + 'rank_title' => $row['rank_title'], + 'rank_image' => $row['rank_image'] + ); + } + else + { + $ranks['normal'][] = array( + 'rank_title' => $row['rank_title'], + 'rank_min' => $row['rank_min'], + 'rank_image' => $row['rank_image'] + ); + } + } + $db->sql_freeresult($result); + + $mx_cache->put('_ranks', $ranks); + } + + return $ranks; + } + + /** + * Obtain allowed extensions + * + * @param mixed $forum_id If false then check for private messaging, if int then check for forum id. If true, then only return extension informations. + * + * @return array allowed extensions array. + */ + function obtain_attach_extensions($forum_id) + { + global $mx_cache; + + if (($extensions = $mx_cache->get('_extensions')) === false) + { + global $db; + + $extensions = array( + '_allowed_post' => array(), + '_allowed_pm' => array(), + ); + + // The rule is to only allow those extensions defined. ;) + $sql = 'SELECT e.extension, g.* + FROM ' . EXTENSIONS_TABLE . ' e, ' . EXTENSION_GROUPS_TABLE . ' g + WHERE e.group_id = g.group_id + AND (g.allow_group = 1 OR g.allow_in_pm = 1)'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $extension = strtolower(trim($row['extension'])); + + $extensions[$extension] = array( + 'display_cat' => (int) $row['cat_id'], + 'download_mode' => (int) $row['download_mode'], + 'upload_icon' => trim($row['upload_icon']), + 'max_filesize' => (int) $row['max_filesize'], + 'allow_group' => $row['allow_group'], + 'allow_in_pm' => $row['allow_in_pm'], + ); + + $allowed_forums = ($row['allowed_forums']) ? unserialize(trim($row['allowed_forums'])) : array(); + + // Store allowed extensions forum wise + if ($row['allow_group']) + { + $extensions['_allowed_post'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums; + } + + if ($row['allow_in_pm']) + { + $extensions['_allowed_pm'][$extension] = 0; + } + } + $db->sql_freeresult($result); + + $mx_cache->put('_extensions', $extensions); + } + + // Forum post + if ($forum_id === false) + { + // We are checking for private messages, therefore we only need to get the pm extensions... + $return = array('_allowed_' => array()); + + foreach ($extensions['_allowed_pm'] as $extension => $check) + { + $return['_allowed_'][$extension] = 0; + $return[$extension] = $extensions[$extension]; + } + + $extensions = $return; + } + else if ($forum_id === true) + { + return $extensions; + } + else + { + $forum_id = (int) $forum_id; + $return = array('_allowed_' => array()); + + foreach ($extensions['_allowed_post'] as $extension => $check) + { + // Check for allowed forums + if (is_array($check)) + { + $allowed = (!in_array($forum_id, $check)) ? false : true; + } + else + { + $allowed = true; + } + + if ($allowed) + { + $return['_allowed_'][$extension] = 0; + $return[$extension] = $extensions[$extension]; + } + } + + $extensions = $return; + } + + if (!isset($extensions['_allowed_'])) + { + $extensions['_allowed_'] = array(); + } + + return $extensions; + } + + /** + * Obtain active bots + */ + function obtain_bots() + { + global $mx_cache; + + if (($bots = $mx_cache->get('_bots')) === false) + { + global $db; + + switch ($db->sql_layer) + { + case 'mssql': + case 'mssql_odbc': + $sql = 'SELECT user_id, bot_agent, bot_ip + FROM ' . BOTS_TABLE . ' + WHERE bot_active = 1 + ORDER BY LEN(bot_agent) DESC'; + break; + + case 'firebird': + $sql = 'SELECT user_id, bot_agent, bot_ip + FROM ' . BOTS_TABLE . ' + WHERE bot_active = 1 + ORDER BY CHAR_LENGTH(bot_agent) DESC'; + break; + + // LENGTH supported by MySQL, IBM DB2 and Oracle for sure... + default: + $sql = 'SELECT user_id, bot_agent, bot_ip + FROM ' . BOTS_TABLE . ' + WHERE bot_active = 1 + ORDER BY LENGTH(bot_agent) DESC'; + break; + } + $result = $db->sql_query($sql); + + $bots = array(); + while ($row = $db->sql_fetchrow($result)) + { + $bots[] = $row; + } + $db->sql_freeresult($result); + + $mx_cache->put('_bots', $bots); + } + + return $bots; + } + + /** * Obtain cfg file data * *************** *** 803,806 **** --- 1008,1071 ---- /** + * Obtain disallowed usernames + */ + function obtain_disallowed_usernames() + { + global $mx_cache; + + if (($usernames = $mx_cache->get('_disallowed_usernames')) === false) + { + global $db; + + $sql = 'SELECT disallow_username + FROM ' . DISALLOW_TABLE; + $result = $db->sql_query($sql); + + $usernames = array(); + while ($row = $db->sql_fetchrow($result)) + { + $usernames[] = str_replace('%', '.*?', preg_quote(utf8_clean_string($row['disallow_username']), '#')); + } + $db->sql_freeresult($result); + + $mx_cache->put('_disallowed_usernames', $usernames); + } + + return $usernames; + } + + /** + * Obtain hooks... + */ + function obtain_hooks() + { + global $phpbb_root_path, $phpEx, $mx_cache; + + if (($hook_files = $mx_cache->get('_hooks')) === false) + { + $hook_files = array(); + + // Now search for hooks... + $dh = @opendir($phpbb_root_path . 'includes/hooks/'); + + if ($dh) + { + while (($file = readdir($dh)) !== false) + { + if (strpos($file, 'hook_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx) + { + $hook_files[] = substr($file, 0, -(strlen($phpEx) + 1)); + } + } + closedir($dh); + } + + $mx_cache->put('_hooks', $hook_files); + } + + return $hook_files; + } + + /** * Enter description here... * *************** *** 813,820 **** FROM " . GROUPS_TABLE . " g WHERE g.group_name NOT IN ('BOTS', 'GUESTS') ! ORDER BY g.group_type ASC, g.group_name"; return $sql; } ! /** * Get username details for placing into templates. --- 1078,1148 ---- FROM " . GROUPS_TABLE . " g WHERE g.group_name NOT IN ('BOTS', 'GUESTS') ! ORDER BY g.group_type ASC, g.group_name"; return $sql; } ! ! /** ! * Enter description here... ! * ! * @return unknown ! */ ! function generate_session_online_sql($guest = false) ! { ! if ($guest) ! { ! $sql = "SELECT u.*, s.* ! FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s ! WHERE u.user_id = " . ANONYMOUS . " ! AND u.user_id = s.session_user_id ! AND s.session_time >= " . ( time() - 300 ) . " ! ORDER BY s.session_time DESC"; ! } ! else ! { ! $sql = "SELECT u.*, s.*, s.session_time AS user_session_time ! FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE . " s ! WHERE u.user_id <> " . ANONYMOUS . " ! AND u.user_id = s.session_user_id ! AND s.session_time >= " . ( time() - 300 ) . " ! ORDER BY s.session_time DESC"; ! } ! return $sql; ! } ! ! /** ! * Enter description here... ! * ! * @param unknown_type $str_ip ! * @return unknown ! */ ! function decode_ip($str_ip) ! { ! return $str_ip; ! } ! ! /** ! * Enter description here... ! * ! * @return unknown ! */ ! function get_phpbb_version() ! { ! global $board_config; ! ! return $board_config['version']; ! } ! ! /** ! * Enter description here... ! * ! * @return unknown ! */ ! function confirm_backend() ! { ! global $portal_config; ! ! return PORTAL_BACKEND == $portal_config['portal_backend']; ! } ! /** * Get username details for placing into templates. *************** *** 834,841 **** $profile_url = ''; ! //Added by OryNider if (($username == false) || ($username_colour == false)) ! { $this_userdata = mx_get_userdata($user_id, false); $user_id = $this_userdata['user_id']; --- 1162,1169 ---- $profile_url = ''; ! //Added by OryNider if (($username == false) || ($username_colour == false)) ! { $this_userdata = mx_get_userdata($user_id, false); $user_id = $this_userdata['user_id']; *************** *** 845,849 **** //Added Ends ! $username_colour = ($username_colour) ? '#' . $username_colour : ''; if ($guest_username === false) --- 1173,1177 ---- //Added Ends ! $username_colour = ($username_colour) ? '#' . $username_colour : ''; if ($guest_username === false) *************** *** 914,919 **** break; } ! } ! } --- 1242,1523 ---- break; } ! } ! ! // ! // ACP ! // ! /** ! * Enter description here... ! * ! */ ! function load_phpbb_acp_menu() ! { ! global $phpbb_root_path, $template, $lang, $phpEx, $theme, $userdata, $mx_user; ! ! $template->assign_block_vars('module_phpbb', array( ! 'L_PHPBB' => $lang['Phpbb'], ! "L_FORUM_INDEX" => $lang['Main_index'], ! "L_PREVIEW_FORUM" => $lang['Preview_forum'], ! "U_FORUM_INDEX" => mx_append_sid(PHPBB_URL . "index.$phpEx"), ! )); ! ! $menu_cat_id = 0; ! ! $template->assign_block_vars('module_phpbb.catrow', array( ! //+MOD: DHTML Menu for ACP ! 'MENU_CAT_ID' => $menu_cat_id, ! 'MENU_CAT_ROWS' => 1, ! //-MOD: DHTML Menu for ACP ! 'ADMIN_CATEGORY' => 'Olympus adminCP') ! ); ! ! $template->assign_block_vars('module_phpbb.catrow.modulerow', array( ! "ROW_COLOR" => "#" . $theme['td_color1'], ! "ROW_CLASS" => $theme['td_class1'], ! //+MOD: DHTML Menu for ACP ! 'ROW_COUNT' => 0, ! //-MOD: DHTML Menu for ACP ! "ADMIN_MODULE" => 'Go!', ! "U_ADMIN_MODULE" => mx_append_sid($phpbb_root_path . 'adm/index.php?sid='.$mx_user->session_id)) ! ); ! } ! ! /** ! * Enter description here... ! * ! */ ! function load_forum_stats() ! { ! global $db, $template, $board_config, $portal_config, $phpbb_root_path, $mx_root_path, $lang, $theme, $mx_user, $userdata; ! ! $template->assign_block_vars("forum_stats", array()); ! // ! // Get forum statistics ! // ! $total_posts = phpBB2::get_db_stat('postcount'); ! $total_users = phpBB2::get_db_stat('usercount'); ! $total_topics = phpBB2::get_db_stat('topiccount'); ! ! $start_date = phpBB2::create_date($board_config['default_dateformat'], $board_config['board_startdate'], $board_config['board_timezone']); ! ! $boarddays = ( time() - $board_config['board_startdate'] ) / 86400; ! ! $posts_per_day = sprintf("%.2f", $total_posts / $boarddays); ! $topics_per_day = sprintf("%.2f", $total_topics / $boarddays); ! $users_per_day = sprintf("%.2f", $total_users / $boarddays); ! ! $avatar_dir_size = 0; ! ! if ($avatar_dir = @opendir($phpbb_root_path . $board_config['avatar_path']) ) ! { ! while( $file = @readdir($avatar_dir) ) ! { ! if( $file != "." && $file != ".." ) ! { ! $avatar_dir_size += @filesize($phpbb_root_path . $board_config['avatar_path'] . "/" . $file); ! } ! } ! @closedir($avatar_dir); ! ! // ! // This bit of code translates the avatar directory size into human readable format ! // Borrowed the code from the PHP.net annoted manual, origanally written by: ! // Jesse (je...@je...) ! // ! if($avatar_dir_size >= 1048576) ! { ! $avatar_dir_size = round($avatar_dir_size / 1048576 * 100) / 100 . " MB"; ! } ! else if($avatar_dir_size >= 1024) ! { ! $avatar_dir_size = round($avatar_dir_size / 1024 * 100) / 100 . " KB"; ! } ! else ! { ! $avatar_dir_size = $avatar_dir_size . " Bytes"; ! } ! } ! else ! { ! // Couldn't open Avatar dir. ! $avatar_dir_size = $lang['Not_available']; ! } ! ! if($posts_per_day > $total_posts) ! { ! $posts_per_day = $total_posts; ! } ! ! if($topics_per_day > $total_topics) ! { ! $topics_per_day = $total_topics; ! } ! ! if($users_per_day > $total_users) ! { ! $users_per_day = $total_users; ! } ! ! // ! // DB size ... MySQL only ! // ! // This code is heavily influenced by a similar routine ! // in phpMyAdmin 2.2.0 ! // ! if( preg_match("/^mysql/", SQL_LAYER) ) ! { ! $sql = "SELECT VERSION() AS mysql_version"; ! if($result = $db->sql_query($sql)) ! { ! $row = $db->sql_fetchrow($result); ! $version = $row['mysql_version']; ! ! if( preg_match("/^(3\.23|4\.|5\.)/", $version) ) ! { ! $db_name = ( preg_match("/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)|(5\.)/", $version) ) ? "`$dbname`" : $dbname; ! ! $sql = "SHOW TABLE STATUS ! FROM " . $db_name; ! if($result = $db->sql_query($sql)) ! { ! $tabledata_ary = $db->sql_fetchrowset($result); ! ! $dbsize = 0; ! for($i = 0; $i < count($tabledata_ary); $i++) ! { ! if( $tabledata_ary[$i]['Type'] != "MRG_MyISAM" ) ! { ! if( $table_prefix != "" ) ! { ! if( strstr($tabledata_ary[$i]['Name'], $table_prefix) ) ! { ! $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; ! } ! } ! else ! { ! $dbsize += $tabledata_ary[$i]['Data_length'] + $tabledata_ary[$i]['Index_length']; ! } ! } ! } ! } // Else we couldn't get the table status. ! } ! else ! { ! $dbsize = $lang['Not_available']; ! } ! } ! else ! { ! $dbsize = $lang['Not_available']; ! } ! $db->sql_freeresult($result); ! } ! else if( preg_match("/^mssql/", SQL_LAYER) ) ! { ! $sql = "SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize ! FROM sysfiles"; ! if( $result = $db->sql_query($sql) ) ! { ! $dbsize = ( $row = $db->sql_fetchrow($result) ) ? intval($row['dbsize']) : $lang['Not_available']; ! } ! else ! { ! $dbsize = $lang['Not_available']; ! } ! $db->sql_freeresult($result); ! } ! else ! { ! $dbsize = $lang['Not_available']; ! } ! ! if ( is_integer($dbsize) ) ! { ! if( $dbsize >= 1048576 ) ! { ! $dbsize = sprintf("%.2f MB", ( $dbsize / 1048576 )); ! } ! else if( $dbsize >= 1024 ) ! { ! $dbsize = sprintf("%.2f KB", ( $dbsize / 1024 )); ! } ! else ! { ! $dbsize = sprintf("%.2f Bytes", $dbsize); ! } ! } ! ! $template->assign_vars(array( ! "NUMBER_OF_POSTS" => $total_posts, ! "NUMBER_OF_TOPICS" => $total_topics, ! "NUMBER_OF_USERS" => $total_users, ! "START_DATE" => $start_date, ! "POSTS_PER_DAY" => $posts_per_day, ! "TOPICS_PER_DAY" => $topics_per_day, ! "USERS_PER_DAY" => $users_per_day, ! "AVATAR_DIR_SIZE" => $avatar_dir_size, ! "DB_SIZE" => $dbsize, ! "GZIP_COMPRESSION" => ( $board_config['gzip_compress'] ) ? $lang['ON'] : $lang['OFF']) ! ); ! } ! ! /** ! * Enter description here... ! * ! * @return unknown ! */ ! function phpbb_version_check() ! { ! global $board_config, $lang; ! ! $current_phpbb_version = explode('.', '' . $board_config['version']); ! $minor_phpbb_revision = (int) $current_phpbb_version[3]; ! ! $errno = 0; ! $errstr = $phpbb_version_info = ''; ! ! if ($fsock = @fsockopen('www.phpbb.com', 80, $errno, $errstr, 10)) ! { ! $phpbb_version_info = mx_get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno); ! if ($info === false) ! { ! trigger_error($errstr, E_USER_WARNING); ! } ! ! $phpbb_version_info = explode("\n", $phpbb_version_info); ! ! $announcement_url = trim($info[1]); ! //$update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update'); ! $latest_phpbb_head_revision = trim($phpbb_version_info[0]); ! $latest_phpbb_minor_revision = trim($phpbb_version_info[2]); ! $latest_phpbb_version = trim($phpbb_version_info[0]) . '.' . trim($phpbb_version_info[1]) . '.' . trim($phpbb_version_info[2]); ! ! if ($latest_phpbb_head_revision == 3 && $minor_phpbb_revision == $latest_phpbb_minor_revision) ! { ! $phpbb_version_info = '<p style="color:green">' . $lang['Version_up_to_date'] . '</p>'; ! } ! else ! { ! $phpbb_version_info = '<p style="color:red">' . $lang['Version_not_up_to_date']; ! $phpbb_version_info .= '<br />' . sprintf($lang['Latest_version_info'], $latest_phpbb_version) . sprintf($lang['Current_version_info'], $board_config['version']) . '</p>'; ! } ! } ! else ! { ! if ($errstr) ! { ! $phpbb_version_info = '<p style="color:red">' . sprintf($lang['Connect_socket_error'], $errstr) . '</p>'; ! } ! else ! { ! $phpbb_version_info = '<p>' . $lang['Socket_functions_disabled'] . '</p>'; ! } ! } ! ! $phpbb_version_info .= '<p>' . $lang['Mailing_list_subscribe_reminder'] . '</p>'; ! ! return $phpbb_version_info; ! } } Index: constants.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/phpbb3/constants.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** constants.php 15 Jun 2008 09:15:44 -0000 1.3 --- constants.php 31 Oct 2008 18:54:23 -0000 1.4 *************** *** 55,58 **** --- 55,64 ---- @define('LOGIN_ERROR_PASSWORD_CONVERT', 15); + // Error codes (from phpbb2) + @define('GENERAL_MESSAGE', 200); + @define('GENERAL_ERROR', 202); + @define('CRITICAL_MESSAGE', 203); + @define('CRITICAL_ERROR', 204); + // Group settings @define('GROUP_OPEN', 0); Index: session.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/phpbb3/session.php,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** session.php 7 Oct 2008 09:12:07 -0000 1.38 --- session.php 31 Oct 2008 18:54:23 -0000 1.39 *************** *** 129,133 **** function extract_current_page($root_path) { - global $phpBB2; $page_array = array(); --- 129,132 ---- *************** *** 166,171 **** // current directory within the phpBB root (for example: adm) ! $root_dirs = explode('/', str_replace('\\', '/', $phpBB2->phpbb_realpath($root_path))); ! $page_dirs = explode('/', str_replace('\\', '/', $phpBB2->phpbb_realpath('./'))); $intersection = array_intersect_assoc($root_dirs, $page_dirs); --- 165,170 ---- // current directory within the phpBB root (for example: adm) ! $root_dirs = explode('/', str_replace('\\', '/', phpBB2::phpbb_realpath($root_path))); ! $page_dirs = explode('/', str_replace('\\', '/', phpBB2::phpbb_realpath('./'))); $intersection = array_intersect_assoc($root_dirs, $page_dirs); *************** *** 229,233 **** function session_begin($update_session_page = true) { ! global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $board_config, $phpbb_root_path, $phpBB3; // Give us some basic information --- 228,232 ---- function session_begin($update_session_page = true) { ! global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $board_config, $phpbb_root_path; // Give us some basic information *************** *** 270,276 **** if (isset($_COOKIE[$board_config['cookie_name'] . '_sid']) || isset($_COOKIE[$board_config['cookie_name'] . '_u'])) { ! $this->cookie_data['u'] = $phpBB3->request_var($board_config['cookie_name'] . '_u', 0, false, true); ! $this->cookie_data['k'] = $phpBB3->request_var($board_config['cookie_name'] . '_k', '', false, true); ! $this->session_id = $phpBB3->request_var($board_config['cookie_name'] . '_sid', '', false, true); // original code: $SID = (defined('NEED_SID')) ? 'sid=' . $this->session_id : 'sid='; --- 269,275 ---- if (isset($_COOKIE[$board_config['cookie_name'] . '_sid']) || isset($_COOKIE[$board_config['cookie_name'] . '_u'])) { ! $this->cookie_data['u'] = phpBB3::request_var($board_config['cookie_name'] . '_u', 0, false, true); ! $this->cookie_data['k'] = phpBB3::request_var($board_config['cookie_name'] . '_k', '', false, true); ! $this->session_id = phpBB3::request_var($board_config['cookie_name'] . '_sid', '', false, true); // original code: $SID = (defined('NEED_SID')) ? 'sid=' . $this->session_id : 'sid='; *************** *** 280,284 **** if (empty($this->session_id)) { ! $this->session_id = $_SID = $phpBB3->request_var('sid', ''); $SID = 'sid=' . $this->session_id; $this->cookie_data = array('u' => 0, 'k' => ''); --- 279,283 ---- if (empty($this->session_id)) { ! $this->session_id = $_SID = phpBB3::request_var('sid', ''); $SID = 'sid=' . $this->session_id; $this->cookie_data = array('u' => 0, 'k' => ''); *************** *** 287,291 **** else { ! $this->session_id = $_SID = $phpBB3->request_var('sid', ''); $SID = 'sid=' . $this->session_id; } --- 286,290 ---- else { ! $this->session_id = $_SID = phpBB3::request_var('sid', ''); $SID = 'sid=' . $this->session_id; } *************** *** 439,444 **** function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true) { ! global $SID, $_SID, $db, $board_config, $cache, $phpbb_root_path, $phpEx; ! global $phpBB3; $this->data = array(); --- 438,442 ---- function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true) { ! global $SID, $_SID, $db, $board_config, $cache, $phpbb_root_path, $phpEx, $mx_backend; $this->data = array(); *************** *** 465,469 **** */ $bot = false; ! $active_bots = $cache->obtain_bots(); foreach ($active_bots as $row) --- 463,467 ---- */ $bot = false; ! $active_bots = $mx_backend->obtain_bots(); foreach ($active_bots as $row) *************** *** 713,717 **** } ! $this->session_id = $this->data['session_id'] = md5($phpBB3->unique_id()); $sql_ary['session_id'] = (string) $this->session_id; --- 711,715 ---- } ! $this->session_id = $this->data['session_id'] = md5(phpBB3::unique_id()); $sql_ary['session_id'] = (string) $this->session_id; *************** *** 1204,1208 **** function set_login_key($user_id = false, $key = false, $user_ip = false) { ! global $board_config, $db, $phpBB3; $user_id = ($user_id === false) ? $this->data['user_id'] : $user_id; --- 1202,1206 ---- function set_login_key($user_id = false, $key = false, $user_ip = false) { ! global $board_config, $db; $user_id = ($user_id === false) ? $this->data['user_id'] : $user_id; *************** *** 1210,1214 **** $key = ($key === false) ? (($this->cookie_data['k']) ? $this->cookie_data['k'] : false) : $key; ! $key_id = $phpBB3->unique_id(hexdec(substr($this->session_id, 0, 8))); $sql_ary = array( --- 1208,1212 ---- $key = ($key === false) ? (($this->cookie_data['k']) ? $this->cookie_data['k'] : false) : $key; ! $key_id = phpBB3::unique_id(hexdec(substr($this->session_id, 0, 8))); $sql_ary = array( *************** *** 1309,1313 **** $this->dst = $board_config['board_dst'] * 3600; } ! if ((@include $this->lang_path . "common.$phpEx") === false) --- 1307,1311 ---- $this->dst = $board_config['board_dst'] * 3600; } ! if ((@include $this->lang_path . "common.$phpEx") === false) *************** *** 1319,1323 **** } } ! // // We include common language file here to not load it every time a custom language file is included --- 1317,1321 ---- } } ! // // We include common language file here to not load it every time a custom language file is included *************** *** 1335,1339 **** { global $db, $template, $board_config, $userdata, $phpbb_auth, $phpEx, $phpbb_root_path, $mx_root_path, $mx_cache; ! global $mx_request_vars, $portal_config, $mx_backend, $phpBB3; //added for mxp if (!empty($_GET['style']) && $phpbb_auth->acl_get('a_styles')) --- 1333,1337 ---- { global $db, $template, $board_config, $userdata, $phpbb_auth, $phpEx, $phpbb_root_path, $mx_root_path, $mx_cache; ! global $mx_request_vars, $portal_config, $mx_backend; //added for mxp if (!empty($_GET['style']) && $phpbb_auth->acl_get('a_styles')) *************** *** 1341,1345 **** global $SID, $_EXTRA_URL; ! $style = $phpBB3->request_var('style', 0); $SID .= '&style=' . $style; $_EXTRA_URL = array('style=' . $style); --- 1339,1343 ---- global $SID, $_EXTRA_URL; ! $style = phpBB3::request_var('style', 0); $SID .= '&style=' . $style; $_EXTRA_URL = array('style=' . $style); *************** *** 1348,1367 **** { $style = $this->style; ! if(!$board_config['override_user_style'] && ($this->data['user_id'] != ANONYMOUS)) ! { // Set up style $style = $this->data['user_style'] ? $this->data['user_style'] : $board_config['default_style']; } else ! { $default_style = $portal_config['default_style']; //If user have other style in mxp then the one from phpBB not to have forum page and modules graphics will be messaed up //Anonymouse users should see all block graphic corect //Query phpBB style_id corepondent to mxp themes_id ! $sql = "SELECT s.style_id FROM " . MX_THEMES_TABLE . " AS m, " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t WHERE m.themes_id = " . (int) $default_style . " ! AND t.template_path = m.template_name AND t.template_id = s.template_id"; --- 1346,1365 ---- { $style = $this->style; ! if(!$board_config['override_user_style'] && ($this->data['user_id'] != ANONYMOUS)) ! { // Set up style $style = $this->data['user_style'] ? $this->data['user_style'] : $board_config['default_style']; } else ! { $default_style = $portal_config['default_style']; //If user have other style in mxp then the one from phpBB not to have forum page and modules graphics will be messaed up //Anonymouse users should see all block graphic corect //Query phpBB style_id corepondent to mxp themes_id ! $sql = "SELECT s.style_id FROM " . MX_THEMES_TABLE . " AS m, " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t WHERE m.themes_id = " . (int) $default_style . " ! AND t.template_path = m.template_name AND t.template_id = s.template_id"; *************** *** 1369,1390 **** { $style = $row['style_id']; //User style ! } else { ! $style = $this->data['user_style'] ? $this->data['user_style'] : $board_config['default_style']; } } ! // Set up style Temp code should be removed after bugtraking $style = ($style) ? $style : ((!$board_config['override_user_style'] && $this->data['user_id'] != ANONYMOUS) ? $this->data['user_style'] : $this->phpbb_style['style_id']); ! } $sql = "SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name FROM " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t, " . STYLES_THEME_TABLE . " AS c, " . STYLES_IMAGESET_TABLE . " i ! WHERE s.style_id = " . (int) $style . " AND t.template_id = s.template_id AND c.theme_id = s.theme_id ! AND i.imageset_id = s.imageset_id"; if ( !($result = $db->sql_query($sql, 3600)) ) --- 1367,1388 ---- { $style = $row['style_id']; //User style ! } else { ! $style = $this->data['user_style'] ? $this->data['user_style'] : $board_config['default_style']; } } ! // Set up style Temp code should be removed after bugtraking $style = ($style) ? $style : ((!$board_config['override_user_style'] && $this->data['user_id'] != ANONYMOUS) ? $this->data['user_style'] : $this->phpbb_style['style_id']); ! } $sql = "SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name FROM " . STYLES_TABLE . " AS s, " . STYLES_TEMPLATE_TABLE . " AS t, " . STYLES_THEME_TABLE . " AS c, " . STYLES_IMAGESET_TABLE . " i ! WHERE s.style_id = " . (int) $style . " AND t.template_id = s.template_id AND c.theme_id = s.theme_id ! AND i.imageset_id = s.imageset_id"; if ( !($result = $db->sql_query($sql, 3600)) ) *************** *** 1528,1532 **** if (@file_exists("{$phpbb_root_path}styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg")) { ! $cfg_data_imageset_data = $phpBB3->parse_cfg_file("{$phpbb_root_path}styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg"); foreach ($cfg_data_imageset_data as $image_name => $value) { --- 1526,1530 ---- if (@file_exists("{$phpbb_root_path}styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg")) { ! $cfg_data_imageset_data = phpBB3::parse_cfg_file("{$phpbb_root_path}styles/{$this->theme['imageset_path']}/imageset/{$this->img_lang}/imageset.cfg"); foreach ($cfg_data_imageset_data as $image_name => $value) { *************** *** 1869,1875 **** $this->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row; $db->sql_freeresult($result); ! } - /** * Specify/Get images --- 1867,1873 ---- $this->profile_fields = (!($row = $db->sql_fetchrow($result))) ? array() : $row; $db->sql_freeresult($result); ! } ! /** * Specify/Get images *************** *** 1897,1901 **** $alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt; ! switch ($type) { --- 1895,1899 ---- $alt = (!empty($this->lang[$alt])) ? $this->lang[$alt] : $alt; ! switch ($type) { Index: bbcode.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/phpbb3/bbcode.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bbcode.php 7 Oct 2008 03:17:57 -0000 1.4 --- bbcode.php 31 Oct 2008 18:54:23 -0000 1.5 *************** *** 16,34 **** // ! // Here comes a mxp version of original phpbb2 bbcode.php ! // Last in file are the mxp wrapper functions // ! ! define("BBCODE_UID_LEN", 10); ! ! // global that holds loaded-and-prepared bbcode templates, so we only have to do ! // that stuff once. [...1703 lines suppressed...] ! } return $message; } - - //Core BBCode Starts /** --- 246,256 ---- // Make sure the delimiter # is added in front and at the end of every element within $match $message = trim(preg_replace(explode(chr(0), '#' . implode('#' . chr(0) . '#', $match) . '#'), $replace, $message)); } } ! $message = str_replace("{SMILIES_PATH}", $this->smiley_path_url . $this->smilies_path . $smilies[$i][$this->smiley_url], ' ' . $message . ' '); return $message; } /** |