diff options
author | Brion Vibber <brion@pobox.com> | 2009-11-08 14:33:22 +0100 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2009-11-08 14:40:30 +0100 |
commit | 8d44b6a5a2965b37002efd26f23a7cfeb5109391 (patch) | |
tree | 532f5864ce3be5e3c0f2b31a13db31150fccf204 /classes | |
parent | 5c428f8adf5d4686988f371e3de204ac6e70b99a (diff) |
Fix bug 1962: deleteuser.php regression when OpenID plugin not enabled
The User_openid data object was explicitly listed as a related field to delete from in User::delete(); this class doesn't exist anymore by default since OpenID was broken out to a plugin.
Added UserDeleteRelated event for plugins to add related tables to delete from at user delete time.
Diffstat (limited to 'classes')
-rw-r--r-- | classes/User.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/classes/User.php b/classes/User.php index 96a64ccb2..b0d372be8 100644 --- a/classes/User.php +++ b/classes/User.php @@ -719,16 +719,18 @@ class User extends Memcached_DataObject function delete() { $profile = $this->getProfile(); - $profile->delete(); + if ($profile) { + $profile->delete(); + } $related = array('Fave', - 'User_openid', 'Confirm_address', 'Remember_me', 'Foreign_link', 'Invitation', 'Notice_inbox', ); + Event::handle('UserDeleteRelated', array($this, &$related)); foreach ($related as $cls) { $inst = new $cls(); |