Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
marc1706 committed May 31, 2024
2 parents 860b8c6 + b227262 commit e792cc1
Show file tree
Hide file tree
Showing 51 changed files with 548 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/resources/phpbb-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ installer:
server:
cookie_secure: false
server_protocol: http://
force_server_vars: false
force_server_vars: true
server_name: localhost
server_port: 80
script_path: /
Expand Down
8 changes: 8 additions & 0 deletions .devcontainer/resources/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ sudo ln -s /workspaces/phpbb/phpBB /var/www/html
echo "[Codespaces] Copy phpBB configuration"
cp /workspaces/phpbb/.devcontainer/resources/phpbb-config.yml /workspaces/phpbb/phpBB/install/install-config.yml

# Force the server URL to reflect the Codespace
# https://docs.github.com/en/codespaces/developing-in-a-codespace/default-environment-variables-for-your-codespace
if [ "$CODESPACES" = true ] ; then
echo "[Codespaces] Set the phpBB server name using default environment variables"
codespaces_url="${CODESPACE_NAME}-80.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}"
sed -i "s/localhost/$codespaces_url/g" /workspaces/phpbb/phpBB/install/install-config.yml
fi

# Install phpBB
echo "[Codespaces] Run phpBB CLI installation"
cd /workspaces/phpbb/phpBB && composer install --no-interaction
Expand Down
2 changes: 1 addition & 1 deletion build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
<property name="newversion" value="4.0.0-a1-dev" />
<property name="prevversion" value="3.3.12-RC1" />
<property name="prevversion" value="3.3.12" />
<property name="olderversions" value="3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.1.10, 3.1.11, 3.1.12, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5, 3.2.6, 3.2.7, 3.2.8, 3.2.9, 3.2.10, 3.2.11, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.3.5, 3.3.6, 3.3.7, 3.3.8, 3.3.9, 3.3.10, 3.3.11" />
<!-- no configuration should be needed beyond this point -->

Expand Down
3 changes: 3 additions & 0 deletions phpBB/adm/style/acp_groups.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ <h1>{L_ADD_USERS}</h1>

<fieldset>
<legend>{L_ADD_USERS}</legend>
{% EVENT acp_groups_add_user_options_before %}
<dl>
<dt><label for="leader">{L_USER_GROUP_LEADER}{L_COLON}</label></dt>
<dd><label><input name="leader" type="radio" class="radio" value="1" /> {L_YES}</label>
Expand All @@ -235,11 +236,13 @@ <h1>{L_ADD_USERS}</h1>
<dd><label><input name="default" type="radio" class="radio" value="1" /> {L_YES}</label>
<label><input name="default" type="radio" class="radio" id="default" value="0" checked="checked" /> {L_NO}</label></dd>
</dl>
{% EVENT acp_groups_add_user_usernames_before %}
<dl>
<dt><label for="usernames">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt>
<dd><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea></dd>
<dd><!-- EVENT acp_groups_find_username_prepend -->[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]<!-- EVENT acp_groups_find_username_append --></dd>
</dl>
{% EVENT acp_groups_add_user_options_after %}

<p class="quick">
<input class="button2" type="submit" name="addusers" value="{L_SUBMIT}" />
Expand Down
30 changes: 17 additions & 13 deletions phpBB/adm/style/acp_main.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,31 @@ <h1>{L_WELCOME_PHPBB}</h1>

<p>{L_ADMIN_INTRO}</p>

<!-- IF S_UPDATE_INCOMPLETE -->
{% if S_UPDATE_INCOMPLETE %}
<div class="errorbox">
<p>{L_UPDATE_INCOMPLETE} <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p>
<p>{{ lang('UPDATE_INCOMPLETE') }} <a href="{{ U_VERSIONCHECK }}">{{ lang('MORE_INFORMATION') }}</a></p>
</div>
<!-- ELSEIF S_VERSIONCHECK_FAIL -->
{% elseif S_VERSIONCHECK_FAIL %}
<div class="errorbox notice">
<p>{L_VERSIONCHECK_FAIL}</p>
<p>{VERSIONCHECK_FAIL_REASON}</p>
<p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> &middot; <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p>
<p>{{ lang('VERSIONCHECK_FAIL') }}</p>
<p>{{ VERSIONCHECK_FAIL_REASON }}</p>
<p><a href="{{ U_VERSIONCHECK_FORCE }}">{{ lang('VERSIONCHECK_FORCE_UPDATE') }}</a> &middot; <a href="{{ U_VERSIONCHECK }}">{{ lang('MORE_INFORMATION') }}</a></p>
</div>
<!-- ELSEIF not S_VERSION_UP_TO_DATE -->
{% elseif not S_VERSION_UP_TO_DATE %}
<div class="errorbox">
<p>{L_VERSION_NOT_UP_TO_DATE_TITLE}</p>
<p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> &middot; <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p>
<p>{{ lang('VERSION_NOT_UP_TO_DATE_TITLE') }}</p>
<p><a href="{{ U_VERSIONCHECK_FORCE }}">{{ lang('VERSIONCHECK_FORCE_UPDATE') }}</a> &middot; <a href="{{ U_VERSIONCHECK }}">{{ lang('MORE_INFORMATION') }}</a></p>
</div>
<!-- ENDIF -->
<!-- IF S_VERSION_UPGRADEABLE -->
{% elseif S_VERSION_UP_TO_DATE && S_VERSIONCHECK_FORCE %}
<div class="successbox">
<p>{{ lang('VERSION_UP_TO_DATE_ACP') }}</p>
</div>
{% endif %}
{% if S_VERSION_UPGRADEABLE %}
<div class="errorbox notice">
<p>{UPGRADE_INSTRUCTIONS}</p>
<p>{{ UPGRADE_INSTRUCTIONS }}</p>
</div>
<!-- ENDIF -->
{% endif %}
{% if S_CAPTCHA_UNSAFE %}
<div class="errorbox">
<p>{{ lang('CAPTCHA_UNSAFE_WARNING') }}</p>
Expand Down
16 changes: 16 additions & 0 deletions phpBB/docs/CHANGELOG.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ <h1>Changelog</h1>
<ol>
<li><a href="#changelog">Changelog</a>
<ul>
<li><a href="#v3312rc1">Changes since 3.3.12-RC1</a></li>
<li><a href="#v3311">Changes since 3.3.11</a></li>
<li><a href="#v3310">Changes since 3.3.10</a></li>
<li><a href="#v3310rc1">Changes since 3.3.10-RC1</a></li>
Expand Down Expand Up @@ -168,6 +169,21 @@ <h1>Changelog</h1>
<div class="inner">

<div class="content">
<a name="v3312rc1"></a><h3>Changes since 3.3.12-RC1</h3>
<h4>Bug</h4>
<ul>
<li>[<a href="https://tracker.phpbb.com/browse/PHPBB3-17312">PHPBB3-17312</a>] - User last visit gets updated too often</li>
</ul>
<h4>Improvement</h4>
<ul>
<li>[<a href="https://tracker.phpbb.com/browse/PHPBB3-17324">PHPBB3-17324</a>] - Add template event to notification_dropdown.html</li>
</ul>
<h4>Hardening</h4>
<ul>
<li>[<a href="https://tracker.phpbb.com/browse/SECURITY-276">SECURITY-276</a>] - Prevent resending activation email too often</li>
<li>[<a href="https://tracker.phpbb.com/browse/SECURITY-278">SECURITY-278</a>] - Always release cron lock, even invalid task is passed</li>
</ul>

<a name="v3311"></a><h3>Changes since 3.3.11</h3>
<h4>Bug</h4>
<ul>
Expand Down
46 changes: 46 additions & 0 deletions phpBB/docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,24 @@ acp_group_types_prepend
* Since: 3.2.9-RC1
* Purpose: Add additional group type options to group settings (prepend the list)

acp_groups_add_user_options_after
===
* Location: adm/style/acp_groups.html
* Since: 3.3.13-RC1
* Purpose: Add content after options for adding user to group in the ACP

acp_groups_add_user_options_before
===
* Location: adm/style/acp_groups.html
* Since: 3.3.13-RC1
* Purpose: Add content before options for adding user to group in the ACP

acp_groups_add_user_usernames_before
===
* Location: adm/style/acp_groups.html
* Since: 3.3.13-RC1
* Purpose: Add content before usernames option for adding user to group in the ACP

acp_groups_find_username_append
===
* Location: adm/style/acp_groups.html
Expand Down Expand Up @@ -1597,6 +1615,20 @@ navbar_header_username_prepend
* Since: 3.1.0-RC1
* Purpose: Add text and HTMl before the username shown in the navbar.

notification_dropdown_footer_after
===
* Locations:
+ styles/prosilver/template/notification_dropdown.html
* Since: 3.3.12
* Purpose: Add content after notifications list footer.

notification_dropdown_footer_before
===
* Locations:
+ styles/prosilver/template/notification_dropdown.html
* Since: 3.3.12
* Purpose: Add content before notifications list footer.

overall_footer_after
===
* Locations:
Expand Down Expand Up @@ -2521,6 +2553,20 @@ ucp_friend_list_before
* Since: 3.1.0-a4
* Purpose: Add optional elements before list of friends in UCP

ucp_group_settings_after
===
* Locations:
+ styles/prosilver/template/ucp_groups_manage.html
* Since: 3.3.13-RC1
* Purpose: Add content after options for managing a group in the UCP

ucp_group_settings_before
===
* Locations:
+ styles/prosilver/template/ucp_groups_manage.html
* Since: 3.3.13-RC1
* Purpose: Add content before options for managing a group in the UCP

ucp_header_content_before
===
* Locations:
Expand Down
5 changes: 3 additions & 2 deletions phpBB/includes/acp/acp_inactive.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,11 @@ function main($id, $mode)

$messenger->save_queue();

// Add the remind state to the database
// Add the remind state to the database and increase activation expiration by one day
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_reminded = user_reminded + 1,
user_reminded_time = ' . time() . '
user_reminded_time = ' . time() . ',
user_actkey_expiration = ' . (int) $user::get_token_expiration() . '
WHERE ' . $db->sql_in_set('user_id', $user_ids);
$db->sql_query($sql);

Expand Down
1 change: 1 addition & 0 deletions phpBB/includes/acp/acp_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ function main($id, $mode)
$template->assign_vars(array(
'S_VERSION_UP_TO_DATE' => empty($updates_available),
'S_VERSION_UPGRADEABLE' => !empty($upgrades_available),
'S_VERSIONCHECK_FORCE' => (bool) $recheck,
'UPGRADE_INSTRUCTIONS' => !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false,
));
}
Expand Down
2 changes: 1 addition & 1 deletion phpBB/includes/acp/acp_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ protected function get_post_index_progress(int $post_counter): array
$this->db->sql_freeresult($result);

$total_count = $done_count + $remain_count;
$percent = ($done_count / $total_count) * 100;
$percent = $total_count > 0 ? ($done_count / $total_count) * 100 : 100;

return [
'VALUE' => $done_count,
Expand Down
22 changes: 13 additions & 9 deletions phpBB/includes/acp/acp_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,18 @@ function main($id, $mode)
$user_actkey = empty($user_activation_key) ? $user_actkey : $user_activation_key;
}

if ($user_row['user_type'] == USER_NORMAL || empty($user_activation_key))
{
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_actkey = '" . $db->sql_escape($user_actkey) . "'
WHERE user_id = $user_id";
$db->sql_query($sql);
}

// Always update actkey even if same and also update actkey expiration to 24 hours from now
$sql_ary = [
'user_actkey' => $user_actkey,
'user_actkey_expiration' => $user::get_token_expiration(),
];

$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (int) $user_id;
$db->sql_query($sql);

// Start sending email
$messenger = new messenger(false);

$messenger->template($email_template, $user_row['user_lang']);
Expand Down Expand Up @@ -1090,7 +1094,7 @@ function main($id, $mode)
$s_action_options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang] . '</option>';
}

$last_active = (!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_last_active'];

$inactive_reason = '';
if ($user_row['user_type'] == USER_INACTIVE)
Expand Down
2 changes: 1 addition & 1 deletion phpBB/includes/functions_display.php
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl

if ($data['user_allow_viewonline'] || $auth->acl_get('u_viewonline'))
{
$last_active = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_lastvisit'];
$last_active = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_last_active'];
}
else
{
Expand Down
22 changes: 11 additions & 11 deletions phpBB/includes/functions_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,18 +210,18 @@ function user_add($user_row, $cp_data = false, $notifications_data = null)

// These are the additional vars able to be specified
$additional_vars = array(
'user_permissions' => '',
'user_timezone' => $config['board_timezone'],
'user_dateformat' => $config['default_dateformat'],
'user_lang' => $config['default_lang'],
'user_style' => (int) $config['default_style'],
'user_actkey' => '',
'user_ip' => '',
'user_regdate' => time(),
'user_passchg' => time(),
'user_options' => 230271,
'user_permissions' => '',
'user_timezone' => $config['board_timezone'],
'user_dateformat' => $config['default_dateformat'],
'user_lang' => $config['default_lang'],
'user_style' => (int) $config['default_style'],
'user_actkey' => '',
'user_ip' => '',
'user_regdate' => time(),
'user_passchg' => time(),
'user_options' => 230271,
// We do not set the new flag here - registration scripts need to specify it
'user_new' => 0,
'user_new' => 0,

'user_inactive_reason' => 0,
'user_inactive_time' => 0,
Expand Down
1 change: 1 addition & 0 deletions phpBB/includes/mcp/mcp_post.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ function mcp_post_details($id, $mode, $action)
'U_POST_ACTION' => "$url&amp;i=$id&amp;mode=post_details", // Use this for action parameters
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id"),

'S_CAN_APPROVE' => $auth->acl_get('m_approve', $post_info['forum_id']),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']),
'S_CAN_LOCK_POST' => $auth->acl_get('m_lock', $post_info['forum_id']),
Expand Down
2 changes: 2 additions & 0 deletions phpBB/includes/mcp/mcp_reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ function main($id, $mode)
$report_template = array(
'S_MCP_REPORT' => true,
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;p=' . $post_id),
'S_CAN_APPROVE' => $auth->acl_get('m_approve', $post_info['forum_id']),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE,
Expand All @@ -260,6 +261,7 @@ function main($id, $mode)
'S_USER_NOTES' => true,

'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;p={$post_info['post_id']}") : '',
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;p=' . $post_id),
'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;p=' . $post_id),
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;p=' . $post_id),
'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $report['user_id']),
Expand Down
2 changes: 2 additions & 0 deletions phpBB/includes/ucp/ucp_prefs.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ function main($id, $mode)
}

$template->assign_vars(array(
'S_SIG_ALLOWED' => $config['allow_sig'] && $auth->acl_get('u_sig'),

'S_BBCODE' => $data['bbcode'],
'S_SMILIES' => $data['smilies'],
'S_SIG' => $data['sig'],
Expand Down
7 changes: 4 additions & 3 deletions phpBB/includes/ucp/ucp_profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ function main($id, $mode)
{
$notifications_manager = $phpbb_container->get('notification_manager');
$notifications_manager->add_notifications('notification.type.admin_activate_user', array(
'user_id' => $user->data['user_id'],
'user_actkey' => $user_actkey,
'user_regdate' => time(), // Notification time
'user_id' => $user->data['user_id'],
'user_actkey' => $user_actkey,
'user_actkey_expiration' => $user::get_token_expiration(),
'user_regdate' => time(), // Notification time
));
}

Expand Down
25 changes: 13 additions & 12 deletions phpBB/includes/ucp/ucp_register.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,18 +380,19 @@ function main($id, $mode)
$passwords_manager = $phpbb_container->get('passwords.manager');

$user_row = array(
'username' => $data['username'],
'user_password' => $passwords_manager->hash($data['new_password']),
'user_email' => $data['email'],
'group_id' => (int) $group_id,
'user_timezone' => $data['tz'],
'user_lang' => $data['lang'],
'user_type' => $user_type,
'user_actkey' => $user_actkey,
'user_ip' => $user->ip,
'user_regdate' => time(),
'user_inactive_reason' => $user_inactive_reason,
'user_inactive_time' => $user_inactive_time,
'username' => $data['username'],
'user_password' => $passwords_manager->hash($data['new_password']),
'user_email' => $data['email'],
'group_id' => (int) $group_id,
'user_timezone' => $data['tz'],
'user_lang' => $data['lang'],
'user_type' => $user_type,
'user_actkey' => $user_actkey,
'user_actkey_expiration' => $user::get_token_expiration(),
'user_ip' => $user->ip,
'user_regdate' => time(),
'user_inactive_reason' => $user_inactive_reason,
'user_inactive_time' => $user_inactive_time,
);

if ($config['new_member_post_limit'])
Expand Down
Loading

0 comments on commit e792cc1

Please sign in to comment.