From 84e70f2934be37e94c4905fbd6bfa4a53f64d5e3 Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Wed, 3 Mar 2010 08:55:00 +0100 Subject: [PATCH] fix a few last glitches in the IP address formatting and display the users' FQDN. --- pyweb/mumble/locale/de/LC_MESSAGES/django.mo | Bin 9208 -> 9246 bytes pyweb/mumble/locale/de/LC_MESSAGES/django.po | 60 ++++++++++--------- pyweb/mumble/mmobjects.py | 11 ++-- pyweb/mumble/templates/mumble/mumble.html | 2 +- 4 files changed, 40 insertions(+), 33 deletions(-) diff --git a/pyweb/mumble/locale/de/LC_MESSAGES/django.mo b/pyweb/mumble/locale/de/LC_MESSAGES/django.mo index f4b11c36772e1990f57043e009836f466083fbda..54d1796da487e24fe934d1a0b94a85e0b23e68dc 100644 GIT binary patch delta 1875 zcmYM!drZzz9LMo*p~$0~E`&TPPm5HZq+~N>Q}YMQb?y>t7@L?s%6`ms#%$6WbN$1$ zVirSg6C3_8@h9c-M@yTrn9FP~?~l%=J^fzi`}_UQIp6a==XriiKT+(xj_qA*{B7WW zDF26hDf<8C3pZ;Z9DpmZ8Dm0tx3AeY;;eo=!^^0ycd!rM$9Q~%k=TwS@B?OIWW>LI zo=v2|SXP2jSc?6z43lv^j=}?|=QofX>@o7ORxV256%NEMjKyE5_o5jr8V8}~$#8KH zqs%iaq7lY}*|-!JB1zg!+=LI1v8=$?vyviIT#93H3F`fW$j6Rw3E)}O%Aca%Z^Pl( ziAp$}OC>?ncJ2qt0_!NPHEwkWUzc->?+>l0`l) zLOriRC2|x!-Dswv1n#2-eu0|k4XTu1P^Ay!qLLs-IWw8vBuI*)ddyMoh)qn1yfM^Qgf+htrSxIt85B z$Xr(7oQ0}r1!}K1qAI%=S(DWw33zsah6cKcE3w7B5J)mRNnD89^OwjY>p%_k2TRb$ zvb2(Us1>iq9IQf(+kmRbHPnJ0xVZD5?EhC98n_off8%i&s>2-AfMuwy*@6_os!^q` zMNNDfm*W-Gp2iOAsYDV^CJy3atVH!|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TQUz>v@JxHcoS;kZCH*6Q1|j9 zssdjzAH#;4EyH3|zk1Z3xb5P0RAt^_IP+T%2bw5|*PSLvM%{`mXFjT=C8(7xM)sGj za_v>93hhBXCC5Cx)C4K0fpby2xB$~|4X(%I zs1o-{GF#5(9Dys1-OX|<@ja?S#VNhFW&vv4GE^d)Q>ec(^<2YY{FgcE@n}HZ(-zbw zZN-1P+u4nMX%8R^y%&Np9ml(PDJBtDqb9z9!|@iX;vK1su6z9@)fW<&j(_V f9+y2iDLXSSC#yCsHt~Nr!B-kv6X5$CKR);`By+MG diff --git a/pyweb/mumble/locale/de/LC_MESSAGES/django.po b/pyweb/mumble/locale/de/LC_MESSAGES/django.po index 94cec49..7583ee5 100644 --- a/pyweb/mumble/locale/de/LC_MESSAGES/django.po +++ b/pyweb/mumble/locale/de/LC_MESSAGES/django.po @@ -16,8 +16,8 @@ msgid "" msgstr "" "Project-Id-Version: Mumble-Django v0.8\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-02-28 20:31+0100\n" -"PO-Revision-Date: 2010-02-28 20:34\n" +"POT-Creation-Date: 2010-03-03 08:52+0100\n" +"PO-Revision-Date: 2010-03-03 08:53\n" "Last-Translator: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -60,7 +60,7 @@ msgstr "Nein" msgid "Public" msgstr "Öffentlich" -#: admin.py:113 templates/mumble/mumble.html:211 +#: admin.py:113 templates/mumble/mumble.html:214 msgid "Admin on root channel" msgstr "Admin im Wurzelkanal" @@ -257,7 +257,7 @@ msgstr "Benutzername und Login" msgid "Login password" msgstr "Passwort" -#: models.py:495 templates/mumble/mumble.html:281 +#: models.py:495 templates/mumble/mumble.html:284 msgid "Account owner" msgstr "Accountbesitzer" @@ -332,8 +332,8 @@ msgstr "" "

Du musst eingeloggt sein um auf diesem Mumble-Server einen Account registrieren zu können.

\n" " " -#: templates/mumble/mumble.html:64 templates/mumble/mumble.html.py:136 -#: templates/mumble/mumble.html:266 +#: templates/mumble/mumble.html:64 templates/mumble/mumble.html.py:139 +#: templates/mumble/mumble.html:269 msgid "User Texture" msgstr "Benutzertextur" @@ -382,7 +382,7 @@ msgstr "Online seit" msgid "Authenticated" msgstr "Authentifiziert" -#: templates/mumble/mumble.html:112 templates/mumble/mumble.html.py:124 +#: templates/mumble/mumble.html:112 templates/mumble/mumble.html.py:127 msgid "Admin" msgstr "Administrator" @@ -402,87 +402,91 @@ msgstr "Selbst stummgestellt" msgid "Deafened by self" msgstr "Selbst taubgestellt" -#: templates/mumble/mumble.html:119 +#: templates/mumble/mumble.html:118 +msgid "IP Address" +msgstr "IP-Adresse" + +#: templates/mumble/mumble.html:122 msgid "User" msgstr "Benutzer" -#: templates/mumble/mumble.html:122 +#: templates/mumble/mumble.html:125 msgid "Full Name" msgstr "Vollständiger Name" -#: templates/mumble/mumble.html:125 +#: templates/mumble/mumble.html:128 msgid "Sign-up date" msgstr "Datum der Anmeldung" -#: templates/mumble/mumble.html:130 +#: templates/mumble/mumble.html:133 msgid "User Comment" msgstr "Benutzer-Kommentar" -#: templates/mumble/mumble.html:142 templates/mumble/mumble.html.py:156 +#: templates/mumble/mumble.html:145 templates/mumble/mumble.html.py:159 msgid "Kick user" msgstr "Benutzer kicken" -#: templates/mumble/mumble.html:148 +#: templates/mumble/mumble.html:151 msgid "Reason" msgstr "Begründung" -#: templates/mumble/mumble.html:153 +#: templates/mumble/mumble.html:156 msgid "Ban user" msgstr "Benutzer bannen" -#: templates/mumble/mumble.html:163 +#: templates/mumble/mumble.html:166 msgid "Channel" msgstr "Kanal" -#: templates/mumble/mumble.html:165 +#: templates/mumble/mumble.html:168 msgid "Channel ID" msgstr "Kanal-ID" -#: templates/mumble/mumble.html:167 +#: templates/mumble/mumble.html:170 msgid "Connect" msgstr "Verbinden" -#: templates/mumble/mumble.html:170 +#: templates/mumble/mumble.html:173 msgid "Channel description" msgstr "Beschreibung des Kanals" -#: templates/mumble/mumble.html:217 +#: templates/mumble/mumble.html:220 msgid "Delete" msgstr "Löschen" -#: templates/mumble/mumble.html:253 +#: templates/mumble/mumble.html:256 msgid "Server Info" msgstr "Server-Infos" -#: templates/mumble/mumble.html:254 +#: templates/mumble/mumble.html:257 msgid "Registration" msgstr "Registrierung" -#: templates/mumble/mumble.html:263 +#: templates/mumble/mumble.html:266 msgid "Administration" msgstr "Administration" -#: templates/mumble/mumble.html:270 +#: templates/mumble/mumble.html:273 msgid "User List" msgstr "Benutzerliste" -#: templates/mumble/mumble.html:274 +#: templates/mumble/mumble.html:277 msgid "name" msgstr "Name" -#: templates/mumble/mumble.html:294 +#: templates/mumble/mumble.html:297 msgid "Change password" msgstr "Passwort ändern" -#: templates/mumble/mumble.html:307 +#: templates/mumble/mumble.html:310 msgid "Add" msgstr "Hinzufügen" -#: templates/mumble/mumble.html:319 +#: templates/mumble/mumble.html:322 msgid "Save" msgstr "Speichern" -#: templates/mumble/mumble.html:345 +#: templates/mumble/mumble.html:348 msgid "Resync with Murmur" msgstr "Liste neu laden" diff --git a/pyweb/mumble/mmobjects.py b/pyweb/mumble/mmobjects.py index 597e488..29b5e3a 100644 --- a/pyweb/mumble/mmobjects.py +++ b/pyweb/mumble/mmobjects.py @@ -14,6 +14,7 @@ * GNU General Public License for more details. """ +import socket import datetime import re from time import time @@ -200,16 +201,18 @@ class mmPlayer( object ): def getIpAsString( self ): """ Get the client's IPv4 or IPv6 address, in a pretty format. """ - ip = self.player_obj.address; - if max( ip[:10] ) == 0 and ip[10:12] == (255, 255): - return "%d.%d.%d.%d" % tuple( ip[12:] ); + addr = self.player_obj.address; + if max( addr[:10] ) == 0 and addr[10:12] == (255, 255): + return "%d.%d.%d.%d" % tuple( addr[12:] ); ip6addr = [(hi << 8 | lo) for (hi, lo) in zip(addr[0::2], addr[1::2])] # colon-separated string: ipstr = ':'.join([ ("%x" % part) for part in ip6addr ]); # 0:0:0 -> :: - return re.sub( "((^|:)(0:)+)", '::', ipstr, 1 ); + return re.sub( "((^|:)(0:){2,})", '::', ipstr, 1 ); ipaddress = property( getIpAsString ); + fqdn = property( lambda self: socket.getfqdn( self.ipaddress ), + doc="The fully qualified domain name of the user's host." ); # kept for compatibility to mmChannel (useful for traversal funcs) playerCount = property( lambda self: -1, doc="Exists only for compatibility to mmChannel." ); diff --git a/pyweb/mumble/templates/mumble/mumble.html b/pyweb/mumble/templates/mumble/mumble.html index b3f7dda..bfd03de 100644 --- a/pyweb/mumble/templates/mumble/mumble.html +++ b/pyweb/mumble/templates/mumble/mumble.html @@ -115,7 +115,7 @@
  • {% trans "Muted by self" %}: {{ item.selfMute|yesno }}
  • {% trans "Deafened by self" %}: {{ item.selfDeaf|yesno }}
  • {% if CurrentUserIsAdmin or user.is_staff %} -
  • {% trans "IP Address" %}: {{ item.ipaddress }}
  • +
  • {% trans "IP Address" %}: {{ item.fqdn }}
  • {% endif %} {% if item.mumbleuser and item.mumbleuser.owner %}