forked from indymedia/epicyon
Set petname from person options
parent
46b1eea06a
commit
b466e33304
18
daemon.py
18
daemon.py
|
@ -184,6 +184,7 @@ from outbox import postMessageToOutbox
|
|||
from happening import removeCalendarEvent
|
||||
from bookmarks import bookmark
|
||||
from bookmarks import undoBookmark
|
||||
from petnames import setPetName
|
||||
import os
|
||||
|
||||
|
||||
|
@ -7593,6 +7594,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
postUrl = optionsConfirmParams.split('postUrl=')[1]
|
||||
if '&' in postUrl:
|
||||
postUrl = postUrl.split('&')[0]
|
||||
petname = None
|
||||
if 'optionpetname' in optionsConfirmParams:
|
||||
petname = optionsConfirmParams.split('optionpetname=')[1]
|
||||
if '&' in petname:
|
||||
petname = petname.split('&')[0]
|
||||
|
||||
optionsNickname = getNicknameFromActor(optionsActor)
|
||||
if not optionsNickname:
|
||||
|
@ -7628,6 +7634,18 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
cookie, callingDomain)
|
||||
self.server.POSTbusy = False
|
||||
return
|
||||
if '&submitPetname=' in optionsConfirmParams and petname:
|
||||
if self.server.debug:
|
||||
print('Change petname to ' + petname)
|
||||
handle = optionsNickname + '@' + optionsDomainFull
|
||||
setPetName(self.server.baseDir,
|
||||
chooserNickname,
|
||||
self.server.domain,
|
||||
handle, petname)
|
||||
self._redirect_headers(optionsActor,
|
||||
cookie, callingDomain)
|
||||
self.server.POSTbusy = False
|
||||
return
|
||||
if '&submitBlock=' in optionsConfirmParams:
|
||||
if self.server.debug:
|
||||
print('Adding block by ' + chooserNickname +
|
||||
|
|
|
@ -5420,7 +5420,9 @@ def htmlPersonOptions(translate: {}, baseDir: str,
|
|||
optionsStr += \
|
||||
'<p>' + translate['Petname'] + ': ' + \
|
||||
'<input type="text" name="optionpetname" value="' + \
|
||||
petname + '"></p>'
|
||||
petname + '">' \
|
||||
'<button type="submit" class="button" name="submitPetname">' + \
|
||||
translate['Submit'] + '</button></p>'
|
||||
optionsStr += optionsLinkStr
|
||||
optionsStr += \
|
||||
' <button type="submit" class="button" name="submitView">' + \
|
||||
|
|
Loading…
Reference in New Issue