mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 18:01:36 +00:00
Password notification fix
Updated `gam create|update user ... notify` to encode the characters `<>&` in the password so that they display correctly when the notify message content is HTML.
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
|
||||
Merged GAM-Team version
|
||||
|
||||
6.67.19
|
||||
|
||||
Updated `gam create|update user ... notify` to encode the characters `<>&` in the password
|
||||
so that they display correctly when the notify message content is HTML.
|
||||
|
||||
6.67.18
|
||||
|
||||
Cleaned up `Getting/Got` messages for `gam print courses|course-participants`.
|
||||
|
||||
@@ -14357,8 +14357,11 @@ def sendCreateUpdateUserNotification(body, basenotify, tagReplacements, i=0, cou
|
||||
notify[field] = notify[field].replace('#givenname#', body['name'].get('givenName', ''))
|
||||
notify[field] = notify[field].replace('#familyname#', body['name'].get('familyName', ''))
|
||||
|
||||
def _makePasswordSubstitutions(field):
|
||||
notify[field] = notify[field].replace('#password#', notify['password'])
|
||||
def _makePasswordSubstitutions(field, html):
|
||||
if not html:
|
||||
notify[field] = notify[field].replace('#password#', notify['password'])
|
||||
else:
|
||||
notify[field] = notify[field].replace('#password#', notify['password']).replace('&', '&').replace('<', '<').replace('>', '>')
|
||||
|
||||
userName, domain = splitEmailAddress(body['primaryEmail'])
|
||||
notify = basenotify.copy()
|
||||
@@ -14376,8 +14379,8 @@ def sendCreateUpdateUserNotification(body, basenotify, tagReplacements, i=0, cou
|
||||
_getTagReplacementFieldValues(body['primaryEmail'], i, count, tagReplacements, body if createMessage else None)
|
||||
notify['subject'] = _processTagReplacements(tagReplacements, notify['subject'])
|
||||
notify['message'] = _processTagReplacements(tagReplacements, notify['message'])
|
||||
_makePasswordSubstitutions('subject')
|
||||
_makePasswordSubstitutions('message')
|
||||
_makePasswordSubstitutions('subject', False)
|
||||
_makePasswordSubstitutions('message', notify['html'])
|
||||
if 'from' in notify:
|
||||
msgFrom = notify['from']
|
||||
msgReplyTo = notify.get('replyto', None)
|
||||
|
||||
Reference in New Issue
Block a user