fix: [benchmarking] speculative fix for using db settings and benchmarking, fixes #9702

- causes issues for some users, couldn't reproduce it, but addressed the potential issues
pull/9176/merge
iglocska 2024-04-23 07:14:31 +02:00
parent 85062915a6
commit fa9ff6f88e
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 6 additions and 6 deletions

View File

@ -108,6 +108,11 @@ class AppController extends Controller
public function beforeFilter()
{
if (Configure::read('MISP.system_setting_db')) {
App::uses('SystemSetting', 'Model');
SystemSetting::setGlobalSetting();
}
$this->User = ClassRegistry::init('User');
if (Configure::read('Plugin.Benchmarking_enable')) {
App::uses('BenchmarkTool', 'Tools');
@ -117,11 +122,6 @@ class AppController extends Controller
$controller = $this->request->params['controller'];
$action = $this->request->params['action'];
if (Configure::read('MISP.system_setting_db')) {
App::uses('SystemSetting', 'Model');
SystemSetting::setGlobalSetting();
}
$this->_setupBaseurl();
$this->Auth->loginRedirect = $this->baseurl . '/users/routeafterlogin';
@ -879,7 +879,7 @@ class AppController extends Controller
public function afterFilter()
{
// benchmarking
if (Configure::read('Plugin.Benchmarking_enable')) {
if (Configure::read('Plugin.Benchmarking_enable') && isset($this->Benchmark)) {
$this->Benchmark->stopBenchmark([
'user' => $this->Auth->user('id'),
'controller' => $this->request->params['controller'],