Bug fixes for unshare() and opendir(), thanks darkh

This commit is contained in:
Michael Gapczynski 2011-07-24 14:38:01 -04:00
parent 4993fb4665
commit 17b5bcb24f
2 changed files with 4 additions and 1 deletions

View file

@ -246,7 +246,7 @@ class OC_SHARE {
* @param $uid_shared_with Array of users to unshare the item from
*/
public static function unshare($source, $uid_shared_with) {
$query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE source SUBSTR(source, 1, ?) = ? AND uid_shared_with = ? AND uid_owner = ?");
$query = OC_DB::prepare("DELETE FROM *PREFIX*sharing WHERE SUBSTR(source, 1, ?) = ? AND uid_shared_with = ? AND uid_owner = ?");
foreach ($uid_shared_with as $uid) {
$query->execute(array(strlen($source), $source, $uid, OC_USER::getUser()));
}

View file

@ -77,6 +77,9 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
global $FAKEDIRS;
$path = $this->datadir.$path;
$sharedItems = OC_SHARE::getItemsInFolder($path);
if (empty($sharedItems)) {
return false;
}
foreach ($sharedItems as $item) {
// If item is in the root of the shared storage provider add it to the fakedirs
if (dirname($item['target'])."/" == $path) {