From 1b9615b33afb24bbed888624d2b187a8d93b8402 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 1 Oct 2006 19:03:09 +0000 Subject: [PATCH] r1228: Forgot to update caches when the display name changes --- docs/changes.txt | 1 + includes/api_user.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index afa898e..b43d442 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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 =============================== diff --git a/includes/api_user.php b/includes/api_user.php index 4865bba..aa91f77 100644 --- a/includes/api_user.php +++ b/includes/api_user.php @@ -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(); } -- 2.43.5