Merge pull request #6881 from owncloud/remove-user-storage-entry

Also remove the user's home storage from the storage table when deleting a user
remotes/origin/ldap_group_count
Vincent Petry 11 years ago
commit bea80ffe20
  1. 19
      lib/private/files/cache/storage.php
  2. 3
      lib/private/user.php

@ -70,4 +70,23 @@ class Storage {
return false;
}
}
/**
* remove the entry for the storage
*
* @param string $storageId
*/
public static function remove($storageId) {
$storageCache = new Storage($storageId);
$numericId = $storageCache->getNumericId();
if (strlen($storageId) > 64) {
$storageId = md5($storageId);
}
$sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?';
\OC_DB::executeAudited($sql, array($storageId));
$sql = 'DELETE FROM `*PREFIX*filecache` WHERE `storage` = ?';
\OC_DB::executeAudited($sql, array($numericId));
}
}

@ -205,6 +205,9 @@ class OC_User {
// Delete user files in /data/
OC_Helper::rmdirr(\OC_User::getHome($uid));
// Delete the users entry in the storage table
\OC\Files\Cache\Storage::remove('home::' . $uid);
// Remove it from the Cache
self::getManager()->delete($uid);
}

Loading…
Cancel
Save