$CFG->log_level = 3;
// Log method
-// stderr = Stand Error
-// file = file to log to. Requires write permission to web server
+// stderr = Log to stand error
+// file = Log to file. Requires write permission
// syslog = syslog
// Default log method is syslog
$CFG->log_method = 'syslog';
+
+// File to log to if log method is file
+// Both relative and absolut path is accepted
+// If path is relative root is $CFG->root
+// Default file is $CFG->root.qtadmin.log
+$CFG->log_file = 'qtadmin.log';
?>
switch ($this->log_method) {
case 'file':
+ if (isset($CFG->log_file)) {
+ if ($CFG->log_file[0] == '/') {
+ $file = $CFG->log_file;
+ } else {
+ $file = $CFG->root.$CFG->log_file;
+ }
+ } else {
+ $file = $CFG->root.'qtadmin.log';
+ }
+ file_put_contents($file, "[$time]: $message", FILE_APPEND | LOCK_EX);
+ break;
case 'stderr':
+ file_put_contents('php://stderr', "[$time]: $message");
+ break;
case 'syslog':
syslog($priority, $message);
break;
if (ini_get('session.gc_maxlifetime') != $this->timeout)
ini_set('session.gc_maxlifetime', $this->timeout);
- if (ini_get('session.cookie_lifetime') != $this->timeout)
- ini_set('session.cookie_lifetime', $this->timeout);
+ //if (ini_get('session.cookie_lifetime') != $this->timeout)
+ // ini_set('session.cookie_lifetime', $this->timeout);
+ ini_set('session.cookie_lifetime', 0);
session_start();
}
}
if ($loggedIn == false) {
- echo '$this->settings: '.var_export($this->settings, true);
- echo 'R_TIME: '.date('c', $_SERVER['REQUEST_TIME']).' L_ACT: '.date('c', $_SESSION['LAST_ACTIVITY']);
- //exit;
+ $this->log('$this->settings: '.var_export($this->settings, true), 3);
+ $this->log('R_TIME: '.date('c', $_SERVER['REQUEST_TIME']).' L_ACT: '.date('c', $_SESSION['LAST_ACTIVITY']), 3);
}
$_SESSION['settings'] = $this->settings;