Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
451a16be
Commit
451a16be
authored
Mar 23, 2016
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move event logger upgrade to plugin
parent
391068b6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
install.php
qa-include/db/install.php
+0
-7
qa-event-logger.php
qa-plugin/event-logger/qa-event-logger.php
+9
-1
No files found.
qa-include/db/install.php
View file @
451a16be
...
...
@@ -1469,13 +1469,6 @@
break
;
case
63
:
// convert IP addresses to new binary format
if
(
isset
(
$keydbtables
[
qa_db_add_table_prefix
(
'eventlog'
)]))
{
$locktablesquery
.=
', ^eventlog WRITE'
;
qa_db_upgrade_query
(
$locktablesquery
);
qa_db_upgrade_query
(
'ALTER TABLE ^eventlog MODIFY ipaddress VARCHAR(45) CHARACTER SET ascii'
);
}
qa_db_upgrade_query
(
'ALTER TABLE ^cookies MODIFY writeip VARBINARY(16) NULL DEFAULT NULL, MODIFY createip VARBINARY(16) NULL DEFAULT NULL'
);
qa_db_upgrade_query
(
'UPDATE ^cookies SET writeip = UNHEX(HEX(CAST(writeip AS UNSIGNED))), createip = UNHEX(HEX(CAST(createip AS UNSIGNED)))'
);
...
...
qa-plugin/event-logger/qa-event-logger.php
View file @
451a16be
...
...
@@ -28,12 +28,13 @@ class qa_event_logger
$tablename
=
qa_db_add_table_prefix
(
'eventlog'
);
if
(
!
in_array
(
$tablename
,
$table_list
))
{
// table does not exist, so create it
require_once
QA_INCLUDE_DIR
.
'app/users.php'
;
require_once
QA_INCLUDE_DIR
.
'db/maxima.php'
;
return
'CREATE TABLE ^eventlog ('
.
'datetime DATETIME NOT NULL,'
.
'ipaddress VARCHAR (45),'
.
'ipaddress VARCHAR (45)
CHARACTER SET ascii
,'
.
'userid '
.
qa_get_mysql_user_column_type
()
.
','
.
'handle VARCHAR('
.
QA_DB_MAX_HANDLE_LENGTH
.
'),'
.
'cookieid BIGINT UNSIGNED,'
.
...
...
@@ -44,6 +45,13 @@ class qa_event_logger
'KEY userid (userid),'
.
'KEY event (event)'
.
') ENGINE=MyISAM DEFAULT CHARSET=utf8'
;
}
else
{
// table exists: check it has the correct schema
$column
=
qa_db_read_one_assoc
(
qa_db_query_sub
(
'SHOW COLUMNS FROM ^eventlog WHERE Field="ipaddress"'
));
if
(
strtolower
(
$column
[
'Type'
])
!==
'varchar(45)'
)
{
// upgrade to handle IPv6
return
'ALTER TABLE ^eventlog MODIFY ipaddress VARCHAR(45) CHARACTER SET ascii'
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment