Browse Source

- delete properties on node delete

- move properties on node move
tags/v6.0.0beta2
Thomas Müller 10 years ago
parent
commit
09903aa36c

+ 3
- 0
lib/private/connector/sabre/file.php View File

@@ -148,6 +148,9 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
}
\OC\Files\Filesystem::unlink($this->path);

// remove properties
$this->removeProperties();

}

/**

+ 11
- 0
lib/private/connector/sabre/node.php View File

@@ -190,6 +190,17 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
return true;
}

/**
* removes all properties for this node and user
*/
public function removeProperties() {
$query = OC_DB::prepare( 'DELETE FROM `*PREFIX*properties`'
.' WHERE `userid` = ? AND `propertypath` = ?' );
$query->execute( array( OC_User::getUser(), $this->path));

$this->setPropertyCache(null);
}

/**
* @brief Returns a list of properties for this nodes.;
* @param array $properties

+ 5
- 0
lib/private/connector/sabre/objecttree.php View File

@@ -97,6 +97,11 @@ class ObjectTree extends \Sabre_DAV_ObjectTree {
throw new \Sabre_DAV_Exception_Forbidden('');
}

// update properties
$query = \OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertypath` = ?'
.' WHERE `userid` = ? AND `propertypath` = ?' );
$query->execute( array( $destinationPath, \OC_User::getUser(), $sourcePath ));

$this->markDirty($sourceDir);
$this->markDirty($destinationDir);


Loading…
Cancel
Save