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
471dd19c
Commit
471dd19c
authored
Dec 31, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Brians changes.
parent
1fddf7a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
44 deletions
+40
-44
lib/python/Products/OFSP/Session.py
lib/python/Products/OFSP/Session.py
+20
-22
lib/python/Products/OFSP/Version.py
lib/python/Products/OFSP/Version.py
+20
-22
No files found.
lib/python/Products/OFSP/Session.py
View file @
471dd19c
...
@@ -12,15 +12,13 @@ __doc__='''A drop-in object that represents a session.
...
@@ -12,15 +12,13 @@ __doc__='''A drop-in object that represents a session.
$Id: Session.py,v 1.1
0 1997/12/31 17:17:04 brian
Exp $'''
$Id: Session.py,v 1.1
1 1997/12/31 19:34:57 jim
Exp $'''
import
time
,
OFS
.
SimpleItem
,
AccessControl
.
Role
import
time
,
OFS
.
SimpleItem
,
AccessControl
.
Role
import
Persistence
,
Acquisition
,
Globals
import
Persistence
,
Acquisition
,
Globals
from
string
import
rfind
from
string
import
rfind
_addForm
=
Globals
.
HTMLFile
(
'sessionAdd'
,
globals
())
addForm
=
Globals
.
HTMLFile
(
'sessionAdd'
,
globals
())
def
addForm
(
realself
,
self
,
REQUEST
,
**
ignored
):
return
_addForm
(
self
,
REQUEST
)
def
add
(
self
,
id
,
title
,
REQUEST
=
None
):
def
add
(
self
,
id
,
title
,
REQUEST
=
None
):
'Add a session'
'Add a session'
...
@@ -32,14 +30,14 @@ def add(self, id, title, REQUEST=None):
...
@@ -32,14 +30,14 @@ def add(self, id, title, REQUEST=None):
class
Session
(
Persistence
.
Persistent
,
class
Session
(
Persistence
.
Persistent
,
AccessControl
.
Role
.
RoleManager
,
AccessControl
.
Role
.
RoleManager
,
OFS
.
SimpleItem
.
Item
,
SimpleItem
.
Item
,
Acquisition
.
Implicit
):
Acquisition
.
Implicit
):
'''Model sessions as drop-in objects
'''Model sessions as drop-in objects
'''
'''
meta_type
=
'Session'
meta_type
=
'Session'
icon
=
'session'
icon
=
'
misc_/OFSP/
session'
manage_options
=
({
'icon'
:
''
,
'label'
:
'Join/Leave'
,
manage_options
=
({
'icon'
:
''
,
'label'
:
'Join/Leave'
,
'action'
:
'manage_main'
,
'target'
:
'manage_main'
,
'action'
:
'manage_main'
,
'target'
:
'manage_main'
,
...
@@ -74,8 +72,8 @@ class Session(Persistence.Persistent,
...
@@ -74,8 +72,8 @@ class Session(Persistence.Persistent,
if
l
>=
0
:
cookie
=
cookie
[:
l
]
if
l
>=
0
:
cookie
=
cookie
[:
l
]
self
.
cookie
=
"%s/%s"
%
(
cookie
,
id
)
self
.
cookie
=
"%s/%s"
%
(
cookie
,
id
)
manage
=
manage_main
=
Globals
.
HTMLFile
(
'session
Edit
'
,
globals
())
manage
=
manage_main
=
Globals
.
HTMLFile
(
'session'
,
globals
())
index_html
=
Globals
.
HTMLFile
(
'session
'
,
globals
())
manage_properties
=
Globals
.
HTMLFile
(
'sessionEdit
'
,
globals
())
def
title_and_id
(
self
):
def
title_and_id
(
self
):
r
=
Session
.
inheritedAttribute
(
'title_and_id'
)(
self
)
r
=
Session
.
inheritedAttribute
(
'title_and_id'
)(
self
)
...
@@ -84,18 +82,17 @@ class Session(Persistence.Persistent,
...
@@ -84,18 +82,17 @@ class Session(Persistence.Persistent,
def
manage_edit
(
self
,
title
,
REQUEST
=
None
):
def
manage_edit
(
self
,
title
,
REQUEST
=
None
):
'Modify a session'
'Modify a session'
self
.
title
=
title
self
.
title
=
title
if
REQUEST
is
not
None
:
return
self
.
manage_editedDialog
(
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_editedDialog
(
REQUEST
)
def
enter
(
self
,
REQUEST
,
RESPONSE
):
def
enter
(
self
,
REQUEST
,
RESPONSE
):
'Begin working in a session'
'Begin working in a session'
RESPONSE
.
setCookie
(
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
self
.
cookie
,
Globals
.
SessionNameName
,
self
.
cookie
,
expires
=
"Mon, 27-Dec-99 23:59:59 GMT"
,
#
expires="Mon, 27-Dec-99 23:59:59 GMT",
path
=
REQUEST
[
'SCRIPT_NAME'
],
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
)
REQUEST
[
Globals
.
SessionNameName
]
=
self
.
cookie
return
RESPONSE
.
redirect
(
REQUEST
[
'URL1'
]
+
'/manage_main'
)
return
self
.
index_html
(
self
,
REQUEST
)
def
leave
(
self
,
REQUEST
,
RESPONSE
):
def
leave
(
self
,
REQUEST
,
RESPONSE
):
'Temporarily stop working in a session'
'Temporarily stop working in a session'
...
@@ -104,28 +101,26 @@ class Session(Persistence.Persistent,
...
@@ -104,28 +101,26 @@ class Session(Persistence.Persistent,
expires
=
"Mon, 27-Aug-84 23:59:59 GMT"
,
expires
=
"Mon, 27-Aug-84 23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
)
REQUEST
[
Globals
.
SessionNameName
]
=
''
return
RESPONSE
.
redirect
(
REQUEST
[
'URL1'
]
+
'/manage_main'
)
return
self
.
index_html
(
self
,
REQUEST
)
def
leave_another
(
self
,
REQUEST
,
RESPONSE
):
def
leave_another
(
self
,
REQUEST
,
RESPONSE
):
'Leave a session that may not be the current session'
'Leave a session that may not be the current session'
self
.
leave
(
REQUEST
,
RESPONSE
)
return
self
.
leave
(
REQUEST
,
RESPONSE
)
RESPONSE
.
setStatus
(
302
)
RESPONSE
[
'Location'
]
=
REQUEST
[
'URL2'
]
+
'/manage_main'
def
save
(
self
,
remark
,
REQUEST
):
def
save
(
self
,
remark
,
REQUEST
=
None
):
'Make session changes permanent'
'Make session changes permanent'
Globals
.
SessionBase
[
self
.
cookie
].
commit
(
remark
)
Globals
.
SessionBase
[
self
.
cookie
].
commit
(
remark
)
if
REQUEST
is
not
None
:
return
self
.
index_html
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
discard
(
self
,
REQUEST
):
def
discard
(
self
,
REQUEST
=
None
):
'Discard changes made during the session'
'Discard changes made during the session'
Globals
.
SessionBase
[
self
.
cookie
].
abort
()
Globals
.
SessionBase
[
self
.
cookie
].
abort
()
if
REQUEST
is
not
None
:
return
self
.
index_html
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
...
@@ -133,6 +128,9 @@ __version__='$Revision: 1.10 $'[11:-2]
...
@@ -133,6 +128,9 @@ __version__='$Revision: 1.10 $'[11:-2]
##############################################################################
##############################################################################
#
#
# $Log: Session.py,v $
# $Log: Session.py,v $
# Revision 1.11 1997/12/31 19:34:57 jim
# Brians changes.
#
# Revision 1.10 1997/12/31 17:17:04 brian
# Revision 1.10 1997/12/31 17:17:04 brian
# Security update
# Security update
#
#
...
...
lib/python/Products/OFSP/Version.py
View file @
471dd19c
...
@@ -12,15 +12,13 @@ __doc__='''A drop-in object that represents a session.
...
@@ -12,15 +12,13 @@ __doc__='''A drop-in object that represents a session.
$Id: Version.py,v 1.1
0 1997/12/31 17:17:04 brian
Exp $'''
$Id: Version.py,v 1.1
1 1997/12/31 19:34:57 jim
Exp $'''
import
time
,
OFS
.
SimpleItem
,
AccessControl
.
Role
import
time
,
OFS
.
SimpleItem
,
AccessControl
.
Role
import
Persistence
,
Acquisition
,
Globals
import
Persistence
,
Acquisition
,
Globals
from
string
import
rfind
from
string
import
rfind
_addForm
=
Globals
.
HTMLFile
(
'sessionAdd'
,
globals
())
addForm
=
Globals
.
HTMLFile
(
'sessionAdd'
,
globals
())
def
addForm
(
realself
,
self
,
REQUEST
,
**
ignored
):
return
_addForm
(
self
,
REQUEST
)
def
add
(
self
,
id
,
title
,
REQUEST
=
None
):
def
add
(
self
,
id
,
title
,
REQUEST
=
None
):
'Add a session'
'Add a session'
...
@@ -32,14 +30,14 @@ def add(self, id, title, REQUEST=None):
...
@@ -32,14 +30,14 @@ def add(self, id, title, REQUEST=None):
class
Session
(
Persistence
.
Persistent
,
class
Session
(
Persistence
.
Persistent
,
AccessControl
.
Role
.
RoleManager
,
AccessControl
.
Role
.
RoleManager
,
OFS
.
SimpleItem
.
Item
,
SimpleItem
.
Item
,
Acquisition
.
Implicit
):
Acquisition
.
Implicit
):
'''Model sessions as drop-in objects
'''Model sessions as drop-in objects
'''
'''
meta_type
=
'Session'
meta_type
=
'Session'
icon
=
'session'
icon
=
'
misc_/OFSP/
session'
manage_options
=
({
'icon'
:
''
,
'label'
:
'Join/Leave'
,
manage_options
=
({
'icon'
:
''
,
'label'
:
'Join/Leave'
,
'action'
:
'manage_main'
,
'target'
:
'manage_main'
,
'action'
:
'manage_main'
,
'target'
:
'manage_main'
,
...
@@ -74,8 +72,8 @@ class Session(Persistence.Persistent,
...
@@ -74,8 +72,8 @@ class Session(Persistence.Persistent,
if
l
>=
0
:
cookie
=
cookie
[:
l
]
if
l
>=
0
:
cookie
=
cookie
[:
l
]
self
.
cookie
=
"%s/%s"
%
(
cookie
,
id
)
self
.
cookie
=
"%s/%s"
%
(
cookie
,
id
)
manage
=
manage_main
=
Globals
.
HTMLFile
(
'session
Edit
'
,
globals
())
manage
=
manage_main
=
Globals
.
HTMLFile
(
'session'
,
globals
())
index_html
=
Globals
.
HTMLFile
(
'session
'
,
globals
())
manage_properties
=
Globals
.
HTMLFile
(
'sessionEdit
'
,
globals
())
def
title_and_id
(
self
):
def
title_and_id
(
self
):
r
=
Session
.
inheritedAttribute
(
'title_and_id'
)(
self
)
r
=
Session
.
inheritedAttribute
(
'title_and_id'
)(
self
)
...
@@ -84,18 +82,17 @@ class Session(Persistence.Persistent,
...
@@ -84,18 +82,17 @@ class Session(Persistence.Persistent,
def
manage_edit
(
self
,
title
,
REQUEST
=
None
):
def
manage_edit
(
self
,
title
,
REQUEST
=
None
):
'Modify a session'
'Modify a session'
self
.
title
=
title
self
.
title
=
title
if
REQUEST
is
not
None
:
return
self
.
manage_editedDialog
(
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_editedDialog
(
REQUEST
)
def
enter
(
self
,
REQUEST
,
RESPONSE
):
def
enter
(
self
,
REQUEST
,
RESPONSE
):
'Begin working in a session'
'Begin working in a session'
RESPONSE
.
setCookie
(
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
self
.
cookie
,
Globals
.
SessionNameName
,
self
.
cookie
,
expires
=
"Mon, 27-Dec-99 23:59:59 GMT"
,
#
expires="Mon, 27-Dec-99 23:59:59 GMT",
path
=
REQUEST
[
'SCRIPT_NAME'
],
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
)
REQUEST
[
Globals
.
SessionNameName
]
=
self
.
cookie
return
RESPONSE
.
redirect
(
REQUEST
[
'URL1'
]
+
'/manage_main'
)
return
self
.
index_html
(
self
,
REQUEST
)
def
leave
(
self
,
REQUEST
,
RESPONSE
):
def
leave
(
self
,
REQUEST
,
RESPONSE
):
'Temporarily stop working in a session'
'Temporarily stop working in a session'
...
@@ -104,28 +101,26 @@ class Session(Persistence.Persistent,
...
@@ -104,28 +101,26 @@ class Session(Persistence.Persistent,
expires
=
"Mon, 27-Aug-84 23:59:59 GMT"
,
expires
=
"Mon, 27-Aug-84 23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
)
REQUEST
[
Globals
.
SessionNameName
]
=
''
return
RESPONSE
.
redirect
(
REQUEST
[
'URL1'
]
+
'/manage_main'
)
return
self
.
index_html
(
self
,
REQUEST
)
def
leave_another
(
self
,
REQUEST
,
RESPONSE
):
def
leave_another
(
self
,
REQUEST
,
RESPONSE
):
'Leave a session that may not be the current session'
'Leave a session that may not be the current session'
self
.
leave
(
REQUEST
,
RESPONSE
)
return
self
.
leave
(
REQUEST
,
RESPONSE
)
RESPONSE
.
setStatus
(
302
)
RESPONSE
[
'Location'
]
=
REQUEST
[
'URL2'
]
+
'/manage_main'
def
save
(
self
,
remark
,
REQUEST
):
def
save
(
self
,
remark
,
REQUEST
=
None
):
'Make session changes permanent'
'Make session changes permanent'
Globals
.
SessionBase
[
self
.
cookie
].
commit
(
remark
)
Globals
.
SessionBase
[
self
.
cookie
].
commit
(
remark
)
if
REQUEST
is
not
None
:
return
self
.
index_html
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
discard
(
self
,
REQUEST
):
def
discard
(
self
,
REQUEST
=
None
):
'Discard changes made during the session'
'Discard changes made during the session'
Globals
.
SessionBase
[
self
.
cookie
].
abort
()
Globals
.
SessionBase
[
self
.
cookie
].
abort
()
if
REQUEST
is
not
None
:
return
self
.
index_html
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
...
@@ -133,6 +128,9 @@ __version__='$Revision: 1.10 $'[11:-2]
...
@@ -133,6 +128,9 @@ __version__='$Revision: 1.10 $'[11:-2]
##############################################################################
##############################################################################
#
#
# $Log: Version.py,v $
# $Log: Version.py,v $
# Revision 1.11 1997/12/31 19:34:57 jim
# Brians changes.
#
# Revision 1.10 1997/12/31 17:17:04 brian
# Revision 1.10 1997/12/31 17:17:04 brian
# Security update
# Security update
#
#
...
...
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