Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GT-181] Add last logged in field for admins #477

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions htdocs/web_portal/controllers/user/view_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ function view_user()
$params['ShowEdit'] = false;
}

$params['callingUser'] = $callingUser;
$params['idString'] = $userService->getDefaultIdString($user);
$params['projectNamesIds'] = $projectNamesIds;
$params['role_ProjIds'] = $roleProjectIds;
Expand Down
19 changes: 18 additions & 1 deletion htdocs/web_portal/views/user/view_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@
</ul>
</div>


<?php
$isCallingUserAdmin = $params['callingUser']->isAdmin();
?>
<!-- User -->
<div class="tableContainer" style="width: 55%; float: left;">
<span class="header" style="vertical-align:middle; float: left; padding-top: 0.9em; padding-left: 1em;">
Expand Down Expand Up @@ -127,6 +129,21 @@
</td>
</tr>
<?php } ?>
<?php if ($isCallingUserAdmin) : ?>
<tr class="site_table_row_1">
<td class="site_table">Last Logged In</td>
<td class="site_table">
<?php
if ($params['user']->getLastLoginDate()) {
xecho(
$params['user']->getLastLoginDate()
->format('Y-m-d H:i:s')
);
}
?>
</td>
</tr>
<?php endif; ?>
</table>
</div>
</div>
Expand Down