3declare(strict_types=1);
44 if (
null === static::$instance)
46 static::$instance =
new static();
47 static::$instance->initialize();
50 return static::$instance;
57 $this->secure_data = array(
'username',
'action',
'log_text');
58 $this->log_table = TABLE_PREFIX.
'log';
59 if(!isset($_SESSION[
'USER_ID']))
62 $this->username =
'LEPTON cms';
66 $this->user_id = $_SESSION[
'USER_ID'];
67 $this->username = $_SESSION[
'USERNAME'];
70 date_default_timezone_set(
'Europe/London');
71 $this->logged = date(
'Y-m-d H:i:s',time());
74 $this->sUploadMessages = [
75 0 => $MESSAGE[
'UPLOAD_ERR_OK'],
76 1 => $MESSAGE[
'UPLOAD_ERR_INI_SIZE'],
77 2 => $MESSAGE[
'UPLOAD_ERR_FORM_SIZE'],
78 3 => $MESSAGE[
'UPLOAD_ERR_PARTIAL'],
79 4 => $MESSAGE[
'UPLOAD_ERR_NO_FILE'],
80 5 => $MESSAGE[
'unknown_upload_error'],
81 6 => $MESSAGE[
'UPLOAD_ERR_NO_TMP_DIR'],
82 7 => $MESSAGE[
'UPLOAD_ERR_CANT_WRITE'],
83 8 => $MESSAGE[
'UPLOAD_ERR_EXTENSION'],
102 $all_values = array (
104 'logged' => $this->logged,
105 'user_id' => $this->user_id,
106 'username' => $this->username,
108 'log_text' => $log_text
111 $result = $this->database->build_and_execute(
'INSERT', $this->log_table, $all_values,
'');
113 if($result ===
false) {
117 $latest_id = $this->database->get_one(
"SELECT LAST_INSERT_ID() FROM ".$this->log_table.
" ");
118 if($latest_id > 99900)
120 echo
LEPTON_tools::display(
'Please contact your admin: log-table is running full',
'pre',
'ui red message');
138 $this->database->execute_query(
139 "SELECT * FROM ".$this->log_table.
" WHERE id BETWEEN ".$start.
" AND ".$end.
" ",
160 $all_values = array (
162 'logged' => $this->logged,
163 'user_id' => $this->user_id,
164 'username' => $this->username,
166 'log_text' => $log_text
169 $result = $this->database->secure_build_and_execute(
'INSERT', $this->log_table, $all_values,
'', $this->secure_data);
171 if($result ===
false) {
175 $latest_id = $this->database->get_one(
"SELECT LAST_INSERT_ID() FROM ".$this->log_table.
" ");
176 if($latest_id > 99900) {
177 echo
LEPTON_tools::display(
'Please contact your admin: log-table is running full',
'pre',
'ui red message');
194 $this->database->secure_execute_query(
195 "SELECT * FROM ".$this->log_table.
" WHERE id BETWEEN ".$start.
" AND ".$end.
" ",
215 $this->database->execute_query(
216 "SELECT * FROM ".$this->log_table,
223 foreach($temp as $entry)
225 if($entry[
'logged'] != $entry[
'check'] )
228 'id' => $entry[
'id'],
229 'user_id' => $entry[
'user_id'],
230 'logged' => $entry[
'logged'],
231 'check' => $entry[
'check'],
232 'comment' => $entry[
'comment']
static getInstance(array &$settings=[])
display_secure_entry( $start=1, $end=100000)
LEPTON_database $database
display_entry( $start=1, $end=100000)
insert_secure_entry( $action=0, $log_text=0)
insert_entry( $action=0, $log_text=0)