added lastLogins-Logging

This commit is contained in:
marko
2021-12-20 15:42:21 +01:00
parent 4cb5e3ee47
commit 1a3f81bd33
4 changed files with 64 additions and 13 deletions

View File

@@ -12,6 +12,14 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
require_once($config['basePath']."/config/cwsvJudo.config.php");
require_once($config['basePath']."/config/phpcount.config.php");
$dbConnection = getPdoDbConnection(
$cwsvJudoConfig["db"]["host"],
$cwsvJudoConfig["db"]["name"],
$cwsvJudoConfig["db"]["user"],
$cwsvJudoConfig["db"]["password"]
);
$userData = getUserData($dbConnection, $_SESSION['user']['userId']);
?>
<!DOCTYPE html>
<html>
@@ -64,6 +72,11 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
<li class="bold">
<a class="waves-effect waves-teal" href="#Configs">UserInfos</a>
</li>
<?php if( isUserAdmin($dbConnection, $userData['id']) ){?>
<li class="bold">
<a class="waves-effect waves-teal" href="#Admin">adminStuff</a>
</li>
<?php }?>
</ul>
</header>
@@ -130,6 +143,42 @@ if($_SESSION['login']){
</div>
</div>
<?php if( isUserAdmin($dbConnection, $userData['id']) ){?>
<div class="divider"></div>
<div class="row" id="Admin">
<div style="padding:1%;" class="col s12 m6">
<div style="margin:1%;" class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">lastLogins</span>
<img style="max-height:10vh;" class="responsive-img" src="images/account.svg" />
<p>Die letzten Logins der einzelnen User</p>
<?php $lastLogins=json_decode( file_get_contents("lastLogins.json"), true);?>
<table>
<thead>
<tr>
<th>userName</th>
<th>lastLogins</th>
</tr>
</thead>
<tbody>
<?php foreach( $lastLogins as $userName => $lastLogins ){ ?>
<tr>
<td><?php echo( $userName );?></td>
<td><?php echo( $lastLogins['lastLogins'][0] );?></td>
</tr>
<?php }?>
</tbody>
</table>
</div>
<div class="card-action">
</div>
</div>
</div>
</div>
<?php }?>
</main>
<?php
}