Advanced logs
This commit is contained in:
parent
022a864eb4
commit
22f0904196
|
@ -14,7 +14,7 @@ This is only a **development version**.
|
|||
|CLI Installation|:heavy_check_mark:|||
|
||||
|Translation|||:x:|
|
||||
|User managament|||:x:|
|
||||
|Logs||:clock8:||
|
||||
|Logs|:heavy_check_mark:|||
|
||||
|Graphs|||:x:|
|
||||
|Images||:clock8:||
|
||||
|
||||
|
|
|
@ -335,6 +335,7 @@ class user{
|
|||
die('Too many requests');
|
||||
}
|
||||
if($this->auth->isLoggedIn()){
|
||||
$this->log("Login", $this->auth->getUserId(), $this->auth->getUserId(), date("d/m/Y"), date("H:i.s"));
|
||||
$user = $this->database->exec("SELECT * FROM `%PREFIX%_profiles` WHERE id = :id;", true, [":id" => $this->auth->getUserId()]);
|
||||
if(!empty($user)){
|
||||
if(is_null($user[0]["name"])){
|
||||
|
@ -363,6 +364,7 @@ class user{
|
|||
|
||||
public function logout(){
|
||||
try {
|
||||
$this->log("Logout", $this->auth->getUserId(), $this->auth->getUserId(), date("d/m/Y"), date("H:i.s"));
|
||||
$this->auth->destroySession();
|
||||
}
|
||||
catch (\Delight\Auth\NotLoggedInException $e) {
|
||||
|
|
|
@ -3,7 +3,7 @@ include_once("../../core.php");
|
|||
init_class();
|
||||
$user->requirelogin();
|
||||
|
||||
$risultato = $database->exec("SELECT * FROM `%PREFIX%_log`", true);
|
||||
$risultato = $database->exec("SELECT * FROM `%PREFIX%_log` ORDER BY `date` DESC, `time` DESC", true);
|
||||
|
||||
$hidden = $user->hidden();
|
||||
?>
|
||||
|
@ -80,8 +80,8 @@ select::-ms-expand {
|
|||
<tbody>
|
||||
<?php
|
||||
foreach($risultato as $row){
|
||||
if(!in_array($row['subisce'], $hidden) OR in_array($user->name(), $hidden)){
|
||||
echo "<tr><td>" . $row["azione"] . "</td><td>" . $user->nameById($row["subisce"]) . "</td><td>" . $user->nameById($row["agisce"]) ."</td><td>" . $row['data'] . " - ore " . $row['ora'] . "</tr>";
|
||||
if(!in_array($row['changed'], $hidden) OR in_array($user->name(), $hidden)){
|
||||
echo "<tr><td>" . $row["action"] . "</td><td>" . $user->nameById($row["changed"]) . "</td><td>" . $user->nameById($row["editor"]) ."</td><td>" . $row['date'] . " - ore " . $row['time'] . "</tr>";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue