Commit 19985ee3 authored by matt@zope.com's avatar matt@zope.com

Update SessionDataManager to use a request session name vs the fixed 'SESSION',

remove 'on' button from browser ID manager.
parent e7f290b0
...@@ -103,10 +103,10 @@ constructSessionDataManagerForm = Globals.DTMLFile('dtml/addDataManager', ...@@ -103,10 +103,10 @@ constructSessionDataManagerForm = Globals.DTMLFile('dtml/addDataManager',
ADD_SESSION_DATAMANAGER_PERM="Add Session Data Manager" ADD_SESSION_DATAMANAGER_PERM="Add Session Data Manager"
def constructSessionDataManager(self, id, title='', path=None, automatic=None, def constructSessionDataManager(self, id, title='', path=None, requestName=None,
REQUEST=None): REQUEST=None):
""" """ """ """
ob = SessionDataManager(id, path, title, automatic) ob = SessionDataManager(id, path, title, requestName)
self._setObject(id, ob) self._setObject(id, ob)
if REQUEST is not None: if REQUEST is not None:
return self.manage_main(self, REQUEST, update_menu=1) return self.manage_main(self, REQUEST, update_menu=1)
...@@ -177,23 +177,23 @@ class SessionDataManager(Item, Implicit, Persistent, RoleManager, Owned, Tabs): ...@@ -177,23 +177,23 @@ class SessionDataManager(Item, Implicit, Persistent, RoleManager, Owned, Tabs):
# END INTERFACE METHODS # END INTERFACE METHODS
def __init__(self, id, path=None, title='', automatic=None): def __init__(self, id, path=None, title='', requestName=None):
self.id = id self.id = id
self.setContainerPath(path) self.setContainerPath(path)
self.setTitle(title) self.setTitle(title)
if automatic: if requestName:
self._requestSessionName='SESSION' self._requestSessionName=requestName
else: else:
self._requestSessionName=None self._requestSessionName=None
security.declareProtected(CHANGE_DATAMGR_PERM, 'manage_changeSDM') security.declareProtected(CHANGE_DATAMGR_PERM, 'manage_changeSDM')
def manage_changeSDM(self, title, path=None, automatic=None, REQUEST=None): def manage_changeSDM(self, title, path=None, requestName=None, REQUEST=None):
""" """ """ """
self.setContainerPath(path) self.setContainerPath(path)
self.setTitle(title) self.setTitle(title)
if automatic: if requestName:
self.updateTraversalData('SESSION') self.updateTraversalData(requestName)
else: else:
self.updateTraversalData(None) self.updateTraversalData(None)
if REQUEST is not None: if REQUEST is not None:
...@@ -273,11 +273,10 @@ class SessionDataManager(Item, Implicit, Persistent, RoleManager, Owned, Tabs): ...@@ -273,11 +273,10 @@ class SessionDataManager(Item, Implicit, Persistent, RoleManager, Owned, Tabs):
string.join(self.obpath,'/') string.join(self.obpath,'/')
) )
security.declareProtected(MGMT_SCREEN_PERM, 'getAutomatic') security.declareProtected(MGMT_SCREEN_PERM, 'getrequestName')
def getAutomatic(self): def getrequestName(self):
""" """ """ """
if hasattr(self,'_hasTraversalHook'): return 1 return self._requestSessionName or ''
return 0
def manage_afterAdd(self, item, container): def manage_afterAdd(self, item, container):
""" Add our traversal hook """ """ Add our traversal hook """
......
...@@ -46,18 +46,19 @@ user obtained from a Transient Object Container. ...@@ -46,18 +46,19 @@ user obtained from a Transient Object Container.
<div class="form-help">e.g. '/temp_folder/transient_container'.</div> <div class="form-help">e.g. '/temp_folder/transient_container'.</div>
</TD> </TD>
<TD ALIGN="LEFT" VALIGN="TOP"> <TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="path" SIZE="60" value="/temp_folder/transient_container"> <INPUT TYPE="TEXT" NAME="path" SIZE="60" value="">
</TD> </TD>
</TR> </TR>
<tr> <tr>
<td align="LEFT" valign="TOP"> <td align="LEFT" valign="TOP">
<div class="form-label"> <div class="form-label">
Automatic SESSION placement in REQUEST object Place SESSION in REQUEST object as
</div> </div>
</td> </td>
<td align="LEFT" valign="TOP"> <td align="LEFT" valign="TOP">
<input class="form-element" type='CHECKBOX' name='automatic' CHECKED> <input class="form-element" type="TEXT" name="requestName"
value="SESSION">
</td> </td>
</tr> </tr>
......
...@@ -35,15 +35,12 @@ ...@@ -35,15 +35,12 @@
<tr> <tr>
<td align="LEFT" valign="TOP"> <td align="LEFT" valign="TOP">
<div class="form-label"> <div class="form-label">
Automatic SESSION placement in REQUEST object Place SESSION in REQUEST object as
</div> </div>
</td> </td>
<td align="LEFT" valign="TOP"> <td align="LEFT" valign="TOP">
<dtml-if getAutomatic> <input class="form-element" type="TEXT" name="requestName"
<input class="form-element" type='CHECKBOX' name='automatic' CHECKED> value="&dtml-getrequestName;">
<dtml-else>
<input class="form-element" type='CHECKBOX' name='automatic'>
</dtml-if>
</td> </td>
</tr> </tr>
<tr> <tr>
......
...@@ -13,10 +13,13 @@ ...@@ -13,10 +13,13 @@
Browser Id Mgr On Browser Id Mgr On
</div> </div>
</TD> </TD>
<dtml-comment>
<TD ALIGN="LEFT" VALIGN="TOP"> <TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="checkbox" NAME="on" <INPUT TYPE="checkbox" NAME="on"
<dtml-if isOn>CHECKED</dtml-if>> <dtml-if isOn>CHECKED</dtml-if>>
</TD> </TD>
</dtml-comment>
<input type="hidden" name="on" value="1">
</TR> </TR>
<TR> <TR>
<TD ALIGN="LEFT" VALIGN="TOP"> <TD ALIGN="LEFT" VALIGN="TOP">
......
...@@ -77,12 +77,7 @@ Browser Id Manager - Add ...@@ -77,12 +77,7 @@ Browser Id Manager - Add
button to instantiate a browser id manager. button to instantiate a browser id manager.
You can manage a browser id manager by visiting it in the You can manage a browser id manager by visiting it in the
management interface. In addition to adjusting the settings you management interface.
chose at add-time, you can additionally turn a browser id
manager "off" via this management interface, which will cause
session data managers to ignore it when attempting to acquire a
browser id manager. Session data managers will instead acquire
a browser id manager nearer the root of the ZODB.
Instantiating Multiple Browser Id Managers (Optional) Instantiating Multiple Browser Id Managers (Optional)
......
...@@ -2,9 +2,6 @@ Browser Id Manager - Change ...@@ -2,9 +2,6 @@ Browser Id Manager - Change
Form options available are: Form options available are:
browser id mgr on -- check to activate this Browser Id Manager,
uncheck to disable it.
title -- the browser id manager title. title -- the browser id manager title.
session token key -- the cookie name and/or form variable name session token key -- the cookie name and/or form variable name
......
...@@ -26,10 +26,9 @@ Session Data Manager - Add ...@@ -26,10 +26,9 @@ Session Data Manager - Add
store the actual session data. This path is store the actual session data. This path is
/temp_folder/transient_container in a default Zope installation. /temp_folder/transient_container in a default Zope installation.
automatic SESSION placement in REQUEST object -- place SESSION in REQUEST as --
check this option to have a SESSION object automatically If set, the REQUEST variable will be updated with the session
inserted into the REQUEST object, corresponding to the object, stored as the given name (default is 'SESSION')
current browser's session.
After reviewing and changing these options, click the "Add" After reviewing and changing these options, click the "Add"
button to instantiate a session data manager. button to instantiate a session data manager.
......
...@@ -9,10 +9,9 @@ Session Data Manager - Change ...@@ -9,10 +9,9 @@ Session Data Manager - Change
store the actual session data. This path is store the actual session data. This path is
/temp_folder/transient_container in a default Zope installation. /temp_folder/transient_container in a default Zope installation.
automatic SESSION placement in REQUEST object -- place SESSION in REQUEST as --
check this option to have a SESSION object automatically If set, the REQUEST variable will be updated with the session
inserted into the REQUEST object, corresponding to the object, stored as the given name (default is 'SESSION')
current browser's session.
After reviewing and changing these options, click the "Change" After reviewing and changing these options, click the "Change"
button to change the session data manager. button to change the session data manager.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment