mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 19:54:12 +02:00
some changes/bugfixes
git-svn-id: file:///svn/phpbb/trunk@7241 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -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"));
|
||||
|
@@ -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]
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user