fix ocs path and queries

This commit is contained in:
Thibaut GRIDEL 2010-05-16 23:13:42 +02:00
parent d7bb8c4c30
commit 477b9877a0
2 changed files with 21 additions and 23 deletions

View File

@ -186,7 +186,7 @@
// get additional properties from database
$query = "SELECT ns, name, value FROM properties WHERE path = '$path'";
$res = OC_DB::select($query);
while ($row = $res[0]) {
foreach ($res as $row) {
$info["props"][] = $this->mkprop($row["ns"], $row["name"], $row["value"]);
}
return $info;
@ -608,9 +608,7 @@
$where = "WHERE path = '$options[path]' AND token = '$options[update]'";
$query = "SELECT owner, exclusivelock FROM locks $where";
$res = OC_DB::query($query);
$row = OC_DB::fetch_assoc($res);
OC_DB::free_result($res);
$row = OC_DB::select($query);
if (is_array($row)) {
$query = "UPDATE `locks` SET `expires` = '$options[timeout]', `modified` = ".time()." $where";

View File

@ -97,7 +97,7 @@ class OC_OCS {
}
// preprocess url
$url=$_SERVER['PHP_SELF'];
$url=$_SERVER['REQUEST_URI'];
if(substr($url,(strlen($url)-1))<>'/') $url.='/';
$ex=explode('/',$url);
$paracount=count($ex);
@ -375,8 +375,8 @@ class OC_OCS {
$user=OC_OCS::checkpassword();
$result = OC_DB::query('select count(id) as co from log');
$entry=OC_DB::fetch_assoc($result);
$result = OC_DB::query('select count(*) as co from log');
$entry=$result->fetchRow();
$totalcount=$entry['co'];
OC_DB::free_result($result);