]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix some database errors
authorRobin Appelman <icewind1991@gmail.com>
Mon, 5 Jul 2010 11:39:53 +0000 (13:39 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Mon, 5 Jul 2010 11:39:53 +0000 (13:39 +0200)
inc/HTTP/WebDAV/Server/Filesystem.php
inc/lib_config.php
inc/lib_log.php

index b99bbdbb81eece50170a73193711b30f34031b97..a41d36873036ad1ca7762827cc7e6d52191b40e5 100755 (executable)
      */
     function PUT(&$options) 
     {
+               error_log("put $fspath");
         $fspath = $options["path"];
         $dir = dirname($fspath);
         if (!OC_FILESYSTEM::file_exists($dir) || !OC_FILESYSTEM::is_dir($dir)) {
                 return true;
             } else {//check for indirect refresh
                $query = "SELECT *
-                  FROM locks
+                  FROM {$CONFIG_DBTABLEPREFIX}locks
                  WHERE recursive = 1
                ";
             $res = OC_DB::select($query);
             foreach($res as $row){
                                if(strpos($options['path'],$row['path'])==0){//are we a child of a folder with an recursive lock
                                        $where = "WHERE path = '$row[path]' AND token = '$options[update]'";
-                                        $query = "UPDATE `locks` SET `expires` = '$options[timeout]', `modified` = ".time()." $where";
+                                        $query = "UPDATE `{$CONFIG_DBTABLEPREFIX}locks` SET `expires` = '$options[timeout]', `modified` = ".time()." $where";
                 OC_DB::query($query);
                 $options['owner'] = $row['owner'];
                 $options['scope'] = $row["exclusivelock"] ? "exclusive" : "shared";
         }else{
                        //check for recursive locks;
                        $query = "SELECT *
-                  FROM locks
+                  FROM {$CONFIG_DBTABLEPREFIX}locks
                  WHERE recursive = 1
                ";
             $res = OC_DB::select($query);
index 78e10f9474e474891b4a997116867d76f9f46878..dad2fbf81599972f917987b13e53aebfd5249bd9 100755 (executable)
@@ -336,7 +336,6 @@ class OC_CONFIG{
                                $result = pg_exec($connection, $query);
                        }
                }
-               global $CONFIG_DBTABLEPREFIX;
        }
 }
 ?>
index f163fb9fe949adc2462c5284f9777cdd26ba52e3..ce46e9a683d90225d83e6ff36e17c119b22a4b72 100755 (executable)
@@ -69,7 +69,6 @@ class OC_LOG {
                $user=$_SESSION['username_clean'];
                $result = OC_DB::select('select `timestamp`,`user`,`type`,`message` from '.$CONFIG_DBTABLEPREFIX.'log where user=\''.$user.'\' order by timestamp desc limit 20');
        }
-       $result = OC_DB::select($query);
     foreach($result as $entry){
       echo('<tr class="browserline">');
       echo('<td class="sizetext">'.date($CONFIG_DATEFORMAT,$entry['timestamp']).'</td>');