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
2e680cdb
Commit
2e680cdb
authored
May 02, 2011
by
Nikolay Kim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move Control_Panel out of zodb
parent
a3cc04df
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
29 deletions
+30
-29
doc/CHANGES.rst
doc/CHANGES.rst
+2
-0
src/OFS/Application.py
src/OFS/Application.py
+28
-29
No files found.
doc/CHANGES.rst
View file @
2e680cdb
...
...
@@ -55,6 +55,8 @@ Features Added
- Added `addzope2user` script, suitable for adding an admin user directly to
the root acl_users folder.
- Remove "Control panel" object from zodb.
- Updated distributions:
- AccessControl = 2.13.4
...
...
src/OFS/Application.py
View file @
2e680cdb
...
...
@@ -50,6 +50,9 @@ from misc_ import Misc_
LOG
=
getLogger
(
'Application'
)
APP_MANAGER
=
None
class
Application
(
ApplicationDefaultPermissions
,
ZDOM
.
Root
,
Folder
.
Folder
,
...
...
@@ -70,6 +73,14 @@ class Application(ApplicationDefaultPermissions,
# Create the help system object
HelpSys
=
HelpSys
(
'HelpSys'
)
manage_options
=
((
Folder
.
Folder
.
manage_options
[
0
],
Folder
.
Folder
.
manage_options
[
1
],
{
'label'
:
'Control Panel'
,
'action'
:
'Control_Panel/manage_main'
},
)
+
Folder
.
Folder
.
manage_options
[
2
:]
)
p_
=
misc_
.
p_
misc_
=
misc_
.
misc_
...
...
@@ -95,12 +106,6 @@ class Application(ApplicationDefaultPermissions,
self
.
__allow_groups__
=
uf
self
.
_setObject
(
'acl_users'
,
uf
)
# Initialize control panel
cpl
=
ApplicationManager
()
cpl
.
_init
()
self
.
_setObject
(
'Control_Panel'
,
cpl
)
transaction
.
get
().
note
(
"Created Zope Application"
)
def
id
(
self
):
try
:
return
self
.
REQUEST
[
'SCRIPT_NAME'
][
1
:]
...
...
@@ -116,6 +121,10 @@ class Application(ApplicationDefaultPermissions,
def
__class_init__
(
self
):
InitializeClass
(
self
)
@
property
def
Control_Panel
(
self
):
return
APP_MANAGER
.
__of__
(
self
)
def
PrincipiaRedirect
(
self
,
destination
,
URL1
):
"""Utility function to allow user-controlled redirects"""
if
destination
.
find
(
'//'
)
>=
0
:
...
...
@@ -125,7 +134,8 @@ class Application(ApplicationDefaultPermissions,
Redirect
=
ZopeRedirect
=
PrincipiaRedirect
def
__bobo_traverse__
(
self
,
REQUEST
,
name
=
None
):
if
name
==
'Control_Panel'
:
return
APP_MANAGER
.
__of__
(
self
)
try
:
return
getattr
(
self
,
name
)
except
AttributeError
:
...
...
@@ -279,30 +289,19 @@ class AppInitializer:
self
.
install_virtual_hosting
()
def
install_cp_and_products
(
self
):
global
APP_MANAGER
APP_MANAGER
=
ApplicationManager
()
APP_MANAGER
.
_init
()
APP_MANAGER
.
Products
=
App
.
Product
.
ProductFolder
()
app
=
self
.
getApp
()
app
.
_p_activate
()
# Ensure that Control Panel exists.
if
not
hasattr
(
app
,
'Control_Panel'
):
cpl
=
ApplicationManager
()
cpl
.
_init
()
app
.
_setObject
(
'Control_Panel'
,
cpl
)
self
.
commit
(
'Added Control_Panel'
)
else
:
# Inline migration of old databases
cp
=
app
.
Control_Panel
ids
=
[
i
[
'id'
]
for
i
in
cp
.
_objects
]
if
'Versions'
in
ids
:
new
=
[]
for
entry
in
cp
.
_objects
:
if
entry
[
'id'
]
!=
'Versions'
:
new
.
append
(
entry
)
cp
.
_objects
=
tuple
(
new
)
self
.
commit
(
'Removed Control_Panel.Versions'
)
# b/c: Ensure that a ProductFolder exists.
if
not
hasattr
(
aq_base
(
app
.
Control_Panel
),
'Products'
):
app
.
Control_Panel
.
Products
=
App
.
Product
.
ProductFolder
()
self
.
commit
(
'Added Control_Panel.Products'
)
# Remove Control Panel.
if
'Control_Panel'
in
app
.
__dict__
.
keys
():
del
app
.
__dict__
[
'Control_Panel'
]
app
.
_objects
=
tuple
(
i
for
i
in
app
.
_objects
if
i
[
'id'
]
!=
'Control_Panel'
)
self
.
commit
(
'Removed persistent Control_Panel'
)
def
install_tempfolder_and_sdc
(
self
):
app
=
self
.
getApp
()
...
...
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