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
4c42f4a9
Commit
4c42f4a9
authored
Jan 17, 2001
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged last fixes for domain auth mode from branch
parent
7de2b48f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
26 deletions
+1
-26
lib/python/AccessControl/User.py
lib/python/AccessControl/User.py
+1
-26
No files found.
lib/python/AccessControl/User.py
View file @
4c42f4a9
...
...
@@ -84,7 +84,7 @@
##############################################################################
"""Access control package"""
__version__
=
'$Revision: 1.13
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.13
5
$'
[
11
:
-
2
]
import
Globals
,
socket
,
ts_regex
,
SpecialUsers
import
os
...
...
@@ -524,7 +524,6 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
# return him as the authorized user.
if
not
auth
:
if
self
.
_domain_auth_mode
:
self
.
_lookupRemoteHostAddr
(
request
)
for
user
in
self
.
getUsers
():
if
user
.
getDomains
():
if
self
.
authenticate
(
user
.
getUserName
(),
''
,
request
):
...
...
@@ -574,7 +573,6 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
name
=
request
.
environ
.
get
(
'REMOTE_USER'
,
None
)
if
name
is
None
:
if
self
.
_domain_auth_mode
:
self
.
_lookupRemoteHostAddr
(
request
)
for
user
in
self
.
getUsers
():
if
user
.
getDomains
():
if
self
.
authenticate
(
...
...
@@ -826,29 +824,6 @@ class BasicUserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
turn this behavior on or off."""
v
=
self
.
_domain_auth_mode
=
domain_auth_mode
and
1
or
0
return
'Domain authentication mode set to %d'
%
v
def
_lookupRemoteHostAddr
(
self
,
request
):
# If no authorization, only a user with a domain spec and no
# passwd or nobody can match. We cache reverse DNS before
# checking the users, otherwise it can get real slow looking
# it up for every user.
host
=
request
.
get
(
'REMOTE_HOST'
,
''
)
addr
=
request
.
get
(
'REMOTE_ADDR'
,
''
)
if
host
or
addr
:
if
not
host
:
try
:
host
=
socket
.
gethostbyaddr
(
addr
)[
0
]
request
.
set
(
'REMOTE_HOST'
,
host
)
except
:
pass
if
not
addr
:
try
:
addr
=
socket
.
gethostbyname
(
host
)
request
.
set
(
'REMOTE_ADDR'
,
addr
)
except
:
pass
...
...
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