From b76e7f70223763eb41cce9654325a0d9a2923c9f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 3 Mar 2003 20:53:43 +0000 Subject: [PATCH] fixed bugs #1286, #1337 and #1153 git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3587 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_users.php | 7 ++++++- phpBB/includes/usercp_register.php | 22 +++++++++++++++++++--- phpBB/language/lang_english/lang_main.php | 2 +- phpBB/search.php | 3 ++- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/phpBB/admin/admin_users.php b/phpBB/admin/admin_users.php index 81f8aa9877..c318150c9d 100644 --- a/phpBB/admin/admin_users.php +++ b/phpBB/admin/admin_users.php @@ -308,7 +308,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) { unset($rename_user); - if ( stripslashes(strtolower($username)) != strtolower($this_userdata['username']) ) + if ( stripslashes(strtolower($username)) != strtolower($this_userdata['username']) ) { $result = validate_username($username); if ( $result['error'] ) @@ -316,6 +316,11 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) $error = TRUE; $error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . $result['error_msg']; } + else if ( strtolower(str_replace("\'", "''", $username)) == strtolower($userdata['username']) ) + { + $error = TRUE; + $error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . $lang['Username_taken']; + } } if (!$error) diff --git a/phpBB/includes/usercp_register.php b/phpBB/includes/usercp_register.php index adbf975e9f..b52d30355c 100644 --- a/phpBB/includes/usercp_register.php +++ b/phpBB/includes/usercp_register.php @@ -609,11 +609,27 @@ if ( isset($HTTP_POST_VARS['submit']) ) if ( $board_config['require_activation'] == USER_ACTIVATION_ADMIN ) { - //$emailer->use_template("admin_activate", stripslashes($user_lang)); + $sql = "SELECT user_email + FROM " . USERS_TABLE . " + WHERE user_level = " . ADMIN; + + if ( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql); + } + + $rows = $db->sql_fetchrowset($result); + $bcc_list = ''; + + for ($i = 0; $i < count($rows); $i++) + { + $bcc_list = ($bcc_list != '') ? ', ' . trim($rows[$i]['user_email']) : trim($rows[$i]['user_email']); + } + $emailer->use_template("admin_activate", $board_config['default_lang']); - $emailer->email_address($board_config['board_email']); + $emailer->email_address(' '); $emailer->set_subject($lang['New_account_subject']); - $emailer->extra_headers($email_headers); + $emailer->extra_headers($email_headers . "Bcc: $bcc_list\n"); $emailer->assign_vars(array( 'USERNAME' => $username, diff --git a/phpBB/language/lang_english/lang_main.php b/phpBB/language/lang_english/lang_main.php index ccf60a9959..7d3e3fa0d2 100644 --- a/phpBB/language/lang_english/lang_main.php +++ b/phpBB/language/lang_english/lang_main.php @@ -877,7 +877,7 @@ $lang['Topic_split'] = 'The selected topic has been split successfully'; $lang['Too_many_error'] = 'You have selected too many posts. You can only select one post to split a topic after!'; -$lang['None_selected'] = 'You have no selected any topics to perform this operation on. Please go back and select at least one.'; +$lang['None_selected'] = 'You have not selected any topics to perform this operation on. Please go back and select at least one.'; $lang['New_forum'] = 'New forum'; $lang['This_posts_IP'] = 'IP address for this post'; diff --git a/phpBB/search.php b/phpBB/search.php index c84dc0c183..295130e973 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -522,6 +522,7 @@ else if ( $search_keywords != '' || $search_author != '' || $search_id ) for ($i = 0; $i < count($search_id_chunks); $i++) { $where_sql = ( $search_author == '' && $auth_sql == '' ) ? 'post_id IN (' . implode(', ', $search_id_chunks[$i]) . ')' : 'p.post_id IN (' . implode(', ', $search_id_chunks[$i]) . ')'; + $select_sql = ( $search_author == '' && $auth_sql == '' ) ? 'post_id' : 'p.post_id'; $from_sql = ( $search_author == '' && $auth_sql == '' ) ? POSTS_TABLE : POSTS_TABLE . ' p'; if ( $search_time ) @@ -541,7 +542,7 @@ else if ( $search_keywords != '' || $search_author != '' || $search_id ) $where_sql .= " AND u.user_id = p.poster_id AND u.username LIKE '$search_author'"; } - $sql = "SELECT p.post_id + $sql = "SELECT " . $select_sql . " FROM $from_sql WHERE $where_sql"; if ( !($result = $db->sql_query($sql)) )