summaryrefslogtreecommitdiffstats
path: root/lib/ocs
diff options
context:
space:
mode:
authorTom Needham <tom@owncloud.com>2013-02-09 11:56:30 +0000
committerTom Needham <tom@owncloud.com>2013-02-09 11:56:30 +0000
commitab8777a623099f04636e33e3e406cfd685cf4867 (patch)
tree7bd66f664cb08e86f2fb4133564ba83c5a5aafb5 /lib/ocs
parent934735043bd130db1dc854f444a076e6e8ef89d3 (diff)
parent5102596e6d461313cd10f64d033107ce1218a854 (diff)
downloadnextcloud-server-ab8777a623099f04636e33e3e406cfd685cf4867.tar.gz
nextcloud-server-ab8777a623099f04636e33e3e406cfd685cf4867.zip
Merge branch 'ocs_capabilities' into ocs_multiple_methods
Diffstat (limited to 'lib/ocs')
-rw-r--r--lib/ocs/cloud.php60
1 files changed, 17 insertions, 43 deletions
diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php
index 2d18b1db3f2..9ae4b4c8ebb 100644
--- a/lib/ocs/cloud.php
+++ b/lib/ocs/cloud.php
@@ -24,49 +24,23 @@
class OC_OCS_Cloud {
- public static function getSystemWebApps() {
- OC_Util::checkLoggedIn();
- $apps = OC_App::getEnabledApps();
- $values = array();
- foreach($apps as $app) {
- $info = OC_App::getAppInfo($app);
- if(isset($info['standalone'])) {
- $newValue = array('name'=>$info['name'],'url'=>OC_Helper::linkToAbsolute($app,''),'icon'=>'');
- $values[] = $newValue;
- }
- }
- return new OC_OCS_Result($values);
- }
-
- public static function getUserQuota($parameters) {
- $user = OC_User::getUser();
- if(OC_User::isAdminUser($user) or ($user==$parameters['user'])) {
-
- if(OC_User::userExists($parameters['user'])) {
- // calculate the disc space
- $userDir = '/'.$parameters['user'].'/files';
- OC_Filesystem::init($userDir);
- $rootInfo = OC_FileCache::get('');
- $sharedInfo = OC_FileCache::get('/Shared');
- $used = $rootInfo['size'] - $sharedInfo['size'];
- $free = OC_Filesystem::free_space();
- $total = $free + $used;
- if($total===0) $total = 1; // prevent division by zero
- $relative = round(($used/$total)*10000)/100;
-
- $xml = array();
- $xml['quota'] = $total;
- $xml['free'] = $free;
- $xml['used'] = $used;
- $xml['relative'] = $relative;
-
- return new OC_OCS_Result($xml);
- } else {
- return new OC_OCS_Result(null, 300);
- }
- } else {
- return new OC_OCS_Result(null, 300);
- }
+ public static function getCapabilities($parameters){
+ $result = array();
+ list($major, $minor, $micro) = OC_Util::getVersion();
+ $result['version'] = array(
+ 'major' => $major,
+ 'minor' => $minor,
+ 'micro' => $micro,
+ 'string' => OC_Util::getVersionString(),
+ 'edition' => OC_Util::getEditionString(),
+ );
+
+ $result['capabilities'] = array(
+ 'core' => array(
+ 'pollinterval' => OC_Config::getValue('pollinterval', 60),
+ ),
+ );
+ return new OC_OCS_Result($result);
}
public static function getUserPublickey($parameters) {