added lastLogins-Logging
This commit is contained in:
@@ -43,9 +43,9 @@ processPostData($dbConnection, $_POST);
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
||||||
<!-- Compiled and minified CSS -->
|
<!-- Compiled and minified CSS -->
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/css/materialize.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/css/materialize.min.css">
|
||||||
<!-- Compiled and minified JavaScript -->
|
<!-- Compiled and minified JavaScript -->
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/js/materialize.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@materializecss/materialize@1.1.0-alpha/dist/js/materialize.min.js"></script>
|
||||||
|
|
||||||
<!-- inits for the materializeCss -->
|
<!-- inits for the materializeCss -->
|
||||||
<?php include("lib/machs/materializeInit.php");?>
|
<?php include("lib/machs/materializeInit.php");?>
|
||||||
|
|||||||
@@ -64,9 +64,7 @@ if( empty($someOptions['dontFetch' ]) ) $someOptions['dontFetch' ] = false;
|
|||||||
if(!$pdoResult){
|
if(!$pdoResult){
|
||||||
echo("Error during dbQuery!\n");
|
echo("Error during dbQuery!\n");
|
||||||
echo("DB-Error:\n"); var_dump($aDbConnection->errorInfo());
|
echo("DB-Error:\n"); var_dump($aDbConnection->errorInfo());
|
||||||
// var_dump($aQueryString);
|
|
||||||
// var_dump($aBindArray);
|
|
||||||
// echo($pdoStatement.errorInfo());
|
|
||||||
}
|
}
|
||||||
if($someOptions['dontFetch']){
|
if($someOptions['dontFetch']){
|
||||||
$ret = NULL;
|
$ret = NULL;
|
||||||
@@ -91,9 +89,6 @@ if( empty($someOptions['dontFetch' ]) ) $someOptions['dontFetch' ] = false;
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//var_dump($ret);
|
|
||||||
//var_dump($aQueryString);
|
|
||||||
//var_dump($aBindArray);
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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/cwsvJudo.config.php");
|
||||||
require_once($config['basePath']."/config/phpcount.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>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -64,6 +72,11 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
<li class="bold">
|
<li class="bold">
|
||||||
<a class="waves-effect waves-teal" href="#Configs">UserInfos</a>
|
<a class="waves-effect waves-teal" href="#Configs">UserInfos</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php if( isUserAdmin($dbConnection, $userData['id']) ){?>
|
||||||
|
<li class="bold">
|
||||||
|
<a class="waves-effect waves-teal" href="#Admin">adminStuff</a>
|
||||||
|
</li>
|
||||||
|
<?php }?>
|
||||||
</ul>
|
</ul>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -130,6 +143,42 @@ if($_SESSION['login']){
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
</main>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
|
|||||||
require_once("config/participo.php");
|
require_once("config/participo.php");
|
||||||
|
|
||||||
require_once("./local/dbConf.php");
|
require_once("./local/dbConf.php");
|
||||||
// require_once("./local/achievementsConf.php");
|
|
||||||
|
|
||||||
// require_once("./lib/achievementsLib.php");
|
|
||||||
|
|
||||||
$basePath = $config['basePath'];
|
$basePath = $config['basePath'];
|
||||||
require_once($basePath."/config/phpcount.config.php");
|
require_once($basePath."/config/phpcount.config.php");
|
||||||
@@ -37,7 +34,17 @@ function checkCredentials($username, $password, $db_server, $db_user, $db_passwo
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
$message['success'] = 'Anmeldung erfolgreich, <a href="index.php">weiter zum Inhalt</a>.';
|
$message['success'] = 'Anmeldung erfolgreich, <a href="index.php">weiter zum Inhalt</a>.';
|
||||||
PHPCount::AddHit("participo-Login ".$_POST['f']['username']);
|
PHPCount::AddHit("participo-Login-".$_POST['f']['username']);
|
||||||
|
|
||||||
|
$lastLogins=file("logins.txt");
|
||||||
|
$file = fopen("logins.txt", "w");
|
||||||
|
fwrite($file, $_POST['f']['username']."\n");
|
||||||
|
for ( $i=0;i<30;++$i)
|
||||||
|
{
|
||||||
|
fwrite($file, $lastLoggins."\n");
|
||||||
|
}
|
||||||
|
fclose($file);
|
||||||
|
|
||||||
header('Location: http://' . $_SERVER['HTTP_HOST'] . '/participo?user=' . $_POST['f']['username']);
|
header('Location: http://' . $_SERVER['HTTP_HOST'] . '/participo?user=' . $_POST['f']['username']);
|
||||||
} else {
|
} else {
|
||||||
sleep(5);
|
sleep(5);
|
||||||
|
|||||||
Reference in New Issue
Block a user