forked from indymedia/epicyon
As a workaround, profile backgrounds are global to the instance. Perhaps this will change in future
parent
8b70048514
commit
642fd31c7d
19
daemon.py
19
daemon.py
|
@ -3408,6 +3408,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.POSTbusy = False
|
self.server.POSTbusy = False
|
||||||
return
|
return
|
||||||
|
|
||||||
|
adminNickname = getConfigParam(self.server.baseDir, 'admin')
|
||||||
|
|
||||||
# get the various avatar, banner and background images
|
# get the various avatar, banner and background images
|
||||||
actorChanged = True
|
actorChanged = True
|
||||||
profileMediaTypes = ('avatar', 'image',
|
profileMediaTypes = ('avatar', 'image',
|
||||||
|
@ -3416,6 +3418,14 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
'left_col_image', 'right_col_image')
|
'left_col_image', 'right_col_image')
|
||||||
profileMediaTypesUploaded = {}
|
profileMediaTypesUploaded = {}
|
||||||
for mType in profileMediaTypes:
|
for mType in profileMediaTypes:
|
||||||
|
# some images can only be changed by the admin
|
||||||
|
if mType == 'instanceLogo' or \
|
||||||
|
mType == 'image':
|
||||||
|
if nickname != adminNickname:
|
||||||
|
print('WARN: only the admin can change ' +
|
||||||
|
'instance logo or profile backgrounds')
|
||||||
|
continue
|
||||||
|
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: profile update extracting ' + mType +
|
print('DEBUG: profile update extracting ' + mType +
|
||||||
' image or font from POST')
|
' image or font from POST')
|
||||||
|
@ -3432,6 +3442,13 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
' image or font was found in POST')
|
' image or font was found in POST')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# NOTE: profile background comes from the news system user
|
||||||
|
# perhaps at some future time profile background will be
|
||||||
|
# per account
|
||||||
|
currNick = nickname
|
||||||
|
if mType == 'image':
|
||||||
|
currNick = 'news'
|
||||||
|
|
||||||
# Note: a .temp extension is used here so that at no
|
# Note: a .temp extension is used here so that at no
|
||||||
# time is an image with metadata publicly exposed,
|
# time is an image with metadata publicly exposed,
|
||||||
# even for a few mS
|
# even for a few mS
|
||||||
|
@ -3441,7 +3458,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
else:
|
else:
|
||||||
filenameBase = \
|
filenameBase = \
|
||||||
baseDir + '/accounts/' + \
|
baseDir + '/accounts/' + \
|
||||||
nickname + '@' + domain + \
|
currNick + '@' + domain + \
|
||||||
'/' + mType + '.temp'
|
'/' + mType + '.temp'
|
||||||
|
|
||||||
filename, attachmentMediaType = \
|
filename, attachmentMediaType = \
|
||||||
|
|
Loading…
Reference in New Issue