diff --git a/appinfo/routes.php b/appinfo/routes.php index b7f789ee..3af8fdf2 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -65,10 +65,11 @@ return [ ['name' => 'share#getItemAcl', 'url' => '/api/v2/sharing/credential/{item_guid}/acl', 'verb' => 'GET'], ['name' => 'share#getFile', 'url' => '/api/v2/sharing/credential/{item_guid}/file/{file_guid}', 'verb' => 'GET'], ['name' => 'share#updateSharedCredentialACL', 'url' => '/api/v2/sharing/credential/{item_guid}/acl', 'verb' => 'PATCH'], + ['name' => 'internal#getAppVersion', 'url' => '/api/v2/version', 'verb' => 'GET'], //Translations - ['name' => 'translation#getLanguageStrings', 'url' => '/api/v2/language', 'verb' => 'GET'], + ['name' => 'translation#getLanguageStrings', 'url' => '/api/v2/language', 'verb' => 'GET'], //Internal API ['name' => 'internal#remind', 'url' => '/api/internal/notifications/remind/{credential_id}', 'verb' => 'POST'], diff --git a/controller/internalcontroller.php b/controller/internalcontroller.php index defab3de..01a310a9 100644 --- a/controller/internalcontroller.php +++ b/controller/internalcontroller.php @@ -15,7 +15,7 @@ use OCP\IRequest; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\ApiController; use OCA\Passman\Service\CredentialService; - +use \OCP\App; class InternalController extends ApiController { private $userId; @@ -65,9 +65,11 @@ class InternalController extends ApiController { /** * @NoAdminRequired + * @NoCSRFRequired */ public function getAppVersion() { - return new JSONResponse(array('version' => '1.0.2.25')); + $AppInstance = new App(); + return new JSONResponse(array('version' => $AppInstance->getAppInfo("passman")["version"])); } /**