mirror of
https://github.com/9001/copyparty.git
synced 2025-08-19 01:42:20 -06:00
dont whine about inaccessible root on rootless configs,
and make it easier for on403 to invoke the homepage-redirect
This commit is contained in:
parent
db0abbfdda
commit
9fb9ada3aa
|
@ -843,14 +843,17 @@ class HttpCli(object):
|
||||||
|
|
||||||
if not self.can_read and not self.can_write and not self.can_get:
|
if not self.can_read and not self.can_write and not self.can_get:
|
||||||
t = "@{} has no access to [{}]"
|
t = "@{} has no access to [{}]"
|
||||||
self.log(t.format(self.uname, self.vpath))
|
|
||||||
|
|
||||||
if "on403" in self.vn.flags:
|
if "on403" in self.vn.flags:
|
||||||
|
t += " (on403)"
|
||||||
|
self.log(t.format(self.uname, self.vpath))
|
||||||
ret = self.on40x(self.vn.flags["on403"], self.vn, self.rem)
|
ret = self.on40x(self.vn.flags["on403"], self.vn, self.rem)
|
||||||
if ret == "true":
|
if ret == "true":
|
||||||
return True
|
return True
|
||||||
elif ret == "false":
|
elif ret == "false":
|
||||||
return False
|
return False
|
||||||
|
elif ret == "home":
|
||||||
|
self.uparam["h"] = ""
|
||||||
elif ret == "allow":
|
elif ret == "allow":
|
||||||
self.log("plugin override; access permitted")
|
self.log("plugin override; access permitted")
|
||||||
self.can_read = self.can_write = self.can_move = True
|
self.can_read = self.can_write = self.can_move = True
|
||||||
|
@ -860,6 +863,7 @@ class HttpCli(object):
|
||||||
return self.tx_404(True)
|
return self.tx_404(True)
|
||||||
else:
|
else:
|
||||||
if self.vpath:
|
if self.vpath:
|
||||||
|
self.log(t.format(self.uname, self.vpath))
|
||||||
return self.tx_404(True)
|
return self.tx_404(True)
|
||||||
|
|
||||||
self.uparam["h"] = ""
|
self.uparam["h"] = ""
|
||||||
|
|
Loading…
Reference in a new issue