Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
ef1889e7
Commit
ef1889e7
authored
Sep 06, 2006
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collector #2185: Log username for FCGI requests.
parent
776ed785
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/ZServer/FCGIServer.py
lib/python/ZServer/FCGIServer.py
+17
-2
No files found.
doc/CHANGES.txt
View file @
ef1889e7
...
@@ -8,6 +8,8 @@ Zope Changes
...
@@ -8,6 +8,8 @@ Zope Changes
Bugs fixed
Bugs fixed
- Collector #2185: Log username for FCGI requests.
- Collector #2152: Fixed MailHost documentation; simple_send does not
- Collector #2152: Fixed MailHost documentation; simple_send does not
process or validate its arguments in any way.
process or validate its arguments in any way.
...
...
lib/python/ZServer/FCGIServer.py
View file @
ef1889e7
...
@@ -47,6 +47,7 @@ from tempfile import TemporaryFile
...
@@ -47,6 +47,7 @@ from tempfile import TemporaryFile
import
socket
,
string
,
os
,
sys
,
time
import
socket
,
string
,
os
,
sys
,
time
import
thread
import
thread
from
types
import
StringTypes
from
types
import
StringTypes
import
base64
tz_for_log
=
compute_timezone_for_log
()
tz_for_log
=
compute_timezone_for_log
()
...
@@ -455,11 +456,24 @@ class FCGIChannel(asynchat.async_chat):
...
@@ -455,11 +456,24 @@ class FCGIChannel(asynchat.async_chat):
method
=
self
.
env
[
'REQUEST_METHOD'
]
method
=
self
.
env
[
'REQUEST_METHOD'
]
else
:
else
:
method
=
"GET"
method
=
"GET"
if
self
.
env
.
has_key
(
'HTTP_AUTHORIZATION'
):
http_authorization
=
self
.
env
[
'HTTP_AUTHORIZATION'
]
if
string
.
lower
(
http_authorization
[:
6
])
==
'basic '
:
try
:
decoded
=
base64
.
decodestring
(
http_authorization
[
6
:])
except
base64
.
binascii
.
Error
:
decoded
=
''
t
=
string
.
split
(
decoded
,
':'
,
1
)
if
len
(
t
)
<
2
:
user_name
=
'-'
else
:
user_name
=
t
[
0
]
else
:
user_name
=
'-'
if
self
.
addr
:
if
self
.
addr
:
self
.
server
.
logger
.
log
(
self
.
server
.
logger
.
log
(
self
.
addr
[
0
],
self
.
addr
[
0
],
'%s -
-
[%s] "%s %s" %d %d "%s" "%s"'
%
(
'%s -
%s
[%s] "%s %s" %d %d "%s" "%s"'
%
(
self
.
addr
[
1
],
self
.
addr
[
1
],
user_name
,
time
.
strftime
(
time
.
strftime
(
'%d/%b/%Y:%H:%M:%S '
,
'%d/%b/%Y:%H:%M:%S '
,
time
.
localtime
(
time
.
time
())
time
.
localtime
(
time
.
time
())
...
@@ -471,7 +485,8 @@ class FCGIChannel(asynchat.async_chat):
...
@@ -471,7 +485,8 @@ class FCGIChannel(asynchat.async_chat):
else
:
else
:
self
.
server
.
logger
.
log
(
self
.
server
.
logger
.
log
(
'127.0.0.1 '
,
'127.0.0.1 '
,
'- - [%s] "%s %s" %d %d "%s" "%s"'
%
(
'- %s [%s] "%s %s" %d %d "%s" "%s"'
%
(
user_name
,
time
.
strftime
(
time
.
strftime
(
'%d/%b/%Y:%H:%M:%S '
,
'%d/%b/%Y:%H:%M:%S '
,
time
.
localtime
(
time
.
time
())
time
.
localtime
(
time
.
time
())
...
...
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