Jump to content

[bug] 4.6.7 - Can't Enable/Disable Two Factor Authentication


Go to solution Solved by Marc,

Recommended Posts

Posted

IC 4.6.7 / PHP 8 / MySQL 8

All 3rd party apps/plugins disabled

Not a fresh install - upgraded from 4.4.10 recently, 3.4.9 before that.

It seems, perhaps due to something missed in an upgrade routine, the Enabled/Disabled status for Two Factor Authentication handlers is missing. (it had never been used)

In IPS\core\modules\admin\settings\mfa.php, line 108

isEnabled() is run on the handler, which checks for the settings:

\IPS\Settings::i()->authy_enabled
\IPS\Settings::i()->questions_enabled
\IPS\Settings::i()->google_enabled

The settings have never been populated with a 0 or 1, and are instead null.

image.png.fda6712b957bcfa5b56583322d786057.png

Since they are null, the "Enable/Disable" button doesn't know to appear here:

image.png.5067f09f30d1f7dd0b25660f66c1a09c.png

My solution to this was to write a plugin which modifies this, at line 108:
 

$handler->isEnabled()

To:

$handler->isEnabled() ?? 0

and the buttons appeared, with "Disabled" selected.  

I proceeded to enable each item, then disable, and disabled the plugin.   This wrote 0's to the setting for each handler:

image.png.0d805e6609c73e96181170caf263b101.png

Now I can freely enable/disable the MFA handlers without the plugin:

image.png.5f03bc482be02901206a2e122c700fc4.png

I'm not sure how this would be worked into a future update, whether by the method I used, or doing something in the upgrader to populate the null settings with 0's, but the issue existed for me so I figured I'd report it!  👍

Posted

Thank you for letting us know of this. Could I please confirm if the issue occurred from 3.4 to 4.4.10 or from 4.4.10 to the current release?

Also, just making sure you aren't still having to use a plugin to correct yours. If that's the case, you shouldn't have to be and we need to get that resolved properly for you

Posted

Unfortunately I don't know when this originated, as I hadn't tried to use the 2FA feature until today.  I'm only theorizing it had to do with my install having been upgraded with long version gaps in-between and wanted to share my solution in case its of any benefit to others.

It is indeed resolved. The plugin I wrote was disabled and discarded, and I'm successfully using Google Authenticator.   👍

 

  • Solution
Posted

I think its very likely this was an anomaly in your data there, but will pass on the information in any case. I havent seen this happen in the thousands I have seen updated from those releases

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...