diff options
Diffstat (limited to 'lib/Connector/Sabre/node.php')
-rw-r--r-- | lib/Connector/Sabre/node.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Connector/Sabre/node.php b/lib/Connector/Sabre/node.php index 0e8bae75fd9..dc1013dc524 100644 --- a/lib/Connector/Sabre/node.php +++ b/lib/Connector/Sabre/node.php @@ -71,9 +71,14 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr list(, $newName) = Sabre_DAV_URLUtil::splitPath($name); $newPath = $parentPath . '/' . $newName; + $oldPath = $this->path; + OC_FILESYSTEM::rename($this->path,$newPath); $this->path = $newPath; + + $query = OC_DB::prepare( 'UPDATE *PREFIX*properties SET propertypath = ? WHERE userid = ? AND propertypath = ?' ); + $query->execute( array( $newPath,OC_USER::getUser(), $oldPath )); } @@ -104,17 +109,17 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr if (is_null($propertyValue)) { if(array_key_exists( $propertyName, $existing )){ $query = OC_DB::prepare( 'DELETE FROM *PREFIX*properties WHERE userid = ? AND propertypath = ? AND propertyname = ?' ); - $query->execute( array( 'OC_USER::getUser()', $this->path, $propertyName )); + $query->execute( array( OC_USER::getUser(), $this->path, $propertyName )); } } else { if(!array_key_exists( $propertyName, $existing )){ $query = OC_DB::prepare( 'INSERT INTO *PREFIX*properties (userid,propertypath,propertyname,propertyvalue) VALUES(?,?,?,?)' ); - $query->execute( array( 'OC_USER::getUser()', $this->path, $propertyName,$propertyValue )); + $query->execute( array( OC_USER::getUser(), $this->path, $propertyName,$propertyValue )); } - elseif($existing[$propertyName] !== $propertyValue){ + else{ $query = OC_DB::prepare( 'UPDATE *PREFIX*properties SET propertyvalue = ? WHERE userid = ? AND propertypath = ? AND propertyname = ?' ); - $query->execute( array( $propertyValue,'OC_USER::getUser()', $this->path, $propertyName )); + $query->execute( array( $propertyValue,OC_USER::getUser(), $this->path, $propertyName )); } } @@ -134,7 +139,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr function getProperties($properties) { // At least some magic in here :-) $query = OC_DB::prepare( 'SELECT * FROM *PREFIX*properties WHERE userid = ? AND propertypath = ?' ); - $result = $query->execute( array( 'OC_USER::getUser()', $this->path )); + $result = $query->execute( array( OC_USER::getUser(), $this->path )); $existing = array(); while( $row = $result->fetchRow()){ |