Log User object ID even when account is an admin 0.0.2
authorJeremy Stanley <fungi@yuggoth.org>
Fri, 27 Sep 2019 16:26:54 +0000 (16:26 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Fri, 27 Sep 2019 16:26:54 +0000 (16:26 +0000)
Adjust authentication logging to consistently record the User object
instance ID regardless of, and separately from, whether the account
which authenticated is an administrator.

mudpy/misc.py

index b83215c..eea2f00 100644 (file)
@@ -637,14 +637,13 @@ class User:
         """Flag the user as authenticated and disconnect duplicates."""
         if self.state != "authenticated":
             self.authenticated = True
+            log("User %s authenticated for account %s." % (
+                    self, self.account.subkey), 2)
             if ("mudpy.limit" in universe.contents and self.account.subkey in
                     universe.contents["mudpy.limit"].get("admins")):
                 self.account.set("administrator", True)
-                log("Administrator %s authenticated." %
-                    self.account.get("name"), 2)
-            else:
-                log("User %s authenticated for account %s." % (
-                        self, self.account.subkey), 2)
+                log("Account %s is an administrator." % (
+                        self.account.subkey), 2)
 
     def show_menu(self):
         """Send the user their current menu."""