mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
option to restrict recent-uploads visibility
This commit is contained in:
parent
cdd3b67a5c
commit
b8b5214f44
|
@ -892,6 +892,8 @@ will show uploader IP and upload-time if the visitor has the admin permission
|
||||||
|
|
||||||
* global-option `--ups-when` makes upload-time visible to all users, and not just admins
|
* global-option `--ups-when` makes upload-time visible to all users, and not just admins
|
||||||
|
|
||||||
|
* global-option `--ups-who` (volflag `ups_who`) specifies who gets access (0=nobody, 1=admins, 2=everyone), default=2
|
||||||
|
|
||||||
note that the [🧯 unpost](#unpost) feature is better suited for viewing *your own* recent uploads, as it includes the option to undo/delete them
|
note that the [🧯 unpost](#unpost) feature is better suited for viewing *your own* recent uploads, as it includes the option to undo/delete them
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1344,6 +1344,7 @@ def add_admin(ap):
|
||||||
ap2.add_argument("--no-ups-page", action="store_true", help="disable ?ru (list of recent uploads)")
|
ap2.add_argument("--no-ups-page", action="store_true", help="disable ?ru (list of recent uploads)")
|
||||||
ap2.add_argument("--no-up-list", action="store_true", help="don't show list of incoming files in controlpanel")
|
ap2.add_argument("--no-up-list", action="store_true", help="don't show list of incoming files in controlpanel")
|
||||||
ap2.add_argument("--dl-list", metavar="LVL", type=int, default=2, help="who can see active downloads in the controlpanel? [\033[32m0\033[0m]=nobody, [\033[32m1\033[0m]=admins, [\033[32m2\033[0m]=everyone")
|
ap2.add_argument("--dl-list", metavar="LVL", type=int, default=2, help="who can see active downloads in the controlpanel? [\033[32m0\033[0m]=nobody, [\033[32m1\033[0m]=admins, [\033[32m2\033[0m]=everyone")
|
||||||
|
ap2.add_argument("--ups-who", metavar="LVL", type=int, default=2, help="who can see recent uploads on the ?ru page? [\033[32m0\033[0m]=nobody, [\033[32m1\033[0m]=admins, [\033[32m2\033[0m]=everyone (volflag=ups_who)")
|
||||||
ap2.add_argument("--ups-when", action="store_true", help="let everyone see upload timestamps on the ?ru page, not just admins")
|
ap2.add_argument("--ups-when", action="store_true", help="let everyone see upload timestamps on the ?ru page, not just admins")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,7 @@ def vf_vmap() -> dict[str, str]:
|
||||||
"unlist",
|
"unlist",
|
||||||
"u2abort",
|
"u2abort",
|
||||||
"u2ts",
|
"u2ts",
|
||||||
|
"ups_who",
|
||||||
):
|
):
|
||||||
ret[k] = k
|
ret[k] = k
|
||||||
return ret
|
return ret
|
||||||
|
|
|
@ -5152,6 +5152,12 @@ class HttpCli(object):
|
||||||
adm = "*" in vol.axs.uadmin or self.uname in vol.axs.uadmin
|
adm = "*" in vol.axs.uadmin or self.uname in vol.axs.uadmin
|
||||||
dots = "*" in vol.axs.udot or self.uname in vol.axs.udot
|
dots = "*" in vol.axs.udot or self.uname in vol.axs.udot
|
||||||
|
|
||||||
|
lvl = int(vol.flags["ups_who"])
|
||||||
|
if not lvl:
|
||||||
|
continue
|
||||||
|
elif lvl == 1 and not adm:
|
||||||
|
continue
|
||||||
|
|
||||||
n = 1000
|
n = 1000
|
||||||
q = "select sz, rd, fn, ip, at from up where at>0 order by at desc"
|
q = "select sz, rd, fn, ip, at from up where at>0 order by at desc"
|
||||||
for sz, rd, fn, ip, at in cur.execute(q):
|
for sz, rd, fn, ip, at in cur.execute(q):
|
||||||
|
|
Loading…
Reference in a new issue