From 7bc9de66adfbc2b6a05470134a01490d8d6dd2ca Mon Sep 17 00:00:00 2001 From: overflowerror Date: Sat, 16 Aug 2014 20:58:39 +0200 Subject: [PATCH] some new methods for logging --- backend/actionLogger.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backend/actionLogger.php b/backend/actionLogger.php index d50e72e..179482a 100644 --- a/backend/actionLogger.php +++ b/backend/actionLogger.php @@ -35,5 +35,17 @@ return -1; return $result->fetch_object()->ID; } + static public function login($uid, $session, $success) { + global $db; + $db->query("INSERT INTO `logLogins` (`currentUserFK`, `newUserFK`, `connectFK`, `time`, `success`) VALUES (" . $session['uid'] . ", " . $uid . ", " . actionLogger::getConnectFK($session) . ", " . time() . ", " . $success . ")"); + } + static public function command($session, $command) { + global $db; + $db->query("INSERT INTO `logCommands`(`time`, `connectFK`, `userFK`, `command`) VALUES (" . time() . ", " . actionLogger::getConnectFK($session) . ", " . $session['uid'] . ", '" . $db->real_escape_string($command) . "')"); + } + static public function init($session) { + global $db; + $db->query("INSERT INTO `logInits`(`userFK`, `connectFK`, `time`) VALUES (" . $session['uid'] . ", " . actionLogger::getConnectFK($session) . ", " . time() . ")"); + } } ?>