aboutsummaryrefslogtreecommitdiffstats
path: root/include/reddav.php
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2014-06-29 17:49:46 +0200
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2014-06-29 17:49:46 +0200
commit322091cd12ba972d1f3fee0df47ffb4e49a452ce (patch)
tree364190b66e0c3774495841e80e1b005a695bdb71 /include/reddav.php
parent5be3ba8436cbe998bdadc2404ebc7aafa05f94df (diff)
downloadvolse-hubzilla-322091cd12ba972d1f3fee0df47ffb4e49a452ce.tar.gz
volse-hubzilla-322091cd12ba972d1f3fee0df47ffb4e49a452ce.tar.bz2
volse-hubzilla-322091cd12ba972d1f3fee0df47ffb4e49a452ce.zip
Fixed some more timestamp bugs in RedDAV.
Fixed an SQL-query in RedFile::put(), where parameters where in wrong order.
Diffstat (limited to 'include/reddav.php')
-rw-r--r--include/reddav.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/reddav.php b/include/reddav.php
index 2c2ddcb1c..1eaf7cd02 100644
--- a/include/reddav.php
+++ b/include/reddav.php
@@ -476,8 +476,8 @@ class RedFile extends DAV\Node implements DAV\IFile {
// @todo only 3 values are needed
$c = q("SELECT * FROM channel WHERE channel_id = %d AND NOT (channel_pageflags & %d) LIMIT 1",
- intval(PAGE_REMOVED),
- intval($this->auth->owner_id)
+ intval($this->auth->owner_id),
+ intval(PAGE_REMOVED)
);
$r = q("SELECT flags, folder, data FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1",
@@ -518,7 +518,7 @@ class RedFile extends DAV\Node implements DAV\IFile {
);
// update the folder's lastmodified timestamp
- $e = q("UPDATE attach SET edited = '%s' WHERE folder = '%s' AND uid = %d LIMIT 1",
+ $e = q("UPDATE attach SET edited = '%s' WHERE hash = '%s' AND uid = %d LIMIT 1",
dbesc($edited),
dbesc($r[0]['folder']),
intval($c[0]['channel_id'])
@@ -628,12 +628,14 @@ class RedFile extends DAV\Node implements DAV\IFile {
}
/**
- * @brief Delete the current file.
+ * @brief Delete the file.
*
* @throw DAV\Exception\Forbidden
* @return void
*/
public function delete() {
+ logger('RedFile::delete(): ' . basename($this->name), LOGGER_DEBUG);
+
if ((! $this->auth->owner_id) || (! perm_is_allowed($this->auth->owner_id, $this->auth->observer, 'write_storage'))) {
throw new DAV\Exception\Forbidden('Permission denied.');
}
@@ -732,7 +734,7 @@ function RedCollectionData($file, &$auth) {
$permission_error = false;
for ($x = 1; $x < count($path_arr); $x++) {
- $r = q("select id, hash, filename, flags from attach where folder = '%s' and filename = '%s' and uid = %d and (flags & %d) $perms limit 1",
+ $r = q("SELECT id, hash, filename, flags FROM attach WHERE folder = '%s' AND filename = '%s' AND uid = %d AND (flags & %d) $perms LIMIT 1",
dbesc($folder),
dbesc($path_arr[$x]),
intval($channel_id),