diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2007-03-30 10:49:06 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-03-30 10:49:06 +0000 |
| commit | 9f82dec04b18813c060e5a090a149c1a2c140689 (patch) | |
| tree | efab7d5e9ce8166ff4bff69d180c82230c3df481 /phpBB/includes/ucp | |
| parent | 331a549c42a74472d27dadbe213618a7b914a737 (diff) | |
| download | forums-9f82dec04b18813c060e5a090a149c1a2c140689.tar forums-9f82dec04b18813c060e5a090a149c1a2c140689.tar.gz forums-9f82dec04b18813c060e5a090a149c1a2c140689.tar.bz2 forums-9f82dec04b18813c060e5a090a149c1a2c140689.tar.xz forums-9f82dec04b18813c060e5a090a149c1a2c140689.zip | |
some changes/bugfixes
git-svn-id: file:///svn/phpbb/trunk@7241 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp')
| -rw-r--r-- | phpBB/includes/ucp/ucp_activate.php | 11 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 16 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_profile.php | 27 |
3 files changed, 43 insertions, 11 deletions
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index e9fbe69938..6b17b28ba0 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -25,7 +25,7 @@ class ucp_activate $user_id = request_var('u', 0); $key = request_var('k', ''); - $sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey + $sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason FROM ' . USERS_TABLE . " WHERE user_id = $user_id"; $result = $db->sql_query($sql); @@ -101,7 +101,14 @@ class ucp_activate } else { - $message = (!$update_password) ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED'; + if (!$update_password) + { + $message = ($user_row['user_inactive_reason'] == INACTIVE_PROFILE) ? 'ACCOUNT_ACTIVE_PROFILE' : 'ACCOUNT_ACTIVE'; + } + else + { + $message = 'PASSWORD_ACTIVATED'; + } } meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 6df48c8c3e..d48f11a71d 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -923,17 +923,25 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove global $auth, $db, $user; // Delete User [TO/BCC] - if ($remove_u) + if ($remove_u && !empty($_REQUEST['remove_u']) && is_array($_REQUEST['remove_u'])) { $remove_user_id = array_keys($_REQUEST['remove_u']); - unset($address_list['u'][(int) $remove_user_id[0]]); + + if (isset($remove_user_id[0])) + { + unset($address_list['u'][(int) $remove_user_id[0]]); + } } // Delete Group [TO/BCC] - if ($remove_g) + if ($remove_g && !empty($_REQUEST['remove_g']) && is_array($_REQUEST['remove_g'])) { $remove_group_id = array_keys($_REQUEST['remove_g']); - unset($address_list['g'][(int) $remove_group_id[0]]); + + if (isset($remove_group_id[0])) + { + unset($address_list['g'][(int) $remove_group_id[0]]); + } } // Add User/Group [TO] diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 7309b34377..f50c322fce 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -116,8 +116,12 @@ class ucp_profile add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $data['username'], $user->data['user_email'], $data['email']); } + $message = 'PROFILE_UPDATED'; + if ($config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN)) { + $message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN'; + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $server_url = generate_board_url(); @@ -184,9 +188,9 @@ class ucp_profile user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE); - $sql_ary += array( - 'user_actkey' => $user_actkey, - ); + // Because we want the profile to be reactivated we set user_newpasswd to empty (else the reactivation will fail) + $sql_ary['user_actkey'] = $user_actkey; + $sql_ary['user_newpasswd'] = ''; } if (sizeof($sql_ary)) @@ -203,8 +207,21 @@ class ucp_profile user_update_name($user->data['username'], $data['username']); } - meta_refresh(3, $this->u_action); - $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); + // Now, we can remove the user completely (kill the session) - NOT BEFORE!!! + if (!empty($sql_ary['user_actkey'])) + { + meta_refresh(5, append_sid($phpbb_root_path . 'index.' . $phpEx)); + $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid($phpbb_root_path . 'index.' . $phpEx) . '">', '</a>'); + + // Because the user gets deactivated we log him out too, killing his session + $user->session_kill(); + } + else + { + meta_refresh(3, $this->u_action); + $message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>'); + } + trigger_error($message); } |
