mirror of https://github.com/MISP/MISP
Revert "Merge pull request #5304 from JakubOnderka/version-loading"
This reverts commitpull/5435/head71fb7fcbd7
, reversing changes made to11ee95aeb3
. Note: broke freetext import.
parent
170d38345f
commit
623bb20cb0
|
@ -165,10 +165,10 @@ class AppController extends Controller
|
|||
} else {
|
||||
$this->Auth->authenticate['Form']['userFields'] = $auth_user_fields;
|
||||
}
|
||||
$versionArray = $this->{$this->modelClass}->checkMISPVersion();
|
||||
if (!empty($this->params['named']['disable_background_processing'])) {
|
||||
Configure::write('MISP.background_jobs', 0);
|
||||
}
|
||||
$versionArray = $this->{$this->modelClass}->checkMISPVersion();
|
||||
$this->mispVersion = implode('.', array_values($versionArray));
|
||||
$this->Security->blackHoleCallback = 'blackHole';
|
||||
$this->_setupBaseurl();
|
||||
|
@ -395,8 +395,10 @@ class AppController extends Controller
|
|||
// instead of using checkAction(), like we normally do from controllers when trying to find out about a permission flag, we can use getActions()
|
||||
// getActions returns all the flags in a single SQL query
|
||||
if ($this->Auth->user()) {
|
||||
$versionArray = $this->{$this->modelClass}->checkMISPVersion();
|
||||
$this->mispVersionFull = implode('.', array_values($versionArray));
|
||||
$this->set('mispVersion', implode('.', array($versionArray['major'], $versionArray['minor'], 0)));
|
||||
$this->set('mispVersionFull', $this->mispVersion);
|
||||
$this->set('mispVersionFull', $this->mispVersionFull);
|
||||
$role = $this->getActions();
|
||||
$this->set('me', $this->Auth->user());
|
||||
$this->set('isAdmin', $role['perm_admin']);
|
||||
|
|
|
@ -1545,6 +1545,7 @@ class AppModel extends Model
|
|||
|
||||
public function checkMISPVersion()
|
||||
{
|
||||
App::uses('Folder', 'Utility');
|
||||
$file = new File(ROOT . DS . 'VERSION.json', true);
|
||||
$version_array = json_decode($file->read(), true);
|
||||
$file->close();
|
||||
|
|
Loading…
Reference in New Issue