mirror of https://gitlab.com/bashrc2/epicyon
Removing share via its itemID
parent
4972c68773
commit
c41aacba6f
|
@ -11256,22 +11256,18 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
|
||||
# remove a shared item
|
||||
if htmlGET and '?rmshare=' in self.path:
|
||||
print('Debug rmshare: 1: ' + self.path)
|
||||
shareName = self.path.split('?rmshare=')[1]
|
||||
shareName = urllib.parse.unquote_plus(shareName.strip())
|
||||
print('Debug rmshare: 2: ' + shareName)
|
||||
usersPath = self.path.split('?rmshare=')[0]
|
||||
actor = \
|
||||
self.server.httpPrefix + '://' + \
|
||||
self.server.domainFull + usersPath
|
||||
print('Debug rmshare: 3: ' + actor)
|
||||
msg = htmlConfirmRemoveSharedItem(self.server.cssCache,
|
||||
self.server.translate,
|
||||
self.server.baseDir,
|
||||
actor, shareName,
|
||||
callingDomain)
|
||||
if not msg:
|
||||
print('Debug rmshare: no msg ' + actor)
|
||||
if callingDomain.endswith('.onion') and \
|
||||
self.server.onionDomain:
|
||||
actor = 'http://' + self.server.onionDomain + usersPath
|
||||
|
|
|
@ -104,11 +104,10 @@ def htmlConfirmDelete(cssCache: {},
|
|||
|
||||
|
||||
def htmlConfirmRemoveSharedItem(cssCache: {}, translate: {}, baseDir: str,
|
||||
actor: str, shareName: str,
|
||||
actor: str, itemID: str,
|
||||
callingDomain: str) -> str:
|
||||
"""Shows a screen asking to confirm the removal of a shared item
|
||||
"""
|
||||
itemID = getValidSharedItemID(actor, shareName)
|
||||
nickname = getNicknameFromActor(actor)
|
||||
domain, port = getDomainFromActor(actor)
|
||||
domainFull = getFullDomain(domain, port)
|
||||
|
@ -153,7 +152,7 @@ def htmlConfirmRemoveSharedItem(cssCache: {}, translate: {}, baseDir: str,
|
|||
sharesStr += \
|
||||
' <input type="hidden" name="actor" value="' + actor + '">\n'
|
||||
sharesStr += ' <input type="hidden" name="shareName" value="' + \
|
||||
shareName + '">\n'
|
||||
itemID + '">\n'
|
||||
sharesStr += \
|
||||
' <button type="submit" class="button" name="submitYes">' + \
|
||||
translate['Yes'] + '</button>\n'
|
||||
|
|
Loading…
Reference in New Issue