Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_rtl_support
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
Romain Courteaud
erp5_rtl_support
Commits
ad8e5263
Commit
ad8e5263
authored
Dec 19, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_auto_logout: decipher weird float
parent
4912d34a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
bt5/erp5_auto_logout/SkinTemplateItem/portal_skins/erp5_auto_logout/setAuthCookie.xml
...plateItem/portal_skins/erp5_auto_logout/setAuthCookie.xml
+9
-5
bt5/erp5_auto_logout/bt/revision
bt5/erp5_auto_logout/bt/revision
+1
-1
No files found.
bt5/erp5_auto_logout/SkinTemplateItem/portal_skins/erp5_auto_logout/setAuthCookie.xml
View file @
ad8e5263
...
...
@@ -170,7 +170,9 @@
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from DateTime import DateTime\n
<value>
<string
encoding=
"cdata"
>
<![CDATA[
from DateTime import DateTime\n
kw = {\'name\': cookie_name,\n
\'value\': cookie_value,\n
\'path\': \'/\'}\n
...
...
@@ -180,9 +182,9 @@ expire_interval = context.ERP5Site_getMaxUserInactivityDuration(user_name)\n
\n
# set cookie expire argument only if it\'s defined for current user\n
if expire_interval not in (\'\', None):\n
expire_
time_offset = 0.00069444444444444436 * (expire_interval / 60.0)
\n
ac_expires = DateTime() + expire_
time_offset
\n
ac_renew = DateTime() + expire_
time_offset
/ 2\n
expire_
interval /= 86400. # seconds ->
days
\n
ac_expires = DateTime() + expire_
interval
\n
ac_renew = DateTime() + expire_
interval
/ 2\n
kw[\'expires\'] = ac_expires.toZone(\'GMT\').rfc822()\n
# save next \'__ac\' renew time\n
context.portal_sessions[ac_session_key_pattern %user_name][\'ac_renew\'] = ac_renew.millis()\n
...
...
@@ -193,7 +195,9 @@ else:\n
\n
# set cookie\n
resp.setCookie(**kw)\n
</string>
</value>
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
...
...
bt5/erp5_auto_logout/bt/revision
View file @
ad8e5263
11
\ No newline at end of file
12
\ No newline at end of file
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