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
722f78e6
Commit
722f78e6
authored
Nov 07, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
a807e859
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
519 additions
and
0 deletions
+519
-0
lib/python/OFS/Session.py
lib/python/OFS/Session.py
+112
-0
lib/python/OFS/session.dtml
lib/python/OFS/session.dtml
+61
-0
lib/python/Products/OFSP/Session.py
lib/python/Products/OFSP/Session.py
+112
-0
lib/python/Products/OFSP/Version.py
lib/python/Products/OFSP/Version.py
+112
-0
lib/python/Products/OFSP/session.dtml
lib/python/Products/OFSP/session.dtml
+61
-0
lib/python/Products/OFSP/version.dtml
lib/python/Products/OFSP/version.dtml
+61
-0
No files found.
lib/python/OFS/Session.py
0 → 100644
View file @
722f78e6
#!/bin/env python
##############################################################################
#
# Copyright
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
# Street, Suite 300, Fredericksburg, Virginia 22401 U.S.A. All
# rights reserved.
#
##############################################################################
__doc__
=
'''A drop-in object that represents a session.
$Id: Session.py,v 1.1 1997/11/07 16:13:15 jim Exp $'''
import
time
,
SimpleItem
,
AccessControl
.
Role
,
Persistence
,
Acquisition
,
Globals
from
string
import
rfind
_addForm
=
Globals
.
HTMLFile
(
'OFS/sessionAdd'
)
def
addForm
(
realself
,
self
,
REQUEST
,
**
ignored
):
return
_addForm
(
self
,
REQUEST
,
selectedRoles
=
map
(
lambda
i
:
(
'<OPTION VALUE="%s"%s>%s'
%
(
i
,
i
==
'manage'
and
' SELECTED'
or
''
,
i
))
,
self
.
validRoles
()),
aclEChecked
=
' CHECKED'
,
aclAChecked
=
''
,
aclPChecked
=
''
)
def
add
(
self
,
id
,
title
,
acl_type
=
'A'
,
acl_roles
=
[],
REQUEST
=
None
):
'Add a session'
i
=
Session
()
i
.
_init
(
id
,
title
,
REQUEST
)
i
.
_setRoles
(
acl_type
,
acl_roles
)
self
.
_setObject
(
id
,
i
)
return
self
.
manage_main
(
self
,
REQUEST
)
class
Session
(
Persistence
.
Persistent
,
AccessControl
.
Role
.
RoleManager
,
SimpleItem
.
Item
,
Acquisition
.
Explicit
):
'''Model sessions as drop-in objects
'''
meta_type
=
'Session'
icon
=
'OFS/session.gif'
def
_init
(
self
,
id
,
title
,
REQUEST
):
self
.
id
=
id
self
.
title
=
title
cookie
=
REQUEST
[
'PATH_INFO'
]
l
=
rfind
(
cookie
,
'/'
)
if
l
>=
0
:
cookie
=
cookie
[:
l
]
self
.
cookie
=
"%s/%s"
%
(
cookie
,
id
)
manage
=
Globals
.
HTMLFile
(
'OFS/sessionEdit'
)
index_html
=
Globals
.
HTMLFile
(
'OFS/session'
)
def
manage_edit
(
self
,
title
,
acl_type
=
'A'
,
acl_roles
=
[],
REQUEST
=
None
):
'Modify a session'
self
.
_setRoles
(
acl_type
,
acl_roles
)
self
.
title
=
title
if
REQUEST
is
not
None
:
return
self
.
manage_editedDialog
(
REQUEST
)
def
enter
(
self
,
REQUEST
,
RESPONSE
):
'Begin working in a session'
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
self
.
cookie
,
expires
=
"Mon, 27-Dec-99 23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
REQUEST
[
Globals
.
SessionNameName
]
=
self
.
cookie
return
self
.
index_html
(
self
,
REQUEST
)
def
leave
(
self
,
REQUEST
,
RESPONSE
):
'Temporarily stop working in a session'
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
'No longer active'
,
expires
=
"Mon, 27-Aug-84 23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
REQUEST
[
Globals
.
SessionNameName
]
=
''
return
self
.
index_html
(
self
,
REQUEST
)
def
save
(
self
,
remark
,
REQUEST
):
'Make session changes permanent'
Globals
.
SessionBase
[
self
.
cookie
].
commit
(
remark
)
if
REQUEST
is
not
None
:
return
self
.
index_html
(
self
,
REQUEST
)
def
discard
(
self
,
REQUEST
):
'Discard changes made during the session'
Globals
.
SessionBase
[
self
.
cookie
].
abort
()
if
REQUEST
is
not
None
:
return
self
.
index_html
(
self
,
REQUEST
)
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
__version__
=
'$Revision: 1.1 $'
[
11
:
-
2
]
##############################################################################
#
# $Log: Session.py,v $
# Revision 1.1 1997/11/07 16:13:15 jim
# *** empty log message ***
#
#
lib/python/OFS/session.dtml
0 → 100644
View file @
722f78e6
<html>
<head>
<title>
<!--#var title_or_id-->
</title>
</head>
<body>
<!--#if Principia-Session-->
<!--#if expr="_vars['Principia-Session'] != cookie"-->
<h2>
Another session is active!
</h2>
You cannot start working in this session while another session,
<strong>
<!--#var Principia-Session-->
</strong>
is active.
Leave
<strong>
<!--#var Principia-Session-->
</strong>
first and then
you may work in this session.
<!--#else-->
<h2>
Active
<!--#var title_or_id-->
Session Operations
</h2>
<form
action=
leave
>
You
<strong>
are
</strong>
currently working in the
<!--#var Principia-Session-->
session. To
<strong>
quit
</strong>
working in this session click on this button:
<input
type=
submit
value=
"Quit Working in <!--#var Principia-Session-->"
>
</form>
<!--#/if-->
<!--#else-->
<h2>
Inactive
<!--#var title_or_id-->
Session Operations
</h2>
<form
action=
enter
>
You
<strong>
are not
</strong>
currently working in the
<!--#var title_and_id-->
session. To
<strong>
start
</strong>
working in this session click
on this button:
<input
type=
submit
value=
"Start Working in <!--#var title_or_id-->"
>
</form>
<!--#endif-->
<!--#if nonempty-->
<hr>
<p><form
action=
save
>
You can make work done in
<!--#var title_and_id-->
permanent by
entering a remark in the space below and then
clicking on the "Save" button.
<br>
<textarea
name=
remark
rows=
10
cols=
50
></textarea><br>
<input
type=
submit
value=
"Save"
>
</form>
<hr>
<p><form
action=
discard
>
You can throw away work done in
<!--#var title_and_id-->
by
clicking on the "Discard" button.
<input
type=
submit
value=
"Discard"
>
</form>
<!--#endif-->
</body>
</html>
lib/python/Products/OFSP/Session.py
0 → 100644
View file @
722f78e6
#!/bin/env python
##############################################################################
#
# Copyright
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
# Street, Suite 300, Fredericksburg, Virginia 22401 U.S.A. All
# rights reserved.
#
##############################################################################
__doc__
=
'''A drop-in object that represents a session.
$Id: Session.py,v 1.1 1997/11/07 16:13:15 jim Exp $'''
import
time
,
SimpleItem
,
AccessControl
.
Role
,
Persistence
,
Acquisition
,
Globals
from
string
import
rfind
_addForm
=
Globals
.
HTMLFile
(
'OFS/sessionAdd'
)
def
addForm
(
realself
,
self
,
REQUEST
,
**
ignored
):
return
_addForm
(
self
,
REQUEST
,
selectedRoles
=
map
(
lambda
i
:
(
'<OPTION VALUE="%s"%s>%s'
%
(
i
,
i
==
'manage'
and
' SELECTED'
or
''
,
i
))
,
self
.
validRoles
()),
aclEChecked
=
' CHECKED'
,
aclAChecked
=
''
,
aclPChecked
=
''
)
def
add
(
self
,
id
,
title
,
acl_type
=
'A'
,
acl_roles
=
[],
REQUEST
=
None
):
'Add a session'
i
=
Session
()
i
.
_init
(
id
,
title
,
REQUEST
)
i
.
_setRoles
(
acl_type
,
acl_roles
)
self
.
_setObject
(
id
,
i
)
return
self
.
manage_main
(
self
,
REQUEST
)
class
Session
(
Persistence
.
Persistent
,
AccessControl
.
Role
.
RoleManager
,
SimpleItem
.
Item
,
Acquisition
.
Explicit
):
'''Model sessions as drop-in objects
'''
meta_type
=
'Session'
icon
=
'OFS/session.gif'
def
_init
(
self
,
id
,
title
,
REQUEST
):
self
.
id
=
id
self
.
title
=
title
cookie
=
REQUEST
[
'PATH_INFO'
]
l
=
rfind
(
cookie
,
'/'
)
if
l
>=
0
:
cookie
=
cookie
[:
l
]
self
.
cookie
=
"%s/%s"
%
(
cookie
,
id
)
manage
=
Globals
.
HTMLFile
(
'OFS/sessionEdit'
)
index_html
=
Globals
.
HTMLFile
(
'OFS/session'
)
def
manage_edit
(
self
,
title
,
acl_type
=
'A'
,
acl_roles
=
[],
REQUEST
=
None
):
'Modify a session'
self
.
_setRoles
(
acl_type
,
acl_roles
)
self
.
title
=
title
if
REQUEST
is
not
None
:
return
self
.
manage_editedDialog
(
REQUEST
)
def
enter
(
self
,
REQUEST
,
RESPONSE
):
'Begin working in a session'
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
self
.
cookie
,
expires
=
"Mon, 27-Dec-99 23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
REQUEST
[
Globals
.
SessionNameName
]
=
self
.
cookie
return
self
.
index_html
(
self
,
REQUEST
)
def
leave
(
self
,
REQUEST
,
RESPONSE
):
'Temporarily stop working in a session'
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
'No longer active'
,
expires
=
"Mon, 27-Aug-84 23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
REQUEST
[
Globals
.
SessionNameName
]
=
''
return
self
.
index_html
(
self
,
REQUEST
)
def
save
(
self
,
remark
,
REQUEST
):
'Make session changes permanent'
Globals
.
SessionBase
[
self
.
cookie
].
commit
(
remark
)
if
REQUEST
is
not
None
:
return
self
.
index_html
(
self
,
REQUEST
)
def
discard
(
self
,
REQUEST
):
'Discard changes made during the session'
Globals
.
SessionBase
[
self
.
cookie
].
abort
()
if
REQUEST
is
not
None
:
return
self
.
index_html
(
self
,
REQUEST
)
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
__version__
=
'$Revision: 1.1 $'
[
11
:
-
2
]
##############################################################################
#
# $Log: Session.py,v $
# Revision 1.1 1997/11/07 16:13:15 jim
# *** empty log message ***
#
#
lib/python/Products/OFSP/Version.py
0 → 100644
View file @
722f78e6
#!/bin/env python
##############################################################################
#
# Copyright
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
# Street, Suite 300, Fredericksburg, Virginia 22401 U.S.A. All
# rights reserved.
#
##############################################################################
__doc__
=
'''A drop-in object that represents a session.
$Id: Version.py,v 1.1 1997/11/07 16:13:15 jim Exp $'''
import
time
,
SimpleItem
,
AccessControl
.
Role
,
Persistence
,
Acquisition
,
Globals
from
string
import
rfind
_addForm
=
Globals
.
HTMLFile
(
'OFS/sessionAdd'
)
def
addForm
(
realself
,
self
,
REQUEST
,
**
ignored
):
return
_addForm
(
self
,
REQUEST
,
selectedRoles
=
map
(
lambda
i
:
(
'<OPTION VALUE="%s"%s>%s'
%
(
i
,
i
==
'manage'
and
' SELECTED'
or
''
,
i
))
,
self
.
validRoles
()),
aclEChecked
=
' CHECKED'
,
aclAChecked
=
''
,
aclPChecked
=
''
)
def
add
(
self
,
id
,
title
,
acl_type
=
'A'
,
acl_roles
=
[],
REQUEST
=
None
):
'Add a session'
i
=
Session
()
i
.
_init
(
id
,
title
,
REQUEST
)
i
.
_setRoles
(
acl_type
,
acl_roles
)
self
.
_setObject
(
id
,
i
)
return
self
.
manage_main
(
self
,
REQUEST
)
class
Session
(
Persistence
.
Persistent
,
AccessControl
.
Role
.
RoleManager
,
SimpleItem
.
Item
,
Acquisition
.
Explicit
):
'''Model sessions as drop-in objects
'''
meta_type
=
'Session'
icon
=
'OFS/session.gif'
def
_init
(
self
,
id
,
title
,
REQUEST
):
self
.
id
=
id
self
.
title
=
title
cookie
=
REQUEST
[
'PATH_INFO'
]
l
=
rfind
(
cookie
,
'/'
)
if
l
>=
0
:
cookie
=
cookie
[:
l
]
self
.
cookie
=
"%s/%s"
%
(
cookie
,
id
)
manage
=
Globals
.
HTMLFile
(
'OFS/sessionEdit'
)
index_html
=
Globals
.
HTMLFile
(
'OFS/session'
)
def
manage_edit
(
self
,
title
,
acl_type
=
'A'
,
acl_roles
=
[],
REQUEST
=
None
):
'Modify a session'
self
.
_setRoles
(
acl_type
,
acl_roles
)
self
.
title
=
title
if
REQUEST
is
not
None
:
return
self
.
manage_editedDialog
(
REQUEST
)
def
enter
(
self
,
REQUEST
,
RESPONSE
):
'Begin working in a session'
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
self
.
cookie
,
expires
=
"Mon, 27-Dec-99 23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
REQUEST
[
Globals
.
SessionNameName
]
=
self
.
cookie
return
self
.
index_html
(
self
,
REQUEST
)
def
leave
(
self
,
REQUEST
,
RESPONSE
):
'Temporarily stop working in a session'
RESPONSE
.
setCookie
(
Globals
.
SessionNameName
,
'No longer active'
,
expires
=
"Mon, 27-Aug-84 23:59:59 GMT"
,
path
=
REQUEST
[
'SCRIPT_NAME'
],
)
REQUEST
[
Globals
.
SessionNameName
]
=
''
return
self
.
index_html
(
self
,
REQUEST
)
def
save
(
self
,
remark
,
REQUEST
):
'Make session changes permanent'
Globals
.
SessionBase
[
self
.
cookie
].
commit
(
remark
)
if
REQUEST
is
not
None
:
return
self
.
index_html
(
self
,
REQUEST
)
def
discard
(
self
,
REQUEST
):
'Discard changes made during the session'
Globals
.
SessionBase
[
self
.
cookie
].
abort
()
if
REQUEST
is
not
None
:
return
self
.
index_html
(
self
,
REQUEST
)
def
nonempty
(
self
):
return
Globals
.
SessionBase
[
self
.
cookie
].
nonempty
()
__version__
=
'$Revision: 1.1 $'
[
11
:
-
2
]
##############################################################################
#
# $Log: Version.py,v $
# Revision 1.1 1997/11/07 16:13:15 jim
# *** empty log message ***
#
#
lib/python/Products/OFSP/session.dtml
0 → 100644
View file @
722f78e6
<html>
<head>
<title>
<!--#var title_or_id-->
</title>
</head>
<body>
<!--#if Principia-Session-->
<!--#if expr="_vars['Principia-Session'] != cookie"-->
<h2>
Another session is active!
</h2>
You cannot start working in this session while another session,
<strong>
<!--#var Principia-Session-->
</strong>
is active.
Leave
<strong>
<!--#var Principia-Session-->
</strong>
first and then
you may work in this session.
<!--#else-->
<h2>
Active
<!--#var title_or_id-->
Session Operations
</h2>
<form
action=
leave
>
You
<strong>
are
</strong>
currently working in the
<!--#var Principia-Session-->
session. To
<strong>
quit
</strong>
working in this session click on this button:
<input
type=
submit
value=
"Quit Working in <!--#var Principia-Session-->"
>
</form>
<!--#/if-->
<!--#else-->
<h2>
Inactive
<!--#var title_or_id-->
Session Operations
</h2>
<form
action=
enter
>
You
<strong>
are not
</strong>
currently working in the
<!--#var title_and_id-->
session. To
<strong>
start
</strong>
working in this session click
on this button:
<input
type=
submit
value=
"Start Working in <!--#var title_or_id-->"
>
</form>
<!--#endif-->
<!--#if nonempty-->
<hr>
<p><form
action=
save
>
You can make work done in
<!--#var title_and_id-->
permanent by
entering a remark in the space below and then
clicking on the "Save" button.
<br>
<textarea
name=
remark
rows=
10
cols=
50
></textarea><br>
<input
type=
submit
value=
"Save"
>
</form>
<hr>
<p><form
action=
discard
>
You can throw away work done in
<!--#var title_and_id-->
by
clicking on the "Discard" button.
<input
type=
submit
value=
"Discard"
>
</form>
<!--#endif-->
</body>
</html>
lib/python/Products/OFSP/version.dtml
0 → 100644
View file @
722f78e6
<html>
<head>
<title>
<!--#var title_or_id-->
</title>
</head>
<body>
<!--#if Principia-Session-->
<!--#if expr="_vars['Principia-Session'] != cookie"-->
<h2>
Another session is active!
</h2>
You cannot start working in this session while another session,
<strong>
<!--#var Principia-Session-->
</strong>
is active.
Leave
<strong>
<!--#var Principia-Session-->
</strong>
first and then
you may work in this session.
<!--#else-->
<h2>
Active
<!--#var title_or_id-->
Session Operations
</h2>
<form
action=
leave
>
You
<strong>
are
</strong>
currently working in the
<!--#var Principia-Session-->
session. To
<strong>
quit
</strong>
working in this session click on this button:
<input
type=
submit
value=
"Quit Working in <!--#var Principia-Session-->"
>
</form>
<!--#/if-->
<!--#else-->
<h2>
Inactive
<!--#var title_or_id-->
Session Operations
</h2>
<form
action=
enter
>
You
<strong>
are not
</strong>
currently working in the
<!--#var title_and_id-->
session. To
<strong>
start
</strong>
working in this session click
on this button:
<input
type=
submit
value=
"Start Working in <!--#var title_or_id-->"
>
</form>
<!--#endif-->
<!--#if nonempty-->
<hr>
<p><form
action=
save
>
You can make work done in
<!--#var title_and_id-->
permanent by
entering a remark in the space below and then
clicking on the "Save" button.
<br>
<textarea
name=
remark
rows=
10
cols=
50
></textarea><br>
<input
type=
submit
value=
"Save"
>
</form>
<hr>
<p><form
action=
discard
>
You can throw away work done in
<!--#var title_and_id-->
by
clicking on the "Discard" button.
<input
type=
submit
value=
"Discard"
>
</form>
<!--#endif-->
</body>
</html>
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