]> git.ipfire.org Git - ipfire.org.git/commitdiff
nopaste: Show uploader IP address to admins
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 23 Feb 2024 19:55:45 +0000 (19:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 23 Feb 2024 19:55:45 +0000 (19:55 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/nopaste.py
src/templates/nopaste/view.html

index b92d6cebf8743234d74e843d778111ba783104af..43f5552a962611b34faf56ee1be90ac99f48ce28 100644 (file)
@@ -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
 
index 359db2e6f93448a78e08fa579de3aa8ff0e665d0..5ba3ad6ce33686ebe023bb48f90a96b60f061e0d 100644 (file)
 
                                <h6 class="subtitle">
                                        {{ _("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() %}
+                                               &bull; {{ paste.address }}
+                                               {% if paste.country %}&bull; {{ paste.country }}{% end %}
+                                               {% if paste.asn %}&bull; {{ paste.asn }}{% end %}
+                                       {% end %}
                                </h6>
                        </div>
                </div>