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
3e611ec2
Commit
3e611ec2
authored
Jul 19, 1999
by
Amos Latteier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed FTP listing so that you cannot list or cd to an acquired directory or object.
parent
ff86bd9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
lib/python/OFS/ObjectManager.py
lib/python/OFS/ObjectManager.py
+13
-7
lib/python/OFS/SimpleItem.py
lib/python/OFS/SimpleItem.py
+12
-2
No files found.
lib/python/OFS/ObjectManager.py
View file @
3e611ec2
...
...
@@ -84,9 +84,9 @@
##############################################################################
__doc__
=
"""Object Manager
$Id: ObjectManager.py,v 1.7
7 1999/07/15 16:49:02 jim
Exp $"""
$Id: ObjectManager.py,v 1.7
8 1999/07/19 05:58:34 amos
Exp $"""
__version__
=
'$Revision: 1.7
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.7
8
$'
[
11
:
-
2
]
import
App.Management
,
Acquisition
,
App
.
Undo
,
Globals
,
CopySupport
import
os
,
App
.
FactoryDispatcher
,
ts_regex
,
Products
...
...
@@ -97,6 +97,7 @@ from webdav.Collection import Collection
from
urllib
import
quote
from
cStringIO
import
StringIO
import
marshal
import
App.Common
bad_id
=
ts_regex
.
compile
(
'[^a-zA-Z0-9-_~
\
,
\
. ]'
).
match
#TS
...
...
@@ -475,11 +476,16 @@ class ObjectManager(
def
manage_FTPlist
(
self
,
REQUEST
):
"Directory listing for FTP"
out
=
()
# check to see if we are acquiring our objectValues or not
if
len
(
REQUEST
.
PARENTS
)
>
1
and
\
self
.
objectValues
()
==
REQUEST
.
PARENTS
[
1
].
objectValues
():
raise
ValueError
,
'FTP List not supported on acquired objects'
# XXX what type of error to raise?
# check to see if we are being acquiring or not
ob
=
self
while
1
:
if
App
.
Common
.
is_acquired
(
ob
):
raise
ValueError
(
'FTP List not supported on acquired objects'
)
if
not
hasattr
(
ob
,
'aq_parent'
):
break
ob
=
ob
.
aq_parent
files
=
self
.
objectItems
()
if
not
(
hasattr
(
self
,
'isTopLevelPrincipiaApplicationObject'
)
and
self
.
isTopLevelPrincipiaApplicationObject
):
...
...
lib/python/OFS/SimpleItem.py
View file @
3e611ec2
...
...
@@ -89,8 +89,8 @@ Aqueduct database adapters, etc.
This module can also be used as a simple template for implementing new
item types.
$Id: SimpleItem.py,v 1.
59 1999/06/24 19:27:25 jim
Exp $'''
__version__
=
'$Revision: 1.
59
$'
[
11
:
-
2
]
$Id: SimpleItem.py,v 1.
60 1999/07/19 05:58:34 amos
Exp $'''
__version__
=
'$Revision: 1.
60
$'
[
11
:
-
2
]
import
regex
,
sys
,
Globals
,
App
.
Management
,
Acquisition
from
webdav.Resource
import
Resource
...
...
@@ -101,6 +101,7 @@ from string import join, lower, find, split
from
types
import
InstanceType
,
StringType
from
ComputedAttribute
import
ComputedAttribute
from
urllib
import
quote
import
App.Common
import
marshal
...
...
@@ -286,6 +287,15 @@ class Item(Base, Resource, CopySource, App.Management.Tabs):
def
manage_FTPlist
(
self
,
REQUEST
):
"""Directory listing for FTP. In the case of non-Foldoid objects,
the listing should contain one object, the object itself."""
# check to see if we are being acquiring or not
ob
=
self
while
1
:
if
App
.
Common
.
is_acquired
(
ob
):
raise
ValueError
(
'FTP List not supported on acquired objects'
)
if
not
hasattr
(
ob
,
'aq_parent'
):
break
ob
=
ob
.
aq_parent
stat
=
marshal
.
loads
(
self
.
manage_FTPstat
(
REQUEST
))
if
callable
(
self
.
id
):
id
=
self
.
id
()
else
:
id
=
self
.
id
...
...
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