forked from indymedia/epicyon
Only show delete icon on posts which can be deleted
parent
cc52d917b2
commit
7c7bb45c0d
|
@ -795,6 +795,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if authorized and '?delete=' in self.path:
|
||||
deleteUrl=self.path.split('?delete=')[1]
|
||||
actor=self.path.split('?delete=')[0]
|
||||
if actor not in deleteUrl:
|
||||
# You can only delete your own posts
|
||||
self.server.GETbusy=False
|
||||
self._redirect_headers(actor+'/inbox',cookie)
|
||||
return
|
||||
self.postToNickname=getNicknameFromActor(actor)
|
||||
if not self.server.session:
|
||||
self.server.session= \
|
||||
|
|
|
@ -693,9 +693,11 @@ def individualPostAsHtml(baseDir: str, \
|
|||
likeStr= \
|
||||
'<a href="/users/'+nickname+'?'+likeLink+'='+postJsonObject['object']['id']+'" title="'+likeTitle+'">' \
|
||||
'<img src="/icons/'+likeIcon+'"/></a>'
|
||||
deleteStr= \
|
||||
'<a href="/users/'+nickname+'?delete='+postJsonObject['object']['id']+'" title="Delete this post">' \
|
||||
'<img src="/icons/delete.png"/></a>'
|
||||
deleteStr=''
|
||||
if '/users/'+nickname+'/' in postJsonObject['object']['id']:
|
||||
deleteStr= \
|
||||
'<a href="/users/'+nickname+'?delete='+postJsonObject['object']['id']+'" title="Delete this post">' \
|
||||
'<img src="/icons/delete.png"/></a>'
|
||||
|
||||
if showIcons:
|
||||
footerStr='<div class="'+containerClassIcons+'">'
|
||||
|
|
Loading…
Reference in New Issue