Merge branch 'develop' of github.com:cerebrate-project/cerebrate into develop-unstable
commit
bb94765243
|
@ -137,6 +137,30 @@ class AuthKeycloakBehavior extends Behavior
|
|||
]
|
||||
]
|
||||
);
|
||||
$logChange = [
|
||||
'username' => $data['username'],
|
||||
'individual_id' => $data['individual_id'],
|
||||
'role_id' => $data['role_id']
|
||||
];
|
||||
if (!$response->isOk()) {
|
||||
$logChange['error_code'] = $response->getStatusCode();
|
||||
$logChange['error_body'] = $response->getStringBody();
|
||||
$this->_table->auditLogs()->insert([
|
||||
'request_action' => 'enrollUser',
|
||||
'model' => 'User',
|
||||
'model_id' => 0,
|
||||
'model_title' => __('Failed Keycloak enrollment for user {0}', $data['username']),
|
||||
'changed' => $logChange
|
||||
]);
|
||||
} else {
|
||||
$this->_table->auditLogs()->insert([
|
||||
'request_action' => 'enrollUser',
|
||||
'model' => 'User',
|
||||
'model_id' => 0,
|
||||
'model_title' => __('Successful Keycloak enrollment for user {0}', $data['username']),
|
||||
'changed' => $logChange
|
||||
]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -398,7 +398,7 @@ class CerebrateSettingValidator extends SettingValidator
|
|||
$foundEnabledAuth = __('Cannot make change - this would disable every possible authentication method.');
|
||||
foreach ($providers as $provider) {
|
||||
if ($provider !== $setting['authentication_type']) {
|
||||
if (Configure::read($provider . '.enable')) {
|
||||
if (Configure::read($provider . '.enabled')) {
|
||||
$foundEnabledAuth = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue