diff options
Diffstat (limited to 'lib/ocs/cloud.php')
-rw-r--r-- | lib/ocs/cloud.php | 60 |
1 files changed, 17 insertions, 43 deletions
diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php index 5553ae38215..132d923d960 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\Files\Filesystem::init($parameters['user'], $userDir); - $rootInfo = \OC\Files\Filesystem::getFileInfo(''); - $sharedInfo = \OC\Files\Filesystem::getFileInfo('/Shared'); - $used = $rootInfo['size'] - $sharedInfo['size']; - $free = \OC\Files\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) { |