diff options
author | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:41 +0100 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-03-02 01:05:41 +0100 |
commit | 6ebc26e330d5e204eab0ac9061bb5817534047fe (patch) | |
tree | 417aa508a0b4282ec0ae1834ea02032e7e033d5f /phpBB/includes | |
parent | f0eb18fffd11a97383c8ccf2ae7d2838939f09e2 (diff) | |
parent | 8d12b40fc4fdf50517e9584d14a5edd311953e7c (diff) | |
download | forums-6ebc26e330d5e204eab0ac9061bb5817534047fe.tar forums-6ebc26e330d5e204eab0ac9061bb5817534047fe.tar.gz forums-6ebc26e330d5e204eab0ac9061bb5817534047fe.tar.bz2 forums-6ebc26e330d5e204eab0ac9061bb5817534047fe.tar.xz forums-6ebc26e330d5e204eab0ac9061bb5817534047fe.zip |
Merge commit 'release-3.0.6-RC3'
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 10 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_profile.php | 8 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_update.php | 5 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 2 | ||||
-rw-r--r-- | phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php | 22 | ||||
-rw-r--r-- | phpBB/includes/constants.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_profile_fields.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 4 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 3 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 12 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 87 | ||||
-rw-r--r-- | phpBB/includes/template.php | 8 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm.php | 1 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 2 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewfolder.php | 1 |
15 files changed, 64 insertions, 105 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 62ccbdb68e..2ff597ee98 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -193,18 +193,19 @@ class acp_forums $cache->destroy('sql', FORUMS_TABLE); // Copy permissions? - if (!empty($forum_perm_from) && $forum_perm_from != $forum_data['forum_id'] && - (($action != 'edit') || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')))) + if ($forum_perm_from && $forum_perm_from != $forum_data['forum_id'] && + ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')))) { copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], ($action == 'edit') ? true : false); cache_moderators(); } - else if (($action != 'edit') && $auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')) +/* Commented out because of questionable UI workflow - re-visit for 3.0.7 + else if (!$this->parent_id && $action != 'edit' && $auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth')) { $this->copy_permission_page($forum_data); return; } - +*/ $auth->acl_clear_prefetch(); $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; @@ -1919,6 +1920,7 @@ class acp_forums /** * Display copy permission page + * Not used at the moment - we will have a look at it for 3.0.7 */ function copy_permission_page($forum_data) { diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 1b0ec4b5d5..fc08c7e8e8 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -509,6 +509,14 @@ class acp_profile // Get the number of options if this key is 'field_maxlen' $var = request_var('field_default_value', 0); }*/ + else if ($field_type == FIELD_INT && $key == 'field_default_value') + { + // Permit an empty string + if (request_var('field_default_value', '') === '') + { + $var = ''; + } + } $cp->vars[$key] = $var; } diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index 0d75b7ceb1..3204e0204e 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -39,6 +39,11 @@ class acp_update $info = obtain_latest_version_info(request_var('versioncheck_force', false), true); + if ($info === false) + { + trigger_error('VERSIONCHECK_FAIL', E_USER_WARNING); + } + $info = explode("\n", $info); $latest_version = trim($info[0]); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 614b58e7a9..afca056eb2 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1023,7 +1023,7 @@ class acp_users 'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}", 'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '', - 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_row['user_id']}") : '', + 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_row['user_id']}&hash=" . generate_link_hash('switchperm')) : '', 'POSTS_IN_QUEUE' => $user_row['posts_in_queue'], 'USER' => $user_row['username'], diff --git a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php index 411d1366fa..c17cfa7bbe 100644 --- a/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php +++ b/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php @@ -349,7 +349,12 @@ class phpbb_captcha_qa global $config, $db, $user; $error = ''; - + + if (!sizeof($this->question_ids)) + { + return false; + } + if (!$this->confirm_id) { $error = $user->lang['CONFIRM_QUESTION_WRONG']; @@ -388,6 +393,11 @@ class phpbb_captcha_qa { global $db, $user; + + if (!sizeof($this->question_ids)) + { + return false; + } $this->confirm_id = md5(unique_id($user->ip)); $this->question = (int) array_rand($this->question_ids); @@ -409,6 +419,11 @@ class phpbb_captcha_qa function reselect_question() { global $db, $user; + + if (!sizeof($this->question_ids)) + { + return false; + } $this->question = (int) array_rand($this->question_ids); $this->solved = 0; @@ -449,6 +464,11 @@ class phpbb_captcha_qa function load_answer() { global $db, $user; + + if (!sizeof($this->question_ids)) + { + return false; + } $sql = 'SELECT con.question_id, attempts, question_text, strict FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' con, ' . CAPTCHA_QUESTIONS_TABLE . " qes diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 3bb9467bbf..267a0220ed 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -25,7 +25,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.0.6-RC2'); +define('PHPBB_VERSION', '3.0.6-RC3'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 9e356414a9..db1925bdcc 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -624,7 +624,7 @@ class custom_profile } else { - if (!$preview && isset($user->profile_fields[$user_ident]) && is_null($user->profile_fields[$user_ident])) + if (!$preview && array_key_exists($user_ident, $user->profile_fields) && is_null($user->profile_fields[$user_ident])) { $value = NULL; } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 7255d138ab..21e82030ee 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2832,11 +2832,11 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, if ($config['coppa_enable']) { - $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS'); + $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'NEWLY_REGISTERED', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS'); } else { - $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED', 'BOTS', 'GUESTS'); + $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'NEWLY_REGISTERED', 'REGISTERED', 'BOTS', 'GUESTS'); } // We need both username and user_id info diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index acb7aa4ac0..b70601b479 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -416,14 +416,11 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) // If the topic no longer exist, we will update the topic watch table. // To not let it error out on users watching both topics, we just return on an error... - // Same for Bookmarks $db->sql_return_on_error(true); $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids)); - $db->sql_query('UPDATE ' . BOOKMARKS_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids)); $db->sql_return_on_error(false); $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids)); - $db->sql_query('DELETE FROM ' . BOOKMARKS_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids)); // Link to the new topic $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 6c2ac0b521..50b05e989f 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -813,7 +813,14 @@ function mcp_delete_topic($topic_ids) foreach ($data as $topic_id => $row) { - add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_' . ($row['topic_moved_id'] ? 'SHADOW_' : '') . 'TOPIC', $row['topic_title']); + if ($row['topic_moved_id']) + { + add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_SHADOW_TOPIC', $row['topic_title']); + } + else + { + add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']); + } } $return = delete_topics('topic_id', $topic_ids); @@ -897,7 +904,8 @@ function mcp_delete_post($post_ids) foreach ($post_data as $id => $row) { - add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject']); + $post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username']; + add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username); } // Now delete the posts, topics and forums are automatically resync'ed diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index eb3d6d3970..abdb839e7b 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -504,45 +504,6 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) // Update forum statistics set_config_count('num_topics', 1, true); - // Add new topic to bookmarks - $bookmarks = array(); - $sql = 'SELECT user_id - FROM ' . BOOKMARKS_TABLE . ' - WHERE topic_id = ' . $topic_id; - $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) - { - $bookmarks[] = array( - 'user_id' => (int) $row['user_id'], - 'topic_id' => $to_topic_id, - ); - } - $db->sql_freeresult($result); - if (sizeof($bookmarks)) - { - $db->sql_multi_insert(BOOKMARKS_TABLE, $bookmarks); - } - - // Add new topic to watch-list - $notifications = array(); - $sql = 'SELECT user_id, notify_status - FROM ' . TOPICS_WATCH_TABLE . ' - WHERE topic_id = ' . $topic_id; - $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) - { - $notifications[] = array( - 'user_id' => (int) $row['user_id'], - 'topic_id' => $to_topic_id, - 'notify_status' => (int) $row['notify_status'], - ); - } - $db->sql_freeresult($result); - if (sizeof($notifications)) - { - $db->sql_multi_insert(TOPICS_WATCH_TABLE, $notifications); - } - // Link back to both topics $return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); } @@ -636,65 +597,17 @@ function merge_posts($topic_id, $to_topic_id) if ($row) { - // Add new topic to bookmarks - $bookmarks = array(); - $sql = 'SELECT user_id - FROM ' . BOOKMARKS_TABLE . ' - WHERE topic_id = ' . (int) $topic_id; - $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) - { - $bookmarks[] = array( - 'user_id' => (int) $row['user_id'], - 'topic_id' => (int) $to_topic_id, - ); - } - $db->sql_freeresult($result); - if (sizeof($bookmarks)) - { - // To not let it error out on users, who already bookmarked the topic, we just return on an error... - $db->sql_return_on_error(true); - $db->sql_multi_insert(BOOKMARKS_TABLE, $bookmarks); - $db->sql_return_on_error(false); - } - - // Add new topic to notifications - $notifications = array(); - $sql = 'SELECT user_id, notify_status - FROM ' . TOPICS_WATCH_TABLE . ' - WHERE topic_id = ' . (int) $topic_id; - $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) - { - $notifications[] = array( - 'user_id' => (int) $row['user_id'], - 'topic_id' => (int) $to_topic_id, - 'notify_status' => (int) $row['notify_status'], - ); - } - $db->sql_freeresult($result); - if (sizeof($notifications)) - { - // To not let it error out on users, who already watch the topic, we just return on an error... - $db->sql_return_on_error(true); - $db->sql_multi_insert(TOPICS_WATCH_TABLE, $notifications); - $db->sql_return_on_error(false); - } - $return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $topic_id) . '">', '</a>'); } else { // If the topic no longer exist, we will update the topic watch table. // To not let it error out on users watching both topics, we just return on an error... - // Same for bookmarks $db->sql_return_on_error(true); $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE topic_id = ' . (int) $topic_id); - $db->sql_query('UPDATE ' . BOOKMARKS_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE topic_id = ' . (int) $topic_id); $db->sql_return_on_error(false); $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . (int) $topic_id); - $db->sql_query('DELETE FROM ' . BOOKMARKS_TABLE . ' WHERE topic_id = ' . (int) $topic_id); } // Link to the new topic diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 648af61c00..af5c9d3a47 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -152,6 +152,7 @@ class template function destroy() { $this->_tpldata = array('.' => array(0 => array())); + $this->_rootref = &$this->_tpldata['.'][0]; } /** @@ -248,8 +249,13 @@ class template { global $user, $phpEx, $config; + if (!isset($this->filename[$handle])) + { + trigger_error("template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR); + } + $filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . $phpEx; - $this->files_template[$handle] = $user->theme['template_id']; + $this->files_template[$handle] = (isset($user->theme['template_id'])) ? $user->theme['template_id'] : 0; $recompile = false; if (!file_exists($filename) || @filesize($filename) === 0) diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 6ac02c7d0a..e1c51170db 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -122,6 +122,7 @@ class ucp_pm // trigger_error('NO_AUTH_SEND_MESSAGE'); $template->assign_vars(array( 'S_NO_AUTH_SEND_MESSAGE' => true, + 'S_COMPOSE_PM_VIEW' => true, )); $tpl_file = 'ucp_pm_viewfolder'; diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index fba3bfeb32..2f56bcdf7a 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -811,7 +811,7 @@ function compose_pm($id, $mode, $action) } // Decode text for message display - $bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh && !sizeof($error)) ? $bbcode_uid : $message_parser->bbcode_uid; + $bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh) ? $bbcode_uid : $message_parser->bbcode_uid; $message_parser->decode_message($bbcode_uid); diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 6493b54e1f..33d2c9fb6f 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -432,7 +432,6 @@ function get_pm_from($folder_id, $folder, $user_id) 'TOTAL_MESSAGES' => (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)), 'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'), - 'L_NO_MESSAGES' => (!$auth->acl_get('u_sendpm')) ? $user->lang['NO_AUTH_SEND_MESSAGE'] : $user->lang['NO_MESSAGES'], 'S_NO_AUTH_SEND_MESSAGE' => !$auth->acl_get('u_sendpm'), |