mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-13 03:46:58 +01:00
* [FIX] Fixed wrong behaviour when config parameter was not found
This commit is contained in:
@@ -237,10 +237,11 @@ class ConfigManagerController extends ControllerBase
|
||||
$configService = $this->dic->get(ConfigService::class);
|
||||
|
||||
$template->assign('lastUpdateMPass', $configService->getByParam('lastupdatempass', 0));
|
||||
$template->assign('tempMasterPassTime', $configService->getByParam('tempmaster_passtime', 0));
|
||||
$template->assign('tempMasterMaxTime', $configService->getByParam('tempmaster_maxtime', 0));
|
||||
|
||||
$tempMasterAttempts = sprintf('%d/%d', $configService->getByParam('tempmaster_attempts', 0), TemporaryMasterPassService::MAX_ATTEMPTS);
|
||||
$template->assign('tempMasterPassTime', $configService->getByParam(TemporaryMasterPassService::PARAM_TIME, 0));
|
||||
$template->assign('tempMasterMaxTime', $configService->getByParam(TemporaryMasterPassService::PARAM_MAX_TIME, 0));
|
||||
|
||||
$tempMasterAttempts = sprintf('%d/%d', $configService->getByParam(TemporaryMasterPassService::PARAM_ATTEMPTS, 0), TemporaryMasterPassService::MAX_ATTEMPTS);
|
||||
|
||||
$template->assign('tempMasterAttempts', $tempMasterAttempts);
|
||||
$template->assign('tempMasterPass', $this->session->getTemporaryMasterPass());
|
||||
|
||||
@@ -63,9 +63,13 @@ class ConfigService extends Service
|
||||
|
||||
|
||||
if ($result->getNumRows() === 0) {
|
||||
throw new NoSuchItemException(
|
||||
sprintf(__('Parámetro no encontrado (%s)'), $param)
|
||||
);
|
||||
if ($default === null) {
|
||||
throw new NoSuchItemException(
|
||||
sprintf(__('Parámetro no encontrado (%s)'), $param)
|
||||
);
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
/** @var ConfigData $data */
|
||||
|
||||
Reference in New Issue
Block a user