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
d9bdcd42
Commit
d9bdcd42
authored
Jul 20, 1999
by
Christopher Petrilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for multiple authentication types, encoded via the standard
LDAP rules.
parent
998d1ae9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
lib/python/AccessControl/User.py
lib/python/AccessControl/User.py
+24
-7
No files found.
lib/python/AccessControl/User.py
View file @
d9bdcd42
...
...
@@ -84,9 +84,9 @@
##############################################################################
"""Access control package"""
__version__
=
'$Revision: 1.8
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.8
6
$'
[
11
:
-
2
]
import
Globals
,
App
.
Undo
,
socket
,
regex
import
Globals
,
App
.
Undo
,
socket
,
regex
,
binascii
,
sha
from
Globals
import
HTMLFile
,
MessageDialog
,
Persistent
,
PersistentMapping
from
string
import
join
,
strip
,
split
,
lower
from
App.Management
import
Navigation
,
Tabs
...
...
@@ -95,9 +95,15 @@ from OFS.SimpleItem import Item
from
base64
import
decodestring
from
App.ImageFile
import
ImageFile
from
Role
import
RoleManager
from
string
import
split
,
join
from
string
import
split
,
join
,
upper
from
PermissionRole
import
_what_not_even_god_should_do
,
rolesForPermissionOn
# Bogosity on various platforms due to ITAR restrictions
try
:
import
crypt
except
ImportError
:
crypt
=
None
ListType
=
type
([])
...
...
@@ -161,12 +167,23 @@ class BasicUser(Implicit):
# ------------------------------
def
authenticate
(
self
,
password
,
request
):
domains
=
self
.
getDomains
()
passwrd
=
self
.
_getPassword
()
result
=
0
if
upper
(
passwrd
[:
5
])
==
'{SHA}'
:
password
=
binascii
.
b2a_base64
(
sha
.
new
(
password
).
digest
())[:
-
1
]
result
=
passwrd
[
5
:]
==
password
elif
upper
(
passwrd
[:
7
])
==
'{CRYPT}'
and
crypt
is
not
None
:
#if crypt is None, it's not compiled in and everything will fail
password
=
crypt
(
password
,
passwrd
[
7
:
9
])
result
=
passwrd
[
7
:]
==
password
else
:
result
=
passwrd
==
password
domains
=
self
.
getDomains
()
if
domains
:
return
(
password
==
passwrd
)
and
domainSpecMatch
(
domains
,
request
)
return
password
==
passwrd
return
result
and
domainSpecMatch
(
domains
,
request
)
return
result
def
_shared_roles
(
self
,
parent
):
r
=
[]
while
1
:
...
...
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