phpBB

Code Changes

File: includes/ucp/ucp_activate.php

  Unmodified   Added   Modified   Removed
Line 51Line 51
			trigger_error('ALREADY_ACTIVATED');
}


			trigger_error('ALREADY_ACTIVATED');
}


		if ($user_row['user_actkey'] != $key)

		if ($user_row['user_inactive_reason'] == INACTIVE_MANUAL || $user_row['user_actkey'] !== $key)

		{
trigger_error('WRONG_ACTIVATION');

		{
trigger_error('WRONG_ACTIVATION');

 
		}

// Do not allow activating by non administrators when admin activation is on
// Only activation type the user should be able to do is INACTIVE_REMIND
// or activate a new password which is not an activation state :@
if (!$user_row['user_newpasswd'] && $user_row['user_inactive_reason'] != INACTIVE_REMIND && $config['require_activation'] == USER_ACTIVATION_ADMIN && !$auth->acl_get('a_user'))
{
if (!$user->data['is_registered'])
{
login_box('', $user->lang['NO_AUTH_OPERATION']);
}
trigger_error('NO_AUTH_OPERATION');

		}

$update_password = ($user_row['user_newpasswd']) ? true : false;

		}

$update_password = ($user_row['user_newpasswd']) ? true : false;

Line 65Line 77
				'user_password'		=> $user_row['user_newpasswd'],
'user_newpasswd' => '',
'user_pass_convert' => 0,

				'user_password'		=> $user_row['user_newpasswd'],
'user_newpasswd' => '',
'user_pass_convert' => 0,

 
				'user_login_attempts'	=> 0,

			);

$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user_row['user_id'];
$db->sql_query($sql);

			);

$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user_row['user_id'];
$db->sql_query($sql);

 

add_log('user', $user_row['user_id'], 'LOG_USER_NEW_PASSWORD', $user_row['username']);

		}

if (!$update_password)

		}

if (!$update_password)

Line 83Line 98
				SET user_actkey = ''
WHERE user_id = {$user_row['user_id']}";
$db->sql_query($sql);

				SET user_actkey = ''
WHERE user_id = {$user_row['user_id']}";
$db->sql_query($sql);

 

// Create the correct logs
add_log('user', $user_row['user_id'], 'LOG_USER_ACTIVE_USER');
if ($auth->acl_get('a_user'))
{
add_log('admin', 'LOG_USER_ACTIVE', $user_row['username']);
}

		}

if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)

		}

if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)

Line 95Line 117

$messenger->to($user_row['user_email'], $user_row['username']);



$messenger->to($user_row['user_email'], $user_row['username']);


			$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);

			$messenger->anti_abuse_headers($config, $user);





$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']))


$messenger->assign_vars(array(
'USERNAME' => htmlspecialchars_decode($user_row['username']))