diff --git a/phpBB/admin/admin_forum_prune.php b/phpBB/admin/admin_forum_prune.php
index 899b4e3670..7cd40fd1ef 100644
--- a/phpBB/admin/admin_forum_prune.php
+++ b/phpBB/admin/admin_forum_prune.php
@@ -178,6 +178,7 @@ else
$template->assign_vars(array(
'FORUM_NAME' => $forum_name,
+ 'L_FORUM' => $lang['Forum'],
'L_FORUM_PRUNE' => $lang['Forum_Prune'],
'L_FORUM_PRUNE_EXPLAIN' => $lang['Forum_Prune_explain'],
'L_DO_PRUNE' => $lang['Do_Prune'],
diff --git a/phpBB/admin/admin_forumauth.php b/phpBB/admin/admin_forumauth.php
index d1b45fbaa7..70f046a8d6 100644
--- a/phpBB/admin/admin_forumauth.php
+++ b/phpBB/admin/admin_forumauth.php
@@ -34,7 +34,7 @@ if( !empty($setmodules) )
// Load default header
//
$no_page_header = TRUE;
-$phpbb_root_path = "./../";
+$phpbb_root_path = './../';
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);
@@ -52,23 +52,23 @@ $simple_auth_ary = array(
6 => array(AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD, AUTH_MOD),
);
-$simple_auth_types = array($lang['Public'], $lang['Registered'], $lang['Registered'] . " [" . $lang['Hidden'] . "]", $lang['Private'], $lang['Private'] . " [" . $lang['Hidden'] . "]", $lang['Moderators'], $lang['Moderators'] . " [" . $lang['Hidden'] . "]");
+$simple_auth_types = array($lang['Public'], $lang['Registered'], $lang['Registered'] . ' [' . $lang['Hidden'] . ']', $lang['Private'], $lang['Private'] . ' [' . $lang['Hidden'] . ']', $lang['Moderators'], $lang['Moderators'] . ' [' . $lang['Hidden'] . ']');
-$forum_auth_fields = array("auth_view", "auth_read", "auth_post", "auth_reply", "auth_edit", "auth_delete", "auth_sticky", "auth_announce", "auth_vote", "auth_pollcreate");
+$forum_auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate');
$field_names = array(
- "auth_view" => $lang['View'],
- "auth_read" => $lang['Read'],
- "auth_post" => $lang['Post'],
- "auth_reply" => $lang['Reply'],
- "auth_edit" => $lang['Edit'],
- "auth_delete" => $lang['Delete'],
- "auth_sticky" => $lang['Sticky'],
- "auth_announce" => $lang['Announce'],
- "auth_vote" => $lang['Vote'],
- "auth_pollcreate" => $lang['Pollcreate']);
+ 'auth_view' => $lang['View'],
+ 'auth_read' => $lang['Read'],
+ 'auth_post' => $lang['Post'],
+ 'auth_reply' => $lang['Reply'],
+ 'auth_edit' => $lang['Edit'],
+ 'auth_delete' => $lang['Delete'],
+ 'auth_sticky' => $lang['Sticky'],
+ 'auth_announce' => $lang['Announce'],
+ 'auth_vote' => $lang['Vote'],
+ 'auth_pollcreate' => $lang['Pollcreate']);
-$forum_auth_levels = array("ALL", "REG", "PRIVATE", "MOD", "ADMIN");
+$forum_auth_levels = array('ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN');
$forum_auth_const = array(AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN);
if(isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]))
@@ -79,7 +79,7 @@ if(isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL
else
{
unset($forum_id);
- $forum_sql = "";
+ $forum_sql = '';
}
if( isset($HTTP_GET_VARS['adv']) )
@@ -96,7 +96,7 @@ else
//
if( isset($HTTP_POST_VARS['submit']) )
{
- $sql = "";
+ $sql = '';
if(!empty($forum_id))
{
@@ -108,11 +108,7 @@ if( isset($HTTP_POST_VARS['submit']) )
for($i = 0; $i < count($simple_ary); $i++)
{
- $sql .= $forum_auth_fields[$i] . " = " . $simple_ary[$i];
- if($i < count($simple_ary) - 1)
- {
- $sql .= ", ";
- }
+ $sql .= ( ( $i < count($simple_ary) - 1 ) ? ', ' : '' ) . $forum_auth_fields[$i] . ' = ' . $simple_ary[$i];
}
$sql .= " WHERE forum_id = $forum_id";
@@ -123,28 +119,24 @@ if( isset($HTTP_POST_VARS['submit']) )
{
$value = $HTTP_POST_VARS[$forum_auth_fields[$i]];
- if($forum_auth_fields[$i] == 'auth_vote')
+ if ( $forum_auth_fields[$i] == 'auth_vote' )
{
- if( $HTTP_POST_VARS['auth_vote'] == AUTH_ALL )
+ if ( $HTTP_POST_VARS['auth_vote'] == AUTH_ALL )
{
$value = AUTH_REG;
}
}
- $sql .= $forum_auth_fields[$i] . " = " . $value;
- if($i < count($forum_auth_fields) - 1)
- {
- $sql .= ", ";
- }
+ $sql .= ( ( $i < count($forum_auth_fields) - 1 ) ? ', ' : '' ) .$forum_auth_fields[$i] . ' = ' . $value;
}
$sql .= " WHERE forum_id = $forum_id";
}
- if($sql != "")
+ if ( $sql != '' )
{
- if(!$db->sql_query($sql))
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update auth table!", "", __LINE__, __FILE__, $sql);
}
@@ -155,7 +147,7 @@ if( isset($HTTP_POST_VARS['submit']) )
}
$template->assign_vars(array(
- "META" => '')
+ 'META' => '')
);
$message = $lang['Forum_auth_updated'] . '
' . sprintf($lang['Click_return_forumauth'], '', "");
message_die(GENERAL_MESSAGE, $message);
@@ -187,7 +179,7 @@ if( empty($forum_id) )
// specified
//
$template->set_filenames(array(
- "body" => "admin/auth_select_body.tpl")
+ 'body' => 'admin/auth_select_body.tpl')
);
$select_list = '';
$template->assign_vars(array(
- "L_AUTH_TITLE" => $lang['Auth_Control_Forum'],
- "L_AUTH_EXPLAIN" => $lang['Forum_auth_explain'],
- "L_AUTH_SELECT" => $lang['Select_a_Forum'],
- "L_LOOK_UP" => $lang['Look_up_Forum'],
+ 'L_AUTH_TITLE' => $lang['Auth_Control_Forum'],
+ 'L_AUTH_EXPLAIN' => $lang['Forum_auth_explain'],
+ 'L_AUTH_SELECT' => $lang['Select_a_Forum'],
+ 'L_LOOK_UP' => $lang['Look_up_Forum'],
- "S_AUTH_ACTION" => append_sid("admin_forumauth.$phpEx"),
- "S_AUTH_SELECT" => $select_list)
+ 'S_AUTH_ACTION' => append_sid("admin_forumauth.$phpEx"),
+ 'S_AUTH_SELECT' => $select_list)
);
}
@@ -215,7 +207,7 @@ else
// specified
//
$template->set_filenames(array(
- "body" => "admin/auth_forum_body.tpl")
+ 'body' => 'admin/auth_forum_body.tpl')
);
$forum_name = $forum_rows[0]['forum_name'];
@@ -244,38 +236,30 @@ else
// If we didn't get a match above then we
// automatically switch into 'advanced' mode
//
- if(!isset($adv) && !$matched)
+ if ( !isset($adv) && !$matched )
{
$adv = 1;
}
$s_column_span == 0;
- if( empty($adv) )
+ if ( empty($adv) )
{
- $simple_auth = "';
- $template->assign_block_vars("forum_auth_titles", array(
- "CELL_TITLE" => $lang['Simple_mode'])
+ $template->assign_block_vars('forum_auth_titles', array(
+ 'CELL_TITLE' => $lang['Simple_mode'])
);
- $template->assign_block_vars("forum_auth_data", array(
- "S_AUTH_LEVELS_SELECT" => $simple_auth)
+ $template->assign_block_vars('forum_auth_data', array(
+ 'S_AUTH_LEVELS_SELECT' => $simple_auth)
);
$s_column_span++;
@@ -288,37 +272,29 @@ else
//
for($j = 0; $j < count($forum_auth_fields); $j++)
{
- $custom_auth[$j] = " ";
+ $custom_auth[$j] = ' ';
for($k = 0; $k < count($forum_auth_levels); $k++)
{
- if ( $forum_rows[0][$forum_auth_fields[$j]] == $forum_auth_const[$k] )
- {
- $custom_auth[$j] .= "";
- }
- else
- {
- $custom_auth[$j] .= "";
- }
+ $selected = ( $forum_rows[0][$forum_auth_fields[$j]] == $forum_auth_const[$k] ) ? ' selected="selected"' : '';
+ $custom_auth[$j] .= '';
}
- $custom_auth[$j] .= " ";
+ $custom_auth[$j] .= ' ';
$cell_title = $field_names[$forum_auth_fields[$j]];
- $template->assign_block_vars("forum_auth_titles", array(
- "CELL_TITLE" => $cell_title)
+ $template->assign_block_vars('forum_auth_titles', array(
+ 'CELL_TITLE' => $cell_title)
);
- $template->assign_block_vars("forum_auth_data", array(
- "S_AUTH_LEVELS_SELECT" => $custom_auth[$j])
+ $template->assign_block_vars('forum_auth_data', array(
+ 'S_AUTH_LEVELS_SELECT' => $custom_auth[$j])
);
$s_column_span++;
}
}
- $adv_mode = (empty($adv)) ? "1" : "0";
+ $adv_mode = ( empty($adv) ) ? '1' : '0';
$switch_mode = append_sid("admin_forumauth.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&adv=". $adv_mode);
$switch_mode_text = ( empty($adv) ) ? $lang['Advanced_mode'] : $lang['Simple_mode'];
$u_switch_mode = '' . $switch_mode_text . '';
@@ -326,25 +302,26 @@ else
$s_hidden_fields = '';
$template->assign_vars(array(
- "FORUM_NAME" => $forum_name,
+ 'FORUM_NAME' => $forum_name,
- "L_AUTH_TITLE" => $lang['Auth_Control_Forum'],
- "L_AUTH_EXPLAIN" => $lang['Forum_auth_explain'],
- "L_SUBMIT" => $lang['Submit'],
- "L_RESET" => $lang['Reset'],
+ 'L_FORUM' => $lang['Forum'],
+ 'L_AUTH_TITLE' => $lang['Auth_Control_Forum'],
+ 'L_AUTH_EXPLAIN' => $lang['Forum_auth_explain'],
+ 'L_SUBMIT' => $lang['Submit'],
+ 'L_RESET' => $lang['Reset'],
- "U_SWITCH_MODE" => $u_switch_mode,
+ 'U_SWITCH_MODE' => $u_switch_mode,
- "S_FORUMAUTH_ACTION" => append_sid("admin_forumauth.$phpEx"),
- "S_COLUMN_SPAN" => $s_column_span,
- "S_HIDDEN_FIELDS" => $s_hidden_fields)
+ 'S_FORUMAUTH_ACTION' => append_sid("admin_forumauth.$phpEx"),
+ 'S_COLUMN_SPAN' => $s_column_span,
+ 'S_HIDDEN_FIELDS' => $s_hidden_fields)
);
}
include('./page_header_admin.'.$phpEx);
-$template->pparse("body");
+$template->pparse('body');
include('./page_footer_admin.'.$phpEx);
diff --git a/phpBB/admin/admin_groups.php b/phpBB/admin/admin_groups.php
index 4d82edf762..239056304a 100644
--- a/phpBB/admin/admin_groups.php
+++ b/phpBB/admin/admin_groups.php
@@ -308,7 +308,7 @@ else if( isset($HTTP_POST_VARS['group_update']) )
}
else
{
- message_die(GENERAL_MESSAGE, $lang['Group_mode_not_selected']);
+ message_die(GENERAL_MESSAGE, $lang['No_group_action']);
}
}
}
diff --git a/phpBB/admin/admin_ranks.php b/phpBB/admin/admin_ranks.php
index 2438db8799..b6aa54c6bc 100644
--- a/phpBB/admin/admin_ranks.php
+++ b/phpBB/admin/admin_ranks.php
@@ -255,7 +255,7 @@ if( $mode != "" )
$template->assign_vars(array(
"L_RANKS_TITLE" => $lang['Ranks_title'],
"L_RANKS_TEXT" => $lang['Ranks_explain'],
- "L_RANK" => $lang['Rank'],
+ "L_RANK" => $lang['Rank_title'],
"L_RANK_MINIMUM" => $lang['Rank_minimum'],
"L_SPECIAL_RANK" => $lang['Special_rank'],
"L_EDIT" => $lang['Edit'],
diff --git a/phpBB/admin/admin_smilies.php b/phpBB/admin/admin_smilies.php
index 8929f8cec9..571eb05d46 100644
--- a/phpBB/admin/admin_smilies.php
+++ b/phpBB/admin/admin_smilies.php
@@ -286,7 +286,7 @@ else if( isset($HTTP_POST_VARS['add']) )
$template->assign_vars(array(
"L_SMILEY_TITLE" => $lang['smiley_title'],
"L_SMILEY_CONFIG" => $lang['smiley_config'],
- "L_SMILEY_EXPLAIN" => $lang['smiley_instr'],
+ "L_SMILEY_EXPLAIN" => $lang['smile_desc'],
"L_SMILEY_CODE" => $lang['smiley_code'],
"L_SMILEY_URL" => $lang['smiley_url'],
"L_SMILEY_EMOTION" => $lang['smiley_emot'],
@@ -340,7 +340,7 @@ else if ( $mode != "" )
$result = $db->sql_query($sql);
if( !$result )
{
- message_die(GENERAL_ERROR, $lang['smile_edit_err'], "", __LINE__, __FILE__, $sql);
+ message_die(GENERAL_ERROR, 'Could not obtain emoticon information', "", __LINE__, __FILE__, $sql);
}
$smile_data = $db->sql_fetchrow($result);
diff --git a/phpBB/admin/admin_ug_auth.php b/phpBB/admin/admin_ug_auth.php
index d0810710b9..c31f1017cb 100644
--- a/phpBB/admin/admin_ug_auth.php
+++ b/phpBB/admin/admin_ug_auth.php
@@ -858,14 +858,14 @@ else if ( ( $mode == 'user' && ( isset($HTTP_POST_VARS['username']) || $user_id
$template->assign_vars(array(
'L_USER_OR_GROUPNAME' => ( $mode == 'user' ) ? $lang['Username'] : $lang['Group_name'],
- 'L_USER_OR_GROUP' => ( $mode == 'user' ) ? $lang['User'] : $lang['Group'],
'L_AUTH_TITLE' => ( $mode == 'user' ) ? $lang['Auth_Control_User'] : $lang['Auth_Control_Group'],
'L_AUTH_EXPLAIN' => ( $mode == 'user' ) ? $lang['User_auth_explain'] : $lang['Group_auth_explain'],
'L_MODERATOR_STATUS' => $lang['Moderator_status'],
'L_PERMISSIONS' => $lang['Permissions'],
'L_SUBMIT' => $lang['Submit'],
- 'L_RESET' => $lang['Reset'],
+ 'L_RESET' => $lang['Reset'],
+ 'L_FORUM' => $lang['Forum'],
'U_USER_OR_GROUP' => append_sid("admin_ug_auth.$phpEx"),
'U_SWITCH_MODE' => $u_switch_mode,
@@ -922,7 +922,7 @@ else
$s_hidden_fields = '';
- $l_type = ( $mode == 'user' ) ? "USER" : "AUTH";
+ $l_type = ( $mode == 'user' ) ? 'USER' : 'AUTH';
$template->assign_vars(array(
'L_' . $l_type . '_TITLE' => ( $mode == 'user' ) ? $lang['Auth_Control_User'] : $lang['Auth_Control_Group'],
diff --git a/phpBB/admin/admin_user_ban.php b/phpBB/admin/admin_user_ban.php
index bc9ecfc85e..8e2a5ad4ed 100644
--- a/phpBB/admin/admin_user_ban.php
+++ b/phpBB/admin/admin_user_ban.php
@@ -22,7 +22,7 @@
define('IN_PHPBB', 1);
-if( !empty($setmodules) )
+if ( !empty($setmodules) )
{
$filename = basename(__FILE__);
$module['Users']['Ban_Management'] = $filename;
@@ -33,38 +33,39 @@ if( !empty($setmodules) )
//
// Load default header
//
-$phpbb_root_path = "./../";
+$phpbb_root_path = './../';
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);
//
// Start program
//
-if( isset($HTTP_POST_VARS['submit']) )
+if ( isset($HTTP_POST_VARS['submit']) )
{
- $user_bansql = "";
- $email_bansql = "";
- $ip_bansql = "";
+ $user_bansql = '';
+ $email_bansql = '';
+ $ip_bansql = '';
$user_list = array();
- if( isset($HTTP_POST_VARS['ban_user']) )
+ if ( !empty($HTTP_POST_VARS['username']) )
{
- $user_list_temp = $HTTP_POST_VARS['ban_user'];
-
- for($i = 0; $i < count($user_list_temp); $i++)
+ $this_userdata = get_userdata($HTTP_POST_VARS['username']);
+ if( !$this_userdata )
{
- $user_list[] = trim($user_list_temp[$i]);
+ message_die(GENERAL_MESSAGE, $lang['No_user_id_specified'] );
}
+
+ $user_list[] = $this_userdata['user_id'];
}
$ip_list = array();
- if( isset($HTTP_POST_VARS['ban_ip']) )
+ if ( isset($HTTP_POST_VARS['ban_ip']) )
{
- $ip_list_temp = explode(",", $HTTP_POST_VARS['ban_ip']);
+ $ip_list_temp = explode(',', $HTTP_POST_VARS['ban_ip']);
for($i = 0; $i < count($ip_list_temp); $i++)
{
- if( preg_match("/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})[ ]*\-[ ]*([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/", trim($ip_list_temp[$i]), $ip_range_explode) )
+ if ( preg_match('/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})[ ]*\-[ ]*([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/', trim($ip_list_temp[$i]), $ip_range_explode) )
{
//
// Don't ask about all this, just don't ask ... !
@@ -72,12 +73,12 @@ if( isset($HTTP_POST_VARS['submit']) )
$ip_1_counter = $ip_range_explode[1];
$ip_1_end = $ip_range_explode[5];
- while($ip_1_counter <= $ip_1_end)
+ while ( $ip_1_counter <= $ip_1_end )
{
- $ip_2_counter = ($ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[2] : 0;
- $ip_2_end = ($ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[6];
+ $ip_2_counter = ( $ip_1_counter == $ip_range_explode[1] ) ? $ip_range_explode[2] : 0;
+ $ip_2_end = ( $ip_1_counter < $ip_1_end ) ? 254 : $ip_range_explode[6];
- if($ip_2_counter == 0 && $ip_2_end == 254)
+ if ( $ip_2_counter == 0 && $ip_2_end == 254 )
{
$ip_2_counter = 255;
$ip_2_fragment = 255;
@@ -85,12 +86,12 @@ if( isset($HTTP_POST_VARS['submit']) )
$ip_list[] = encode_ip("$ip_1_counter.255.255.255");
}
- while($ip_2_counter <= $ip_2_end)
+ while ( $ip_2_counter <= $ip_2_end )
{
- $ip_3_counter = ($ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[3] : 0;
- $ip_3_end = ($ip_2_counter < $ip_2_end || $ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[7];
+ $ip_3_counter = ( $ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1] ) ? $ip_range_explode[3] : 0;
+ $ip_3_end = ( $ip_2_counter < $ip_2_end || $ip_1_counter < $ip_1_end ) ? 254 : $ip_range_explode[7];
- if($ip_3_counter == 0 && $ip_3_end == 254 )
+ if ( $ip_3_counter == 0 && $ip_3_end == 254 )
{
$ip_3_counter = 255;
$ip_3_fragment = 255;
@@ -98,12 +99,12 @@ if( isset($HTTP_POST_VARS['submit']) )
$ip_list[] = encode_ip("$ip_1_counter.$ip_2_counter.255.255");
}
- while($ip_3_counter <= $ip_3_end)
+ while ( $ip_3_counter <= $ip_3_end )
{
- $ip_4_counter = ($ip_3_counter == $ip_range_explode[3] && $ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[4] : 0;
- $ip_4_end = ($ip_3_counter < $ip_3_end || $ip_2_counter < $ip_2_end) ? 254 : $ip_range_explode[8];
+ $ip_4_counter = ( $ip_3_counter == $ip_range_explode[3] && $ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1] ) ? $ip_range_explode[4] : 0;
+ $ip_4_end = ( $ip_3_counter < $ip_3_end || $ip_2_counter < $ip_2_end ) ? 254 : $ip_range_explode[8];
- if($ip_4_counter == 0 && $ip_4_end == 254)
+ if ( $ip_4_counter == 0 && $ip_4_end == 254 )
{
$ip_4_counter = 255;
$ip_4_fragment = 255;
@@ -111,7 +112,7 @@ if( isset($HTTP_POST_VARS['submit']) )
$ip_list[] = encode_ip("$ip_1_counter.$ip_2_counter.$ip_3_counter.255");
}
- while($ip_4_counter <= $ip_4_end)
+ while ( $ip_4_counter <= $ip_4_end )
{
$ip_list[] = encode_ip("$ip_1_counter.$ip_2_counter.$ip_3_counter.$ip_4_counter");
$ip_4_counter++;
@@ -123,29 +124,29 @@ if( isset($HTTP_POST_VARS['submit']) )
$ip_1_counter++;
}
}
- else if( preg_match("/^([\w\-_]\.?){2,}$/is", trim($ip_list_temp[$i])) )
+ else if ( preg_match('/^([\w\-_]\.?){2,}$/is', trim($ip_list_temp[$i])) )
{
$ip = gethostbynamel(trim($ip_list_temp[$i]));
for($j = 0; $j < count($ip); $j++)
{
- if( !empty($ip[$j]) )
+ if ( !empty($ip[$j]) )
{
$ip_list[] = encode_ip($ip[$j]);
}
}
}
- else if( preg_match("/^([0-9]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})$/", trim($ip_list_temp[$i])) )
+ else if ( preg_match('/^([0-9]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})$/', trim($ip_list_temp[$i])) )
{
- $ip_list[] = encode_ip(str_replace("*", "255", trim($ip_list_temp[$i])));
+ $ip_list[] = encode_ip(str_replace('*', '255', trim($ip_list_temp[$i])));
}
}
}
$email_list = array();
- if(isset($HTTP_POST_VARS['ban_email']))
+ if ( isset($HTTP_POST_VARS['ban_email']) )
{
- $email_list_temp = explode(",", $HTTP_POST_VARS['ban_email']);
+ $email_list_temp = explode(',', $HTTP_POST_VARS['ban_email']);
for($i = 0; $i < count($email_list_temp); $i++)
{
@@ -154,7 +155,7 @@ if( isset($HTTP_POST_VARS['submit']) )
// contained in the annotated php manual at php.com (ereg
// section)
//
- if( eregi("^(([[:alnum:]\*]+([-_.][[:alnum:]\*]+)*\.?)|(\*))@([[:alnum:]]+([-_]?[[:alnum:]]+)*\.){1,3}([[:alnum:]]{2,6})$", trim($email_list_temp[$i])) )
+ if ( eregi('^(([[:alnum:]\*]+([-_.][[:alnum:]\*]+)*\.?)|(\*))@([[:alnum:]]+([-_]?[[:alnum:]]+)*\.){1,3}([[:alnum:]]{2,6})$', trim($email_list_temp[$i])) )
{
$email_list[] = trim($email_list_temp[$i]);
}
@@ -163,32 +164,33 @@ if( isset($HTTP_POST_VARS['submit']) )
$sql = "SELECT *
FROM " . BANLIST_TABLE;
- if( !$result = $db->sql_query($sql) )
+ if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain banlist information", "", __LINE__, __FILE__, $sql);
}
$current_banlist = $db->sql_fetchrowset($result);
+ $db->sql_freeresult($result);
- $kill_session_sql = "";
+ $kill_session_sql = '';
for($i = 0; $i < count($user_list); $i++)
{
$in_banlist = false;
for($j = 0; $j < count($current_banlist); $j++)
{
- if($user_list[$i] == $current_banlist[$j]['ban_userid'])
+ if ( $user_list[$i] == $current_banlist[$j]['ban_userid'] )
{
$in_banlist = true;
}
}
- if(!$in_banlist)
+ if ( !$in_banlist )
{
- $kill_session_sql .= ( ($kill_session_sql != "") ? " OR " : "" ) . "session_user_id = $user_list[$i]";
+ $kill_session_sql .= ( ( $kill_session_sql != '' ) ? ' OR ' : '' ) . "session_user_id = " . $user_list[$i];
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_userid)
VALUES (" . $user_list[$i] . ")";
- if( !$result = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't insert ban_userid info into database", "", __LINE__, __FILE__, $sql);
}
@@ -200,28 +202,28 @@ if( isset($HTTP_POST_VARS['submit']) )
$in_banlist = false;
for($j = 0; $j < count($current_banlist); $j++)
{
- if($ip_list[$i] == $current_banlist[$j]['ban_ip'])
+ if ( $ip_list[$i] == $current_banlist[$j]['ban_ip'] )
{
$in_banlist = true;
}
}
- if(!$in_banlist)
+ if ( !$in_banlist )
{
- if( preg_match("/(ff\.)|(\.ff)/is", chunk_split($ip_list[$i], 2, ".")) )
+ if ( preg_match('/(ff\.)|(\.ff)/is', chunk_split($ip_list[$i], 2, '.')) )
{
- $kill_ip_sql = "session_ip LIKE '" . str_replace(".", "", preg_replace("/(ff\.)|(\.ff)/is", "%", chunk_split($ip_list[$i], 2, "."))) . "'";
+ $kill_ip_sql = "session_ip LIKE '" . str_replace('.', '', preg_replace('/(ff\.)|(\.ff)/is', '%', chunk_split($ip_list[$i], 2, "."))) . "'";
}
else
{
$kill_ip_sql = "session_ip = '" . $ip_list[$i] . "'";
}
- $kill_session_sql .= ( ($kill_session_sql != "") ? " OR " : "" ) . $kill_ip_sql;
+ $kill_session_sql .= ( ( $kill_session_sql != '' ) ? ' OR ' : '' ) . $kill_ip_sql;
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_ip)
VALUES ('" . $ip_list[$i] . "')";
- if( !$result = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't insert ban_ip info into database", "", __LINE__, __FILE__, $sql);
}
@@ -229,18 +231,15 @@ if( isset($HTTP_POST_VARS['submit']) )
}
//
- // Now we'll delete all entries from the
- // session table with any of the banned
- // user or IP info just entered into the
- // ban table ... this will force a session
- // initialisation resulting in an instant
- // ban
+ // Now we'll delete all entries from the session table with any of the banned
+ // user or IP info just entered into the ban table ... this will force a session
+ // initialisation resulting in an instant ban
//
- if( $kill_session_sql != "" )
+ if ( $kill_session_sql != '' )
{
$sql = "DELETE FROM " . SESSIONS_TABLE . "
WHERE $kill_session_sql";
- if( !$result = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't delete banned sessions from database", "", __LINE__, __FILE__, $sql);
}
@@ -251,87 +250,75 @@ if( isset($HTTP_POST_VARS['submit']) )
$in_banlist = false;
for($j = 0; $j < count($current_banlist); $j++)
{
- if( $email_list[$i] == $current_banlist[$j]['ban_email'] )
+ if ( $email_list[$i] == $current_banlist[$j]['ban_email'] )
{
$in_banlist = true;
}
}
- if( !$in_banlist )
+ if ( !$in_banlist )
{
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_email)
VALUES ('" . str_replace("\'", "''", $email_list[$i]) . "')";
- if( !$result = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't insert ban_email info into database", "", __LINE__, __FILE__, $sql);
}
}
}
- $where_sql = "";
+ $where_sql = '';
- if(isset($HTTP_POST_VARS['unban_user']))
+ if ( isset($HTTP_POST_VARS['unban_user']) )
{
$user_list = $HTTP_POST_VARS['unban_user'];
for($i = 0; $i < count($user_list); $i++)
{
- if($user_list[$i] != -1)
+ if ( $user_list[$i] != -1 )
{
- if($where_sql != "")
- {
- $where_sql .= ", ";
- }
- $where_sql .= $user_list[$i];
+ $where_sql .= ( ( $where_sql != '' ) ? ', ' : '' ) . $user_list[$i];
}
}
}
- if( isset($HTTP_POST_VARS['unban_ip']) )
+ if ( isset($HTTP_POST_VARS['unban_ip']) )
{
$ip_list = $HTTP_POST_VARS['unban_ip'];
for($i = 0; $i < count($ip_list); $i++)
{
- if($ip_list[$i] != -1)
+ if ( $ip_list[$i] != -1 )
{
- if($where_sql != "")
- {
- $where_sql .= ", ";
- }
- $where_sql .= $ip_list[$i];
+ $where_sql .= ( ( $where_sql != '' ) ? ', ' : '' ) . $ip_list[$i];
}
}
}
- if( isset($HTTP_POST_VARS['unban_email']) )
+ if ( isset($HTTP_POST_VARS['unban_email']) )
{
$email_list = $HTTP_POST_VARS['unban_email'];
for($i = 0; $i < count($email_list); $i++)
{
- if($email_list[$i] != -1)
+ if ( $email_list[$i] != -1 )
{
- if($where_sql != "")
- {
- $where_sql .= ", ";
- }
- $where_sql .= $email_list[$i];
+ $where_sql .= ( ( $where_sql != '' ) ? ', ' : '' ) . $email_list[$i];
}
}
}
- if( $where_sql != "" )
+ if ( $where_sql != '' )
{
$sql = "DELETE FROM " . BANLIST_TABLE . "
WHERE ban_id IN ($where_sql)";
- if( !$result = $db->sql_query($sql) )
+ if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't delete ban info from database", "", __LINE__, __FILE__, $sql);
}
}
- $message = $lang['Ban_update_sucessful'] . "
" . sprintf($lang['Click_return_banadmin'], "", "") . "
" . sprintf($lang['Click_return_admin_index'], "", "");
+ $message = $lang['Ban_update_sucessful'] . '
' . sprintf($lang['Click_return_banadmin'], '', '') . '
' . sprintf($lang['Click_return_admin_index'], '', '');
message_die(GENERAL_MESSAGE, $message);
@@ -354,37 +341,13 @@ else
'S_BANLIST_ACTION' => append_sid("admin_user_ban.$phpEx"))
);
- $userban_count = 0;
-
- $sql = "SELECT user_id, username
- FROM " . USERS_TABLE . "
- WHERE user_id <> " . ANONYMOUS . "
- ORDER BY username ASC";
- if ( !($result = $db->sql_query($sql)) )
- {
- message_die(GENERAL_ERROR, 'Could not select current user_id ban list', '', __LINE__, __FILE__, $sql);
- }
-
- $user_list = $db->sql_fetchrowset($result);
- $db->sql_freeresult($result);
-
- $select_userlist = '';
- for($i = 0; $i < count($user_list); $i++)
- {
- $select_userlist .= '';
- $userban_count++;
- }
- $select_userlist = '' . $select_userlist . '';
-
$template->assign_vars(array(
'L_BAN_USER' => $lang['Ban_username'],
'L_BAN_USER_EXPLAIN' => $lang['Ban_username_explain'],
'L_BAN_IP' => $lang['Ban_IP'],
'L_BAN_IP_EXPLAIN' => $lang['Ban_IP_explain'],
'L_BAN_EMAIL' => $lang['Ban_email'],
- 'L_BAN_EMAIL_EXPLAIN' => $lang['Ban_email_explain'],
-
- 'S_BAN_USERLIST_SELECT' => $select_userlist)
+ 'L_BAN_EMAIL_EXPLAIN' => $lang['Ban_email_explain'])
);
$userban_count = 0;
@@ -469,8 +432,12 @@ else
'L_UNBAN_IP' => $lang['Unban_IP'],
'L_UNBAN_IP_EXPLAIN' => $lang['Unban_IP_explain'],
'L_UNBAN_EMAIL' => $lang['Unban_email'],
- 'L_UNBAN_EMAIL_EXPLAIN' => $lang['Unban_email_explain'],
+ 'L_UNBAN_EMAIL_EXPLAIN' => $lang['Unban_email_explain'],
+ 'L_USERNAME' => $lang['Username'],
+ 'L_LOOK_UP' => $lang['Look_up_User'],
+ 'L_FIND_USERNAME' => $lang['Find_username'],
+ 'U_SEARCH_USER' => append_sid("./../search.$phpEx?mode=searchuser"),
'S_UNBAN_USERLIST_SELECT' => $select_userlist,
'S_UNBAN_IPLIST_SELECT' => $select_iplist,
'S_UNBAN_EMAILLIST_SELECT' => $select_emaillist,
diff --git a/phpBB/admin/admin_users.php b/phpBB/admin/admin_users.php
index 2bdc6a5106..ab8be3bae6 100644
--- a/phpBB/admin/admin_users.php
+++ b/phpBB/admin/admin_users.php
@@ -159,10 +159,12 @@ if( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) |
if( stripslashes($username) != $this_userdata['username'] )
{
unset($rename_user);
- if( !validate_username($username) )
+
+ $result = validate_username($username);
+ if ( $result['error'] )
{
$error = TRUE;
- $error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . $lang['Invalid_username'];
+ $error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . $result['error_msg'];
}
else
{
@@ -971,7 +973,7 @@ if( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) |
'L_ALWAYS_ADD_SIGNATURE' => $lang['Always_add_sig'],
'L_SPECIAL' => $lang['User_special'],
- 'L_SPECIAL_EXPLAIN' => $lang['User_specail_explain'],
+ 'L_SPECIAL_EXPLAIN' => $lang['User_special_explain'],
'L_USER_ACTIVE' => $lang['User_status'],
'L_ALLOW_PM' => $lang['User_allowpm'],
'L_ALLOW_AVATAR' => $lang['User_allowavatar'],
@@ -1035,19 +1037,6 @@ else
//
// Default user selection box
//
- $sql = "SELECT user_id, username
- FROM " . USERS_TABLE . "
- WHERE user_id <> " . ANONYMOUS ."
- ORDER BY username";
- $result = $db->sql_query($sql);
-
- $select_list = '';
- while( $row = $db->sql_fetchrow($result) )
- {
- $select_list .= '';
- }
- $select_list .= '';
-
$template->set_filenames(array(
'body' => 'admin/user_select_body.tpl')
);
@@ -1059,7 +1048,7 @@ else
'L_LOOK_UP' => $lang['Look_up_user'],
'L_FIND_USERNAME' => $lang['Find_username'],
- 'U_SEARCH_USER' => append_sid("../search.$phpEx?mode=searchuser"),
+ 'U_SEARCH_USER' => append_sid("./../search.$phpEx?mode=searchuser"),
'S_USER_ACTION' => append_sid("admin_users.$phpEx"),
'S_USER_SELECT' => $select_list)
@@ -1070,4 +1059,4 @@ else
include('./page_footer_admin.'.$phpEx);
-?>
+?>
\ No newline at end of file
diff --git a/phpBB/admin/admin_words.php b/phpBB/admin/admin_words.php
index 905ab66f2a..762f8378e5 100644
--- a/phpBB/admin/admin_words.php
+++ b/phpBB/admin/admin_words.php
@@ -172,7 +172,7 @@ if( $mode != "" )
}
else
{
- message_die(GENERAL_MESSAGE, $lang['Must_specify_word']);
+ message_die(GENERAL_MESSAGE, $lang['No_word_selected']);
}
}
}
diff --git a/phpBB/admin/page_footer_admin.php b/phpBB/admin/page_footer_admin.php
index e181640451..547513d977 100644
--- a/phpBB/admin/page_footer_admin.php
+++ b/phpBB/admin/page_footer_admin.php
@@ -62,7 +62,7 @@ if( $do_gzip_compress )
$gzip_contents = gzcompress($gzip_contents, 9);
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
- echo '\x1f\x8b\x08\x00\x00\x00\x00\x00';
+ echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
echo $gzip_contents;
echo pack('V', $gzip_crc);
echo pack('V', $gzip_size);
diff --git a/phpBB/admin/page_header_admin.php b/phpBB/admin/page_header_admin.php
index ae84e68c5c..73e6757b34 100644
--- a/phpBB/admin/page_header_admin.php
+++ b/phpBB/admin/page_header_admin.php
@@ -31,22 +31,22 @@ define('HEADER_INC', true);
// gzip_compression
//
$do_gzip_compress = FALSE;
-if($board_config['gzip_compress'])
+if ( $board_config['gzip_compress'] )
{
$phpver = phpversion();
- if($phpver >= '4.0.4pl1')
+ if ( $phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible') )
{
- if(extension_loaded('zlib'))
+ if ( extension_loaded('zlib') )
{
ob_start('ob_gzhandler');
}
}
- else if($phpver > '4.0')
+ else if ( $phpver > '4.0' )
{
- if(strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip'))
+ if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') )
{
- if(extension_loaded('zlib'))
+ if ( extension_loaded('zlib') )
{
$do_gzip_compress = TRUE;
ob_start();
@@ -72,30 +72,8 @@ $template->assign_vars(array(
'PAGE_TITLE' => $page_title,
'L_ADMIN' => $lang['Admin'],
- 'L_USERNAME' => $lang['Username'],
- 'L_PASSWORD' => $lang['Password'],
'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']),
- 'L_REGISTER' => $lang['Register'],
- 'L_PROFILE' => $lang['Profile'],
- 'L_SEARCH' => $lang['Search'],
- 'L_PRIVATEMSGS' => $lang['Private_msgs'],
- 'L_MEMBERLIST' => $lang['Memberlist'],
'L_FAQ' => $lang['FAQ'],
- 'L_USERGROUPS' => $lang['Usergroups'],
- 'L_FORUM' => $lang['Forum'],
- 'L_TOPICS' => $lang['Topics'],
- 'L_REPLIES' => $lang['Replies'],
- 'L_VIEWS' => $lang['Views'],
- 'L_POSTS' => $lang['Posts'],
- 'L_LASTPOST' => $lang['Last_Post'],
- 'L_MODERATOR' => $lang['Moderator'],
- 'L_NONEWPOSTS' => $lang['No_new_posts'],
- 'L_NEWPOSTS' => $lang['New_posts'],
- 'L_POSTED' => $lang['Posted'],
- 'L_JOINED' => $lang['Joined'],
- 'L_AUTHOR' => $lang['Author'],
- 'L_MESSAGE' => $lang['Message'],
- 'L_BY' => $lang['by'],
'U_INDEX' => append_sid('../index.'.$phpEx),
diff --git a/phpBB/includes/functions_search.php b/phpBB/includes/functions_search.php
index 526670e84f..f0ffbbcfdb 100644
--- a/phpBB/includes/functions_search.php
+++ b/phpBB/includes/functions_search.php
@@ -198,14 +198,14 @@ function add_search_words($post_id, $post_text, $post_title = '')
{
case 'mysql':
case 'mysql4':
- $value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . '(\'' . $word[$i] . '\')';
+ $value_sql .= ( ( $value_sql != '' ) ? ', ' : '' ) . '(\'' . $word[$i] . '\', 0)';
break;
case 'mssql':
- $value_sql .= ( ( $value_sql != '' ) ? ' UNION ALL ' : '' ) . "SELECT '" . $word[$i] . "'";
+ $value_sql .= ( ( $value_sql != '' ) ? ' UNION ALL ' : '' ) . "SELECT '" . $word[$i] . "', 0";
break;
default:
- $sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text)
- VALUES ('" . $word[$i] . "')";
+ $sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text, word_common)
+ VALUES ('" . $word[$i] . "', 0)";
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert new word', '', __LINE__, __FILE__, $sql);
@@ -221,11 +221,11 @@ function add_search_words($post_id, $post_text, $post_title = '')
{
case 'mysql':
case 'mysql4':
- $sql = "INSERT IGNORE INTO " . SEARCH_WORD_TABLE . " (word_text)
+ $sql = "INSERT IGNORE INTO " . SEARCH_WORD_TABLE . " (word_text, word_common)
VALUES $value_sql";
break;
case 'mssql':
- $sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text)
+ $sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text, word_common)
$value_sql";
break;
}
diff --git a/phpBB/includes/usercp_avatar.php b/phpBB/includes/usercp_avatar.php
index 2c77e3b459..84906954fb 100644
--- a/phpBB/includes/usercp_avatar.php
+++ b/phpBB/includes/usercp_avatar.php
@@ -162,7 +162,7 @@ function user_avatar_upload($mode, $avatar_mode, &$current_avatar, &$current_typ
{
if ( $avatar_filesize <= $board_config['avatar_filesize'] && $avatar_filesize > 0 )
{
- preg_match("'image\/[x\-]*([a-z]+)'", $avatar_filetype, $avatar_filetype);
+ preg_match('#image\/[x\-]*([a-z]+)#', $avatar_filetype, $avatar_filetype);
$avatar_filetype = $avatar_filetype[1];
}
else
@@ -184,7 +184,7 @@ function user_avatar_upload($mode, $avatar_mode, &$current_avatar, &$current_typ
if ( $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
{
- $new_filename = ( ( $current_avatar != '' && $current_type == USER_AVATAR_UPLOAD ) && $mode != 'register' ) ? $current_avatar : uniqid($user_ip) . $imgtype;
+ $new_filename = uniqid($user_ip) . $imgtype;
if ( $mode == 'editprofile' && $current_type == USER_AVATAR_UPLOAD && $current_avatar != '' )
{
diff --git a/phpBB/includes/usercp_register.php b/phpBB/includes/usercp_register.php
index 40fbad2468..062fec633c 100644
--- a/phpBB/includes/usercp_register.php
+++ b/phpBB/includes/usercp_register.php
@@ -899,27 +899,30 @@ else
// of the templates to 'fake' an IF...ELSE...ENDIF solution
// it works well :)
//
- if ( $userdata['user_allowavatar'] && ( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) )
+ if ( $mode != 'register' )
{
- $template->assign_block_vars('switch_avatar_block', array() );
-
- if ( $board_config['allow_avatar_upload'] && file_exists('./' . $board_config['avatar_path']) )
+ if ( $userdata['user_allowavatar'] && ( $board_config['allow_avatar_upload'] || $board_config['allow_avatar_local'] || $board_config['allow_avatar_remote'] ) )
{
- if ( $form_enctype != '' )
+ $template->assign_block_vars('switch_avatar_block', array() );
+
+ if ( $board_config['allow_avatar_upload'] && file_exists('./' . $board_config['avatar_path']) )
{
- $template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array() );
+ if ( $form_enctype != '' )
+ {
+ $template->assign_block_vars('switch_avatar_block.switch_avatar_local_upload', array() );
+ }
+ $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array() );
}
- $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_upload', array() );
- }
- if ( $board_config['allow_avatar_remote'] )
- {
- $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() );
- }
+ if ( $board_config['allow_avatar_remote'] )
+ {
+ $template->assign_block_vars('switch_avatar_block.switch_avatar_remote_link', array() );
+ }
- if ( $board_config['allow_avatar_local'] && file_exists('./' . $board_config['avatar_gallery_path']) )
- {
- $template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
+ if ( $board_config['allow_avatar_local'] && file_exists('./' . $board_config['avatar_gallery_path']) )
+ {
+ $template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
+ }
}
}
}
diff --git a/phpBB/modcp.php b/phpBB/modcp.php
index 8861525ff4..f91868bcb2 100644
--- a/phpBB/modcp.php
+++ b/phpBB/modcp.php
@@ -68,29 +68,6 @@ else
$confirm = ( $HTTP_POST_VARS['confirm'] ) ? TRUE : 0;
-//
-// Check if user did or did not confirm
-// If they did not, forward them to the last page they were on
-//
-if ( isset($HTTP_POST_VARS['cancel']) )
-{
- if ( $topic_id )
- {
- $redirect = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id";
- }
- else if ( $forum_id )
- {
- $redirect = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id";
- }
- else
- {
- $redirect = "index.$phpEx";
- }
-
- $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
- header($header_location . append_sid($redirect, true));
-}
-
//
// Continue var definitions
//
@@ -176,6 +153,29 @@ init_userprefs($userdata);
// End session management
//
+//
+// Check if user did or did not confirm
+// If they did not, forward them to the last page they were on
+//
+if ( isset($HTTP_POST_VARS['cancel']) )
+{
+ if ( $topic_id )
+ {
+ $redirect = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id";
+ }
+ else if ( $forum_id )
+ {
+ $redirect = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id";
+ }
+ else
+ {
+ $redirect = "index.$phpEx";
+ }
+
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
+ header($header_location . append_sid($redirect, true));
+}
+
//
// Start auth check
//
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 0a2ff94985..cb6f826d0f 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -68,6 +68,15 @@ else if ( $mode == 'smilies' )
exit;
}
+//
+// Start session management
+//
+$userdata = session_pagestart($user_ip, PAGE_POSTING);
+init_userprefs($userdata);
+//
+// End session management
+//
+
//
// Was cancel pressed? If so then redirect to the appropriate
// page, no point in continuing with any further checks
@@ -96,19 +105,10 @@ if ( isset($HTTP_POST_VARS['cancel']) )
}
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
- header($header_location . append_sid($redirect) . $post_append, true);
+ header($header_location . append_sid($redirect, true) . $post_append);
exit;
}
-//
-// Start session management
-//
-$userdata = session_pagestart($user_ip, PAGE_POSTING);
-init_userprefs($userdata);
-//
-// End session management
-//
-
//
// What auth type do we need to check?
//
diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php
index 86a19d5e5f..5c3dd48e15 100644
--- a/phpBB/privmsg.php
+++ b/phpBB/privmsg.php
@@ -407,7 +407,7 @@ else if ( $mode == 'read' )
$s_hidden_fields = '';
- $page_title = $lang['Read_private_message'];
+ $page_title = $lang['Read_pm'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
//
@@ -440,6 +440,7 @@ else if ( $mode == 'read' )
'BOX_NAME' => $l_box_name,
+ 'L_MESSAGE' => $lang['Message'],
'L_INBOX' => $lang['Inbox'],
'L_OUTBOX' => $lang['Outbox'],
'L_SENTBOX' => $lang['Sent'],
@@ -1180,21 +1181,21 @@ else if ( $submit || $refresh || $mode != '' )
//
if ( $mode == 'post' )
{
- $page_title = $lang['Send_new_privmsg'];
+ $page_title = $lang['Post_new_pm'];
$user_sig = ( $userdata['user_sig'] != '' && $board_config['allow_sig'] ) ? $userdata['user_sig'] : '';
}
else if ( $mode == 'reply' )
{
- $page_title = $lang['Reply_privmsg'];
+ $page_title = $lang['Post_reply_pm'];
$user_sig = ( $userdata['user_sig'] != '' && $board_config['allow_sig'] ) ? $userdata['user_sig'] : '';
}
else if ( $mode == 'edit' )
{
- $page_title = $lang['Edit_privmsg'];
+ $page_title = $lang['Edit_pm'];
$sql = "SELECT u.user_id, u.user_sig
FROM " . PRIVMSGS_TABLE . " pm, " . USERS_TABLE . " u
@@ -1209,7 +1210,7 @@ else if ( $submit || $refresh || $mode != '' )
{
if ( $userdata['user_id'] != $postrow['user_id'] )
{
- message_die(GENERAL_MESSAGE, $lang['Sorry_edit_own_posts']);
+ message_die(GENERAL_MESSAGE, $lang['Edit_own_posts']);
}
$user_sig = ( $postrow['user_sig'] != '' && $board_config['allow_sig'] ) ? $postrow['user_sig'] : '';
@@ -1808,7 +1809,7 @@ switch ( $folder )
$l_box_name = $lang['Outbox'];
break;
case 'savebox':
- $l_box_name = $lang['Savedbox'];
+ $l_box_name = $lang['Savebox'];
break;
case 'sentbox':
$l_box_name = $lang['Sentbox'];
diff --git a/phpBB/templates/subSilver/admin/user_ban_body.tpl b/phpBB/templates/subSilver/admin/user_ban_body.tpl
index f5f1b90836..c3fdb4070d 100644
--- a/phpBB/templates/subSilver/admin/user_ban_body.tpl
+++ b/phpBB/templates/subSilver/admin/user_ban_body.tpl
@@ -3,13 +3,13 @@
{L_BAN_EXPLAIN}
-