r1228: Forgot to update caches when the display name changes 1.1.0
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 1 Oct 2006 19:03:09 +0000 (19:03 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 1 Oct 2006 19:03:09 +0000 (19:03 +0000)
docs/changes.txt
includes/api_user.php

index afa898ec175001d5c70afc89e49ff9581b5dff42..b43d442651c96dd113b27282f86a8e54cd4b56dd 100644 (file)
@@ -7,6 +7,7 @@
 - If no custom fields were setup, an empty query error would be thrown [newreport.php#130]
 - If no custom fields were present, adding an automation would fail [admin/automation.php#74]
 - Remove a warning when saving a usergroup and there are no custom fields present [admin/usergroup.php#221]
+- Update cached usernames when the display name changes
 
 1.1.0 Release Candidate 1
 ===============================
index 4865bbaaac66d94b05e64a9dc7e77f42e7391b72..aa91f77d5fa97f501f5d5a09a714d5400f8e15b3 100644 (file)
@@ -217,6 +217,13 @@ class UserAPI extends API
        */
        function post_update()
        {
+               $username =  $this->registry->escape($this->values['displayname']);
+               $id = $this->values['userid'];
+               
+               $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET username = '$username' WHERE userid = $id");
+               $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET lastpostbyname = '$username' WHERE lastpostby = $id");
+               $this->registry->db->query("UPDATE " . TABLE_PREFIX . "bug SET hiddenlastpostbyname = '$username' WHERE hiddenlastpostby = $id");
+               
                build_assignedto();
        }