Skip to content

Commit

Permalink
Use ifexists message if messages are obscured
Browse files Browse the repository at this point in the history
  • Loading branch information
coudot committed Mar 20, 2024
1 parent bfee595 commit 941e5d6
Show file tree
Hide file tree
Showing 31 changed files with 33 additions and 5 deletions.
2 changes: 1 addition & 1 deletion htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
$smarty->assign('error', $messages[$result]);
// TODO : Make it clean $error_sms - START
if ($action == 'sendsms') {
if (isset($result) && ($result == 'smscrypttokensrequired' || $result == 'smsuserfound' || $result == 'smssent' || $result == 'tokenattempts')) {
if (isset($result) && ($result == 'smscrypttokensrequired' || $result == 'smsuserfound' || $result == 'smssent' || $result == 'smssent_ifexists' || $result == 'tokenattempts')) {
$smarty->assign('error_sms', $result);
} else {
$smarty->assign('error_sms', false);
Expand Down
6 changes: 3 additions & 3 deletions htdocs/sendsms.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
$result = "sendsms";
}
if (!$match){
list($result, $token) = obscure_info_sendsms("smssent","smsnomatch");
list($result, $token) = obscure_info_sendsms("smssent_ifexists","smsnomatch");
error_log("SMS number $phone does not match for user $login");
}
}else{
Expand Down Expand Up @@ -358,7 +358,7 @@ function get_mobile_and_displayname($login) {
$displayname = ldap_get_values($ldap, $entry, $ldap_fullname_attribute);
}
if (!$userdn) {
list($result, $token) = obscure_info_sendsms("smssent","badcredentials");
list($result, $token) = obscure_info_sendsms("smssent_ifexists","badcredentials");
error_log("LDAP - User $login not found");
} else {
# Get first sms number for configured ldap attributes in sms_attributes.
Expand All @@ -373,7 +373,7 @@ function get_mobile_and_displayname($login) {
$sms = truncate_number($sms);
}
}else{
list($result, $token) = obscure_info_sendsms("smssent","smsnonumber");
list($result, $token) = obscure_info_sendsms("smssent_ifexists","smsnonumber");
error_log("No SMS number found for user $login");
}
}
Expand Down
1 change: 1 addition & 0 deletions lang/ar.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
$messages['smsresetmessage'] = ": رمز إعادة تعيين كلمة السر الخاصة بك هو";
$messages['sendsmshelpnosms'] = ".أدخل اسم المستخدم الخاصة بك للحصول على رمز إعادة تعيين كلمة السر. ثم اكتب الرمز المرسل في الرسائل القصيرة";
$messages['smssent'] = "تم إرسال رمز التأكيد عن طريق الرسائل القصيرة";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "خطأ عند إرسال الرسائل القصيرة";
$messages['smsnonumber'] = "لا يمكن العثور على رقم الهاتف المحمول";
$messages['userfullname'] = "الإسم الكامل للمستخدم";
Expand Down
1 change: 1 addition & 0 deletions lang/ca.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
$messages['smsresetmessage'] = "El testimoni de restabliment de contrasenya és:";
$messages['sendsmshelpnosms'] = "Introdueixi el seu nom d'usuari per obtenir un testimoni de restabliment de contrasenya. A continuació, escriviu el testimoni en l'SMS enviat.";
$messages['smssent'] = "Un codi de confirmació ha estat enviat per SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Error enviant el SMS";
$messages['smsnonumber'] = "No es pot trobar el número de telèfon mòbil";
$messages['userfullname'] = "Nom d'usuari complert";
Expand Down
1 change: 1 addition & 0 deletions lang/cn.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
$messages['sendsmshelpnosms'] = "Enter your login to get password reset token. Then type token in sent SMS.";
$messages['smsnotsent'] = "Error when sending SMS";
$messages['smssent'] = "A confirmation code has been send by SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['changehelpsms'] = "<a href=\"?action=sendsms\">Reset your password with a SMS</a>";
$messages['resetbysmshelp'] = "The token sent by sms allows you to reset your password. To get a new token, <a href=\"?action=sendsms\">click here</a>.";
$messages['smsresetmessage'] = "Your password reset token is:";
Expand Down
1 change: 1 addition & 0 deletions lang/cs.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
$messages['smsresetmessage'] = "Řetezec pro obnovu hesla je:";
$messages['sendsmshelpnosms'] = "Vložte své uživatelské jméno pro získání kódu pro obnovu hesla. Poté přepište kód z doručené SMS.";
$messages['smssent'] = "Ověřovací kód byl odeslán pomocí SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Chyba při odesílání SMS";
$messages['smsnonumber'] = "Telefonní číslo nenalezeno";
$messages['userfullname'] = "Celé jméno";
Expand Down
1 change: 1 addition & 0 deletions lang/de.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
$messages['smsresetmessage'] = "Ihr Bestätigungscode für die Passwortrücksetzung lautet:";
$messages['sendsmshelpnosms'] = "Geben Sie Ihren Benutzernamen ein, um einen Bestätigungscode für die Passwortrücksetzung zu erhalten. Geben Sie nachfolgend den per SMS erhaltenen Bestätigungscode ein.";
$messages['smssent'] = "Ein Bestätigungscode wurde per SMS versandt";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Fehler beim Versenden der SMS";
$messages['smsnonumber'] = "Kann Mobilfunknummer nicht finden";
$messages['userfullname'] = "Vollständiger Name des Benutzers";
Expand Down
1 change: 1 addition & 0 deletions lang/ee.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
$messages['smsresetmessage'] = "Sinu parooli lähtestamise ajutine kood on:";
$messages['sendsmshelpnosms'] = "Sisesta oma kasutajanimi, et saada parooli lähtestamise ajutine kood. Kasuta SMS teel saadud ajutist koodi.";
$messages['smssent'] = "Kinnituskood saadetud SMS'iga";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Viga SMS saatmisel";
$messages['smsnonumber'] = "Ei leia mobiiltelefoni numbrit";
$messages['userfullname'] = "Ees- ja perenimi";
Expand Down
1 change: 1 addition & 0 deletions lang/el.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
$messages['smsresetmessage'] = "Το μοναδικό αναγνωριστικό αλλαγής του κωδικού σας είναι:";
$messages['sendsmshelpnosms'] = "Καταχωρήστε το όνομα χρήστη για να λάβετε μοναδικό αναγνωριστικό αλλαγής κωδικού. Στη συνέχεια καταχωρήστε το μοναδικό αναγνωριστικό που λάβατε μέσω SMS.";
$messages['smssent'] = "Ένας κωδικός επιβεβαίωσης στάλθηκε μέσω SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Λάθος στην αποστολή SMS";
$messages['smsnonumber'] = "Δεν υπάρχει αριθμός κινητού τηλεφώνου";
$messages['userfullname'] = "Ονοματεπώνυμο χρήστη";
Expand Down
1 change: 1 addition & 0 deletions lang/en.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
$messages['sms'] = "SMS number";
$messages['smsresetmessage'] = "Your password reset token is:";
$messages['smssent'] = "A confirmation code has been send by SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Error when sending SMS";
$messages['smsnonumber'] = "Can't find mobile number";
$messages['userfullname'] = "User full name";
Expand Down
1 change: 1 addition & 0 deletions lang/es.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
$messages['smsresetmessage'] = "Su código para resetear su contraseña es:";
$messages['sendsmshelpnosms'] = "Introduzca su nombre de usuario para obtener un reseteo de contraseña por código. Luego teclee el código y enviéela en un SMS.";
$messages['smssent'] = "Un código de confirmación ha sido enviado por SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Error al enviar el SMS";
$messages['smsnonumber'] = "No se pudo encontrar el número del móvil";
$messages['userfullname'] = "Nombre completo del usuario";
Expand Down
1 change: 1 addition & 0 deletions lang/eu.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
$messages['smsresetmessage'] = "Pasahitza berrezartzeko kodea hau da:";
$messages['sendsmshelpnosms'] = "Zure erabiltzaile izena idatzi pasahitza kode bidez berrezartzeko. Kodea SMS bidez iritsiko zaizu.";
$messages['smssent'] = "SMS bat bidali da kodearekin";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Errorea SMS-a bidaltzean";
$messages['smsnonumber'] = "Telefono zenbakirik ez dago";
$messages['userfullname'] = "Erabiltzailearen izen osoa";
Expand Down
1 change: 1 addition & 0 deletions lang/fr.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
$messages['smsresetmessage'] = "Votre jeton est:";
$messages['sendsmshelpnosms'] = "Entrez votre identifiant pour obtenir votre code de confirmation. Entrez ensuite le code reçu par SMS.";
$messages['smssent'] = "Le code de confirmation a été envoyé par SMS.";
$messages['smssent_ifexists'] = "Si ce compte exsite, le code de confirmation a été envoyé par SMS.";
$messages['smsnotsent'] = "Erreur lors de l'envoi du SMS";
$messages['smsnonumber'] = "Le numéro de mobile n'a pas été trouvé.";
$messages['userfullname'] = "Nom complet";
Expand Down
1 change: 1 addition & 0 deletions lang/hu.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
$messages['smsresetmessage'] = "Jelszava megváltoztatásához írja be az alábbi kódot:";
$messages['sendsmshelpnosms'] = "Írja be felhasználónevét, majd az SMS-ben kapott aktiváló kódot.";
$messages['smssent'] = "Aktiváló kód SMS-ben kiküldve";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Hiba az SMS küldése közben";
$messages['smsnonumber'] = "Mobilszám nem található";
$messages['userfullname'] = "Teljes név";
Expand Down
1 change: 1 addition & 0 deletions lang/it.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
$messages['getuser'] = "Ottieni utente";
$messages['resetbysmshelp'] = "Il codice inviato via SMS ti permette di reimpostare la password. Per ricevere un nuovo codice, <a href=\"?action=sendsms\">clicca qui</a>.";
$messages['smssent'] = "Un codice di conferma è stato inviato via SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsuserfound'] = "Controlla che i dati siano corretti e premi 'Invia' per ricevere il codice via SMS";
$messages['nophpmbstring'] = "Devi installare PHP mbstring";
$messages['menuquestions'] = "Domande";
Expand Down
1 change: 1 addition & 0 deletions lang/ja.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
$messages['smsresetmessage'] = "パスワードリセット用のトークン:";
$messages['sendsmshelpnosms'] = "パスワードリセット用のトークンを取得するにはログインIDを入力してください。その後、SMSで送信されたトークンを入力してください。";
$messages['smssent'] = "確認用のトークンをSMSで送信しました";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "SMSを送信する際にエラーが発生しました";
$messages['smsnonumber'] = "携帯電話番号を取得できません";
$messages['userfullname'] = "氏名";
Expand Down
1 change: 1 addition & 0 deletions lang/nb-NO.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
$messages['smsresetmessage'] = "Ditt engangspassord er:";
$messages['sendsmshelpnosms'] = "Angi brukernavn for å få tilsendt engangspassord. Angi engangspassordet fra SMS'en.";
$messages['smssent'] = "Engangspassord er sendt på SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Feil ved sending av SMS";
$messages['smsnonumber'] = "Kan ikke finne mobilnummer";
$messages['userfullname'] = "Navn";
Expand Down
1 change: 1 addition & 0 deletions lang/nl.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
$messages['smsresetmessage'] = "Uw wachtwoord reset token is:";
$messages['sendsmshelpnosms'] = "Voer uw login informatie in om uw wachtwoord reset token te ontvangen. Voer vervolgens het token in wat toegestuurd is via SMS.";
$messages['smssent'] = "Een bevestigingscode is verzonden via SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Fout tijdens het versturen van een SMS";
$messages['smsnonumber'] = "Mobiele nummer niet gevonden";
$messages['userfullname'] = "Volledige naam van gebruiker";
Expand Down
1 change: 1 addition & 0 deletions lang/pl.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
$messages['smsresetmessage'] = "Twój Token resetowania hasła to:";
$messages['sendsmshelpnosms'] = "Wprowadź swój login, aby otrzymać Token resetowania hasła. Następnie wpisz token w wysłanej wiadomości SMS.";
$messages['smssent'] = "Kod potwierdzający został wysłany SMS-em";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Błąd podczas wysyłania wiadomości SMS";
$messages['smsnonumber'] = "Nie znaleziono numeru telefonu komórkowego";
$messages['userfullname'] = "Pełna nazwa użytkownika";
Expand Down
1 change: 1 addition & 0 deletions lang/pt-BR.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
$messages['smsresetmessage'] = "Seu código para redefinir a senha é:";
$messages['sendsmshelpnosms'] = "Informe seu nome de usuário para obter o código para redefinir sua senha. Depois digite o código enviado no SMS.";
$messages['smssent'] = "Um código de confirmação foi enviado via SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Erro ao enviar SMS";
$messages['smsnonumber'] = "Não foi possível encontrar o número";
$messages['userfullname'] = "Nome completo";
Expand Down
1 change: 1 addition & 0 deletions lang/pt-PT.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
$messages['smsresetmessage'] = "O teu código para redefinir a password é:";
$messages['sendsmshelpnosms'] = "Indica o teu username para obteres o código para redefinir a tua password. Depois digita o código enviado por SMS.";
$messages['smssent'] = "Um código de confirmação foi enviado via SMS.";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Erro ao enviar SMS.";
$messages['smsnonumber'] = "Nao foi possível encontrar o teu número de telemóvel.";
$messages['userfullname'] = "Nome completo";
Expand Down
1 change: 1 addition & 0 deletions lang/rs.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
$messages['smsresetmessage'] = "Vaš token za resetovanje lozinke je:";
$messages['sendsmshelpnosms'] = "Unesite svoje korisničko ime da dobijete token za resetovanje lozinke. Zatim ukucajte token koji ćete dobiti SMS-om.";
$messages['smssent'] = "Vaš token je poslat SMS-om";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Greška prilikom slanja SMS-a";
$messages['smsnonumber'] = "Nema broja mobilnog telefona";
$messages['userfullname'] = "Puno ime korisnika";
Expand Down
1 change: 1 addition & 0 deletions lang/ru.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
$messages['getuser'] = "Get user";
$messages['resetbysmshelp'] = "The token sent by sms allows you to reset your password. To get a new token, <a href=\"?action=sendsms\">click here</a>.";
$messages['smssent'] = "A confirmation code has been send by SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsuserfound'] = "Check that user information are correct and press Send to get SMS token";
$messages['nophpmbstring'] = "You should install PHP mbstring";
$messages['menuquestions'] = "Question";
Expand Down
1 change: 1 addition & 0 deletions lang/sk.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
$messages['smsresetmessage'] = "Váš token pre zmenu hesla je:";
$messages['sendsmshelpnosms'] = "Zadajte Vaše prihlasovacie meno pre získanie tokenu pre zmenu hesla. Potom zadajte token v odoslanej SMS.";
$messages['smssent'] = "Potvrdzovací kód bol poslaný SMSkou";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Chyba pri posielaní SMSky";
$messages['smsnonumber'] = "Telefónne číslo sa nenašlo";
$messages['userfullname'] = "Meno a priezvisko";
Expand Down
1 change: 1 addition & 0 deletions lang/sl.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
$messages['smsresetmessage'] = "Žeton za ponastavitev gesla je:";
$messages['sendsmshelpnosms'] = "Vnesite uporabniško ime, da dobite žeton za ponastavitev gesla. Potem vnesite žeton v poslani SMS.";
$messages['smssent'] = "Potrditvena koda je bila poslana preko SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Napaka pri pošiljanju SMS";
$messages['smsnonumber'] = "Ne najdem številke mobilnega telefona";
$messages['userfullname'] = "Polno ime uporabnika";
Expand Down
1 change: 1 addition & 0 deletions lang/sv.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
$messages['smsresetmessage'] = "Lösenkod:";
$messages['sendsmshelpnosms'] = "Ange användarnamn för att får en Lösenkod. Ange sedan Lösenkoden som står i SMSet.";
$messages['smssent'] = "En Lösenkod är skickad via SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "Fel vid sändning av SMS";
$messages['smsnonumber'] = "Kan inte hitta mobilnummer";
$messages['userfullname'] = "Namn";
Expand Down
1 change: 1 addition & 0 deletions lang/tr.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
$messages['smsresetmessage'] = "Parola sıfırlama belirteciniz:";
$messages['sendsmshelpnosms'] = "SMS almak için kullanıcı adınızı, sonrasında da SMS ile yollanan belirteci girin.";
$messages['smssent'] = "SMS ile bir doğrulama kodu gönderildi";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "SMS gönderilirken hata oluştu";
$messages['smsnonumber'] = "Mobil numara bulunamıyor";
$messages['userfullname'] = "Kullanıcının tam adı";
Expand Down
1 change: 1 addition & 0 deletions lang/uk.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
$messages['getuser'] = "Отримати користувача";
$messages['resetbysmshelp'] = "Жетон який дозволяє скинути пароль, відправлено через SMS. Щоб отримати новий жетон, <a href=\"?action=sendsms\">клацніть тут</a>.";
$messages['smssent'] = "Код підтвердження був відправлений через SMS";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsuserfound'] = "Перевірте, що інформація про користувача вірна та натисніть «Відправити SMS», щоб отримати жетон";
$messages['nophpmbstring'] = "Ви повинні встановити PHP mbstring";
$messages['menuquestions'] = "Question";
Expand Down
1 change: 1 addition & 0 deletions lang/zh-CN.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
$messages['sms'] = "短信号码";
$messages['smsresetmessage'] = "您的密码重置口令:";
$messages['smssent'] = "口令短信已发送";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "短信发送错误";
$messages['smsnonumber'] = "未发现手机号码";
$messages['userfullname'] = "用户全名";
Expand Down
1 change: 1 addition & 0 deletions lang/zh-TW.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
$messages['sms'] = "簡訊號碼";
$messages['smsresetmessage'] = "您的密碼重新設定金鑰:";
$messages['smssent'] = "金鑰簡訊已發送";
$messages['smssent_ifexists'] = "If account exists, a confirmation code has been send by SMS";
$messages['smsnotsent'] = "簡訊發送錯誤";
$messages['smsnonumber'] = "未發現手機號碼";
$messages['userfullname'] = "帳號全名";
Expand Down
2 changes: 1 addition & 1 deletion templates/sendsms.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
</form>
</div>
{elseif $error_sms and ($error_sms == 'smssent' or $error_sms == 'tokenattempts')}
{elseif $error_sms and ($error_sms == 'smssent' or $error_sms == 'smssent_ifexists' or $error_sms == 'tokenattempts')}
<div class="alert shadow alert-info">
<form action="#" method="post" class="form-horizontal">
<div class="row mb-3">
Expand Down

0 comments on commit 941e5d6

Please sign in to comment.