This commit is contained in:
Aitzol 2023-11-24 20:25:35 +01:00
parent 92bc2bbdbf
commit a53f2aa274
6 changed files with 58 additions and 21 deletions

View File

@ -16,10 +16,7 @@
<h1>{{ str['2fa-title'] }}</h1>
% if data['secureAuth'] == True:
<div class="info">
Aurrerantzean ondorengo kodea erabili beharko duzu saioa hasteko. Mugikorrerako OTP edo 2FA aplikazioa baten
bidez QR kodea irakurtzean jasoko duzun gakoa baliatuz horretarako.
</div>
<div class="info">{{ str['2fa-info-1'] }}</div>
<div class="qr-code">
<img src="{{'static/tmp/'+data['authToken']+'.png'}}" />
@ -37,10 +34,7 @@
</form>
% else:
<div class="info">
Bi urratseko autentifikazioa segurtasun gehigarri bat da. Hau gaituz saio hasieran erabiltzaile eta pasahitzaz
gain QR bidez jasoko duzun gako bat eskatuko zaizu.
</div>
<div class="info">{{ str['2fa-info-2'] }}</div>
<form name="enable2faForm" method="post" action="/enable_2fa">
<!--<input id="token" name="token" type="text" value="{{data['authToken']}}" readonly>-->

4
app.py
View File

@ -822,7 +822,6 @@ def add_auth_attribute_step3(conf, username, code, action):
#set current LDAP
superUser = SuperUsers(conf)
print(action)
with connect_ldap(conf, user=superUser.admin_dn, password=superUser.admin_pwd) as c:
user_dn = find_user_dn(conf, c, username)
if(action == 'enable'):
@ -1080,7 +1079,7 @@ def is_trusted_device(conf, user_dn):
c.unbind()
return True
except Exception as e:
print(e)
LOG.warning(e)
return True
def update_login_info(conf, user_dn):
@ -1127,7 +1126,6 @@ def newSession():
return CONF['locale']['lang']
def get(self):
print(self.data)
if 'username' in self.data:
return(self.data)
else:

Binary file not shown.

View File

@ -129,6 +129,30 @@ msgstr "Devices"
msgid "show"
msgstr "show"
#: libs/localization.py:43
msgid "Two factor authentication"
msgstr "Two factor authentication"
#: libs/localization.py:44
msgid "Token"
msgstr "Token"
#: libs/localization.py:45
msgid "Disable"
msgstr "Disable"
#: libs/localization.py:46
msgid "Enable"
msgstr "Enable"
#: libs/localization.py:47
msgid "You must then use the following code to log in. Using the key you will receive by reading the QR code via a OTP or 2FA mobile app."
msgstr "You must then use the following code to log in. Using the key you will receive by reading the QR code via a OTP or 2FA mobile app."
#: libs/localization.py:48
msgid "Two factor authentication is additional security. By enabling this you will be asked at the login, in addition to the user and password, a key you will receive by QR."
msgstr "Two factor authentication is additional security. By enabling this you will be asked at the login, in addition to the user and password, a key you will receive by QR."
#: libs/localization.py:45
msgid "The session was closed."
msgstr "The session was closed."

Binary file not shown.

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: 0.0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-07 17:23+0200\n"
"PO-Revision-Date: 2023-04-07 13:27+0200\n"
"PO-Revision-Date: 2023-11-24 20:21+0100\n"
"Last-Translator: Aitzol Berasategi <aitzol@lainoa.eus>\n"
"Language-Team: LANGUAGE <EU@eu.org>\n"
"Language: eu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
"X-Generator: Poedit 3.2.2\n"
#: libs/localization.py:15
msgid "User"
@ -129,6 +129,32 @@ msgstr "Gailuak"
msgid "show"
msgstr "ikusi"
#: libs/localization.py:43
msgid "Two factor authentication"
msgstr "Bi urratseko autentifikazioa"
#: libs/localization.py:44
msgid "Token"
msgstr "Gakoa"
#: libs/localization.py:45
msgid "Disable"
msgstr "Desgaitu"
#: libs/localization.py:46
msgid "Enable"
msgstr "Gaitu"
#: libs/localization.py:47
msgid "You must then use the following code to log in. Using the key you will receive by reading the QR code via a OTP or 2FA mobile app."
msgstr ""
"Aurrerantzean ondorengo kodea erabili beharko duzu saioa hasteko. Mugikorrerako OTP edo 2FA aplikazio baten bidez QR kodea irakurtzean jasoko duzun gakoa baliatuz "
"horretarako."
#: libs/localization.py:48
msgid "Two factor authentication is additional security. By enabling this you will be asked at the login, in addition to the user and password, a key you will receive by QR."
msgstr "Bi urratseko autentifikazioa segurtasun gehigarri bat da. Hau gaituz saio hasieran erabiltzaile eta pasahitzaz gain QR bidez jasoko duzun gako bat eskatuko zaizu."
#: libs/localization.py:45
msgid "The session was closed."
msgstr "Saioa itxi da."
@ -158,12 +184,8 @@ msgid "Passwords do not match!"
msgstr "Pasahitzak ez datoz bat!"
#: libs/localization.py:53
msgid ""
"The password must contain at least 8 characters, at least one number, "
"a capital letter and a special character."
msgstr ""
"Pasahitzak gutxienez 8 karaktere izan behar ditu, zenbaki bat, hizki larri bat "
"eta karaktere berezi bat."
msgid "The password must contain at least 8 characters, at least one number, a capital letter and a special character."
msgstr "Pasahitzak gutxienez 8 karaktere izan behar ditu, zenbaki bat, hizki larri bat eta karaktere berezi bat."
#: libs/localization.py:54
msgid "Congratulations, your account has been created!"
@ -222,8 +244,7 @@ msgid "Unable to connect to the remote server."
msgstr "Ezinezkoa urruneko zerbitzara konektatzea."
#: libs/localization.py:68
msgid ""
"Encountered an unexpected error while communicating with the remote server."
msgid "Encountered an unexpected error while communicating with the remote server."
msgstr "Ezusteko errore bat gertatu da urruneko zerbitzariarekin komunikatzean."
#: libs/localization.py:69