From: Michael Tremer Date: Fri, 23 Feb 2024 19:55:45 +0000 (+0000) Subject: nopaste: Show uploader IP address to admins X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b965940bd5b5b3f84e13447b1610cacf07e13ccb;p=ipfire.org.git nopaste: Show uploader IP address to admins Signed-off-by: Michael Tremer --- diff --git a/src/backend/nopaste.py b/src/backend/nopaste.py index b92d6ceb..43f5552a 100644 --- a/src/backend/nopaste.py +++ b/src/backend/nopaste.py @@ -234,7 +234,7 @@ class Paste(Object): @lazy_property def asn(self): if self.location and self.location.asn: - return self.backend.location.get_asn(self.location.asn) + return self.backend.location.get_as(self.location.asn) # Country diff --git a/src/templates/nopaste/view.html b/src/templates/nopaste/view.html index 359db2e6..5ba3ad6c 100644 --- a/src/templates/nopaste/view.html +++ b/src/templates/nopaste/view.html @@ -12,6 +12,13 @@
{{ _("Uploaded %s by %s") % (locale.format_date(paste.time_created), paste.account or "N/A") }} + + {# Show IP address of uploader to admins #} + {% if current_user and current_user.is_admin() %} + • {{ paste.address }} + {% if paste.country %}• {{ paste.country }}{% end %} + {% if paste.asn %}• {{ paste.asn }}{% end %} + {% end %}