This commit is contained in:
Jakob Sack 2012-07-31 23:31:25 +02:00
parent 36ccaf51ed
commit 1fe9892292
1 changed files with 7 additions and 4 deletions

View File

@ -41,8 +41,11 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
// NOTE: the following 10 lines or so could be easily replaced by // NOTE: the following 10 lines or so could be easily replaced by
// pure sql. MySQL's non-standard string concatination prevents us // pure sql. MySQL's non-standard string concatination prevents us
// from doing this though. // from doing this though.
$query = 'SELECT * FROM *PREFIX*locks WHERE userid = ? AND (created + timeout) > ? AND ((uri = ?)'; // NOTE: SQLite requires time() to be inserted directly. That's ugly
$params = array(OC_User::getUser(),time(),$uri); // but otherwise reading locks from SQLite Databases will return
// nothing
$query = 'SELECT * FROM *PREFIX*locks WHERE userid = ? AND (created + timeout) > '.time().' AND (( uri = ?)';
$params = array(OC_User::getUser(),$uri);
// We need to check locks for every part in the uri. // We need to check locks for every part in the uri.
$uriParts = explode('/',$uri); $uriParts = explode('/',$uri);
@ -70,8 +73,8 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
} }
$query.=')'; $query.=')';
$stmt = OC_DB::prepare($query); $stmt = OC_DB::prepare($query );
$result = $stmt->execute($params); $result = $stmt->execute( $params );
$lockList = array(); $lockList = array();
while( $row = $result->fetchRow()){ while( $row = $result->fetchRow()){