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
5e61e187
Commit
5e61e187
authored
Mar 18, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added REMOTE_USER support
parent
a9f73592
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
5 deletions
+48
-5
lib/python/AccessControl/User.py
lib/python/AccessControl/User.py
+33
-3
lib/python/AccessControl/addUser.dtml
lib/python/AccessControl/addUser.dtml
+10
-2
lib/python/AccessControl/editUser.dtml
lib/python/AccessControl/editUser.dtml
+5
-0
No files found.
lib/python/AccessControl/User.py
View file @
5e61e187
"""Access control package"""
__version__
=
'$Revision: 1.4
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
3
$'
[
11
:
-
2
]
from
PersistentMapping
import
PersistentMapping
...
...
@@ -52,10 +52,12 @@ class User(Implicit, Persistent):
def
__str__
(
self
):
return
self
.
name
__repr__
=
__str__
_remote_user_mode
=
0
try
:
f
=
open
(
'%s/access'
%
SOFTWARE_HOME
,
'r'
)
data
=
split
(
strip
(
f
.
readline
()),
':'
)
f
.
close
()
_remote_user_mode
=
not
data
[
1
]
super
=
User
(
data
[
0
],
data
[
1
],(
'manage'
,))
del
data
except
:
...
...
@@ -147,8 +149,10 @@ class UserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
return
None
_mainUser
=
HTMLFile
(
'mainUser'
,
globals
())
_add_User
=
HTMLFile
(
'addUser'
,
globals
())
_editUser
=
HTMLFile
(
'editUser'
,
globals
())
_add_User
=
HTMLFile
(
'addUser'
,
globals
(),
remote_user_mode__
=
_remote_user_mode
)
_editUser
=
HTMLFile
(
'editUser'
,
globals
(),
remote_user_mode__
=
_remote_user_mode
)
manage
=
manage_main
=
_mainUser
...
...
@@ -272,6 +276,32 @@ class UserFolder(Implicit, Persistent, Navigation, Tabs, RoleManager,
raise
(
'Copy Error'
,
'<EM>Cannot change the id of a UserFolder</EM>'
)
if
_remote_user_mode
:
class
UserFolder
(
UserFolder
):
def
validate
(
self
,
request
,
auth
=
''
,
roles
=
None
):
parent
=
request
[
'PARENTS'
][
0
]
e
=
request
.
environ
if
e
.
has_key
(
'REMOTE_USER'
):
name
=
e
[
'REMOTE_USER'
]
else
:
if
nobody
.
hasRole
(
parent
,
roles
):
return
nobody
return
None
# Check for superuser
if
self
.
_isTop
()
and
(
name
==
super
.
name
):
return
super
# Try to get user
try
:
user
=
self
.
data
[
name
]
except
:
return
None
# Try to authorize user
if
user
.
hasRole
(
parent
,
roles
):
return
user
def
manage_addUserFolder
(
self
,
dtself
=
None
,
REQUEST
=
None
,
**
ignored
):
""" """
...
...
lib/python/AccessControl/addUser.dtml
View file @
5e61e187
...
...
@@ -5,8 +5,11 @@
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<!--#var manage_tabs-->
<P>
To add a new user, enter the name, password, confirmation and
roles for the new user and click "Add".
To add a new user, enter the name,
<!--#unless remote_user_mode__-->
password, confirmation
<!--#/unless-->
and roles for the new user and click "Add".
<FORM ACTION="manage_users" METHOD="POST">
<TABLE>
...
...
@@ -18,6 +21,10 @@ roles for the new user and click "Add".
<INPUT TYPE="TEXT" NAME="name" SIZE="20">
</TD>
</TR>
<!--#if remote_user_mode__-->
<INPUT TYPE="HIDDEN" NAME="password" value="password">
<INPUT TYPE="HIDDEN" NAME="confirm" value="password">
<!--#else-->
<TR>
<TD VALIGN="TOP">
<STRONG>Password</STRONG>
...
...
@@ -34,6 +41,7 @@ roles for the new user and click "Add".
<INPUT TYPE="PASSWORD" NAME="confirm" SIZE="20">
</TD>
</TR>
<!--#/if-->
<TR>
<TD VALIGN="TOP">
<STRONG>Roles</STRONG>
...
...
lib/python/AccessControl/editUser.dtml
View file @
5e61e187
...
...
@@ -15,6 +15,10 @@
<!--#var expr="user.name"-->
</TD>
</TR>
<!--#if remote_user_mode__-->
<INPUT TYPE="HIDDEN" NAME="password" value="<!--#var password-->">
<INPUT TYPE="HIDDEN" NAME="confirm" value="<!--#var password-->">
<!--#else-->
<TR>
<TD VALIGN="TOP">
<STRONG>Password</STRONG>
...
...
@@ -31,6 +35,7 @@
<INPUT TYPE="PASSWORD" NAME="confirm" VALUE="<!--#var password-->" SIZE="20">
</TD>
</TR>
<!--#/if-->
<TR>
<TD VALIGN="TOP">
<STRONG>Roles</STRONG>
...
...
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