Updated user attribute replace <Tag> <UserReplacement> to allow field:photourl

This commit is contained in:
Ross Scroggs
2024-01-02 21:08:35 -08:00
parent 293e1c1d9a
commit 668ded91e2
20 changed files with 104 additions and 55 deletions

View File

@@ -4858,8 +4858,11 @@ gam <UserTypeEntity> show teamdriveacls
relation.<RelationSubfieldName>.<RelationSubfieldName>.<String>|
sshkeys.<SSHkeysSubfieldName>.<SSHkeysSubfieldName>.<String>|
website.<WebsiteSubfieldName>.<WebsiteSubfieldName>.<String>
<UserReplacementField> ::=
photourl
<Tag> ::= <String>
<UserReplacement> ::=
(field:<UserReplacementField>)|
(field:<UserReplacementFieldSubfield>)|
(field:<UserReplacementFieldSubfieldMatchSubfield>)|
(schema:<SchemaName>.<FieldName>)|

View File

@@ -2,6 +2,12 @@
Merged GAM-Team version
6.67.04
Updated user attribute `replace <Tag> <UserReplacement>` to allow `field:photourl` which allows
embedding a link to a user's photo in their signature. Formatting the signature HTML
to properly display the photo is left to the GAM admin.
6.67.03
Fixed bug introduced in 6.67.02 in `gam <UserTypeEntity> claim ownership` that caused a trap.

View File

@@ -5751,7 +5751,7 @@ def shlexSplitListStatus(entity, dataDelimiter=' ,'):
return (False, str(e))
def getQueries(myarg):
if myarg == 'query':
if myarg in {'query', 'filter'}:
return [getString(Cmd.OB_QUERY)]
return shlexSplitList(getString(Cmd.OB_QUERY_LIST))
@@ -13971,6 +13971,7 @@ TAG_FIELD_SUBFIELD_CHOICE_MAP = {
'otheremails': ('emails', TAG_OTHEREMAIL_ARGUMENT_TO_FIELD_MAP),
'phone': ('phones', TAG_PHONE_ARGUMENT_TO_FIELD_MAP),
'phones': ('phones', TAG_PHONE_ARGUMENT_TO_FIELD_MAP),
'photourl': ('thumbnailPhotoUrl', {'': 'thumbnailPhotoUrl'}),
'posix': ('posixAccounts', TAG_POSIXACCOUNT_ARGUMENT_TO_FIELD_MAP),
'posixaccounts': ('posixAccounts', TAG_POSIXACCOUNT_ARGUMENT_TO_FIELD_MAP),
'relation': ('relations', TAG_RELATION_ARGUMENT_TO_FIELD_MAP),
@@ -14014,6 +14015,8 @@ def _getTagReplacement(tagReplacements, allowSubs):
else:
Cmd.Backup()
usageErrorExit(Msg.INVALID_TAG_SPECIFICATION)
elif field == 'photourl':
subfield = matchfield = matchvalue = ''
else:
field = ''
if not field or field not in TAG_FIELD_SUBFIELD_CHOICE_MAP:
@@ -14128,6 +14131,8 @@ def _getTagReplacementFieldValues(user, i, count, tagReplacements, results=None)
break
else:
data = {}
elif field == 'thumbnailPhotoUrl':
data = results
else:
data = results.get(field, {})
tag['value'] = str(data.get(tag['subfield'], ''))