Plugin: Whispeak allow login with credentials when reaching max attempts - refs BT#15820

pull/3377/head
Angel Fernando Quiroz Campos 6 years ago
parent fb136e0df5
commit 039069e91a
  1. 19
      plugin/whispeakauth/ajax/record_audio.php
  2. 3
      plugin/whispeakauth/lang/english.php
  3. 3
      plugin/whispeakauth/lang/french.php
  4. 3
      plugin/whispeakauth/lang/spanish.php

@ -168,10 +168,14 @@ if ($isAuthentify) {
ChamiloSession::write(WhispeakAuthPlugin::SESSION_FAILED_LOGINS, ++$failedLogins);
if ($maxAttempts && $failedLogins >= $maxAttempts) {
$message .= PHP_EOL.$plugin->get_lang('MaxAttemptsReached');
$message .= PHP_EOL
.$plugin->get_lang('MaxAttemptsReached')
.PHP_EOL
.'<br><strong>'
.$plugin->get_lang('LoginWithUsernameAndPassword')
.'</strong>';
} else {
$message .= PHP_EOL.$plugin->get_lang('TryAgain');
}
if ('true' === api_get_setting('allow_lostpassword')) {
$message .= '<br>'
@ -181,6 +185,7 @@ if ($isAuthentify) {
);
}
}
}
foreach ($qualityNote as $note) {
$message .= '<br>'.PHP_EOL.$plugin->get_lang("AudioQuality$note");
@ -192,6 +197,14 @@ if ($isAuthentify) {
false
);
if (!$success && $maxAttempts && $failedLogins >= $maxAttempts) {
echo '<script>window.setTimeout(function () {
window.location.href = "'.api_get_path(WEB_PATH).'";
}, 1500);</script>';
exit;
}
if ($success) {
$loggedUser = [
'user_id' => $user->getId(),
@ -209,6 +222,4 @@ if ($isAuthentify) {
echo '<script>window.location.href = "'.api_get_path(WEB_PATH).'";</script>';
}
exit;
}

@ -35,6 +35,8 @@ $strings['EnrollmentSuccess'] = 'Enrollment success.';
$strings['AuthentifyFailed'] = 'Login failed.';
$strings['AuthentifySuccess'] = 'Authentication success!';
$strings['TryAgain'] = 'Try again';
$strings['MaxAttemptsReached'] = 'You reached the maximum number of attempts allowed.';
$strings['LoginWithUsernameAndPassword'] = 'You should login using the username and password.';
$strings['AudioQualityShort'] = 'Too short audio';
$strings['AudioQualityQuiet'] = 'Too quiet audio';
@ -45,5 +47,4 @@ $strings['AudioQualityPoorness'] = 'Too poor general audio quality';
$strings['AgreeAllowResearch'] = 'I agree to allow the use of data for research (no commercial usage).';
$strings['MaxAttemptsReached'] = 'You reached the maximum number of attempts allowed.';
$strings['MarkForSpeechAuthentication'] = 'Mark item for speech authentication';

@ -35,6 +35,8 @@ $strings['EnrollmentSuccess'] = 'Inscription réussie.';
$strings['AuthentifyFailed'] = 'Échec de l\'authentification.';
$strings['AuthentifySuccess'] = 'Authentification réussie!';
$strings['TryAgain'] = 'Essayez encore';
$strings['MaxAttemptsReached'] = 'You reached the maximum number of attempts allowed.';
$strings['LoginWithUsernameAndPassword'] = 'You should login using the username and password.';
$strings['AudioQualityShort'] = 'Too short audio';
$strings['AudioQualityQuiet'] = 'Too quiet audio';
@ -45,5 +47,4 @@ $strings['AudioQualityPoorness'] = 'Too poor general audio quality';
$strings['AgreeAllowResearch'] = 'I agree to allow the use of data for research (no commercial usage).';
$strings['MaxAttemptsReached'] = 'You reached the maximum number of attempts allowed.';
$strings['MarkForSpeechAuthentication'] = 'Mark item for speech authentication';

@ -35,6 +35,8 @@ $strings['EnrollmentSuccess'] = 'Inscripción correcta.';
$strings['AuthentifyFailed'] = 'Inicio de sesión fallido.';
$strings['AuthentifySuccess'] = '¡Autenticación correcta!';
$strings['TryAgain'] = 'Intente de nuevo.';
$strings['MaxAttemptsReached'] = 'Ha alcanzado el número máximo de intentos permitidos.';
$strings['LoginWithUsernameAndPassword'] = 'Debe iniciar sesión usando su nombre de usuario y contraseña.';
$strings['AudioQualityShort'] = 'Audio demasiado corto';
$strings['AudioQualityQuiet'] = 'Audio demasiado silencioso';
@ -45,5 +47,4 @@ $strings['AudioQualityPoorness'] = 'Calidad de audio general demasiado pobre';
$strings['AgreeAllowResearch'] = 'Estoy de acuerdo en permitir el uso de datos para investigación (no uso comercial).';
$strings['MaxAttemptsReached'] = 'Ha alcanzado el número máximo de intentos permitidos.';
$strings['MarkForSpeechAuthentication'] = 'Marcar elemento para autenticación con voz';

Loading…
Cancel
Save