From 84c261c579544bcea07296e5accd4f062d16c881 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sat, 14 Dec 2013 14:09:38 -0500 Subject: [PATCH] Add information about user who created the user on screen and when - refs BT#7123 --- main/admin/user_information.php | 5 +++++ main/inc/lib/main_api.lib.php | 3 +++ 2 files changed, 8 insertions(+) diff --git a/main/admin/user_information.php b/main/admin/user_information.php index 3492477005..f6293d1629 100644 --- a/main/admin/user_information.php +++ b/main/admin/user_information.php @@ -92,6 +92,11 @@ echo '' echo '

'.($user['status'] == 1 ? get_lang('Teacher') : get_lang('Student')) .'

'; echo '

'.Display :: encrypted_mailto_link($user['mail'], $user['mail']).'

'; +// Show info about who created this user and when +$creatorId = $user['creator_id']; +$creatorInfo = api_get_user_info($creatorId); +$registrationDate = $user['registration_date']; +echo '

'.sprintf(get_lang('CreatedByXYOnZ'), 'user_information.php?user_id='.$creatorId, $creatorInfo['username'], api_get_utc_datetime($registrationDate)).'

'; /** * Show the sessions and the courses in which this user is subscribed diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index f9a5d42697..d3b1db61f9 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -1156,6 +1156,9 @@ function _api_format_user($user, $add_password = false) { $result['password'] = $user['password']; } + $result['creator_id'] = $user['creator_id']; + $result['registration_date'] = $user['registration_date']; + return $result; }