aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_ban.php34
-rw-r--r--phpBB/includes/functions.php4
-rw-r--r--phpBB/includes/functions_privmsgs.php9
-rw-r--r--phpBB/includes/ucp/ucp_pm.php2
-rw-r--r--phpBB/includes/ucp/ucp_profile.php12
5 files changed, 45 insertions, 16 deletions
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index a7ea57b753..f8af1b86e1 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -175,12 +175,21 @@ class acp_ban
}
$result = $db->sql_query($sql);
- $banned_options = '';
+ $banned_options = $excluded_options = array();
$ban_length = $ban_reasons = $ban_give_reasons = array();
while ($row = $db->sql_fetchrow($result))
{
- $banned_options .= '<option' . (($row['ban_exclude']) ? ' class="sep"' : '') . ' value="' . $row['ban_id'] . '">' . $row[$field] . '</option>';
+ $option = '<option value="' . $row['ban_id'] . '">' . $row[$field] . '</option>';
+
+ if ($row['ban_exclude'])
+ {
+ $excluded_options[] = $option;
+ }
+ else
+ {
+ $banned_options[] = $option;
+ }
$time_length = ($row['ban_end']) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0;
@@ -241,11 +250,26 @@ class acp_ban
}
}
+ $options = '';
+ if ($excluded_options)
+ {
+ $options .= '<optgroup label="' . $user->lang['OPTIONS_EXCLUDED'] . '">';
+ $options .= implode('', $excluded_options);
+ $options .= '</optgroup>';
+ }
+
+ if ($banned_options)
+ {
+ $options .= '<optgroup label="' . $user->lang['OPTIONS_BANNED'] . '">';
+ $options .= implode('', $banned_options);
+ $options .= '</optgroup>';
+ }
+
$template->assign_vars(array(
'S_BAN_END_OPTIONS' => $ban_end_options,
- 'S_BANNED_OPTIONS' => ($banned_options) ? true : false,
- 'BANNED_OPTIONS' => $banned_options)
- );
+ 'S_BANNED_OPTIONS' => ($banned_options || $excluded_options) ? true : false,
+ 'BANNED_OPTIONS' => $options,
+ ));
}
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 8017c379f3..817111491f 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3486,6 +3486,10 @@ function get_preg_expression($mode)
$inline = ($mode == 'relative_url') ? ')' : '';
return "(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;
+
+ case 'table_prefix':
+ return '#^[a-zA-Z][a-zA-Z0-9_]*$#';
+ break;
}
return '';
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 4c34bc92ca..c40ceb088f 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1607,7 +1607,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
// Send Notifications
if ($mode != 'edit')
{
- pm_notification($mode, $data['from_username'], $recipients, $subject, $data['message']);
+ pm_notification($mode, $data['from_username'], $recipients, $subject, $data['message'], $data['msg_id']);
}
return $data['msg_id'];
@@ -1616,7 +1616,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
/**
* PM Notification
*/
-function pm_notification($mode, $author, $recipients, $subject, $message)
+function pm_notification($mode, $author, $recipients, $subject, $message, $msg_id)
{
global $db, $user, $config, $phpbb_root_path, $phpEx, $auth;
@@ -1688,8 +1688,9 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
'AUTHOR_NAME' => htmlspecialchars_decode($author),
'USERNAME' => htmlspecialchars_decode($addr['name']),
- 'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&folder=inbox")
- );
+ 'U_INBOX' => generate_board_url() . "/ucp.$phpEx?i=pm&folder=inbox",
+ 'U_VIEW_MESSAGE' => generate_board_url() . "/ucp.$phpEx?i=pm&mode=view&p=$msg_id",
+ ));
$messenger->send($addr['method']);
}
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index c675928a5b..447b6ebe87 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -243,7 +243,7 @@ class ucp_pm
$num_not_moved = $num_removed = 0;
$release = request_var('release', 0);
- if ($user->data['user_new_privmsg'] && $action == 'view_folder')
+ if ($user->data['user_new_privmsg'] && ($action == 'view_folder' || $action == 'view_message'))
{
$return = place_pm_into_folder($global_privmsgs_rules, $release);
$num_not_moved = $return['not_moved'];
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index c099e3b3fa..65b32bd0c4 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -78,14 +78,14 @@ class ucp_profile
$error = validate_data($data, $check_ary);
- if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
+ if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
{
- $error[] = 'NEW_PASSWORD_ERROR';
+ $error[] = ($data['email_confirm']) ? 'NEW_EMAIL_ERROR' : 'NEW_EMAIL_CONFIRM_EMPTY';
}
- if (($data['new_password'] || ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) || ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && !phpbb_check_hash($data['cur_password'], $user->data['user_password']))
+ if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
{
- $error[] = 'CUR_PASSWORD_ERROR';
+ $error[] = ($data['password_confirm']) ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY';
}
// Only check the new password against the previous password if there have been no errors
@@ -94,9 +94,9 @@ class ucp_profile
$error[] = 'SAME_PASSWORD_ERROR';
}
- if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
+ if (!phpbb_check_hash($data['cur_password'], $user->data['user_password']))
{
- $error[] = 'NEW_EMAIL_ERROR';
+ $error[] = ($data['cur_password']) ? 'CUR_PASSWORD_ERROR' : 'CUR_PASSWORD_EMPTY';
}
if (!check_form_key('ucp_reg_details'))