[Pkg-owncloud-commits] [owncloud] 97/145: Also remove the user's home storage from the storage table when deleting a user

David Prévot taffit at moszumanska.debian.org
Wed Feb 26 16:27:45 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit b0ba69ff31fd4776ef6896a527077bfbe17d2697
Author: Robin Appelman <icewind at owncloud.com>
Date:   Tue Jan 21 23:58:48 2014 +0100

    Also remove the user's home storage from the storage table when deleting a user
---
 lib/private/files/cache/storage.php | 13 +++++++++++++
 lib/private/user.php                |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/lib/private/files/cache/storage.php b/lib/private/files/cache/storage.php
index 5657cf0..6d7a100 100644
--- a/lib/private/files/cache/storage.php
+++ b/lib/private/files/cache/storage.php
@@ -70,4 +70,17 @@ class Storage {
 			return false;
 		}
 	}
+
+	/**
+	 * remove the entry for the storage
+	 *
+	 * @param string $storageId
+	 */
+	public static function remove($storageId) {
+		if (strlen($storageId) > 64) {
+			$storageId = md5($storageId);
+		}
+		$sql = 'DELETE FROM `*PREFIX*storages` WHERE `id` = ?';
+		\OC_DB::executeAudited($sql, array($storageId));
+	}
 }
diff --git a/lib/private/user.php b/lib/private/user.php
index 98ebebb..2519200 100644
--- a/lib/private/user.php
+++ b/lib/private/user.php
@@ -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);
 			}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list