chg: [internal] Simplify User::describeAuthFields

pull/6581/head
Jakub Onderka 2020-11-16 20:28:52 +01:00
parent cdf47d705e
commit a0fb186a3c
1 changed files with 2 additions and 3 deletions

View File

@ -165,11 +165,12 @@ class AppController extends Controller
Configure::write('Config.language', 'eng');
}
//if fresh installation (salt empty) generate a new salt
// For fresh installation (salt empty) generate a new salt
if (!Configure::read('Security.salt')) {
$this->loadModel('Server');
$this->Server->serverSettingsSaveValue('Security.salt', $this->User->generateRandomPassword(32));
}
// Check if the instance has a UUID, if not assign one.
if (!Configure::read('MISP.uuid')) {
$this->loadModel('Server');
@ -884,7 +885,6 @@ class AppController extends Controller
$this->loadModel('AuthKey');
$user = $this->AuthKey->getAuthUserByAuthKey($authkey);
} else {
$this->loadModel('User');
$user = $this->User->getAuthUserByAuthKey($authkey);
}
@ -899,7 +899,6 @@ class AppController extends Controller
public function checkExternalAuthUser($authkey)
{
$this->loadModel('User');
$user = $this->User->getAuthUserByExternalAuth($authkey);
if (empty($user)) {
return false;