Signed-off-by: Joas Schilling <coding@schilljs.com>
}
}
+ /**
+ * delete user from accounts table
+ *
+ * @param IUser $user
+ */
+ public function deleteUser(IUser $user) {
+ $uid = $user->getUID();
+ $query = $this->connection->getQueryBuilder();
+ $query->delete($this->table)
+ ->where($query->expr()->eq('uid', $query->createNamedParameter($uid)))
+ ->execute();
+ }
+
/**
* get stored data from a given user
*
namespace OC\User;
+use OC\Accounts\AccountManager;
use OC\Files\Cache\Storage;
use OC\Hooks\Emitter;
use OC_Helper;
$notification->setUser($this->uid);
\OC::$server->getNotificationManager()->markProcessed($notification);
+ /** @var AccountManager $accountManager */
+ $accountManager = \OC::$server->query(AccountManager::class);
+ $accountManager->deleteUser($this);
+
if ($this->emitter) {
$this->emitter->emit('\OC\User', 'postDelete', array($this));
}