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
d02eb129
Commit
d02eb129
authored
Apr 08, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now check security of items, and new skip_unauthorized attr.
parent
c192c285
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
lib/python/DocumentTemplate/DT_In.py
lib/python/DocumentTemplate/DT_In.py
+30
-2
No files found.
lib/python/DocumentTemplate/DT_In.py
View file @
d02eb129
...
...
@@ -296,7 +296,7 @@
'''
#'
__rcs_id__
=
'$Id: DT_In.py,v 1.2
3 1998/04/02 17:37:36
jim Exp $'
__rcs_id__
=
'$Id: DT_In.py,v 1.2
4 1998/04/08 17:45:59
jim Exp $'
############################################################################
# Copyright
...
...
@@ -350,7 +350,7 @@ __rcs_id__='$Id: DT_In.py,v 1.23 1998/04/02 17:37:36 jim Exp $'
# (540) 371-6909
#
############################################################################
__version__
=
'$Revision: 1.2
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
4
$'
[
11
:
-
2
]
from
DT_Util
import
*
from
string
import
find
,
atoi
,
join
...
...
@@ -378,6 +378,7 @@ class InClass:
tname
,
args
,
section
=
blocks
[
0
]
args
=
parse_params
(
args
,
name
=
''
,
start
=
'1'
,
end
=
'-1'
,
size
=
'10'
,
orphan
=
'3'
,
overlap
=
'1'
,
mapping
=
1
,
skip_unauthorized
=
1
,
previous
=
1
,
next
=
1
,
expr
=
''
,
sort
=
''
)
self
.
args
=
args
has_key
=
args
.
has_key
...
...
@@ -510,6 +511,7 @@ class InClass:
else
:
result
=
[]
append
=
result
.
append
validate
=
md
.
validate
for
index
in
range
(
first
,
end
):
if
index
==
first
and
index
>
0
:
pstart
,
pend
,
psize
=
opt
(
None
,
index
+
overlap
,
...
...
@@ -538,6 +540,17 @@ class InClass:
if
index
==
last
:
kw
[
'sequence-end'
]
=
1
client
=
sequence
[
index
]
if
validate
is
not
None
:
try
:
vv
=
validate
(
sequence
,
sequence
,
index
,
client
,
md
)
except
:
vv
=
0
if
not
vv
:
if
(
params
.
has_key
(
'skip_unauthorized'
)
and
params
[
'skip_unauthorized'
]):
if
index
==
first
:
kw
[
'sequence-start'
]
=
0
continue
raise
ValidationError
,
index
kw
[
'sequence-index'
]
=
index
if
type
(
client
)
==
TupleType
and
len
(
client
)
==
2
:
client
=
client
[
1
]
...
...
@@ -595,9 +608,21 @@ class InClass:
try
:
result
=
[]
append
=
result
.
append
validate
=
md
.
validate
for
index
in
range
(
l
):
if
index
==
last
:
kw
[
'sequence-end'
]
=
1
client
=
sequence
[
index
]
if
validate
is
not
None
:
try
:
vv
=
validate
(
sequence
,
sequence
,
index
,
client
,
md
)
except
:
vv
=
0
if
not
vv
:
if
(
self
.
args
.
has_key
(
'skip_unauthorized'
)
and
self
.
args
[
'skip_unauthorized'
]):
if
index
==
1
:
kw
[
'sequence-start'
]
=
0
continue
raise
ValidationError
,
index
kw
[
'sequence-index'
]
=
index
if
type
(
client
)
==
TupleType
and
len
(
client
)
==
2
:
client
=
client
[
1
]
...
...
@@ -665,6 +690,9 @@ def int_param(params,md,name,default=0):
############################################################################
# $Log: DT_In.py,v $
# Revision 1.24 1998/04/08 17:45:59 jim
# Now check security of items, and new skip_unauthorized attr.
#
# Revision 1.23 1998/04/02 17:37:36 jim
# Major redesign of block rendering. The code inside a block tag is
# compiled as a template but only the templates blocks are saved, and
...
...
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