Added an API to quickly check the current MISP version, fixes #664

pull/672/head v2.3.129
iglocska 2015-09-17 00:21:08 +02:00
parent 1d4e07d965
commit 7f3996f43b
2 changed files with 8 additions and 1 deletions

View File

@ -1 +1 @@
{"major":2, "minor":3, "hotfix":128}
{"major":2, "minor":3, "hotfix":129}

View File

@ -668,4 +668,11 @@ class ServersController extends AppController {
}
$this->redirect('/servers/serverSettings/diagnostics');
}
public function getVersion() {
if (!$this->userRole['perm_auth']) throw new MethodNotAllowedException('This action requires API access.');
$versionArray = $this->Server->checkMISPVersion();
$this->set('response', array('version' => $versionArray['major'] . '.' . $versionArray['minor'] . '.' . $versionArray['hotfix']));
$this->set('_serialize', 'response');
}
}