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',
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):
""" """
ob = SessionDataManager(id, path, title, automatic)
ob = SessionDataManager(id, path, title, requestName)
self._setObject(id, ob)
if REQUEST is not None:
return self.manage_main(self, REQUEST, update_menu=1)
......@@ -177,23 +177,23 @@ class SessionDataManager(Item, Implicit, Persistent, RoleManager, Owned, Tabs):
# 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.setContainerPath(path)
self.setTitle(title)
if automatic:
self._requestSessionName='SESSION'
if requestName:
self._requestSessionName=requestName
else:
self._requestSessionName=None
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.setTitle(title)
if automatic:
self.updateTraversalData('SESSION')
if requestName:
self.updateTraversalData(requestName)
else:
self.updateTraversalData(None)
if REQUEST is not None:
......@@ -273,11 +273,10 @@ class SessionDataManager(Item, Implicit, Persistent, RoleManager, Owned, Tabs):
string.join(self.obpath,'/')
)
security.declareProtected(MGMT_SCREEN_PERM, 'getAutomatic')
def getAutomatic(self):
security.declareProtected(MGMT_SCREEN_PERM, 'getrequestName')
def getrequestName(self):
""" """
if hasattr(self,'_hasTraversalHook'): return 1
return 0
return self._requestSessionName or ''
def manage_afterAdd(self, item, container):
""" Add our traversal hook """
......
......@@ -46,18 +46,19 @@ user obtained from a Transient Object Container.
<div class="form-help">e.g. '/temp_folder/transient_container'.</div>
</TD>
<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>
</TR>
<tr>
<td align="LEFT" valign="TOP">
<div class="form-label">
Automatic SESSION placement in REQUEST object
Place SESSION in REQUEST object as
</div>
</td>
<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>
</tr>
......
......@@ -35,15 +35,12 @@
<tr>
<td align="LEFT" valign="TOP">
<div class="form-label">
Automatic SESSION placement in REQUEST object
Place SESSION in REQUEST object as
</div>
</td>
<td align="LEFT" valign="TOP">
<dtml-if getAutomatic>
<input class="form-element" type='CHECKBOX' name='automatic' CHECKED>
<dtml-else>
<input class="form-element" type='CHECKBOX' name='automatic'>
</dtml-if>
<input class="form-element" type="TEXT" name="requestName"
value="&dtml-getrequestName;">
</td>
</tr>
<tr>
......
......@@ -13,10 +13,13 @@
Browser Id Mgr On
</div>
</TD>
<dtml-comment>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="checkbox" NAME="on"
<dtml-if isOn>CHECKED</dtml-if>>
</TD>
</dtml-comment>
<input type="hidden" name="on" value="1">
</TR>
<TR>
<TD ALIGN="LEFT" VALIGN="TOP">
......
......@@ -77,12 +77,7 @@ Browser Id Manager - Add
button to instantiate a browser id manager.
You can manage a browser id manager by visiting it in the
management interface. In addition to adjusting the settings you
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.
management interface.
Instantiating Multiple Browser Id Managers (Optional)
......
......@@ -2,9 +2,6 @@ Browser Id Manager - Change
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.
session token key -- the cookie name and/or form variable name
......
......@@ -26,10 +26,9 @@ Session Data Manager - Add
store the actual session data. This path is
/temp_folder/transient_container in a default Zope installation.
automatic SESSION placement in REQUEST object --
check this option to have a SESSION object automatically
inserted into the REQUEST object, corresponding to the
current browser's session.
place SESSION in REQUEST as --
If set, the REQUEST variable will be updated with the session
object, stored as the given name (default is 'SESSION')
After reviewing and changing these options, click the "Add"
button to instantiate a session data manager.
......
......@@ -9,10 +9,9 @@ Session Data Manager - Change
store the actual session data. This path is
/temp_folder/transient_container in a default Zope installation.
automatic SESSION placement in REQUEST object --
check this option to have a SESSION object automatically
inserted into the REQUEST object, corresponding to the
current browser's session.
place SESSION in REQUEST as --
If set, the REQUEST variable will be updated with the session
object, stored as the given name (default is 'SESSION')
After reviewing and changing these options, click the "Change"
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