cvs: pear /HTTP_WebDAV_Server Server.php /HTTP_WebDAV_Server/Server Filesystem.php /HTTP_WebDAV_Server/db Fileserver.sql

From: Date: Mon, 02 Oct 2006 10:38:30 +0000
Subject: cvs: pear /HTTP_WebDAV_Server Server.php /HTTP_WebDAV_Server/Server Filesystem.php /HTTP_WebDAV_Server/db Fileserver.sql
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-42344@lists.php.net to get a copy of this message
hholzgra Mon Oct 2 10:38:30 2006 UTC Modified files: /pear/HTTP_WebDAV_Server Server.php /pear/HTTP_WebDAV_Server/Server Filesystem.php /pear/HTTP_WebDAV_Server/db Fileserver.sql Log: fix for "PROPFIND does not report lock-null resources" (PEAR Bug #8570) http://cvs.php.net/viewvc.cgi/pear/HTTP_WebDAV_Server/Server.php?r1=1.53&r2=1.54&diff_format=u Index: pear/HTTP_WebDAV_Server/Server.php diff -u pear/HTTP_WebDAV_Server/Server.php:1.53 pear/HTTP_WebDAV_Server/Server.php:1.54 --- pear/HTTP_WebDAV_Server/Server.php:1.53 Mon Oct 2 07:45:13 2006 +++ pear/HTTP_WebDAV_Server/Server.php Mon Oct 2 10:38:30 2006 @@ -17,7 +17,7 @@ // | Christian Stocker <chregu@bitflux.ch> | // +----------------------------------------------------------------------+ // -// $Id: Server.php,v 1.53 2006/10/02 07:45:13 hholzgra Exp $ +// $Id: Server.php,v 1.54 2006/10/02 10:38:30 hholzgra Exp $ // require_once "HTTP/WebDAV/Tools/_parse_propfind.php"; require_once "HTTP/WebDAV/Tools/_parse_proppatch.php"; @@ -539,8 +539,29 @@ $files = Array(); // call user handler if (!$this->PROPFIND($options, $files)) { - $this->http_status("404 Not Found"); - return; + $files = array("files" => array()); + if (method_exists($this, "checkLock")) { + // is locked? + $lock = $this->checkLock($this->path); + + if (is_array($lock) && count($lock)) { + $created = isset($lock['created']) ? $lock['created'] : time(); + $modified = isset($lock['modified']) ? $lock['modified'] : time(); + $files['files'][] = array("path" => $this->_slashify($this->path), + "props" => array($this->mkprop("displayname", $this->path), + $this->mkprop("creationdate", $created), + $this->mkprop("getlastmodified", $modified), + $this->mkprop("resourcetype", ""), + $this->mkprop("getcontenttype", ""), + $this->mkprop("getcontentlength", 0)) + ); + } + } + + if (empty($files['files'])) { + $this->http_status("404 Not Found"); + return; + } } // collect namespaces here http://cvs.php.net/viewvc.cgi/pear/HTTP_WebDAV_Server/Server/Filesystem.php?r1=1.32&r2=1.33&diff_format=u Index: pear/HTTP_WebDAV_Server/Server/Filesystem.php diff -u pear/HTTP_WebDAV_Server/Server/Filesystem.php:1.32 pear/HTTP_WebDAV_Server/Server/Filesystem.php:1.33 --- pear/HTTP_WebDAV_Server/Server/Filesystem.php:1.32 Mon Oct 2 07:57:34 2006 +++ pear/HTTP_WebDAV_Server/Server/Filesystem.php Mon Oct 2 10:38:30 2006 @@ -698,7 +698,10 @@ mysql_free_result($res); if (is_array($row)) { - $query = "UPDATE {$this->db_prefix}locks SET expires = '$options[timeout]' $where"; + $query = "UPDATE {$this->db_prefix}locks + SET expires = '$options[timeout]' + , modified = ".time()." + $where"; mysql_query($query); $options['owner'] = $row['owner']; @@ -714,6 +717,8 @@ $query = "INSERT INTO {$this->db_prefix}locks SET token = '$options[locktoken]' , path = '$options[path]' + , created = ".time()." + , modified = ".time()." , owner = '$options[owner]' , expires = '$options[timeout]' , exclusivelock = " .($options['scope'] === "exclusive" ? "1" : "0") @@ -749,7 +754,7 @@ { $result = false; - $query = "SELECT owner, token, expires, exclusivelock + $query = "SELECT owner, token, created, modified, expires, exclusivelock FROM {$this->db_prefix}locks WHERE path = '$path' "; @@ -765,6 +770,8 @@ "depth" => 0, "owner" => $row['owner'], "token" => $row['token'], + "created" => $row['created'], + "modified" => $row['modified'], "expires" => $row['expires'] ); } http://cvs.php.net/viewvc.cgi/pear/HTTP_WebDAV_Server/db/Fileserver.sql?r1=1.1&r2=1.2&diff_format=u Index: pear/HTTP_WebDAV_Server/db/Fileserver.sql diff -u pear/HTTP_WebDAV_Server/db/Fileserver.sql:1.1 pear/HTTP_WebDAV_Server/db/Fileserver.sql:1.2 --- pear/HTTP_WebDAV_Server/db/Fileserver.sql:1.1 Thu Apr 22 20:06:27 2004 +++ pear/HTTP_WebDAV_Server/db/Fileserver.sql Mon Oct 2 10:38:30 2006 @@ -4,6 +4,9 @@ --------------------------------------------------------- -- Server version 4.0.3-beta +CREATE DATABASE webdav; +USE webdav; + -- -- Table structure for table 'locks' --

« previous php.pear.cvs (#42344) next »