aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/users.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r--engine/lib/users.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 5892035a6..0857c520a 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -153,6 +153,16 @@ class ElggUser extends ElggEntity
* @return bool
*/
public function delete() {
+ global $USERNAME_TO_GUID_MAP_CACHE, $CODE_TO_GUID_MAP_CACHE;
+
+ // clear cache
+ if (isset($USERNAME_TO_GUID_MAP_CACHE[$this->username])) {
+ unset($USERNAME_TO_GUID_MAP_CACHE[$this->username]);
+ }
+ if (isset($CODE_TO_GUID_MAP_CACHE[$this->code])) {
+ unset($CODE_TO_GUID_MAP_CACHE[$this->code]);
+ }
+
// Delete owned data
clear_annotations_by_owner($this->guid);
clear_metadata_by_owner($this->guid);