Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
1
Merge Requests
1
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
Cédric Le Ninivin
erp5
Commits
7663cc59
Commit
7663cc59
authored
Jun 07, 2016
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_auto_logout: Do not depend on __ac_name cookie presence.
parent
02541501
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
5 deletions
+86
-5
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/Base_getAutoLogoutSessionKey.py
...al_skins/erp5_auto_logout/Base_getAutoLogoutSessionKey.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/Base_getAutoLogoutSessionKey.xml
...l_skins/erp5_auto_logout/Base_getAutoLogoutSessionKey.xml
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/Base_getUsernameFromAuthenticationCookie.py
...5_auto_logout/Base_getUsernameFromAuthenticationCookie.py
+2
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/Base_getUsernameFromAuthenticationCookie.xml
..._auto_logout/Base_getUsernameFromAuthenticationCookie.xml
+62
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/logout.py
.../SkinTemplateItem/portal_skins/erp5_auto_logout/logout.py
+6
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/setAuthCookie.py
...mplateItem/portal_skins/erp5_auto_logout/setAuthCookie.py
+7
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/twiddleAuthCookie.py
...teItem/portal_skins/erp5_auto_logout/twiddleAuthCookie.py
+7
-1
No files found.
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/Base_getAutoLogoutSessionKey.py
View file @
7663cc59
...
@@ -2,4 +2,4 @@ from AccessControl import getSecurityManager
...
@@ -2,4 +2,4 @@ from AccessControl import getSecurityManager
from
zExceptions
import
Unauthorized
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
# Cheap "do not call from URL" protection - not that the session key is secret
if
REQUEST
is
not
None
:
# Cheap "do not call from URL" protection - not that the session key is secret
raise
Unauthorized
raise
Unauthorized
return
'ac_cookie_
%s'
%
context
.
REQUEST
.
get
(
'__ac_name'
,
'Anonymous User'
)
return
'ac_cookie_
'
+
username
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/Base_getAutoLogoutSessionKey.xml
View file @
7663cc59
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
REQUEST=None
</string>
</value>
<value>
<string>
username,
REQUEST=None
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/Base_getUsernameFromAuthenticationCookie.py
0 → 100644
View file @
7663cc59
from
urllib
import
unquote
return
unquote
(
value
).
decode
(
'base64'
).
split
(
':'
,
1
)[
0
]
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/Base_getUsernameFromAuthenticationCookie.xml
0 → 100644
View file @
7663cc59
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
value
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_getUsernameFromAuthenticationCookie
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/logout.py
View file @
7663cc59
from
AccessControl
import
getSecurityManager
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
portal
.
portal_sessions
.
manage_delObjects
(
portal
.
Base_getAutoLogoutSessionKey
())
portal
.
portal_sessions
.
manage_delObjects
(
portal
.
Base_getAutoLogoutSessionKey
(
username
=
getSecurityManager
().
getUser
().
getUserName
(),
)
)
REQUEST
=
portal
.
REQUEST
REQUEST
=
portal
.
REQUEST
if
REQUEST
.
has_key
(
'portal_skin'
):
if
REQUEST
.
has_key
(
'portal_skin'
):
portal
.
portal_skins
.
clearSkinCookie
()
portal
.
portal_skins
.
clearSkinCookie
()
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/setAuthCookie.py
View file @
7663cc59
...
@@ -8,7 +8,13 @@ else:
...
@@ -8,7 +8,13 @@ else:
now
=
DateTime
()
now
=
DateTime
()
kw
[
'expires'
]
=
(
now
+
expire_interval
).
toZone
(
'GMT'
).
rfc822
()
kw
[
'expires'
]
=
(
now
+
expire_interval
).
toZone
(
'GMT'
).
rfc822
()
ac_renew
=
(
now
+
expire_interval
/
2
).
millis
()
ac_renew
=
(
now
+
expire_interval
/
2
).
millis
()
portal
.
portal_sessions
[
portal
.
Base_getAutoLogoutSessionKey
()][
'ac_renew'
]
=
ac_renew
portal
.
portal_sessions
[
portal
.
Base_getAutoLogoutSessionKey
(
username
=
portal
.
Base_getUsernameFromAuthenticationCookie
(
cookie_value
,
)
)
][
'ac_renew'
]
=
ac_renew
resp
.
setCookie
(
resp
.
setCookie
(
name
=
cookie_name
,
name
=
cookie_name
,
value
=
cookie_value
,
value
=
cookie_value
,
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/twiddleAuthCookie.py
View file @
7663cc59
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
if
DateTime
().
millis
()
>=
portal
.
portal_sessions
[
portal
.
Base_getAutoLogoutSessionKey
()].
get
(
'ac_renew'
,
0
):
if
DateTime
().
millis
()
>=
portal
.
portal_sessions
[
portal
.
Base_getAutoLogoutSessionKey
(
username
=
portal
.
Base_getUsernameFromAuthenticationCookie
(
cookie_value
,
)
)
].
get
(
'ac_renew'
,
0
):
portal
.
setAuthCookie
(
resp
,
cookie_name
,
cookie_value
)
portal
.
setAuthCookie
(
resp
,
cookie_name
,
cookie_value
)
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