Bug fixes for unshare() and opendir(), thanks darkh
This commit is contained in:
parent
4993fb4665
commit
17b5bcb24f
|
@ -246,7 +246,7 @@ class OC_SHARE {
|
||||||
* @param $uid_shared_with Array of users to unshare the item from
|
* @param $uid_shared_with Array of users to unshare the item from
|
||||||
*/
|
*/
|
||||||
public static function unshare($source, $uid_shared_with) {
|
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) {
|
foreach ($uid_shared_with as $uid) {
|
||||||
$query->execute(array(strlen($source), $source, $uid, OC_USER::getUser()));
|
$query->execute(array(strlen($source), $source, $uid, OC_USER::getUser()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,9 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
|
||||||
global $FAKEDIRS;
|
global $FAKEDIRS;
|
||||||
$path = $this->datadir.$path;
|
$path = $this->datadir.$path;
|
||||||
$sharedItems = OC_SHARE::getItemsInFolder($path);
|
$sharedItems = OC_SHARE::getItemsInFolder($path);
|
||||||
|
if (empty($sharedItems)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
foreach ($sharedItems as $item) {
|
foreach ($sharedItems as $item) {
|
||||||
// If item is in the root of the shared storage provider add it to the fakedirs
|
// If item is in the root of the shared storage provider add it to the fakedirs
|
||||||
if (dirname($item['target'])."/" == $path) {
|
if (dirname($item['target'])."/" == $path) {
|
||||||
|
|
Loading…
Reference in New Issue