Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added locales/pt_BR.mo
Binary file not shown.
65 changes: 65 additions & 0 deletions locales/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
msgid ""
msgstr ""
"Project-Id-Version: MFAuth\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-01-29 14:07+0100\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Localazy (https://localazy.com)\n"
"Plural-Forms: nplurals=2; plural=(n>=0 && n<=1) ? 0 : 1;\n"

#: front/mfa.form.php:46
msgid "Incorrect One-Time Security Code"
msgstr "Código de segurança único incorreto"

#: inc/config.class.php:113
msgid "GLPI Database Authentication"
msgstr "Autenticação do banco de dados GLPI"

#: inc/config.class.php:120
msgid "Mail Server Authentication"
msgstr "Autenticação do servidor de correio"

#: inc/config.class.php:127
msgid "LDAP Directory Authentication"
msgstr "Autenticação do diretório LDAP"

#: inc/config.class.php:134
msgid "External Authentication"
msgstr "Autenticação Externa"

#: inc/mfa.class.php:49
msgid "One-Time Security Code expiration"
msgstr "Expiração do código de segurança único"

#: inc/mfa.class.php:50
msgid "Duration (in minutes)"
msgstr "Duração (em minutos)"

#: inc/mfa.class.php:79
#, php-format
msgid "Deleted the One-Time Security Code of the user %s"
msgstr "Excluído o código de segurança único do usuário %s"

#: inc/notificationtargetmfa.class.php:41
msgid "One-Time Security Code generated"
msgstr "Código de segurança único gerado"

#: inc/notificationtargetmfa.class.php:93
msgid "One-Time Security Code"
msgstr "Código de segurança único"

#: inc/notificationtargetmfa.class.php:108
msgid "This is your security code:"
msgstr "Este é o seu código de segurança:"

#: inc/notificationtargetmfa.class.php:109
msgid "Please verify it as soon as possible; this OTP will expire quickly."
msgstr ""
"Por favor, verifique-o o mais rápido possível; este OTP irá expirar "
"rapidamente."

msgid "Your account requires an additional authentication code."
msgstr "Digite o código de acesso enviado para o seu e-mail."
25 changes: 25 additions & 0 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,31 @@ function plugin_version_mfa()
function plugin_init_mfa()
{
SessionManager::registerPluginStatelessPath('mfa', '#^/front/mfa.form.php$#');

$is_cli = function_exists('is_CommandLine') && is_CommandLine();
$has_mfa = isset($_SESSION['mfa_pending_user_id']);

if ($has_mfa) {

if (!$is_cli) {
$uri = $_SERVER['REQUEST_URI'] ?? '';

$is_protected_page = !str_contains($uri, 'mfa.form.php') &&
!str_contains($uri, 'logout.php') &&
!str_contains($uri, 'login.php');

if ($is_protected_page) {
global $CFG_GLPI;
$mfa_url = ($CFG_GLPI["root_doc"] ?? '') . "/plugins/mfa/front/mfa.form.php";
if (!headers_sent()) {
header("Location: " . $mfa_url);
} else {
echo "<script>window.location.href='$mfa_url';</script>";
}
exit();
}
}
}

global $PLUGIN_HOOKS;

Expand Down