From 1d2201902f0f3789daf02ca054f33f4b4bfa3eb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Erik=20Fr=C3=A8rejean?= <erikfrerejean@phpbb.com>
Date: Thu, 30 Dec 2010 16:03:11 +0100
Subject: [PATCH] [ticket/9961] Create log entries when users are activated.

 * Create log entries when a user activates own account without
   also changing their password.

 * Additionally create admin log entries when an administrator activates
   user accounts.

PHPBB3-9961
---
 phpBB/includes/ucp/ucp_activate.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index 8debaabf31..b00c1b9f52 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -98,6 +98,13 @@ class ucp_activate
 				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)