diff options
36 files changed, 260 insertions, 69 deletions
diff --git a/.travis.yml b/.travis.yml index a4e8bdedd3..88c902cd4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,7 @@ install: before_script: - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi" - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' -a '$DB' = 'mysql' ]; then mysql -e 'SET GLOBAL storage_engine=MyISAM;'; fi" - sh -c "if [ '$DB' = 'mysql' -o '$DB' = 'mariadb' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi" script: diff --git a/build/build.xml b/build/build.xml index 1c6cbe5f25..10ff242ab9 100644 --- a/build/build.xml +++ b/build/build.xml @@ -255,7 +255,7 @@ command="git archive ${revision} composer.phar | tar -xf - -C ${dir}" checkreturn="true" /> <exec dir="${dir}" - command="php composer.phar install" + command="php composer.phar install --no-dev" checkreturn="true" passthru="true" /> <delete file="${dir}/composer.phar" /> diff --git a/composer.phar b/composer.phar Binary files differindex a035fdc911..1e9ca731cd 100755 --- a/composer.phar +++ b/composer.phar diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index b5c691b36b..e0149c2a0f 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -2,6 +2,10 @@ <a id="maincontent"></a> +<!-- IF S_STYLE_DETAILS --> + <a href="{U_ACTION}" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a> +<!-- ENDIF --> + <!-- IF S_CONFIRM_ACTION --> <form id="confirm" method="post" action="{S_CONFIRM_ACTION}"> @@ -72,8 +76,8 @@ <fieldset class="submit-buttons"> <legend>{L_SUBMIT}</legend> - <input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> - <a href="{U_ACTION}" class="button2">{L_BACK}</a> + <input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> + <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> {S_FORM_TOKEN} </fieldset> <!-- ENDIF --> @@ -154,14 +158,6 @@ </fieldset> <!-- ENDIF --> -<!-- IF .extra_links --> - <fieldset class="quick"> - <!-- BEGIN extra_links --> - <a class="button2" href="{extra_links.U_ACTION}">{extra_links.L_ACTION}</a> - <!-- END extra_links --> - </fieldset> -<!-- ENDIF --> - </form> <!-- ENDIF --> diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html index 1caa6e5e13..013be80465 100644 --- a/phpBB/adm/style/acp_users_overview.html +++ b/phpBB/adm/style/acp_users_overview.html @@ -30,7 +30,20 @@ </dl> <dl> <dt><label>{L_POSTS}{L_COLON}</label></dt> - <dd><strong>{USER_POSTS}</strong><!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --> (<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)<!-- ELSEIF POSTS_IN_QUEUE --> ({L_POSTS_IN_QUEUE})<!-- ENDIF --></dd> + <dd> + <strong> + <!-- IF USER_HAS_POSTS and U_SEARCH_USER --> + <a href="{U_SEARCH_USER}">{USER_POSTS}</a> + <!-- ELSE --> + {USER_POSTS} + <!-- ENDIF --> + </strong> + <!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --> + (<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>) + <!-- ELSEIF POSTS_IN_QUEUE --> + ({L_POSTS_IN_QUEUE}) + <!-- ENDIF --> + </dd> </dl> <dl> <dt><label>{L_WARNINGS}{L_COLON}</label></dt> diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index d6377453d1..22bbf404ea 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1513,7 +1513,7 @@ input.autowidth { width: auto !important;} /* Form button styles ---------------------------------------- */ -a.button1, input.button1, input.button3, +a.button1, input.button1, a.button2, input.button2 { width: auto !important; padding: 1px 3px 0 3px; @@ -1556,7 +1556,7 @@ input.disabled { } /* Focus states */ -input.button1:focus, input.button2:focus, input.button3:focus { +input.button1:focus, input.button2:focus { outline-style: none; } diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html index 560bf501e9..99b98ef068 100644 --- a/phpBB/adm/style/install_header.html +++ b/phpBB/adm/style/install_header.html @@ -41,7 +41,7 @@ function dE(n, s, type) <h1>{L_INSTALL_PANEL}</h1> <p id="skip"><a href="#acp">{L_SKIP}</a></p> <!-- IF S_LANG_SELECT --> - <form method="post" action=""> + <form method="post" action="#"> <fieldset class="nobg"> <label for="language">{L_SELECT_LANG}{L_COLON}</label> {S_LANG_SELECT} diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html index c27304a425..150ef37e0e 100644 --- a/phpBB/adm/style/install_update_diff.html +++ b/phpBB/adm/style/install_update_diff.html @@ -223,7 +223,7 @@ table.hrdiff caption span { <!-- ENDIF --> <!-- IF not S_DIFF_NEW_FILE --> <p id="skip"><a href="#acp">{L_SKIP}</a></p> - <form method="post" action=""> + <form method="post" action="#"> <fieldset class="quick"> <label for="diff_mode">{L_SELECT_DIFF_MODE}{L_COLON}</label> <select name="diff_mode" id="diff_mode">{S_DIFF_MODE_OPTIONS}</select> diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 97be92933e..dfefc0c1ea 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -540,6 +540,22 @@ viewtopic_body_postrow_post_before * Since: 3.1.0-a4 * Purpose: Add data before posts +viewtopic_body_postrow_post_notices_after +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.0-b2 +* Purpose: Add posts specific custom notices at the notices bottom. + +viewtopic_body_postrow_post_notices_before +=== +* Locations: + + styles/prosilver/template/viewtopic_body.html + + styles/subsilver2/template/viewtopic_body.html +* Since: 3.1.0-b2 +* Purpose: Add posts specific custom notices at the notices top. + viewtopic_body_topic_actions_before === * Locations: diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index d5492d85a3..3f9d21f56c 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -530,6 +530,9 @@ class acp_styles return; } + // Show page title + $this->welcome_message('ACP_STYLES', null); + // Show parent styles foreach ($list as $row) { diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 3e03efd4d7..1f61010d62 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1019,7 +1019,7 @@ class acp_users $s_action_options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang] . '</option>'; } - $last_visit = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit']; + $last_active = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit']; $inactive_reason = ''; if ($user_row['user_type'] == USER_INACTIVE) @@ -1078,6 +1078,7 @@ class acp_users 'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'), '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_SEARCH_USER' => ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$user_row['user_id']}&sr=posts") : '', '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')) : '', @@ -1085,7 +1086,7 @@ class acp_users 'USER' => $user_row['username'], 'USER_REGISTERED' => $user->format_date($user_row['user_regdate']), 'REGISTERED_IP' => ($ip == 'hostname') ? gethostbyaddr($user_row['user_ip']) : $user_row['user_ip'], - 'USER_LASTACTIVE' => ($last_visit) ? $user->format_date($last_visit) : ' - ', + 'USER_LASTACTIVE' => ($last_active) ? $user->format_date($last_active) : ' - ', 'USER_EMAIL' => $user_row['user_email'], 'USER_WARNINGS' => $user_row['user_warnings'], 'USER_POSTS' => $user_row['user_posts'], diff --git a/phpBB/includes/acp/info/acp_prune.php b/phpBB/includes/acp/info/acp_prune.php index 7498e46cad..0f70d9d638 100644 --- a/phpBB/includes/acp/info/acp_prune.php +++ b/phpBB/includes/acp/info/acp_prune.php @@ -20,7 +20,7 @@ class acp_prune_info 'version' => '1.0.0', 'modes' => array( 'forums' => array('title' => 'ACP_PRUNE_FORUMS', 'auth' => 'acl_a_prune', 'cat' => array('ACP_MANAGE_FORUMS')), - 'users' => array('title' => 'ACP_PRUNE_USERS', 'auth' => 'acl_a_userdel', 'cat' => array('ACP_USER_SECURITY')), + 'users' => array('title' => 'ACP_PRUNE_USERS', 'auth' => 'acl_a_userdel', 'cat' => array('ACP_CAT_USERS')), ), ); } diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 3ccf3e3545..f0ce21fb48 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -189,7 +189,7 @@ class ucp_main $template->assign_vars(array( 'USER_COLOR' => (!empty($user->data['user_colour'])) ? $user->data['user_colour'] : '', 'JOINED' => $user->format_date($user->data['user_regdate']), - 'VISITED' => (empty($last_visit)) ? ' - ' : $user->format_date($last_visit), + 'LAST_ACTIVE' => (empty($last_active)) ? ' - ' : $user->format_date($last_active), 'WARNINGS' => ($user->data['user_warnings']) ? $user->data['user_warnings'] : 0, 'POSTS' => ($user->data['user_posts']) ? $user->data['user_posts'] : 0, 'POSTS_DAY' => $user->lang('POST_DAY', $posts_per_day), diff --git a/phpBB/install/index.php b/phpBB/install/index.php index b18a9dce1b..66c8559e98 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -720,8 +720,9 @@ class module $size = (int) $tpl_type[1]; $maxlength = (int) $tpl_type[2]; + $autocomplete = (isset($options['autocomplete']) && $options['autocomplete'] == 'off') ? ' autocomplete="off"' : ''; - $tpl = '<input id="' . $name . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $value . '" />'; + $tpl = '<input id="' . $name . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '"' . $autocomplete . ' value="' . $value . '" />'; break; case 'textarea': diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 72e6f6affa..009f0dfa33 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -2017,8 +2017,8 @@ class install_install extends module 'smtp_delivery' => array('lang' => 'USE_SMTP', 'type' => 'radio:yes_no', 'explain' => true), 'smtp_host' => array('lang' => 'SMTP_SERVER', 'type' => 'text:25:50', 'explain' => false), 'smtp_auth' => array('lang' => 'SMTP_AUTH_METHOD', 'type' => 'select', 'options' => '$this->module->mail_auth_select(\'{VALUE}\')', 'explain' => true), - 'smtp_user' => array('lang' => 'SMTP_USERNAME', 'type' => 'text:25:255', 'explain' => true), - 'smtp_pass' => array('lang' => 'SMTP_PASSWORD', 'type' => 'password:25:255', 'explain' => true), + 'smtp_user' => array('lang' => 'SMTP_USERNAME', 'type' => 'text:25:255', 'explain' => true, 'options' => array('autocomplete' => 'off')), + 'smtp_pass' => array('lang' => 'SMTP_PASSWORD', 'type' => 'password:25:255', 'explain' => true, 'options' => array('autocomplete' => 'off')), 'legend2' => 'SERVER_URL_SETTINGS', 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'type' => 'radio:enabled_disabled', 'explain' => true), diff --git a/phpBB/language/en/acp/ban.php b/phpBB/language/en/acp/ban.php index 2dc0489030..68a68ebe54 100644 --- a/phpBB/language/en/acp/ban.php +++ b/phpBB/language/en/acp/ban.php @@ -73,10 +73,10 @@ $lang = array_merge($lang, array( 'PERMANENT' => 'Permanent', 'UNTIL' => 'Until', - 'USER_BAN' => 'Ban one or more usernames', + 'USER_BAN' => 'Ban one or more users by username', 'USER_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered users from all current bans.', 'USER_BAN_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the <span style="text-decoration: underline;">Find a member</span> facility to look up and add one or more users automatically.', 'USER_NO_BANNED' => 'No banned usernames', - 'USER_UNBAN' => 'Un-ban or un-exclude usernames', + 'USER_UNBAN' => 'Un-ban or un-exclude users by username', 'USER_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users are emphasised.', )); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 18968d6c97..1d2c979e0c 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -355,7 +355,7 @@ $lang = array_merge($lang, array( 'ACP_LOAD_SETTINGS_EXPLAIN' => 'Here you can enable and disable certain board functions to reduce the amount of processing required. On most servers there is no need to disable any functions. However on certain systems or in shared hosting environments it may be beneficial to disable capabilities you do not really need. You can also specify limits for system load and active sessions beyond which the board will go offline.', 'ALLOW_CDN' => 'Allow usage of third party content delivery networks', - 'ALLOW_CDN_EXPLAIN' => 'If this setting is enabled, some files will be served from external third party servers instead of your server. This reduces the network bandwidth required by your server, but may present a privacy issue for some board administrators.', + 'ALLOW_CDN_EXPLAIN' => 'If this setting is enabled, some files will be served from external third party servers instead of your server. This reduces the network bandwidth required by your server, but may present a privacy issue for some board administrators. In a default phpBB installation, this includes loading “jQuery” and the font “Open Sans” from Google’s content delivery network.', 'CUSTOM_PROFILE_FIELDS' => 'Custom profile fields', 'LIMIT_LOAD' => 'Limit system load', 'LIMIT_LOAD_EXPLAIN' => 'If the system’s 1-minute load average exceeds this value the board will automatically go offline. A value of 1.0 equals ~100% utilisation of one processor. This only functions on UNIX based servers and where this information is accessible. The value here resets itself to 0 if phpBB was unable to get the load limit.', diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 428b9ffd3b..6b48568bba 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -49,7 +49,7 @@ $lang = array_merge($lang, array( 'ACP_BAN' => 'Banning', 'ACP_BAN_EMAILS' => 'Ban emails', 'ACP_BAN_IPS' => 'Ban IPs', - 'ACP_BAN_USERNAMES' => 'Ban usernames', + 'ACP_BAN_USERNAMES' => 'Ban users', 'ACP_BBCODES' => 'BBCodes', 'ACP_BOARD_CONFIGURATION' => 'Board configuration', 'ACP_BOARD_FEATURES' => 'Board features', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 360d6be1e0..fba78d34aa 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -210,8 +210,6 @@ $lang = array_merge($lang, array( 'ERR_CONNECTING_SERVER' => 'Error connecting to the server.', 'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.', 'ERR_JAB_CONNECT' => 'Could not connect to Jabber server.', - 'ERR_TEMPLATE_EVENT_LOCATION' => 'The specified template event location <em>[%s]</em> is improperly formatted.', - 'ERR_TEMPLATE_COMPILATION' => 'The file could not be compiled: %s', 'ERR_UNABLE_TO_LOGIN' => 'The specified username or password is incorrect.', 'ERR_UNWATCHING' => 'An error occurred while trying to unsubscribe.', 'ERR_WATCHING' => 'An error occurred while trying to subscribe.', diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index 83f5e4107e..c7f301fb8c 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -135,5 +135,4 @@ $lang = array_merge($lang, array( 'USERS_PER_PAGE' => 'Users per page', 'VIEWING_PROFILE' => 'Viewing profile - %s', - 'VISITED' => 'Last visited', )); diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 186868e371..ba4a4372a5 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1666,11 +1666,11 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f if ($data['user_allow_viewonline'] || $auth->acl_get('u_viewonline')) { - $last_visit = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_lastvisit']; + $last_active = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_lastvisit']; } else { - $last_visit = ''; + $last_active = ''; } $age = ''; @@ -1703,7 +1703,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f 'AGE' => $age, 'RANK_TITLE' => $rank_title, 'JOINED' => $user->format_date($data['user_regdate']), - 'VISITED' => (empty($last_visit)) ? ' - ' : $user->format_date($last_visit), + 'LAST_ACTIVE' => (empty($last_active)) ? ' - ' : $user->format_date($last_active), 'POSTS' => ($data['user_posts']) ? $data['user_posts'] : 0, 'WARNINGS' => isset($data['user_warnings']) ? $data['user_warnings'] : 0, diff --git a/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php b/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php new file mode 100644 index 0000000000..ab5b1a535b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php @@ -0,0 +1,77 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class acp_prune_users_module extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_CAT_USERS'"; + $result = $this->db->sql_query($sql); + $acp_cat_users_id = (int) $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + $sql = 'SELECT parent_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_basename = 'acp_prune' + AND module_mode = 'users'"; + $result = $this->db->sql_query($sql); + $acp_prune_users_parent = (int) $this->db->sql_fetchfield('parent_id'); + $this->db->sql_freeresult($result); + + // Skip migration if "Users" category has been deleted + // or the module has already been moved to that category + return !$acp_cat_users_id || $acp_cat_users_id === $acp_prune_users_parent; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\beta1'); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'move_prune_users_module'))), + ); + } + + public function move_prune_users_module() + { + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_basename = 'acp_prune' + AND module_mode = 'users'"; + $result = $this->db->sql_query($sql); + $acp_prune_users_id = (int) $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_CAT_USERS'"; + $result = $this->db->sql_query($sql); + $acp_cat_users_id = (int) $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + if (!class_exists('\acp_modules')) + { + include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); + } + $module_manager = new \acp_modules(); + $module_manager->module_class = 'acp'; + $module_manager->move_module($acp_prune_users_id, $acp_cat_users_id); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php b/phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php new file mode 100644 index 0000000000..54ff2a31eb --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/profilefield_location_cleanup.php @@ -0,0 +1,47 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class profilefield_location_cleanup extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'users', 'user_from'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_location', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'users' => array( + 'user_from', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'users' => array( + 'user_from' => array('VCHAR_UNI:100', ''), + ), + ), + ); + } +} diff --git a/phpBB/phpbb/extension/finder.php b/phpBB/phpbb/extension/finder.php index c9c16ae6d5..6cc6e1808a 100644 --- a/phpBB/phpbb/extension/finder.php +++ b/phpBB/phpbb/extension/finder.php @@ -475,14 +475,19 @@ class finder } $directory_pattern = '#' . $directory_pattern . '#'; - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::SELF_FIRST); + $iterator = new \RecursiveIteratorIterator( + new \phpbb\recursive_dot_prefix_filter_iterator( + new \RecursiveDirectoryIterator( + $path, + \FilesystemIterator::SKIP_DOTS + ) + ), + \RecursiveIteratorIterator::SELF_FIRST + ); + foreach ($iterator as $file_info) { $filename = $file_info->getFilename(); - if ($filename == '.' || $filename == '..') - { - continue; - } if ($file_info->isDir() == $is_dir) { diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php index 62edc6a77f..68b023e244 100644 --- a/phpBB/phpbb/log/log.php +++ b/phpBB/phpbb/log/log.php @@ -308,7 +308,7 @@ class log implements \phpbb\log\log_interface * @since 3.1-A1 */ $vars = array('mode', 'user_id', 'log_ip', 'log_operation', 'log_time', 'additional_data', 'sql_ary'); - extract($this->dispatcher->trigger_event('core.add_log', $vars)); + extract($this->dispatcher->trigger_event('core.add_log', compact($vars))); // We didn't find a log_type, so we don't save it in the database. if (!isset($sql_ary['log_type'])) @@ -406,7 +406,7 @@ class log implements \phpbb\log\log_interface * @since 3.1-A1 */ $vars = array('mode', 'count_logs', 'limit', 'offset', 'forum_id', 'topic_id', 'user_id', 'log_time', 'sort_by', 'keywords', 'profile_url', 'log_type', 'sql_additional'); - extract($this->dispatcher->trigger_event('core.get_logs_modify_type', $vars)); + extract($this->dispatcher->trigger_event('core.get_logs_modify_type', compact($vars))); if ($log_type === false) { @@ -502,7 +502,7 @@ class log implements \phpbb\log\log_interface * @since 3.1-A1 */ $vars = array('row', 'log_entry_data'); - extract($this->dispatcher->trigger_event('core.get_logs_modify_entry_data', $vars)); + extract($this->dispatcher->trigger_event('core.get_logs_modify_entry_data', compact($vars))); $log[$i] = $log_entry_data; @@ -561,7 +561,7 @@ class log implements \phpbb\log\log_interface * @since 3.1-A1 */ $vars = array('log', 'topic_id_list', 'reportee_id_list'); - extract($this->dispatcher->trigger_event('core.get_logs_get_additional_data', $vars)); + extract($this->dispatcher->trigger_event('core.get_logs_get_additional_data', compact($vars))); if (sizeof($topic_id_list)) { diff --git a/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php b/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php new file mode 100644 index 0000000000..6ef63ec906 --- /dev/null +++ b/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php @@ -0,0 +1,28 @@ +<?php +/** +* +* @package extension +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +namespace phpbb; + +/** +* Class recursive_dot_prefix_filter_iterator +* +* This filter ignores directories starting with a dot. +* When searching for php classes and template files of extensions +* we don't need to look inside these directories. +* +* @package phpbb +*/ +class recursive_dot_prefix_filter_iterator extends \RecursiveFilterIterator +{ + public function accept() + { + $filename = $this->current()->getFilename(); + return !$this->current()->isDir() || $filename[0] !== '.'; + } +} diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 6c060e21ea..b9b3896606 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -631,18 +631,20 @@ class user extends \phpbb\session else if ($this->lang_name == basename($config['default_lang'])) { // Fall back to the English Language + $reset_lang_name = $this->lang_name; $this->lang_name = 'en'; $this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name); + $this->lang_name = $reset_lang_name; } else if ($this->lang_name == $this->data['user_lang']) { // Fall back to the board default language + $reset_lang_name = $this->lang_name; $this->lang_name = basename($config['default_lang']); $this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name); + $this->lang_name = $reset_lang_name; } - // Reset the lang name - $this->lang_name = (file_exists($lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']); return; } diff --git a/phpBB/posting.php b/phpBB/posting.php index ebb0af3adf..ef90c229da 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1213,17 +1213,11 @@ if ($submit || $preview || $refresh) meta_refresh(10, $redirect_url); $message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD']; $message .= (($user->data['user_id'] == ANONYMOUS) ? '' : ' '. $user->lang['POST_APPROVAL_NOTIFY']); + $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>'); + trigger_error($message); } - else - { - meta_refresh(3, $redirect_url); - $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED'; - $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>'); - } - - $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $data['forum_id']) . '">', '</a>'); - trigger_error($message); + redirect($redirect_url); } } } diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 511c7b22c0..7ba289cfd6 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -113,7 +113,7 @@ <td class="posts"><!-- IF memberrow.POSTS and S_DISPLAY_SEARCH --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td> <td class="info"><!-- BEGIN custom_fields --><div>{memberrow.custom_fields.PROFILE_FIELD_VALUE}</div><!-- BEGINELSE --> <!-- END custom_fields --></td> <td>{memberrow.JOINED}</td> - <!-- IF S_VIEWONLINE --><td>{memberrow.VISITED} </td><!-- ENDIF --> + <!-- IF S_VIEWONLINE --><td>{memberrow.LAST_ACTIVE} </td><!-- ENDIF --> </tr> <!-- BEGINELSE --> <tr class="bg1"> diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index ecbde97b80..caff3b287c 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -85,7 +85,7 @@ <dl class="details"> <!-- EVENT memberlist_view_user_statistics_before --> <dt>{L_JOINED}{L_COLON}</dt> <dd>{JOINED}</dd> - <dt>{L_VISITED}{L_COLON}</dt> <dd>{VISITED}</dd> + <dt>{L_LAST_ACTIVE}{L_COLON}</dt> <dd>{LAST_ACTIVE}</dd> <!-- IF S_WARNINGS --> <dt>{L_WARNINGS}{L_COLON} </dt> <dd><strong>{WARNINGS}</strong><!-- IF U_NOTES or U_WARN --> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --></dd> diff --git a/phpBB/styles/prosilver/template/ucp_main_front.html b/phpBB/styles/prosilver/template/ucp_main_front.html index eca224f2d9..861cf87c92 100644 --- a/phpBB/styles/prosilver/template/ucp_main_front.html +++ b/phpBB/styles/prosilver/template/ucp_main_front.html @@ -60,7 +60,7 @@ <dl class="details"> <dt>{L_JOINED}{L_COLON}</dt> <dd>{JOINED}</dd> - <dt>{L_VISITED}{L_COLON}</dt> <dd>{LAST_VISIT_YOU}</dd> + <dt>{L_LAST_ACTIVE}{L_COLON}</dt> <dd>{LAST_VISIT_YOU}</dd> <dt>{L_TOTAL_POSTS}{L_COLON}</dt> <dd><!-- IF POSTS_PCT -->{POSTS}<!-- IF S_DISPLAY_SEARCH --> | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_YOUR_POSTS}</a></strong><!-- ENDIF --><br />({POSTS_DAY} / {POSTS_PCT})<!-- ELSE -->{POSTS}<!-- ENDIF --></dd> <!-- IF ACTIVE_FORUM != '' --><dt>{L_ACTIVE_IN_FORUM}{L_COLON}</dt> <dd><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})</dd><!-- ENDIF --> <!-- IF ACTIVE_TOPIC != '' --><dt>{L_ACTIVE_IN_TOPIC}{L_COLON}</dt> <dd><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})</dd><!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 2a3962d21e..4d96a0e392 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -252,6 +252,7 @@ </dl> <!-- ENDIF --> + <!-- EVENT viewtopic_body_postrow_post_notices_before --> <!-- IF postrow.S_DISPLAY_NOTICE --><div class="rules">{L_DOWNLOAD_NOTICE}</div><!-- ENDIF --> <!-- IF postrow.DELETED_MESSAGE or postrow.DELETE_REASON --> <div class="notice post_deleted_msg"> @@ -266,6 +267,7 @@ <!-- ENDIF --> <!-- IF postrow.BUMPED_MESSAGE --><div class="notice"><br /><br />{postrow.BUMPED_MESSAGE}</div><!-- ENDIF --> + <!-- EVENT viewtopic_body_postrow_post_notices_after --> <!-- IF postrow.SIGNATURE --><div id="sig{postrow.POST_ID}" class="signature">{postrow.SIGNATURE}</div><!-- ENDIF --> </div> diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html index d4547d822d..b88bfc7092 100644 --- a/phpBB/styles/subsilver2/template/memberlist_view.html +++ b/phpBB/styles/subsilver2/template/memberlist_view.html @@ -72,8 +72,8 @@ <td width="100%"><b class="gen">{JOINED}</b></td> </tr> <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_VISITED}{L_COLON} </td> - <td width="100%"><b class="gen">{VISITED}</b></td> + <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_LAST_ACTIVE}{L_COLON} </td> + <td width="100%"><b class="gen">{LAST_ACTIVE}</b></td> </tr> <!-- IF S_WARNINGS --> <tr> diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index 251983761c..f8f95c660d 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -260,6 +260,7 @@ <div class="postbody"><br />_________________<br />{postrow.SIGNATURE}</div> <!-- ENDIF --> + <!-- EVENT viewtopic_body_postrow_post_notices_before --> <!-- IF postrow.DELETED_MESSAGE or postrow.DELETE_REASON --> <!-- IF postrow.DELETE_REASON --> <br /><br /> @@ -295,6 +296,7 @@ <!-- IF postrow.BUMPED_MESSAGE --> <span class="gensmall"><br /><br />{postrow.BUMPED_MESSAGE}</span> <!-- ENDIF --> + <!-- EVENT viewtopic_body_postrow_post_notices_after --> <!-- IF not postrow.S_HAS_ATTACHMENTS --><br clear="all" /><br /><!-- ENDIF --> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 596272636a..61a28940b1 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1564,13 +1564,19 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) $edit_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_edit', $forum_id) || ( $user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && + $topic_data['topic_status'] != ITEM_LOCKED && !$row['post_edit_locked'] && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time']) ))); + $quote_allowed = $auth->acl_get('m_edit', $forum_id) || ($topic_data['topic_status'] != ITEM_LOCKED && + ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('f_reply', $forum_id)) + ); + $delete_allowed = ($user->data['is_registered'] && (($auth->acl_get('m_delete', $forum_id) || ($auth->acl_get('m_softdelete', $forum_id) && $row['post_visibility'] != ITEM_DELETED)) || ( $user->data['user_id'] == $poster_id && ($auth->acl_get('f_delete', $forum_id) || ($auth->acl_get('f_softdelete', $forum_id) && $row['post_visibility'] != ITEM_DELETED)) && + $topic_data['topic_status'] != ITEM_LOCKED && $topic_data['topic_last_post_id'] == $row['post_id'] && ($row['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']) && // we do not want to allow removal of the last post if a moderator locked it! @@ -1611,7 +1617,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false), 'U_EDIT' => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '', - 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', + 'U_QUOTE' => ($quote_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&p=" . $row['post_id'], true, $user->session_id) : '', 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '', diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index d6eb4a632f..c0e58d1104 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -893,9 +893,9 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $message * @param array $additional_form_data Any additional form data to be sent in the request * @param string $expected Lang var of expected message after posting - * @return array|null post_id, topic_id if message is 'POST_STORED' + * @return array|null post_id, topic_id if message is empty */ - public function create_topic($forum_id, $subject, $message, $additional_form_data = array(), $expected = 'POST_STORED') + public function create_topic($forum_id, $subject, $message, $additional_form_data = array(), $expected = '') { $posting_url = "posting.php?mode=post&f={$forum_id}&sid={$this->sid}"; @@ -919,9 +919,9 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $message * @param array $additional_form_data Any additional form data to be sent in the request * @param string $expected Lang var of expected message after posting - * @return array|null post_id, topic_id if message is 'POST_STORED' + * @return array|null post_id, topic_id if message is empty */ - public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array(), $expected = 'POST_STORED') + public function create_post($forum_id, $topic_id, $subject, $message, $additional_form_data = array(), $expected = '') { $posting_url = "posting.php?mode=reply&f={$forum_id}&t={$topic_id}&sid={$this->sid}"; @@ -941,9 +941,9 @@ class phpbb_functional_test_case extends phpbb_test_case * @param string $posting_contains * @param array $form_data * @param string $expected Lang var of expected message after posting - * @return array|null post_id, topic_id if message is 'POST_STORED' + * @return array|null post_id, topic_id if message is empty */ - protected function submit_post($posting_url, $posting_contains, $form_data, $expected = 'POST_STORED') + protected function submit_post($posting_url, $posting_contains, $form_data, $expected = '') { $this->add_lang('posting'); @@ -989,13 +989,13 @@ class phpbb_functional_test_case extends phpbb_test_case // contained in one of the actual form fields that the browser sees (i.e. it ignores "hidden" inputs) // Instead, I send it as a request with the submit button "post" set to true. $crawler = self::request('POST', $posting_url, $form_data); - $this->assertContainsLang($expected, $crawler->filter('html')->text()); - if ($expected !== 'POST_STORED') + if ($expected !== '') { - return; + $this->assertContainsLang($expected, $crawler->filter('html')->text()); + return null; } - $url = $crawler->selectLink($this->lang('VIEW_MESSAGE', '', ''))->link()->getUri(); + $url = $crawler->selectLink($form_data['subject'])->link()->getUri(); return array( 'topic_id' => $this->get_parameter_from_link($url, 't'), |