diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6dfa517 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,18 @@ +# MFA + +## 1.0.1 - 2022-12-26 +## Features +- New Galician translation (gl_ES) +## Bugfixes +- Update localazy strings #11027 + +## 1.0.0 +#Features +- New option to select which Auth methods are affected by MFA +- 6-digit OTP Token + +## 0.9.0 (Internal) +### Features +- OTP Auth +- OTP Token sent via e-mail +- Expired tokens clean up Automatic Action diff --git a/front/config.form.php b/front/config.form.php new file mode 100644 index 0000000..12938f0 --- /dev/null +++ b/front/config.form.php @@ -0,0 +1,47 @@ +. + -------------------------------------------------------------------------- + @package MFA + @author the TICgal team + @copyright Copyright (c) 2022 TICgal team + @license AGPL License 3.0 or (at your option) any later version + http://www.gnu.org/licenses/agpl-3.0-standalone.html + @link https://www.tic.gal + @since 2022 + ---------------------------------------------------------------------- +*/ + +include('../../../inc/includes.php'); +// Check if plugin is activated... +$plugin = new Plugin(); +if (!$plugin->isInstalled('mfa') || !$plugin->isActivated('mfa')) { + Html::displayNotFoundError(); +} + +Session::checkRight('config', UPDATE); + +$config = new PluginMfaConfig(); +if (isset($_POST["update"])) { + $config->check($_POST['id'], UPDATE); + $config->update($_POST); + Html::back(); +} + +Html::redirect($CFG_GLPI["root_doc"] . "/front/config.form.php?forcetab=" . urlencode('PluginMfaConfig$1')); diff --git a/front/mfa.form.php b/front/mfa.form.php new file mode 100644 index 0000000..64c2397 --- /dev/null +++ b/front/mfa.form.php @@ -0,0 +1,140 @@ +. + -------------------------------------------------------------------------- + @package MFA + @author the TICgal team + @copyright Copyright (c) 2022 TICgal team + @license AGPL License 3.0 or (at your option) any later version + http://www.gnu.org/licenses/agpl-3.0-standalone.html + @link https://www.tic.gal + @since 2022 + ---------------------------------------------------------------------- +*/ + +use Glpi\Toolbox\Sanitizer; + +include('../../../inc/includes.php'); + +$_POST = array_map('stripslashes', $_POST); + +if (isset($_POST['code'])) { + $mfa = new PluginMfaMfa(); + if ($mfa->getFromDBByCrit(['code' => $_POST['code']])) { + $auth = new Auth(); + $user = new User(); + $user->getFromDB($mfa->fields['users_id']); + $auth->auth_succeded = true; + $auth->user = $user; + Session::init($auth); + $mfa->delete(['id' => $mfa->getID()]); + Auth::redirectIfAuthenticated(); + } else { + // we have done at least a good login? No, we exit. + Html::nullHeader("Login", $CFG_GLPI["root_doc"] . '/index.php'); + echo '