diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/filestorage.php | 5 | ||||
-rw-r--r-- | lib/filesystem.php | 6 | ||||
-rw-r--r-- | lib/installer.php | 2 | ||||
-rw-r--r-- | lib/ocsclient.php | 22 |
4 files changed, 26 insertions, 9 deletions
diff --git a/lib/filestorage.php b/lib/filestorage.php index 66b91fc19aa..5161e7f0e57 100644 --- a/lib/filestorage.php +++ b/lib/filestorage.php @@ -75,6 +75,7 @@ class OC_FILESTORAGE{ public function find($path){} public function getTree($path){} public function hash($type,$path,$raw){} + public function free_space($path){} } @@ -466,6 +467,10 @@ class OC_FILESTORAGE_LOCAL extends OC_FILESTORAGE{ } return $return; } + + public function free_space($path){ + return disk_free_space($this->datadir.$path); + } /** * @brief get the size of folder and it's content diff --git a/lib/filesystem.php b/lib/filesystem.php index 54b2ad9ce77..033f50e2aba 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -386,5 +386,11 @@ class OC_FILESYSTEM{ return $storage->hash($type,self::getInternalPath($path),$raw); } } + + static public function free_space($path='/'){ + if(self::canRead($path) and $storage=self::getStorage($path)){ + return $storage->free_space($path); + } + } } ?> diff --git a/lib/installer.php b/lib/installer.php index 14e2be6600f..965642e8476 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -68,7 +68,7 @@ class OC_INSTALLER{ self::createDBUser($username,$password,$connection); //use the admin login data for the new database user OC_CONFIG::setValue('dbuser',$username); - OC_CONFIG::setValue('dbpass',$password); + OC_CONFIG::setValue('dbpassword',$password); //create the database self::createDatabase($dbname,$username,$connection); diff --git a/lib/ocsclient.php b/lib/ocsclient.php index 71a0b1279ab..a3c4659c6e4 100644 --- a/lib/ocsclient.php +++ b/lib/ocsclient.php @@ -35,16 +35,22 @@ class OC_OCSCLIENT{ * This function returns a list of all the application categories on the OCS server */ public static function getCategories(){ - $url='http://api.opendesktop.org/v1/content/categories'; + $url='http://api.apps.owncloud.com/v1/content/categories'; $xml=file_get_contents($url); $data=simplexml_load_string($xml); - $tmp=$data->data->category; + $tmp=$data->data; $cats=array(); - for($i = 0; $i < count($tmp); $i++) { - $cats[$i]=$tmp[$i]->name; + + foreach($tmp->category as $key=>$value) { + + $id= (int) $value->id; + $name= (string) $value->name; + $cats[$id]=$name; + } + return $cats; } @@ -60,8 +66,7 @@ class OC_OCSCLIENT{ }else{ $categoriesstring=$categories; } - $url='http://api.opendesktop.org/v1/content/data?categories='.urlencode($categoriesstring).'&sortmode=new&page=0&pagesize=10'; - + $url='http://api.apps.owncloud.com/v1/content/data?categories='.urlencode($categoriesstring).'&sortmode=new&page=0&pagesize=10'; $apps=array(); $xml=file_get_contents($url); $data=simplexml_load_string($xml); @@ -92,7 +97,7 @@ class OC_OCSCLIENT{ * This function returns an applications from the OCS server */ public static function getApplication($id){ - $url='http://api.opendesktop.org/v1/content/data/'.urlencode($id); + $url='http://api.apps.owncloud.com/v1/content/data/'.urlencode($id); $xml=file_get_contents($url); $data=simplexml_load_string($xml); @@ -121,7 +126,7 @@ class OC_OCSCLIENT{ * This function returns a list of all the knowledgebase entries from the OCS server */ public static function getKnownledgebaseEntries(){ - $url='http://api.opendesktop.org/v1/knowledgebase/data?page=0&pagesize=10'; + $url='http://api.apps.owncloud.com/v1/knowledgebase/data?type=150&page=0&pagesize=10'; $kbe=array(); $xml=file_get_contents($url); @@ -133,6 +138,7 @@ class OC_OCSCLIENT{ $kb['id']=$tmp[$i]->id; $kb['name']=$tmp[$i]->name; $kb['description']=$tmp[$i]->description; + $kb['answer']=$tmp[$i]->answer; $kb['preview1']=$tmp[$i]->smallpreviewpic1; $kbe[]=$kb; } |