From e6f6c62113d101cc7297521ade48ce85e9faac7f Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Sun, 25 Jul 2010 01:48:36 +0200 Subject: [PATCH] some fixes --- inc/lib_base.php | 1 + inc/lib_ocs.php | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/inc/lib_base.php b/inc/lib_base.php index df6df15cc23..5b80055ad83 100644 --- a/inc/lib_base.php +++ b/inc/lib_base.php @@ -376,6 +376,7 @@ class OC_DB { * @return result-set */ static function query($cmd){ + error_log($cmd); global $CONFIG_DBTYPE; if(!trim($cmd)){ return false; diff --git a/inc/lib_ocs.php b/inc/lib_ocs.php index 708500d4094..a4d9534bb30 100644 --- a/inc/lib_ocs.php +++ b/inc/lib_ocs.php @@ -135,14 +135,15 @@ class OC_OCS { // PRIVATEDATA // get - GET DATA - }elseif(($method=='get') and (strtolower($ex[$paracount-5])=='v1.php')and (strtolower($ex[$paracount-3])=='privatedata')){ + }elseif(($method=='get') and (strtolower($ex[$paracount-4])=='v1.php')and (strtolower($ex[$paracount-3])=='privatedata')){ $key=OC_OCS::readdata('key','text'); OC_OCS::privateDataGet($key); // set - POST DATA - }elseif(($method=='post') and (strtolower($ex[$paracount-5])=='v1.php')and (strtolower($ex[$paracount-3])=='privatedata')){ + }elseif(($method=='post') and (strtolower($ex[$paracount-4])=='v1.php')and (strtolower($ex[$paracount-3])=='privatedata')){ $key=OC_OCS::readdata('key','text'); - $value=OC_OCS::readdata('key','text'); + $value=OC_OCS::readdata('value','text'); + error_log("key: '$key', value: '$value'"); OC_OCS::privatedataset($key, $value); }else{ @@ -457,7 +458,7 @@ class OC_OCS { } /** - * set private data referenced by $key to $valu` + * set private data referenced by $key to $value * @param string $key * @param string $value * @return string xml/json @@ -471,9 +472,9 @@ class OC_OCS { $result=OC_DB::query("select count(*) as co from {$CONFIG_DBTABLEPREFIX}privatedata where key = '".$key."'"); // $entry=$result->fetchRow(); //$totalcount=$entry['co']; - $totalcount=$result['co']; - die($totalcount); + $totalcount=(integer)$result['co']; OC_DB::free_result($result); + error_log($totalcount); if ($totalcount != 0) { $result = OC_DB::query("update {$CONFIG_DBTABLEPREFIX}privatedata set value='".addslashes($value)."', timestamp = now() where key = '".addslashes($key)."'"); -- 2.39.5