diff options
Diffstat (limited to 'phpBB/includes')
27 files changed, 240 insertions, 99 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index fadef07ac3..8de53144ea 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -69,7 +69,7 @@ class acm } global $phpEx; - $file = '<?php $this->vars=' . $this->format_array($this->vars) . ";\n\$this->var_expires=" . $this->format_array($this->var_expires) . ' ?>'; + $file = "<?php\n\$this->vars = " . $this->format_array($this->vars) . ";\n\n\$this->var_expires = " . $this->format_array($this->var_expires) . "\n?>"; if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb')) { @@ -255,26 +255,28 @@ class acm /** * Format an array to be stored on filesystem */ - function format_array($array) + function format_array($array, $tab = '') { + $tab .= "\t"; + $lines = array(); foreach ($array as $k => $v) { if (is_array($v)) { - $lines[] = "\n'$k' => " . $this->format_array($v); + $lines[] = "\n{$tab}'$k' => " . $this->format_array($v, $tab); } else if (is_int($v)) { - $lines[] = "\n'$k' => $v"; + $lines[] = "\n{$tab}'$k' => $v"; } else if (is_bool($v)) { - $lines[] = "\n'$k' => " . (($v) ? 'true' : 'false'); + $lines[] = "\n{$tab}'$k' => " . (($v) ? 'true' : 'false'); } else { - $lines[] = "\n'$k' => '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $v)) . "'"; + $lines[] = "\n{$tab}'$k' => '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $v)) . "'"; } } diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index ab416068c4..109d08163b 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -71,6 +71,14 @@ class acp_board 'allow_sig_smilies' => array('lang' => 'ALLOW_SIG_SMILIES', 'type' => 'radio:yes_no', 'explain' => false), 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'type' => 'radio:yes_no', 'explain' => true), 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'type' => 'radio:yes_no', 'explain' => true), + + 'legend2' => 'ACP_LOAD_SETTINGS', + 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'type' => 'radio:yes_no', 'explain' => false), + 'load_moderators' => array('lang' => 'YES_MODERATORS', 'type' => 'radio:yes_no', 'explain' => false), + 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'type' => 'radio:yes_no', 'explain' => false), + 'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'type' => 'radio:yes_no', 'explain' => false), + 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'type' => 'radio:yes_no', 'explain' => false), + 'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'type' => 'radio:yes_no', 'explain' => false), ) ); break; @@ -111,7 +119,6 @@ class acp_board 'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'type' => 'radio:yes_no', 'explain' => false), 'auth_smilies_pm' => array('lang' => 'ALLOW_SMILIES_PM', 'type' => 'radio:yes_no', 'explain' => false), 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_download_pm' => array('lang' => 'ALLOW_DOWNLOAD_PM', 'type' => 'radio:yes_no', 'explain' => false), 'allow_sig_pm' => array('lang' => 'ALLOW_SIG_PM', 'type' => 'radio:yes_no', 'explain' => false), 'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'type' => 'radio:yes_no', 'explain' => false), 'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'type' => 'radio:yes_no', 'explain' => false), diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 257ad8e333..17a843f1a6 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -111,6 +111,7 @@ class acp_forums 'enable_indexing' => request_var('enable_indexing',true), 'enable_icons' => request_var('enable_icons', false), 'enable_prune' => request_var('enable_prune', false), + 'enable_post_review' => request_var('enable_post_review', true), 'prune_days' => request_var('prune_days', 7), 'prune_viewed' => request_var('prune_viewed', 7), 'prune_freq' => request_var('prune_freq', 1), @@ -318,12 +319,13 @@ class acp_forums if ($update) { - $forum_data['forum_flags'] = 0; - $forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? 1 : 0; - $forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? 2 : 0; - $forum_data['forum_flags'] += (request_var('prune_announce', false)) ? 4 : 0; - $forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? 8 : 0; - $forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0; + $forum_data['forum_flags'] = 0; + $forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? 1 : 0; + $forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? 2 : 0; + $forum_data['forum_flags'] += (request_var('prune_announce', false)) ? 4 : 0; + $forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? 8 : 0; + $forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0; + $forum_data['forum_flags'] += (request_var('enable_post_review', true)) ? 32 : 0; } // Show form to create/modify a forum @@ -520,15 +522,16 @@ class acp_forums 'S_FORUM_ORIG_POST' => (isset($old_forum_type) && $old_forum_type == FORUM_POST) ? true : false, 'S_FORUM_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false, 'S_FORUM_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false, - 'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & 1) ? true : false, 'S_ENABLE_INDEXING' => ($forum_data['enable_indexing']) ? true : false, 'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false, 'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false, 'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false, + 'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & 1) ? true : false, 'S_PRUNE_OLD_POLLS' => ($forum_data['forum_flags'] & 2) ? true : false, 'S_PRUNE_ANNOUNCE' => ($forum_data['forum_flags'] & 4) ? true : false, 'S_PRUNE_STICKY' => ($forum_data['forum_flags'] & 8) ? true : false, 'S_DISPLAY_ACTIVE_TOPICS' => ($forum_data['forum_flags'] & 16) ? true : false, + 'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & 32) ? true : false, ) ); @@ -757,12 +760,14 @@ class acp_forums // 4 = prune announcements // 8 = prune stickies // 16 = show active topics + // 32 = enable post review $forum_data['forum_flags'] = 0; $forum_data['forum_flags'] += ($forum_data['forum_link_track']) ? 1 : 0; $forum_data['forum_flags'] += ($forum_data['prune_old_polls']) ? 2 : 0; $forum_data['forum_flags'] += ($forum_data['prune_announce']) ? 4 : 0; $forum_data['forum_flags'] += ($forum_data['prune_sticky']) ? 8 : 0; $forum_data['forum_flags'] += ($forum_data['show_active']) ? 16 : 0; + $forum_data['forum_flags'] += ($forum_data['enable_post_review']) ? 32 : 0; // Unset data that are not database fields $forum_data_sql = $forum_data; @@ -772,6 +777,7 @@ class acp_forums unset($forum_data_sql['prune_announce']); unset($forum_data_sql['prune_sticky']); unset($forum_data_sql['show_active']); + unset($forum_data_sql['enable_post_review']); unset($forum_data_sql['forum_password_confirm']); // What are we going to do tonight Brain? The same thing we do everynight, diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 5aee176524..69757b45f2 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -85,7 +85,7 @@ class acp_groups break; } - trigger_error($user->lang[$message] . adm_back_link($this->u_action)); + trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); break; case 'default': @@ -134,7 +134,7 @@ class acp_groups group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row); } - trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action)); + trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); } else { @@ -165,7 +165,7 @@ class acp_groups case 'delete': if (!$auth->acl_get('a_groupdel')) { - trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); } $error = group_delete($group_id, $group_row['group_name']); @@ -178,7 +178,7 @@ class acp_groups if ($error) { - trigger_error($user->lang[$error] . adm_back_link($this->u_action)); + trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); } $message = ($action == 'delete') ? 'GROUP_DELETED' : 'GROUP_USERS_REMOVE'; @@ -204,7 +204,7 @@ class acp_groups if (!$name_ary) { - trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action)); + trigger_error($user->lang['NO_USERS'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); } $name_ary = array_unique(explode("\n", $name_ary)); @@ -212,11 +212,11 @@ class acp_groups // Add user/s to group if ($error = group_user_add($group_id, false, $name_ary, $group_row['group_name'], $default, $leader, 0, $group_row)) { - trigger_error($user->lang[$error] . adm_back_link($this->u_action)); + trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); } $message = ($action == 'addleaders') ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED'; - trigger_error($user->lang[$message] . adm_back_link($this->u_action)); + trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); break; case 'edit': @@ -607,10 +607,12 @@ class acp_groups 'S_ON_PAGE' => on_page($total_members, $config['topics_per_page'], $start), 'PAGINATION' => generate_pagination($this->u_action . "&action=$action&g=$group_id", $total_members, $config['topics_per_page'], $start, true), + 'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'], 'U_ACTION' => $this->u_action . "&g=$group_id", 'U_BACK' => $this->u_action, - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames')) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=list&field=usernames'), + 'U_DEFAULT_ALL' => "{$this->u_action}&action=default&g=$group_id") ); foreach ($group_data['leader'] as $row) @@ -701,7 +703,6 @@ class acp_groups $template->assign_block_vars('groups', array( 'U_LIST' => "{$this->u_action}&action=list&g=$group_id", - 'U_DEFAULT' => "{$this->u_action}&action=default&g=$group_id", 'U_EDIT' => "{$this->u_action}&action=edit&g=$group_id", 'U_DELETE' => ($auth->acl_get('a_groupdel')) ? "{$this->u_action}&action=delete&g=$group_id" : '', diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 07aabc672a..8cde981346 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -412,8 +412,10 @@ class acp_main 'DBSIZE' => $dbsize, 'UPLOAD_DIR_SIZE' => $upload_dir_size, 'GZIP_COMPRESSION' => ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF'], + 'DATABASE_INFO' => $db->sql_server_info(), 'U_ACTION' => append_sid("{$phpbb_admin_path}index.$phpEx"), + 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'), 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? $s_action_options : '', ) diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index ce14694adf..1d1ef640fe 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -792,9 +792,12 @@ class acp_modules { $this->move_module($module_data['module_id'], $module_data['parent_id']); } - + + $update_ary = $module_data; + unset($update_ary['module_id']); + $sql = 'UPDATE ' . MODULES_TABLE . ' - SET ' . $db->sql_build_array('UPDATE', $module_data) . " + SET ' . $db->sql_build_array('UPDATE', $update_ary) . " WHERE module_class = '" . $db->sql_escape($this->module_class) . "' AND module_id = {$module_data['module_id']}"; $db->sql_query($sql); diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 23743824e1..cbf386b04d 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -82,7 +82,7 @@ parse_css_file = {PARSE_CSS_FILE} pagination_sep = \'{PAGINATION_SEP}\' '; - $this->imageset_keys = 'site_logo, btn_post, btn_post_pm, btn_reply, btn_reply_pm, btn_locked, btn_profile, btn_pm, btn_delete, btn_info, btn_quote, btn_search, btn_edit, btn_report, btn_email, btn_www, btn_icq, btn_aim, btn_yim, btn_msnm, btn_jabber, btn_online, btn_offline, btn_friend, btn_foe, icon_unapproved, icon_reported, icon_attach, icon_post, icon_post_new, icon_post_latest, icon_post_newest, forum, forum_new, forum_locked, forum_link, sub_forum, sub_forum_new, folder, folder_moved, folder_posted, folder_new, folder_new_posted, folder_hot, folder_hot_posted, folder_hot_new, folder_hot_new_posted, folder_locked, folder_locked_posted, folder_locked_new, folder_locked_new_posted, folder_sticky, folder_sticky_posted, folder_sticky_new, folder_sticky_new_posted, folder_announce, folder_announce_posted, folder_announce_new, folder_announce_new_posted, folder_global, folder_global_posted, folder_global_new, folder_global_new_posted, poll_left, poll_center, poll_right, attach_progress_bar, user_icon1, user_icon2, user_icon3, user_icon4, user_icon5, user_icon6, user_icon7, user_icon8, user_icon9, user_icon10'; + $this->imageset_keys = 'site_logo, btn_post, btn_post_pm, btn_reply, btn_reply_pm, btn_locked, btn_profile, btn_pm, btn_delete, btn_info, btn_quote, btn_search, btn_edit, btn_report, btn_email, btn_www, btn_icq, btn_aim, btn_yim, btn_msnm, btn_jabber, btn_online, btn_offline, btn_friend, btn_foe, icon_unapproved, icon_reported, icon_attach, icon_post, icon_post_new, icon_post_latest, icon_post_newest, forum, forum_new, forum_locked, forum_link, sub_forum, sub_forum_new, folder, folder_moved, folder_posted, folder_new, folder_new_posted, folder_hot, folder_hot_posted, folder_hot_new, folder_hot_new_posted, folder_locked, folder_locked_posted, folder_locked_new, folder_locked_new_posted, folder_locked_announce, folder_locked_announce_new, folder_locked_announce_posted, folder_locked_announce_new_posted, folder_locked_global, folder_locked_global_new, folder_locked_global_posted, folder_locked_global_new_posted, folder_locked_sticky, folder_locked_sticky_new, folder_locked_sticky_posted, folder_locked_sticky_new_posted, folder_sticky, folder_sticky_posted, folder_sticky_new, folder_sticky_new_posted, folder_announce, folder_announce_posted, folder_announce_new, folder_announce_new_posted, folder_global, folder_global_posted, folder_global_new, folder_global_new_posted, poll_left, poll_center, poll_right, attach_progress_bar, user_icon1, user_icon2, user_icon3, user_icon4, user_icon5, user_icon6, user_icon7, user_icon8, user_icon9, user_icon10'; // Execute overall actions switch ($action) @@ -183,7 +183,7 @@ pagination_sep = \'{PAGINATION_SEP}\' break; } - $this->frontend('style', array('details', 'export', 'delete')); + $this->frontend('style', array('details'), array('export', 'delete')); break; case 'template': @@ -260,7 +260,7 @@ pagination_sep = \'{PAGINATION_SEP}\' break; } - $this->frontend('template', array('cache', 'details', 'refresh', 'edit', 'export', 'delete')); + $this->frontend('template', array('edit', 'cache', 'details'), array('refresh', 'export', 'delete')); break; case 'theme': @@ -318,11 +318,11 @@ pagination_sep = \'{PAGINATION_SEP}\' break; } - $this->frontend('theme', array('details', 'refresh', 'edit', 'export', 'delete')); + $this->frontend('theme', array('edit', 'details'), array('refresh', 'export', 'delete')); break; case 'imageset': - $this->frontend('imageset', array('details', 'edit', 'delete', 'export')); + $this->frontend('imageset', array('edit', 'details'), array('export', 'delete')); break; } } @@ -330,7 +330,7 @@ pagination_sep = \'{PAGINATION_SEP}\' /** * Build Frontend with supplied options */ - function frontend($mode, $options) + function frontend($mode, $options, $actions) { global $user, $template, $db, $config, $phpbb_root_path, $phpEx; @@ -408,12 +408,19 @@ pagination_sep = \'{PAGINATION_SEP}\' $s_options[] = '<a href="' . $this->u_action . "&action=$option&id=" . $row[$mode . '_id'] . '">' . $user->lang[strtoupper($option)] . '</a>'; } + $s_actions = array(); + foreach ($actions as $option) + { + $s_actions[] = '<a href="' . $this->u_action . "&action=$option&id=" . $row[$mode . '_id'] . '">' . $user->lang[strtoupper($option)] . '</a>'; + } + $template->assign_block_vars('installed', array( 'S_DEFAULT_STYLE' => ($mode == 'style' && $row['style_id'] == $config['default_style']) ? true : false, 'U_EDIT' => $this->u_action . '&action=' . (($mode == 'style') ? 'details' : 'edit') . '&id=' . $row[$mode . '_id'], 'U_STYLE_ACT_DEACT' => $this->u_action . '&action=' . $stylevis . '&id=' . $row[$mode . '_id'], 'L_STYLE_ACT_DEACT' => $user->lang['STYLE_' . strtoupper($stylevis)], 'S_OPTIONS' => implode(' | ', $s_options), + 'S_ACTIONS' => implode(' | ', $s_actions), 'U_PREVIEW' => ($mode == 'style') ? append_sid("{$phpbb_root_path}index.$phpEx", "$mode=" . $row[$mode . '_id']) : '', 'NAME' => $row[$mode . '_name'], @@ -1272,7 +1279,7 @@ pagination_sep = \'{PAGINATION_SEP}\' 'forums' => array( 'forum', 'forum_new', 'forum_locked', 'forum_link', 'sub_forum', 'sub_forum_new',), 'folders' => array( - 'folder', 'folder_posted', 'folder_new', 'folder_new_posted', 'folder_hot', 'folder_hot_posted', 'folder_hot_new', 'folder_hot_new_posted', 'folder_locked', 'folder_locked_posted', 'folder_locked_new', 'folder_locked_new_posted', 'folder_sticky', 'folder_sticky_posted', 'folder_sticky_new', 'folder_sticky_new_posted', 'folder_announce', 'folder_announce_posted', 'folder_announce_new', 'folder_announce_new_posted', 'folder_global', 'folder_global_posted', 'folder_global_new', 'folder_global_new_posted',), + 'folder', 'folder_posted', 'folder_new', 'folder_new_posted', 'folder_hot', 'folder_hot_posted', 'folder_hot_new', 'folder_hot_new_posted', 'folder_locked', 'folder_locked_posted', 'folder_locked_new', 'folder_locked_new_posted', 'folder_locked_announce', 'folder_locked_announce_new', 'folder_locked_announce_posted', 'folder_locked_announce_new_posted', 'folder_locked_global', 'folder_locked_global_new', 'folder_locked_global_posted', 'folder_locked_global_new_posted', 'folder_locked_sticky', 'folder_locked_sticky_new', 'folder_locked_sticky_posted', 'folder_locked_sticky_new_posted', 'folder_sticky', 'folder_sticky_posted', 'folder_sticky_new', 'folder_sticky_new_posted', 'folder_announce', 'folder_announce_posted', 'folder_announce_new', 'folder_announce_new_posted', 'folder_global', 'folder_global_posted', 'folder_global_new', 'folder_global_new_posted',), 'polls' => array( 'poll_left', 'poll_center', 'poll_right',), ); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index f6fe02e617..adc5064b67 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1871,9 +1871,15 @@ class acp_users // Select auth options $sql = 'SELECT auth_option, is_local, is_global FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '%\_' - AND is_global = 1 - ORDER BY auth_option"; + WHERE auth_option LIKE '%\_'"; + + if (SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc') + { + $sql .= " ESCAPE '\\'"; + } + + $sql .= 'AND is_global = 1 + ORDER BY auth_option'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -1885,9 +1891,15 @@ class acp_users $sql = 'SELECT auth_option, is_local, is_global FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '%\_' - AND is_local = 1 - ORDER BY is_global DESC, auth_option"; + WHERE auth_option LIKE '%\_'"; + + if (SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc') + { + $sql .= " ESCAPE '\\'"; + } + + $sql .= 'AND is_local = 1 + ORDER BY is_global DESC, auth_option'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index d5a91fe9bb..3a0567d90a 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -32,6 +32,7 @@ if (!defined('SQL_LAYER')) class dbal_firebird extends dbal { var $last_query_text = ''; + var $service_handle = false; /** * Connect to server @@ -45,10 +46,28 @@ class dbal_firebird extends dbal $this->db_connect_id = ($this->persistency) ? @ibase_pconnect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3) : @ibase_connect($this->server . ':' . $this->dbname, $this->user, $sqlpassword, false, false, 3); + /** + * @todo evaluate the implications of opening a service connection + */ + $this->service_handle = @ibase_service_attach($this->server, $this->user, $sqlpassword); + return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); } /** + * Version information about used database + */ + function sql_server_info() + { + if ($this->service_handle !== false) + { + return @ibase_server_info($this->service_handle, IBASE_SVC_SERVER_VERSION); + } + + return 'Firebird/Interbase'; + } + + /** * SQL Transaction * @access: private */ @@ -323,6 +342,11 @@ class dbal_firebird extends dbal */ function _sql_close() { + if ($this->service_handle !== false) + { + @ibase_service_detach($this->service_handle); + } + return @ibase_close($this->db_connect_id); } diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index cc4de3695a..efe0b4333d 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -56,6 +56,28 @@ class dbal_mssql extends dbal } /** + * Version information about used database + */ + function sql_server_info() + { + $result_id = @mssql_query("SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')", $this->db_connect_id); + + $row = false; + if ($result_id) + { + $row = @mssql_fetch_assoc($result_id); + @mssql_free_result($result_id); + } + + if ($row) + { + return 'MSSQL<br />' . implode(' ', $row); + } + + return 'MSSQL'; + } + + /** * SQL Transaction * @access: private */ diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 658251ea2a..8f37206817 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -50,6 +50,28 @@ class dbal_mssql_odbc extends dbal } /** + * Version information about used database + */ + function sql_server_info() + { + $result_id = @odbc_exec($this->db_connect_id, "SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')"); + + $row = false; + if ($result_id) + { + $row = @odbc_fetch_array($result_id); + @odbc_free_result($result_id); + } + + if ($row) + { + return 'MSSQL (ODBC)<br />' . implode(' ', $row); + } + + return 'MSSQL (ODBC)'; + } + + /** * SQL Transaction * @access: private */ diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index fd7e10a822..60e56e2964 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -56,6 +56,14 @@ class dbal_mysql extends dbal } /** + * Version information about used database + */ + function sql_server_info() + { + return 'MySQL ' . @mysql_get_server_info($this->db_connect_id); + } + + /** * SQL Transaction * @access: private */ diff --git a/phpBB/includes/db/mysql4.php b/phpBB/includes/db/mysql4.php index 13271d9346..6028a7085f 100644 --- a/phpBB/includes/db/mysql4.php +++ b/phpBB/includes/db/mysql4.php @@ -58,6 +58,14 @@ class dbal_mysql4 extends dbal } /** + * Version information about used database + */ + function sql_server_info() + { + return 'MySQL ' . @mysql_get_server_info($this->db_connect_id); + } + + /** * SQL Transaction * @access: private */ diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index b93bf98c1a..1257621729 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -58,6 +58,14 @@ class dbal_mysqli extends dbal } /** + * Version information about used database + */ + function sql_server_info() + { + return 'MySQL(i) ' . @mysqli_get_server_info($this->db_connect_id); + } + + /** * SQL Transaction * @access: private */ diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 499316ac80..d891cab337 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -48,6 +48,14 @@ class dbal_oracle extends dbal } /** + * Version information about used database + */ + function sql_server_info() + { + return 'Oracle ' . @ociserverversion($this->db_connect_id); + } + + /** * SQL Transaction * @access: private */ diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index ad8e0a01da..ccc038075e 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -85,6 +85,16 @@ class dbal_postgres extends dbal } /** + * Version information about used database + */ + function sql_server_info() + { + $version = @pg_version($this->db_connect_id); + + return 'PostgresSQL' . ((!empty($version)) ? ' ' . $version['client'] : ''; + } + + /** * SQL Transaction * @access: private */ diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php index 87d9af8c7f..7b23171187 100644 --- a/phpBB/includes/db/sqlite.php +++ b/phpBB/includes/db/sqlite.php @@ -52,6 +52,14 @@ class dbal_sqlite extends dbal } /** + * Version information about used database + */ + function sql_server_info() + { + return 'SQLite ' . @sqlite_libversion(); + } + + /** * SQL Transaction * @access: private */ diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 50cdd6a121..0da1bf243d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -412,7 +412,7 @@ if (!function_exists('realpath')) $translated_path = ''; - foreach($dirs as $key => $value) + foreach ($dirs as $key => $value) { if (strlen($value) > 0) { @@ -2491,6 +2491,12 @@ function page_header($page_title = '', $display_online_list = true) // Do not change this (it is defined as _f_={forum_id}x within session.php) $reading_sql = " AND s.session_page LIKE '%\_f\_={$f}x%'"; + + // Specify escape character for MSSQL + if (SQL_LAYER == 'mssql' || SQL_LAYER == 'mssql_odbc') + { + $reading_sql .= " ESCAPE '\\'"; + } } // Get number of online guests diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index eec11408dd..515246461b 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -637,21 +637,44 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold $topic_type = $user->lang['VIEW_TOPIC_GLOBAL']; $folder = 'folder_global'; $folder_new = 'folder_global_new'; + + if ($topic_row['topic_status'] == ITEM_LOCKED) + { + $topic_type = $user->lang['VIEW_TOPIC_LOCKED']; + $folder = 'folder_locked_global'; + $folder_new = 'folder_locked_global_new'; + } break; case POST_ANNOUNCE: $topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT']; $folder = 'folder_announce'; $folder_new = 'folder_announce_new'; + + if ($topic_row['topic_status'] == ITEM_LOCKED) + { + $topic_type = $user->lang['VIEW_TOPIC_LOCKED']; + $folder = 'folder_locked_announce'; + $folder_new = 'folder_locked_announce_new'; + } break; case POST_STICKY: $topic_type = $user->lang['VIEW_TOPIC_STICKY']; $folder = 'folder_sticky'; $folder_new = 'folder_sticky_new'; + + if ($topic_row['topic_status'] == ITEM_LOCKED) + { + $topic_type = $user->lang['VIEW_TOPIC_LOCKED']; + $folder = 'folder_locked_sticky'; + $folder_new = 'folder_locked_sticky_new'; + } break; default: + $topic_type = ''; + if ($config['hot_threshold'] && $replies >= $config['hot_threshold']) { $folder = 'folder_hot'; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 937d4f7791..0f3cb7ccfc 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -207,8 +207,6 @@ function user_add($user_row, $cp_data = false) } } - $db->sql_transaction('begin'); - $sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); @@ -237,13 +235,11 @@ function user_add($user_row, $cp_data = false) ); $db->sql_query($sql); - $db->sql_transaction('commit'); - // Now make it the users default group... group_set_user_default($user_row['group_id'], array($user_id)); // set the newest user and adjust the user count if the user is a normal user and no activation mail is sent - if ($user_row['user_type'] == USER_NORMAL && !$config['require_activation']) + if ($user_row['user_type'] == USER_NORMAL) { set_config('newest_user_id', $user_id, true); set_config('newest_username', $user_row['username'], true); diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index ceb2dcbff7..c68f36aefc 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -16,6 +16,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info) global $template, $db, $user, $auth, $cache; global $phpEx, $phpbb_root_path, $config; + include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); + $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); if ($action == 'merge_select') @@ -107,56 +109,11 @@ function mcp_forum_view($id, $mode, $action, $forum_info) { $topic_title = ''; - if ($row['topic_status'] == ITEM_LOCKED) - { - $folder_img = 'folder_locked'; - $folder_alt = 'VIEW_TOPIC_LOCKED'; - } - else - { - if ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) - { - $folder_img = 'folder_announce'; - $folder_alt = 'VIEW_TOPIC_ANNOUNCEMENT'; - } - else if ($row['topic_type'] == POST_STICKY) - { - $folder_img = 'folder_sticky'; - $folder_alt = 'VIEW_TOPIC_STICKY'; - } - else if ($row['topic_status'] == ITEM_MOVED) - { - $folder_img = 'folder_moved'; - $folder_alt = 'VIEW_TOPIC_MOVED'; - } - else - { - $folder_img = 'folder'; - $folder_alt = 'NO_NEW_POSTS'; - } - } - - if ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) - { - $topic_type = $user->lang['VIEW_TOPIC_ANNOUNCEMENT'] . ' '; - } - else if ($row['topic_type'] == POST_STICKY) - { - $topic_type = $user->lang['VIEW_TOPIC_STICKY'] . ' '; - } - else if ($row['topic_status'] == ITEM_MOVED) - { - $topic_type = $user->lang['VIEW_TOPIC_MOVED'] . ' '; - } - else - { - $topic_type = ''; - } + $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies']; - if (intval($row['poll_start'])) - { - $topic_type .= $user->lang['VIEW_TOPIC_POLL'] . ' '; - } + // Get folder img, topic status/type related informations + $folder_img = $folder_alt = $topic_type = ''; + topic_status($row, $replies, false, $folder_img, $folder_alt, $topic_type); $topic_title = censor_text($row['topic_title']); diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 1f8e8f63a0..9bca3a9c9a 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -184,6 +184,7 @@ class mcp_notes 'REPORT_BY' => $row['username'], 'REPORT_AT' => $user->format_date($row['time']), 'ACTION' => $row['action'], + 'IP' => $row['ip'], 'ID' => $row['id']) ); } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 26e754033a..b5090d3950 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -164,7 +164,7 @@ class bbcode_firstpass extends bbcode $in = str_replace("\r\n", "\n", str_replace('\"', '"', $in)); // Trimming here to make sure no empty bbcodes are parsed accidently - if (!trim($in)) + if (trim($in) == '') { return false; } diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 08f911ef64..4498e39270 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -237,7 +237,7 @@ function compose_pm($id, $mode, $action) $check_value = 0; } - if (($to_group_id || isset($address_list['g'])) && !$config['allow_mass_pm']) + if (($to_group_id || isset($address_list['g'])) && (!$config['allow_mass_pm'] || !$auth->acl_get('u_masspm'))) { trigger_error('NO_AUTH_GROUP_MESSAGE'); } @@ -301,7 +301,7 @@ function compose_pm($id, $mode, $action) handle_message_list_actions($address_list, $remove_u, $remove_g, $add_to, $add_bcc); // Check for too many recipients - if (!$config['allow_mass_pm'] && num_recipients($address_list) > 1) + if ((!$config['allow_mass_pm'] || !$auth->acl_get('u_masspm')) && num_recipients($address_list) > 1) { $address_list = get_recipient_pos($address_list, 1); $error[] = $user->lang['TOO_MANY_RECIPIENTS']; diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 30dc8a8b09..cd72917f37 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -195,7 +195,7 @@ function view_folder($id, $mode, $folder_id, $folder) 'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '', 'FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '', - 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment'] && $config['allow_pm_attach'] && $config['auth_download_pm']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', + 'ATTACH_ICON_IMG' => ($auth->acl_get('u_pm_download') && $row['message_attachment'] && $config['allow_pm_attach']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'S_PM_DELETED' => ($row['deleted']) ? true : false, diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 2eb17337cf..2e7a80903d 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -85,7 +85,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) if ($message_row['message_attachment'] && $config['allow_pm_attach']) { - if ($config['auth_download_pm'] && $auth->acl_get('u_pm_download')) + if ($auth->acl_get('u_pm_download')) { include($phpbb_root_path . 'includes/functions_display.' . $phpEx); diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 8b199be6ac..693a785c8f 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -202,7 +202,7 @@ class ucp_register // Which group by default? $group_reg = ($coppa) ? 'REGISTERED_COPPA' : 'REGISTERED'; $group_inactive = ($coppa) ? 'INACTIVE_COPPA' : 'INACTIVE'; - $group_name = ($config['require_activation'] == USER_ACTIVATION_NONE) ? $group_reg : $group_inactive; + $group_name = ($config['require_activation'] == USER_ACTIVATION_NONE || !$config['email_enable']) ? $group_reg : $group_inactive; $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " |