adding server log
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function log($loglevel,$logtext,$userid){
|
function log_action($loglevel,$logtext,$userid){
|
||||||
include "../../../config.php";
|
include "../../../config.php";
|
||||||
$conn = new mysqli($DB_SERVERNAME, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE);
|
$conn = new mysqli($DB_SERVERNAME, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE);
|
||||||
if ($conn->connect_error) {
|
if ($conn->connect_error) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ if(isset($_SESSION["login"])){
|
|||||||
header("LOCATION:/system/secure_zone/php/index.php");
|
header("LOCATION:/system/secure_zone/php/index.php");
|
||||||
}
|
}
|
||||||
include "../../../api/php/notifications/sendmessage.php"; //to send user notification on login
|
include "../../../api/php/notifications/sendmessage.php"; //to send user notification on login
|
||||||
|
include "../../../api/php/log/add_server_entry.php"; //to log things
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@@ -320,7 +321,7 @@ async function checkRegistration() {
|
|||||||
//send the user to 2fa auth page
|
//send the user to 2fa auth page
|
||||||
echo '<script>window.location.href = "/system/insecure_zone/php/2fa.php";</script>';
|
echo '<script>window.location.href = "/system/insecure_zone/php/2fa.php";</script>';
|
||||||
}else{
|
}else{
|
||||||
|
log_action("LOGIN::SUCCESS","User ".$_SESSION["username"]." logged in with password.",$_SESSION["id"]);
|
||||||
if($_SESSION["send_login_message"]=="1"){
|
if($_SESSION["send_login_message"]=="1"){
|
||||||
$ip = $_SERVER['REMOTE_ADDR'];
|
$ip = $_SERVER['REMOTE_ADDR'];
|
||||||
$username=$row["username"];
|
$username=$row["username"];
|
||||||
|
|||||||
Reference in New Issue
Block a user