public function deleteID($userID, $options = [])
{
if ($userID == $this->getSystemUserID()) {
$this->Validation->addValidationResult('', 'You cannot delete the system user.');
return false;
}
$Content = [];
// Remove shared authentications.
$this->getDelete('UserAuthentication', ['UserID' => $userID], $Content);
// Remove role associations.
$this->getDelete('UserRole', ['UserID' => $userID], $Content);
$this->deleteContent($userID, $options, $Content);
// Remove the user's information
$this->SQL->update('User')->set(['Name' => t('[Deleted User]'), 'Photo' => null, 'Password' => randomString('10'), 'About' => '', 'Email' => 'user_' . $userID . '@deleted.email', 'ShowEmail' => '0', 'Gender' => 'u', 'CountVisits' => 0, 'CountInvitations' => 0, 'CountNotifications' => 0, 'InviteUserID' => null, 'DiscoveryText' => '', 'Preferences' => null, 'Permissions' => null, 'Attributes' => dbencode(['State' => 'Deleted']), 'DateSetInvitations' => null, 'DateOfBirth' => null, 'DateUpdated' => Gdn_Format::toDateTime(), 'HourOffset' => '0', 'Score' => null, 'Admin' => 0, 'Deleted' => 1])->where('UserID', $userID)->put();
// Remove user's cache rows
$this->clearCache($userID);
return true;
}