Infinite loop on CLI initiated profile deletion for local users
profile deleting user deleting profile deleting user...
This commit is contained in:
parent
9fdf6474f8
commit
6f62adedfc
|
@ -877,6 +877,11 @@ class Profile extends Managed_DataObject
|
||||||
|
|
||||||
function delete($useWhere=false)
|
function delete($useWhere=false)
|
||||||
{
|
{
|
||||||
|
// just in case it hadn't been done before... (usually set before adding deluser to queue handling!)
|
||||||
|
if (!$this->hasRole(Profile_role::DELETED)) {
|
||||||
|
$this->grantRole(Profile_role::DELETED);
|
||||||
|
}
|
||||||
|
|
||||||
$this->_deleteNotices();
|
$this->_deleteNotices();
|
||||||
$this->_deleteSubscriptions();
|
$this->_deleteSubscriptions();
|
||||||
$this->_deleteTags();
|
$this->_deleteTags();
|
||||||
|
|
|
@ -598,8 +598,10 @@ class User extends Managed_DataObject
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$profile = $this->getProfile();
|
if (!$this->hasRole(Profile_role::DELETED)) {
|
||||||
$profile->delete();
|
$profile = $this->getProfile();
|
||||||
|
$profile->delete();
|
||||||
|
}
|
||||||
} catch (UserNoProfileException $unp) {
|
} catch (UserNoProfileException $unp) {
|
||||||
common_log(LOG_INFO, "User {$this->nickname} has no profile; continuing deletion.");
|
common_log(LOG_INFO, "User {$this->nickname} has no profile; continuing deletion.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,13 @@ class DelUserQueueHandler extends QueueHandler
|
||||||
$qm = QueueManager::get();
|
$qm = QueueManager::get();
|
||||||
$qm->enqueue($user, 'deluser');
|
$qm->enqueue($user, 'deluser');
|
||||||
} else {
|
} else {
|
||||||
// Out of notices? Let's finish deleting this guy!
|
// Out of notices? Let's finish deleting this profile!
|
||||||
$user->delete();
|
try {
|
||||||
|
$user->getProfile()->delete();
|
||||||
|
} catch (UserNoProfileException $e) {
|
||||||
|
// in case a profile didn't exist for some reason, just delete the User directly
|
||||||
|
$user->delete();
|
||||||
|
}
|
||||||
common_log(LOG_INFO, "User $user->id $user->nickname deleted.");
|
common_log(LOG_INFO, "User $user->id $user->nickname deleted.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user