Update of /cvsroot/mxbb/core/includes/sessions/olympus In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv28031 Added Files: auth.php bbcode.php constants.php core.php functions.php index.htm login.php session.php Log Message: --- NEW FILE: login.php --- <?php /** * * @package MX-Publisher Core * @version $Id: login.php,v 1.1 2014/07/07 20:38:12 orynider Exp $ * @copyright (c) 2002-2008 MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://mxpcms.sourceforge.net/ * */ if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } if($mx_request_vars->is_request('login') && ($userdata['user_id'] == ANONYMOUS || $mx_request_vars->is_post('admin')) ) { $username = utf8_clean_string($mx_request_vars->post('username', MX_TYPE_NO_TAGS, '')); $password = $mx_request_vars->post('password', MX_TYPE_NO_TAGS); $viewonline = $mx_request_vars->post('viewonline', MX_TYPE_INT, 0); $sql = "SELECT * FROM " . USERS_TABLE . " WHERE username = '" . str_replace("\\'", "''", $username) . "' OR username_clean = '" . str_replace("\\'", "''", $username) . "'"; if ( !($result = $db->sql_query($sql) ) ) { mx_message_die(GENERAL_ERROR, 'Error in obtaining userdata', '', __LINE__, __FILE__, $sql); } if( $row = $db->sql_fetchrow($result) ) { //$user_type = $row['user_level']; // phpBB2 $user_type = $row['user_type']; // phpBB3 if( $user_type != ADMIN && $board_config['board_disable'] ) { mx_redirect(mx3_append_sid("index.$phpEx", false)); } else { $user_login_attempts = $row['user_login_attempts']; if ( $user_login_attempts && $board_config['login_reset_time'] ) { $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_login_attempts = 0 WHERE user_id = ' . $row['user_id']); $row['user_last_login_try'] = $row['user_login_tries'] = 0; } // Check to see if user is allowed to login again... if his tries are exceeded if ($user_login_attempt && $board_config['login_reset_time'] && $board_config['max_login_attempts'] && $user_login_attempts >= $board_config['max_login_attempts'] && $userdata['user_level'] != ADMIN) { mx_message_die(GENERAL_MESSAGE, sprintf($lang['Login_attempts_exceeded'], $board_config['max_login_attempts'], $board_config['login_reset_time'])); } // If the password convert flag is set we need to convert it if ($row['user_pass_convert']) { // in phpBB2 passwords were used exactly as they were sent, with addslashes applied $password_old_format = isset($_REQUEST['password']) ? $_REQUEST['password'] : $password; $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, ''); if ($password == $password_new_format) { if (!function_exists('utf8_to_cp1252')) { global $mx_root_path, $phpEx; 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(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 $sql = 'UPDATE ' . USERS_TABLE . ' SET user_password = \'' . $db->sql_escape($hash) . '\', user_pass_convert = 0 WHERE user_id = ' . $row['user_id']; $db->sql_query($sql); $row['user_pass_convert'] = 0; $row['user_password'] = $hash; } else { // Although we weren't able to convert this password we have to // increase login attempt count to make sure this cannot be exploited $sql = 'UPDATE ' . USERS_TABLE . ' SET user_login_attempts = user_login_attempts + 1 WHERE user_id = ' . $row['user_id']; $db->sql_query($sql); mx_message_die(GENERAL_MESSAGE, 'We are sorry but password convertion failed, please login direct in forums or rewuest a new activation link.'); return array( 'status' => LOGIN_ERROR_PASSWORD_CONVERT, 'error_msg' => 'LOGIN_ERROR_PASSWORD_CONVERT', 'user_row' => $row, ); } } } else { // in phpBB2 passwords were used exactly as they were sent, with addslashes applied $password_old_format = isset($_REQUEST['password']) ? $_REQUEST['password'] : $password; $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, ''); if ($password_new_format == $password_old_format) { if (!function_exists('utf8_to_cp1252')) { global $mx_root_path, $phpEx; 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'); $admin = $mx_request_vars->is_post('admin'); $mx_user->session_create($row['user_id'], $admin, $autologin, $viewonline = true); $session_id = $mx_user->session_id; // Reset login tries //$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_login_tries = 0, user_last_login_try = 0 WHERE user_id = ' . $row['user_id']); // phpBB2 $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_login_attempts = 0 WHERE user_id = ' . $row['user_id']); // phpBB3 if( $session_id ) { $fromurl = ( !empty($HTTP_REFERER) ) ? str_replace('&', '&', htmlspecialchars($HTTP_REFERER)) : "index.$phpEx"; $url = !$mx_request_vars->is_empty_post('redirect') ? str_replace('&', '&', $mx_request_vars->post('redirect', MX_TYPE_NO_TAGS)) : $fromurl; mx_redirect(mx3_append_sid($url, false, false, $session_id)); } else { mx_message_die(CRITICAL_ERROR, "Couldn't start session : login", "", __LINE__, __FILE__); } } else { // Although we weren't able to convert this password we have to // increase login attempt count to make sure this cannot be exploited $sql = ' UPDATE ' . USERS_TABLE . ' SET user_login_attempts = user_login_attempts + 1 WHERE user_id = ' . $row['user_id']; $db->sql_query($sql); $redirect = !$mx_request_vars->is_empty_post('redirect') ? str_replace('&', '&', $mx_request_vars->post('redirect', MX_TYPE_NO_TAGS)) : ''; $redirect = str_replace('?', '&', $redirect); if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r")) { mx_message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.'); } $template->assign_vars(array( 'META' => "<meta http-equiv=\"refresh\" content=\"3;url=login.$phpEx?redirect=$redirect\">") ); $message = $lang['Error_login'] . '<br /><br />' . sprintf($lang['Click_return_login'], "<a href=\"login.$phpEx?redirect=$redirect\">", '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . mx3_append_sid("index.$phpEx") . '">', '</a>'); mx_message_die(GENERAL_MESSAGE, $message); } } // Check password ... if (!$row['user_pass_convert'] && phpBB3::phpbb_check_hash($password, $row['user_password'])) { if ($row['user_login_attempts'] != 0) { // Successful, reset login attempts (the user passed all stages) $sql = 'UPDATE ' . USERS_TABLE . ' SET user_login_attempts = 0 WHERE user_id = ' . $row['user_id']; $db->sql_query($sql); } // User inactive... if ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) { mx_message_die(GENERAL_MESSAGE, 'Inactive User'); } // Successful login... set user_login_attempts to zero... if( $session_id ) { $url = !$mx_request_vars->is_empty_post('redirect') ? str_replace('&', '&', $mx_request_vars->post('redirect', MX_TYPE_NO_TAGS)) : "index.$phpEx"; mx_redirect(mx3_append_sid($url, false)); } else { mx_message_die(CRITICAL_ERROR, "Couldn't start session : login", "", __LINE__, __FILE__); } } } } } else { $redirect = !$mx_request_vars->is_empty_post('redirect') ? str_replace('&', '&', $mx_request_vars->post('redirect', MX_TYPE_NO_TAGS)) : ''; $redirect = str_replace("?", "&", $redirect); if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r")) { mx_message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.'); } $template->assign_vars(array( 'META' => "<meta http-equiv=\"refresh\" content=\"3;url=login.$phpEx?redirect=$redirect\">") ); $message = $lang['Error_login'] . '<br /><br />' . sprintf($lang['Click_return_login'], "<a href=\"login.$phpEx?redirect=$redirect\">", '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . mx3_append_sid("index.$phpEx") . '">', '</a>'); mx_message_die(GENERAL_MESSAGE, $message); } } else if ($mx_request_vars->is_request('logout') && $userdata['session_logged_in'] ) { // session id check if ($sid == '' || $sid != $userdata['session_id']) { mx_message_die(GENERAL_ERROR, 'Invalid_session' . $userdata['session_id']); } if( $userdata['session_logged_in'] ) { $mx_user->session_kill(); } if (!$mx_request_vars->is_empty_request('redirect')) { $url = $mx_request_vars->post('redirect', MX_TYPE_NO_TAGS); $url = str_replace('&', '&', $url); mx_redirect(mx3_append_sid($url, false)); } else { mx_redirect(mx3_append_sid("index.$phpEx", false)); } } else { $url = !$mx_request_vars->is_empty_post('redirect') ? str_replace('&', '&', $mx_request_vars->post('redirect', MX_TYPE_NO_TAGS)) : "index.$phpEx"; mx_redirect(mx3_append_sid($url, false)); } ?> --- NEW FILE: functions.php --- <?php /** * * @package Auth * @version $Id: functions.php,v 1.1 2014/07/07 20:38:12 orynider Exp $ * @copyright (c) 2002-2008 MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://mxpcms.sourceforge.net/ * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /** * Olympus Parse cfg file */ function mx_parse_cfg_file($filename, $lines = false) { $parsed_items = array(); if ($lines === false) { $lines = file($filename); } foreach ($lines as $line) { $line = trim($line); if (!$line || $line[0] == '#' || ($delim_pos = strpos($line, '=')) === false) { continue; } // Determine first occurrence, since in values the equal sign is allowed $key = strtolower(trim(substr($line, 0, $delim_pos))); $value = trim(substr($line, $delim_pos + 1)); if (in_array($value, array('off', 'false', '0'))) { $value = false; } else if (in_array($value, array('on', 'true', '1'))) { $value = true; } else if (!trim($value)) { $value = ''; } else if (($value[0] == "'" && $value[sizeof($value) - 1] == "'") || ($value[0] == '"' && $value[sizeof($value) - 1] == '"')) { $value = substr($value, 1, sizeof($value)-2); } $parsed_items[$key] = $value; } return $parsed_items; } /** * Add log event */ function mx_add_log() { global $db, $mx_user; $args = func_get_args(); $mode = array_shift($args); $reportee_id = ($mode == 'user') ? intval(array_shift($args)) : ''; $forum_id = ($mode == 'mod') ? intval(array_shift($args)) : ''; $topic_id = ($mode == 'mod') ? intval(array_shift($args)) : ''; $action = array_shift($args); $data = (!sizeof($args)) ? '' : serialize($args); $sql_ary = array( 'user_id' => (empty($mx_user->data)) ? ANONYMOUS : $mx_user->data['user_id'], 'log_ip' => $mx_user->ip, 'log_time' => time(), 'log_operation' => $action, 'log_data' => $data, ); switch ($mode) { case 'admin': $sql_ary['log_type'] = LOG_ADMIN; break; case 'mod': $sql_ary += array( 'log_type' => LOG_MOD, 'forum_id' => $forum_id, 'topic_id' => $topic_id ); break; case 'user': $sql_ary += array( 'log_type' => LOG_USERS, 'reportee_id' => $reportee_id ); break; case 'critical': $sql_ary['log_type'] = LOG_CRITICAL; break; default: return false; } $db->sql_query('INSERT INTO ' . LOG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); return $db->sql_nextid(); } /** * Generate sort selection fields */ function mx_gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, &$sort_dir, &$s_limit_days, &$s_sort_key, &$s_sort_dir, &$u_sort_param) { global $mx_user; $sort_dir_text = array('a' => $mx_user->lang['ASCENDING'], 'd' => $mx_user->lang['DESCENDING']); // Check if the key is selectable. If not, we reset to the first key found. // This ensures the values are always valid. if (!isset($limit_days[$sort_days])) { @reset($limit_days); $sort_days = key($limit_days); } if (!isset($sort_by_text[$sort_key])) { @reset($sort_by_text); $sort_key = key($sort_by_text); } if (!isset($sort_dir_text[$sort_dir])) { @reset($sort_dir_text); $sort_dir = key($sort_dir_text); } $s_limit_days = '<select name="st">'; foreach ($limit_days as $day => $text) { $selected = ($sort_days == $day) ? ' selected="selected"' : ''; $s_limit_days .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>'; } $s_limit_days .= '</select>'; $s_sort_key = '<select name="sk">'; foreach ($sort_by_text as $key => $text) { $selected = ($sort_key == $key) ? ' selected="selected"' : ''; $s_sort_key .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>'; } $s_sort_key .= '</select>'; $s_sort_dir = '<select name="sd">'; foreach ($sort_dir_text as $key => $value) { $selected = ($sort_dir == $key) ? ' selected="selected"' : ''; $s_sort_dir .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>'; } $s_sort_dir .= '</select>'; $u_sort_param = "st=$sort_days&sk=$sort_key&sd=$sort_dir"; return; } /** * Get username details for placing into templates. * * @param string $mode Can be profile (for getting an url to the profile), username (for obtaining the username), colour (for obtaining the user colour) or full (for obtaining a html string representing a coloured link to the users profile). * @param int $user_id The users id * @param string $username The users name * @param string $username_colour The users colour * @param string $guest_username optional parameter to specify the guest username. It will be used in favor of the GUEST language variable then. * @param string $custom_profile_url optional parameter to specify a profile url. The user id get appended to this url as &u={user_id} * * @return string A string consisting of what is wanted based on $mode. */ function mx_get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false) { global $phpbb_root_path, $phpEx, $mx_user, $phpbb_auth; $profile_url = ''; $username_colour = ($username_colour) ? '#' . $username_colour : ''; if ($guest_username === false) { $username = ($username) ? $username : $mx_user->lang['GUEST']; } else { $username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $mx_user->lang['GUEST']); } // Only show the link if not anonymous if ($user_id && $user_id != ANONYMOUS) { // Do not show the link if the user is already logged in but do not have u_viewprofile permissions (relevant for bots mostly). // For all others the link leads to a login page or the profile. if ($mx_user->data['user_id'] != ANONYMOUS && !$phpbb_auth->acl_get('u_viewprofile')) { $profile_url = ''; } else { $profile_url = ($custom_profile_url !== false) ? $custom_profile_url : mx3_append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile'); $profile_url .= '&u=' . (int) $user_id; } } else { $profile_url = ''; } switch ($mode) { case 'profile': return $profile_url; break; case 'username': return $username; break; case 'colour': return $username_colour; break; case 'full': default: $tpl = ''; if (!$profile_url && !$username_colour) { $tpl = '{USERNAME}'; } else if (!$profile_url && $username_colour) { $tpl = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>'; } else if ($profile_url && !$username_colour) { $tpl = '<a href="{PROFILE_URL}">{USERNAME}</a>'; } else if ($profile_url && $username_colour) { $tpl = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>'; } return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), $tpl); break; } } ?> --- NEW FILE: core.php --- <?php /** * * @package Auth * @version $Id: core.php,v 1.1 2014/07/07 20:38:12 orynider Exp $ * @copyright (c) 2002-2008 MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://mxpcms.sourceforge.net/ * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } // // First off, include common vanilla phpBB functions, from our shared dir // Note: These functions will later be accessible wrapped as phpBBX::orig_functionname() [...1519 lines suppressed...] $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; } } // // Now load some bbcodes, to be extended for this backend (see below) // include_once($mx_root_path . 'includes/sessions/olympus/bbcode.' . $phpEx); // BBCode associated functions ?> --- NEW FILE: constants.php --- <?php /** * * @package Style * @version $Id: constants.php,v 1.1 2014/07/07 20:38:12 orynider Exp $ * @copyright (c) 2002-2008 MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://mxpcms.sourceforge.net/ * */ /** * Modifications: * define -> @define * to supress any notices since in mx_constants.php some are allready @@defined */ // User related @define('ANONYMOUS', 1); @define('USER_ACTIVATION_NONE', 0); @define('USER_ACTIVATION_SELF', 1); @define('USER_ACTIVATION_ADMIN', 2); @define('USER_ACTIVATION_DISABLE', 3); @define('AVATAR_UPLOAD', 1); @define('AVATAR_REMOTE', 2); @define('AVATAR_GALLERY', 3); @define('USER_NORMAL', 0); @define('USER_INACTIVE', 1); @define('USER_IGNORE', 2); @define('USER_FOUNDER', 3); @define('INACTIVE_REGISTER', 1); @define('INACTIVE_PROFILE', 2); @define('INACTIVE_MANUAL', 3); @define('INACTIVE_REMIND', 4); // ACL @define('ACL_NEVER', 0); @define('ACL_YES', 1); @define('ACL_NO', -1); // Login error codes @define('LOGIN_CONTINUE', 1); @define('LOGIN_BREAK', 2); @define('LOGIN_SUCCESS', 3); @define('LOGIN_SUCCESS_CREATE_PROFILE', 20); @define('LOGIN_ERROR_USERNAME', 10); @define('LOGIN_ERROR_PASSWORD', 11); @define('LOGIN_ERROR_ACTIVE', 12); @define('LOGIN_ERROR_ATTEMPTS', 13); @define('LOGIN_ERROR_EXTERNAL_AUTH', 14); @define('LOGIN_ERROR_PASSWORD_CONVERT', 15); // SQL codes phpBB2 @define('BEGIN_TRANSACTION', 1); @define('END_TRANSACTION', 2); // 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); @define('GROUP_CLOSED', 1); @define('GROUP_HIDDEN', 2); @define('GROUP_SPECIAL', 3); @define('GROUP_FREE', 4); // Forum/Topic states @define('FORUM_CAT', 0); @define('FORUM_POST', 1); @define('FORUM_LINK', 2); @define('ITEM_UNLOCKED', 0); @define('ITEM_LOCKED', 1); @define('ITEM_MOVED', 2); // Forum Flags @define('FORUM_FLAG_LINK_TRACK', 1); @define('FORUM_FLAG_PRUNE_POLL', 2); @define('FORUM_FLAG_PRUNE_ANNOUNCE', 4); @define('FORUM_FLAG_PRUNE_STICKY', 8); @define('FORUM_FLAG_ACTIVE_TOPICS', 16); @define('FORUM_FLAG_POST_REVIEW', 32); // Optional text flags @define('OPTION_FLAG_BBCODE', 1); @define('OPTION_FLAG_SMILIES', 2); @define('OPTION_FLAG_LINKS', 4); // Topic types @define('POST_NORMAL', 0); @define('POST_STICKY', 1); @define('POST_ANNOUNCE', 2); @define('POST_GLOBAL', 3); // Lastread types @define('TRACK_NORMAL', 0); @define('TRACK_POSTED', 1); // Notify methods @define('NOTIFY_EMAIL', 0); @define('NOTIFY_IM', 1); @define('NOTIFY_BOTH', 2); // Email Priority Settings @define('MAIL_LOW_PRIORITY', 4); @define('MAIL_NORMAL_PRIORITY', 3); @define('MAIL_HIGH_PRIORITY', 2); // Log types @define('LOG_ADMIN', 0); @define('LOG_MOD', 1); @define('LOG_CRITICAL', 2); @define('LOG_USERS', 3); // Private messaging - Do NOT change these values @define('PRIVMSGS_HOLD_BOX', -4); @define('PRIVMSGS_NO_BOX', -3); @define('PRIVMSGS_OUTBOX', -2); @define('PRIVMSGS_SENTBOX', -1); @define('PRIVMSGS_INBOX', 0); // Full Folder Actions @define('FULL_FOLDER_NONE', -3); @define('FULL_FOLDER_DELETE', -2); @define('FULL_FOLDER_HOLD', -1); // Download Modes - Attachments @define('INLINE_LINK', 1); // This mode is only used internally to allow modders extending the attachment functionality @define('PHYSICAL_LINK', 2); // Confirm types @define('CONFIRM_REG', 1); @define('CONFIRM_LOGIN', 2); @define('CONFIRM_POST', 3); // Categories - Attachments @define('ATTACHMENT_CATEGORY_NONE', 0); @define('ATTACHMENT_CATEGORY_IMAGE', 1); // Inline Images @define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming @define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming @define('ATTACHMENT_CATEGORY_THUMB', 4); // Not used within the database, only while displaying posts @define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files @define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files // BBCode UID length @define('BBCODE_UID_LEN', 5); // Number of core BBCodes @define('NUM_CORE_BBCODES', 12); // Magic url types @define('MAGIC_URL_EMAIL', 1); @define('MAGIC_URL_FULL', 2); @define('MAGIC_URL_LOCAL', 3); @define('MAGIC_URL_WWW', 4); // Profile Field Types @define('FIELD_INT', 1); @define('FIELD_STRING', 2); @define('FIELD_TEXT', 3); @define('FIELD_BOOL', 4); @define('FIELD_DROPDOWN', 5); @define('FIELD_DATE', 6); // referer validation define('REFERER_VALIDATE_NONE', 0); define('REFERER_VALIDATE_HOST', 1); define('REFERER_VALIDATE_PATH', 2); // phpbb_chmod() permissions @define('CHMOD_ALL', 7); @define('CHMOD_READ', 4); @define('CHMOD_WRITE', 2); @define('CHMOD_EXECUTE', 1); // Captcha code length define('CAPTCHA_MIN_CHARS', 4); define('CAPTCHA_MAX_CHARS', 7); // Additional constants define('VOTE_CONVERTED', 127); // Additional constants @define('RANKS_PATH', 'images/ranks/'); // Table names @define('ACL_GROUPS_TABLE', $table_prefix . 'acl_groups'); @define('ACL_OPTIONS_TABLE', $table_prefix . 'acl_options'); @define('ACL_ROLES_DATA_TABLE', $table_prefix . 'acl_roles_data'); @define('ACL_ROLES_TABLE', $table_prefix . 'acl_roles'); @define('ACL_USERS_TABLE', $table_prefix . 'acl_users'); @define('ATTACHMENTS_TABLE', $table_prefix . 'attachments'); @define('BANLIST_TABLE', $table_prefix . 'banlist'); @define('BBCODES_TABLE', $table_prefix . 'bbcodes'); @define('BOOKMARKS_TABLE', $table_prefix . 'bookmarks'); @define('BOTS_TABLE', $table_prefix . 'bots'); @define('CONFIG_TABLE', $table_prefix . 'config'); @define('CONFIRM_TABLE', $table_prefix . 'confirm'); @define('DISALLOW_TABLE', $table_prefix . 'disallow'); @define('DRAFTS_TABLE', $table_prefix . 'drafts'); @define('EXTENSIONS_TABLE', $table_prefix . 'extensions'); @define('EXTENSION_GROUPS_TABLE', $table_prefix . 'extension_groups'); @define('FORUMS_TABLE', $table_prefix . 'forums'); @define('FORUMS_ACCESS_TABLE', $table_prefix . 'forums_access'); @define('FORUMS_TRACK_TABLE', $table_prefix . 'forums_track'); @define('FORUMS_WATCH_TABLE', $table_prefix . 'forums_watch'); @define('GROUPS_TABLE', $table_prefix . 'groups'); @define('ICONS_TABLE', $table_prefix . 'icons'); @define('LANG_TABLE', $table_prefix . 'lang'); @define('LOG_TABLE', $table_prefix . 'log'); @define('MODERATOR_CACHE_TABLE', $table_prefix . 'moderator_cache'); @define('MODULES_TABLE', $table_prefix . 'modules'); @define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_options'); @define('POLL_VOTES_TABLE', $table_prefix . 'poll_votes'); @define('POSTS_TABLE', $table_prefix . 'posts'); @define('PRIVMSGS_TABLE', $table_prefix . 'privmsgs'); @define('PRIVMSGS_FOLDER_TABLE', $table_prefix . 'privmsgs_folder'); @define('PRIVMSGS_RULES_TABLE', $table_prefix . 'privmsgs_rules'); @define('PRIVMSGS_TO_TABLE', $table_prefix . 'privmsgs_to'); @define('PROFILE_FIELDS_TABLE', $table_prefix . 'profile_fields'); @define('PROFILE_FIELDS_DATA_TABLE', $table_prefix . 'profile_fields_data'); @define('PROFILE_FIELDS_LANG_TABLE', $table_prefix . 'profile_fields_lang'); @define('PROFILE_LANG_TABLE', $table_prefix . 'profile_lang'); @define('RANKS_TABLE', $table_prefix . 'ranks'); @define('REPORTS_TABLE', $table_prefix . 'reports'); @define('REPORTS_REASONS_TABLE', $table_prefix . 'reports_reasons'); @define('SEARCH_RESULTS_TABLE', $table_prefix . 'search_results'); @define('SEARCH_WORDLIST_TABLE', $table_prefix . 'search_wordlist'); @define('SEARCH_WORDMATCH_TABLE', $table_prefix . 'search_wordmatch'); @define('SESSIONS_TABLE', $table_prefix . 'sessions'); @define('SESSIONS_KEYS_TABLE', $table_prefix . 'sessions_keys'); @define('SITELIST_TABLE', $table_prefix . 'sitelist'); @define('SMILIES_TABLE', $table_prefix . 'smilies'); @define('STYLES_TABLE', $table_prefix . 'styles'); @define('STYLES_TEMPLATE_TABLE', $table_prefix . 'styles_template'); @define('STYLES_TEMPLATE_DATA_TABLE',$table_prefix . 'styles_template_data'); @define('STYLES_THEME_TABLE', $table_prefix . 'styles_theme'); @define('STYLES_IMAGESET_TABLE', $table_prefix . 'styles_imageset'); @define('STYLES_IMAGESET_DATA_TABLE',$table_prefix . 'styles_imageset_data'); @define('TOPICS_TABLE', $table_prefix . 'topics'); @define('TOPICS_POSTED_TABLE', $table_prefix . 'topics_posted'); @define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_track'); @define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch'); @define('USER_GROUP_TABLE', $table_prefix . 'user_group'); @define('USERS_TABLE', $table_prefix . 'users'); @define('WARNINGS_TABLE', $table_prefix . 'warnings'); @define('WORDS_TABLE', $table_prefix . 'words'); @define('ZEBRA_TABLE', $table_prefix . 'zebra'); // Additional tables // Additional constants @define('INHERIT_LANG_NONE', 0); @define('INHERIT_LANG_EN', 1); @define('INHERIT_LANG_DEFAULT', 2); ?> --- NEW FILE: bbcode.php --- <?php /** * * @package Functions_phpBB * @version $Id: bbcode.php,v 1.1 2014/07/07 20:38:12 orynider Exp $ * @copyright (c) 2002-2008 MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://mxpcms.sourceforge.net/ * */ if (!defined('IN_PORTAL')) { exit; } /* * Here comes a mxp version of phpbb2 bbcode.php ported to phpbb3 backend * Last in file are the mxp wrapper functions [...2040 lines suppressed...] 'U_MORE_SMILIES' => mx3_append_sid(PHPBB_URL . "posting.$phpEx", "mode=smilies")) ); } $template->assign_vars(array( 'L_EMOTICONS' => $lang['Emoticons'], 'L_CLOSE_WINDOW' => $lang['Close_window'], 'S_SMILIES_COLSPAN' => $s_colspan) ); } } if ($mode == 'window') { $template->pparse('smiliesbody'); include($mx_root_path . 'includes/page_tail.'.$phpEx); } } } ?> --- NEW FILE: session.php --- <?php /** * * @package Style * @version $Id: session.php,v 1.1 2014/07/07 20:38:17 orynider Exp $ * @copyright (c) 2002-2008 MX-Publisher Project Team & (C) 2005 The phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://mxpcms.sourceforge.net/ * */ if ( !defined('IN_PORTAL') ) { die("Hacking attempt"); } /** * Modifications: * - replaced $config -> $board_config - by Jon [...3750 lines suppressed...] case 'zh': $lang_name = 'chinese'; break; case 'zh_cmn_hans': $lang_name = 'chinese_simplified'; break; case 'zh_cmn_hant': $lang_name = 'chinese_traditional'; break; case 'zu': $lang_name = 'zulu'; break; default: $lang_name = $lang; break; } return $lang_name; } } ?> --- NEW FILE: auth.php --- <?php /** * * @package Auth * @version $Id: auth.php,v 1.1 2014/07/07 20:38:11 orynider Exp $ * @copyright (c) 2002-2008 MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://mxpcms.sourceforge.net/ * */ if ( !defined( 'IN_PORTAL' ) ) { die( "Hacking attempt" ); } /** * Permission/Auth class for phpBB3 forums [...961 lines suppressed...] $sql = array(); foreach ($auth_options as $option) { if (strpos($option, '%') !== false) { $sql[] = $key . ' ' . $db->sql_like_expression(str_replace('%', $db->any_char, $option)); } else { $sql[] = $key . " = '" . $db->sql_escape($option) . "'"; } } $sql_opts = 'AND (' . implode(' OR ', $sql) . ')'; } } } } ?> --- NEW FILE: index.htm --- <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> </body> </html> |