aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/www/include/base/log.php
diff options
context:
space:
mode:
authorM.Gergo2018-07-06 11:14:41 +0200
committerM.Gergo2018-07-06 11:14:41 +0200
commit43de9af71f7f4ca5731b94a06d688ae8412ba427 (patch)
tree54835de1dfcda504c02da261f0dc26885aed2e89 /mayor-orig/www/include/base/log.php
parent50310b0e4513ee3fcce67351ae61e8fff851130e (diff)
downloadmayor-43de9af71f7f4ca5731b94a06d688ae8412ba427.tar.gz
mayor-43de9af71f7f4ca5731b94a06d688ae8412ba427.zip
2018/Feb/28 -i állapot hozzáadva, mint a módosítások kiindulási állapota
Diffstat (limited to 'mayor-orig/www/include/base/log.php')
-rw-r--r--mayor-orig/www/include/base/log.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/mayor-orig/www/include/base/log.php b/mayor-orig/www/include/base/log.php
new file mode 100644
index 00000000..45c669e4
--- /dev/null
+++ b/mayor-orig/www/include/base/log.php
@@ -0,0 +1,33 @@
+<?php
+/*
+ Module: base
+
+ function naploz($aCode)
+ function szamlal($policy,$page)
+*/
+
+ function _clientIp() {
+ return ($_SERVER['HTTP_X_FORWARDED_FOR']!='')?$_SERVER['HTTP_X_FORWARDED_FOR']:$_SERVER['REMOTE_ADDR'];
+ }
+
+ function logLogin($policy, $userAccount, $flag) {
+ $q = "INSERT INTO loginLog (dt,ip,userAccount,policy,flag) VALUES (NOW(),'%s','%s','%s', %u)";
+ db_query($q, array('fv' => 'logLogin', 'modul' => 'login', 'values' => array(_clientIp(), $userAccount, $policy, $flag)));
+ }
+
+ function szamlal($policy, $page) {
+ $q = "INSERT INTO stat (dt, policy, page) VALUES (NOW(),'%s','%s')";
+ db_query($q, array('fv' => 'szamlal', 'modul' => 'login', 'values' => array($policy, $page)));
+ }
+
+ function mayorLogger($loglevel, $modul, $message, $userAccount='') {
+ if ($loglevel>_LOGLEVEL) {
+ $fp = fopen(_LOGDIR.'/'.$modul.'.log','a+');
+ if ($fp!=false) {
+ $msg = date('Y-m-d H:i:s').' '.$userAccount.': '.$message."\n";
+ fputs($fp,$msg);
+ fclose($fp);
+ }
+ }
+ }
+?>