aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/index.php4
-rw-r--r--phpBB/includes/acp/acp_board.php13
-rw-r--r--phpBB/includes/captcha/captcha_gd.php2
-rw-r--r--phpBB/includes/functions.php16
-rw-r--r--phpBB/includes/functions_profile_fields.php14
-rw-r--r--phpBB/includes/session.php6
-rw-r--r--phpBB/includes/ucp/ucp_pm.php4
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php31
-rw-r--r--phpBB/language/en/acp/board.php10
-rw-r--r--phpBB/language/en/ucp.php2
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html2
11 files changed, 84 insertions, 20 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index f673e2af05..68508bc353 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -237,7 +237,7 @@ function build_select($option_ary, $option_default = false)
/**
* Build radio fields in acp pages
*/
-function h_radio($name, &$input_ary, $input_default = false, $id = false, $key = false)
+function h_radio($name, $input_ary, $input_default = false, $id = false, $key = false, $separator = '')
{
global $user;
@@ -246,7 +246,7 @@ function h_radio($name, &$input_ary, $input_default = false, $id = false, $key =
foreach ($input_ary as $value => $title)
{
$selected = ($input_default !== false && $value == $input_default) ? ' checked="checked"' : '';
- $html .= '<label><input type="radio" name="' . $name . '"' . (($id && !$id_assigned) ? ' id="' . $id . '"' : '') . ' value="' . $value . '"' . $selected . (($key) ? ' accesskey="' . $key . '"' : '') . ' class="radio" /> ' . $user->lang[$title] . '</label>';
+ $html .= '<label><input type="radio" name="' . $name . '"' . (($id && !$id_assigned) ? ' id="' . $id . '"' : '') . ' value="' . $value . '"' . $selected . (($key) ? ' accesskey="' . $key . '"' : '') . ' class="radio" /> ' . $user->lang[$title] . '</label>' . $separator;
$id_assigned = true;
}
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index a5e80e1f6d..d38c4d58ba 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -769,13 +769,20 @@ class acp_board
{
global $user, $config;
- $radio_ary = array(USER_ACTIVATION_DISABLE => 'ACC_DISABLE', USER_ACTIVATION_NONE => 'ACC_NONE');
+ $radio_ary = array(
+ USER_ACTIVATION_DISABLE => 'ACC_DISABLE',
+ USER_ACTIVATION_NONE => 'ACC_NONE',
+ );
+
if ($config['email_enable'])
{
- $radio_ary += array(USER_ACTIVATION_SELF => 'ACC_USER', USER_ACTIVATION_ADMIN => 'ACC_ADMIN');
+ $radio_ary[USER_ACTIVATION_SELF] = 'ACC_USER';
+ $radio_ary[USER_ACTIVATION_ADMIN] = 'ACC_ADMIN';
}
- return h_radio('config[require_activation]', $radio_ary, $value, $key);
+ $radio_text = h_radio('config[require_activation]', $radio_ary, $value, 'require_activation', $key, '<br />');
+
+ return $radio_text;
}
/**
diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php
index 5f24618aab..ecdad43978 100644
--- a/phpBB/includes/captcha/captcha_gd.php
+++ b/phpBB/includes/captcha/captcha_gd.php
@@ -77,7 +77,7 @@ class captcha
{
$denom = ($code_len - $i);
$denom = max(1.3, $denom);
- $offset[$i] = mt_rand(0, (1.5 * $width_avail) / $denom);
+ $offset[$i] = phpbb_mt_rand(0, (int) round((1.5 * $width_avail) / $denom));
$width_avail -= $offset[$i];
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 2d9d2c225f..c48eb6d102 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -250,6 +250,22 @@ function unique_id($extra = 'c')
}
/**
+* Wrapper for mt_rand() which allows swapping $min and $max parameters.
+*
+* PHP does not allow us to swap the order of the arguments for mt_rand() anymore.
+* (since PHP 5.3.4, see http://bugs.php.net/46587)
+*
+* @param int $min Lowest value to be returned
+* @param int $max Highest value to be returned
+*
+* @return int Random integer between $min and $max (or $max and $min)
+*/
+function phpbb_mt_rand($min, $max)
+{
+ return ($min > $max) ? mt_rand($max, $min) : mt_rand($min, $max);
+}
+
+/**
* Return formatted string for filesizes
*
* @param int $value filesize in bytes
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php
index 78fe049f40..1eae2a9ad6 100644
--- a/phpBB/includes/functions_profile_fields.php
+++ b/phpBB/includes/functions_profile_fields.php
@@ -149,7 +149,18 @@ class custom_profile
case FIELD_DROPDOWN:
$field_value = (int) $field_value;
-
+
+ // retrieve option lang data if necessary
+ if (!isset($this->options_lang[$field_data['field_id']]) || !isset($this->options_lang[$field_data['field_id']][$field_data['lang_id']]) || !sizeof($this->options_lang[$file_data['field_id']][$field_data['lang_id']]))
+ {
+ $this->get_option_lang($field_data['field_id'], $field_data['lang_id'], FIELD_DROPDOWN, false);
+ }
+
+ if (!isset($this->options_lang[$field_data['field_id']][$field_data['lang_id']][$field_value]))
+ {
+ return 'FIELD_INVALID_VALUE';
+ }
+
if ($field_value == $field_data['field_novalue'] && $field_data['field_required'])
{
return 'FIELD_REQUIRED';
@@ -302,6 +313,7 @@ class custom_profile
switch ($cp_result)
{
case 'FIELD_INVALID_DATE':
+ case 'FIELD_INVALID_VALUE':
case 'FIELD_REQUIRED':
$error = sprintf($user->lang[$cp_result], $row['lang_name']);
break;
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index d803f8d799..2181375dc1 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -1238,6 +1238,12 @@ class session
$ip = $this->ip;
}
+ // Neither Spamhaus nor Spamcop supports IPv6 addresses.
+ if (strpos($ip, ':') !== false)
+ {
+ return false;
+ }
+
$dnsbl_check = array(
'sbl.spamhaus.org' => 'http://www.spamhaus.org/query/bl?ip=',
);
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index e1c51170db..c675928a5b 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -115,7 +115,7 @@ class ucp_pm
case 'compose':
$action = request_var('action', 'post');
- get_folder($user->data['user_id']);
+ $user_folders = get_folder($user->data['user_id']);
if (!$auth->acl_get('u_sendpm'))
{
@@ -130,7 +130,7 @@ class ucp_pm
}
include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
- compose_pm($id, $mode, $action);
+ compose_pm($id, $mode, $action, $user_folders);
$tpl_file = 'posting_body';
break;
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index b596e72c41..05243e3d7a 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -20,7 +20,7 @@ if (!defined('IN_PHPBB'))
* Compose private message
* Called from ucp_pm with mode == 'compose'
*/
-function compose_pm($id, $mode, $action)
+function compose_pm($id, $mode, $action, $user_folders = array())
{
global $template, $db, $auth, $user;
global $phpbb_root_path, $phpEx, $config;
@@ -135,6 +135,7 @@ function compose_pm($id, $mode, $action)
}
$sql = '';
+ $folder_id = 0;
// What is all this following SQL for? Well, we need to know
// some basic information in all cases before we do anything.
@@ -398,7 +399,7 @@ function compose_pm($id, $mode, $action)
unset($message_text);
$s_action = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=$mode&amp;action=$action", true, $user->session_id);
- $s_action .= ($msg_id) ? "&amp;p=$msg_id" : '';
+ $s_action .= (($folder_id) ? "&amp;f=$folder_id" : '') . (($msg_id) ? "&amp;p=$msg_id" : '');
// Delete triggered ?
if ($action == 'delete')
@@ -741,10 +742,30 @@ function compose_pm($id, $mode, $action)
$msg_id = submit_pm($action, $subject, $pm_data);
$return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=view&amp;p=' . $msg_id);
- $return_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=outbox');
- meta_refresh(3, $return_message_url);
+ $inbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox');
+ $outbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=outbox');
+
+ $folder_url = '';
+ if (($folder_id > 0) && isset($user_folders[$folder_id]))
+ {
+ $folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=' . $folder_id);
+ }
+
+ $return_box_url = ($action === 'post' || $action === 'edit') ? $outbox_folder_url : $inbox_folder_url;
+ $return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX';
+
- $message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>') . '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $return_folder_url . '">', '</a>', $user->lang['PM_OUTBOX']);
+ $message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>');
+
+ $last_click_type = 'CLICK_RETURN_FOLDER';
+ if ($folder_url)
+ {
+ $message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $folder_url . '">', '</a>', $user_folders[$folder_id]['folder_name']);
+ $last_click_type = 'CLICK_GOTO_FOLDER';
+ }
+ $message .= '<br /><br />' . sprintf($user->lang[$last_click_type], '<a href="' . $return_box_url . '">', '</a>', $user->lang[$return_box_lang]);
+
+ meta_refresh(3, $return_message_url);
trigger_error($message);
}
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 5293b835d6..10e4aa7b6b 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -208,16 +208,16 @@ $lang = array_merge($lang, array(
'ACP_REGISTER_SETTINGS_EXPLAIN' => 'Here you are able to define registration and profile related settings.',
'ACC_ACTIVATION' => 'Account activation',
- 'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations.',
+ 'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations. “Board-wide e-mail” must be enabled in order to use user or admin activation.',
'NEW_MEMBER_POST_LIMIT' => 'New member post limit',
'NEW_MEMBER_POST_LIMIT_EXPLAIN' => 'New members are within the <em>Newly Registered Users</em> group until they reach this number of posts. You can use this group to keep them from using the PM system or to review their posts. <strong>A value of 0 disables this feature.</strong>',
'NEW_MEMBER_GROUP_DEFAULT' => 'Set Newly Registered Users group to default',
'NEW_MEMBER_GROUP_DEFAULT_EXPLAIN' => 'If set to yes, and a new member post limit is specified, newly registered users will not only be put into the <em>Newly Registered Users</em> group, but this group will also be their default one. This may come in handy if you want to assign a group default rank and/or avatar the user then inherits.',
- 'ACC_ADMIN' => 'By Admin',
- 'ACC_DISABLE' => 'Disable',
- 'ACC_NONE' => 'None',
- 'ACC_USER' => 'By User',
+ 'ACC_ADMIN' => 'By admin',
+ 'ACC_DISABLE' => 'Disable registration',
+ 'ACC_NONE' => 'No activation (immediate access)',
+ 'ACC_USER' => 'By user (e-mail verification)',
// 'ACC_USER_ADMIN' => 'User + Admin',
'ALLOW_EMAIL_REUSE' => 'Allow e-mail address re-use',
'ALLOW_EMAIL_REUSE_EXPLAIN' => 'Different users can register with the same e-mail address.',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 02b8a282d9..c1e3c06c43 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -119,6 +119,7 @@ $lang = array_merge($lang, array(
'CANNOT_REMOVE_FOLDER' => 'This folder cannot be removed.',
'CHANGE_DEFAULT_GROUP' => 'Change default group',
'CHANGE_PASSWORD' => 'Change password',
+ 'CLICK_GOTO_FOLDER' => '%1$sGo to your “%3$s” folder%2$s',
'CLICK_RETURN_FOLDER' => '%1$sReturn to your “%3$s” folder%2$s',
'CONFIRMATION' => 'Confirmation of registration',
'CONFIRM_CHANGES' => 'Confirm changes',
@@ -194,6 +195,7 @@ $lang = array_merge($lang, array(
'FIELD_INVALID_CHARS_ALPHA_ONLY' => 'The field “%s” has invalid characters, only alphanumeric characters are allowed.',
'FIELD_INVALID_CHARS_SPACERS_ONLY' => 'The field “%s” has invalid characters, only alphanumeric, space or -+_[] characters are allowed.',
'FIELD_INVALID_DATE' => 'The field “%s” has an invalid date.',
+ 'FIELD_INVALID_VALUE' => 'The field “%s” has an invalid value.',
'FOE_MESSAGE' => 'Message from foe',
'FOES_EXPLAIN' => 'Foes are users which will be ignored by default. Posts by these users will not be fully visible. Personal messages from foes are still permitted. Please note that you cannot ignore moderators or administrators.',
diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html
index bba00ce685..630871af61 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_body.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_body.html
@@ -150,7 +150,7 @@
<!-- IF postrow.POST_ICON_IMG -->
<td><img src="{T_ICONS_PATH}{postrow.POST_ICON_IMG}" width="{postrow.POST_ICON_IMG_WIDTH}" height="{postrow.POST_ICON_IMG_HEIGHT}" alt="" title="" /></td>
<!-- ENDIF -->
- <td class="gensmall" width="100%"><div style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<b>{L_POST_SUBJECT}:</b> {postrow.POST_SUBJECT}</div><div style="float: {S_CONTENT_FLOW_END};"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><b>{L_POSTED}:</b> {postrow.POST_DATE}&nbsp;</div></td>
+ <td class="gensmall" width="100%"><div style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<b>{L_POST_SUBJECT}:</b> <a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></div><div style="float: {S_CONTENT_FLOW_END};"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><b>{L_POSTED}:</b> {postrow.POST_DATE}&nbsp;</div></td>
</tr>
</table>
</td>