summaryrefslogtreecommitdiffstats
path: root/core/Controller/OCSController.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-08-09 10:21:20 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-08-09 20:56:31 +0200
commit575875e8d03e1396bcdb1fac75a7c6076fd92287 (patch)
treeffac7dadcef7ade1014bdc072a30408e9e8262bd /core/Controller/OCSController.php
parent5214b62d55b3907eb2da7c8e51a3c0c6cd09a00f (diff)
downloadnextcloud-server-575875e8d03e1396bcdb1fac75a7c6076fd92287.tar.gz
nextcloud-server-575875e8d03e1396bcdb1fac75a7c6076fd92287.zip
Allow OCS routes in Core and Settings
Diffstat (limited to 'core/Controller/OCSController.php')
-rw-r--r--core/Controller/OCSController.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/core/Controller/OCSController.php b/core/Controller/OCSController.php
new file mode 100644
index 00000000000..278a16186bf
--- /dev/null
+++ b/core/Controller/OCSController.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace OC\Core\Controller;
+
+use OC\CapabilitiesManager;
+use OCP\AppFramework\Http\DataResponse;
+use OCP\IRequest;
+
+class OCSController extends \OCP\AppFramework\OCSController {
+
+ /** @var CapabilitiesManager */
+ private $capabilitiesManager;
+
+ /**
+ * OCSController constructor.
+ *
+ * @param string $appName
+ * @param IRequest $request
+ * @param CapabilitiesManager $capabilitiesManager
+ */
+ public function __construct($appName,
+ IRequest $request,
+ CapabilitiesManager $capabilitiesManager) {
+ parent::__construct($appName, $request);
+
+ $this->capabilitiesManager = $capabilitiesManager;
+ }
+
+ public function getCapabilities() {
+ $result = [];
+ list($major, $minor, $micro) = \OCP\Util::getVersion();
+ $result['version'] = array(
+ 'major' => $major,
+ 'minor' => $minor,
+ 'micro' => $micro,
+ 'string' => \OC_Util::getVersionString(),
+ 'edition' => \OC_Util::getEditionString(),
+ );
+
+ $result['capabilities'] = $this->capabilitiesManager->getCapabilities();
+
+ return new DataResponse(['data' => $result]);
+ }
+} \ No newline at end of file