Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
d43655c9
Commit
d43655c9
authored
Sep 18, 2005
by
Dries
Browse files
- Patch
#31449
by chx: store session IDs in the accesslog table.
parent
f906d2dd
Changes
5
Hide whitespace changes
Inline
Side-by-side
database/database.mysql
View file @
d43655c9
...
...
@@ -21,6 +21,7 @@ CREATE TABLE access (
CREATE TABLE accesslog (
aid int(10) NOT NULL auto_increment,
sid varchar(32) NOT NULL default '',
title varchar(255) default NULL,
path varchar(255) default NULL,
url varchar(255) default NULL,
...
...
database/database.pgsql
View file @
d43655c9
...
...
@@ -16,6 +16,7 @@ CREATE TABLE access (
CREATE TABLE accesslog (
aid SERIAL,
sid varchar(32) NOT NULL default '',
mask varchar(255) NOT NULL default '',
title varchar(255) default NULL,
path varchar(255) default NULL,
...
...
database/updates.inc
View file @
d43655c9
...
...
@@ -66,7 +66,8 @@
"2005-08-08"
=>
"update_144"
,
"2005-08-15"
=>
"update_145"
,
"2005-08-25"
=>
"update_146"
,
"2005-09-07"
=>
"update_147"
"2005-09-07"
=>
"update_147"
,
"2005-09-18"
=>
"update_148"
);
function
update_110
()
{
...
...
@@ -811,6 +812,26 @@ function update_147() {
return
$ret
;
}
function
update_148
()
{
$ret
=
array
();
// Add support for tracking users' session ids (useful for tracking anon users)
switch
(
$GLOBALS
[
'db_type'
])
{
case
'pgsql'
:
$ret
[]
=
update_sql
(
"ALTER TABLE
{
accesslog
}
ADD sid varchar(32)"
);
$ret
[]
=
update_sql
(
"ALTER TABLE
{
accesslog
}
ALTER sid SET NOT NULL"
);
$ret
[]
=
update_sql
(
"ALTER TABLE
{
accesslog
}
ALTER sid SET DEFAULT ''"
);
break
;
case
'mysql'
:
case
'mysqli'
:
$ret
[]
=
update_sql
(
"ALTER TABLE
{
accesslog
}
ADD sid varchar(32) NOT NULL default ''"
);
break
;
default
:
break
;
}
return
$ret
;
}
function
update_sql
(
$sql
)
{
$edit
=
$_POST
[
"edit"
];
...
...
modules/statistics.module
View file @
d43655c9
...
...
@@ -74,7 +74,7 @@ function statistics_exit() {
}
if
((
variable_get
(
'statistics_enable_access_log'
,
0
))
&&
(
module_invoke
(
'throttle'
,
'status'
)
==
0
))
{
// Log this page access.
db_query
(
"INSERT INTO
{
accesslog
}
(title, path, url, hostname, uid, timer, timestamp) values('%s', '%s', '%s', '%s', %d, %d, %d)"
,
drupal_get_title
(),
$_GET
[
'q'
],
referer_uri
(),
$_SERVER
[
'REMOTE_ADDR'
],
$user
->
uid
,
timer_read
(
'page'
),
time
());
db_query
(
"INSERT INTO
{
accesslog
}
(title, path, url, hostname, uid,
sid,
timer, timestamp) values('%s', '%s', '%s', '%s', %d,
'%s',
%d, %d)"
,
drupal_get_title
(),
$_GET
[
'q'
],
referer_uri
(),
$_SERVER
[
'REMOTE_ADDR'
],
$user
->
uid
,
session_id
(),
timer_read
(
'page'
),
time
());
}
}
...
...
modules/statistics/statistics.module
View file @
d43655c9
...
...
@@ -74,7 +74,7 @@ function statistics_exit() {
}
if
((
variable_get
(
'statistics_enable_access_log'
,
0
))
&&
(
module_invoke
(
'throttle'
,
'status'
)
==
0
))
{
// Log this page access.
db_query
(
"INSERT INTO
{
accesslog
}
(title, path, url, hostname, uid, timer, timestamp) values('%s', '%s', '%s', '%s', %d, %d, %d)"
,
drupal_get_title
(),
$_GET
[
'q'
],
referer_uri
(),
$_SERVER
[
'REMOTE_ADDR'
],
$user
->
uid
,
timer_read
(
'page'
),
time
());
db_query
(
"INSERT INTO
{
accesslog
}
(title, path, url, hostname, uid,
sid,
timer, timestamp) values('%s', '%s', '%s', '%s', %d,
'%s',
%d, %d)"
,
drupal_get_title
(),
$_GET
[
'q'
],
referer_uri
(),
$_SERVER
[
'REMOTE_ADDR'
],
$user
->
uid
,
session_id
(),
timer_read
(
'page'
),
time
());
}
}
...
...
Write
Preview
Supports
Markdown
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