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
c4016749
Commit
c4016749
authored
Feb 15, 2002
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge fixes from Zope-2_5-branch
parent
bcb5c442
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
27 deletions
+24
-27
lib/python/Products/SiteAccess/VirtualHostMonster.py
lib/python/Products/SiteAccess/VirtualHostMonster.py
+24
-27
No files found.
lib/python/Products/SiteAccess/VirtualHostMonster.py
View file @
c4016749
...
...
@@ -50,41 +50,39 @@ class VirtualHostMonster(Persistent, Item, Implicit):
except
:
raise
'LineError'
,
'Needs a slash between host and path'
pp
=
filter
(
None
,
split
(
path
,
'/'
))
if
not
pp
:
raise
'LineError'
,
'Empty path'
obpath
=
pp
[:]
if
obpath
[
0
]
==
'VirtualHostBase'
:
obpath
=
obpath
[
3
:]
if
'VirtualHostRoot'
in
obpath
:
i1
=
obpath
.
index
(
'VirtualHostRoot'
)
i2
=
i1
+
1
while
i2
<
len
(
obpath
)
and
obpath
[
i2
][:
4
]
==
'_vh_'
:
i2
=
i2
+
1
del
obpath
[
i1
:
i2
]
try
:
ob
=
self
.
unrestrictedTraverse
(
obpath
)
except
:
raise
'LineError'
,
'Path not found'
if
not
getattr
(
ob
.
aq_base
,
'isAnObjectManager'
,
0
):
raise
'LineError'
,
'Path must lead to an Object Manager'
if
pp
:
obpath
=
pp
[:]
if
obpath
[
0
]
==
'VirtualHostBase'
:
obpath
=
obpath
[
3
:]
if
'VirtualHostRoot'
in
obpath
:
i1
=
obpath
.
index
(
'VirtualHostRoot'
)
i2
=
i1
+
1
while
i2
<
len
(
obpath
)
and
obpath
[
i2
][:
4
]
==
'_vh_'
:
i2
=
i2
+
1
del
obpath
[
i1
:
i2
]
try
:
ob
=
self
.
unrestrictedTraverse
(
obpath
)
except
:
raise
'LineError'
,
'Path not found'
if
not
getattr
(
ob
.
aq_base
,
'isAnObjectManager'
,
0
):
raise
'LineError'
,
(
'Path must lead to '
'an Object Manager'
)
if
'VirtualHostRoot'
not
in
pp
:
pp
.
append
(
'/'
)
pp
.
reverse
()
try
:
int
(
replace
(
host
,
'.'
,
''
))
raise
'LineError'
,
'IP addresses are not mappable'
except
ValueError
:
pass
if
'VirtualHostRoot'
not
in
pp
:
pp
.
append
(
'/'
)
pp
.
reverse
()
if
host
[:
2
]
==
'*.'
:
host_map
=
sub_map
host
=
host
[
2
:]
else
:
host_map
=
fixed_map
if
not
host_map
.
has_key
(
host
):
host_map
[
host
]
=
{}
hostname
,
port
=
(
split
(
host
,
':'
,
1
)
+
[
None
])[:
2
]
if
not
host_map
.
has_key
(
hostname
):
host_map
[
hostname
]
=
{}
host_map
[
hostname
][
port
]
=
pp
except
'LineError'
,
msg
:
line
=
'%s #! %s'
%
(
line
,
msg
)
...
...
@@ -160,8 +158,7 @@ class VirtualHostMonster(Persistent, Item, Implicit):
# If the directive is on top of the stack, go ahead
# and process it right away.
if
at_end
:
if
pp
==
[
''
]
or
pp
==
[
''
,
''
]:
pp
=
[]
pp
=
filter
(
None
,
pp
)
request
.
setVirtualRoot
(
pp
)
del
stack
[
-
2
:]
break
...
...
@@ -187,7 +184,7 @@ class VirtualHostMonster(Persistent, Item, Implicit):
hostname
=
split
(
hostname
,
'.'
,
1
)[
1
]
if
ports
:
pp
=
ports
.
get
(
port
,
0
)
if
not
pp
and
port
is
not
None
:
if
pp
==
0
and
port
is
not
None
:
# Try default port
pp
=
ports
.
get
(
None
,
0
)
if
not
pp
:
...
...
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