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
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
01f31089
Commit
01f31089
authored
Dec 10, 2015
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PasswordTool: Use of site URL as a parameter and dynamic title
parent
419a5758
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
product/ERP5/Tool/PasswordTool.py
product/ERP5/Tool/PasswordTool.py
+8
-6
No files found.
product/ERP5/Tool/PasswordTool.py
View file @
01f31089
...
...
@@ -90,7 +90,7 @@ class PasswordTool(BaseTool):
parameter
=
urlencode
(
dict
(
reset_key
=
key
))
method
=
self
.
_getTypeBasedMethod
(
"getSiteUrl"
)
if
method
is
not
None
:
base_url
=
method
()
base_url
=
method
(
site_url
)
else
:
base_url
=
"%s/portal_password/PasswordTool_viewResetPassword"
%
(
site_url
,)
...
...
@@ -106,7 +106,8 @@ class PasswordTool(BaseTool):
notification_message
=
None
,
sender
=
None
,
store_as_event
=
False
,
expiration_date
=
None
,
substitution_method_parameter_dict
=
None
):
substitution_method_parameter_dict
=
None
,
site_url
=
None
):
"""
Create a random string and expiration date for request
Parameters:
...
...
@@ -128,9 +129,10 @@ class PasswordTool(BaseTool):
if
user_login
is
None
:
user_login
=
REQUEST
[
"user_login"
]
site_url
=
self
.
getPortalObject
().
absolute_url
()
if
REQUEST
and
'came_from'
in
REQUEST
:
site_url
=
REQUEST
.
came_from
if
not
site_url
:
site_url
=
self
.
getPortalObject
().
absolute_url
()
if
REQUEST
and
'came_from'
in
REQUEST
:
site_url
=
REQUEST
.
came_from
msg
=
None
# check user exists, and have an email
...
...
@@ -187,7 +189,7 @@ class PasswordTool(BaseTool):
message_text_format
=
'text/plain'
else
:
message_text_format
=
notification_message
.
getContentType
()
subject
=
notification_message
.
getTitle
(
)
subject
=
notification_message
.
asSubjectText
(
substitution_method_parameter_dict
=
message_dict
)
if
message_text_format
==
"text/html"
:
message
=
notification_message
.
asEntireHTML
(
substitution_method_parameter_dict
=
message_dict
)
else
:
...
...
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