diff --git a/inc/inc.ClassSettings.php b/inc/inc.ClassSettings.php index 3b8a560f5..20431d852 100644 --- a/inc/inc.ClassSettings.php +++ b/inc/inc.ClassSettings.php @@ -40,6 +40,8 @@ class Settings { /* {{{ */ var $_enableGuestLogin = false; // If you even want guest to be logged in automatically, set the following to true var $_enableGuestAutoLogin = false; + // Set to true for 2-factor Authentication + var $_enable2FactorAuthentication = false; // Allow users to reset their password var $_enablePasswordForgotten = false; // Minimum password strength (0 - x, 0 means no check) @@ -446,6 +448,7 @@ class Settings { /* {{{ */ $tab = $node[0]->attributes(); $this->_enableGuestLogin = Settings::boolVal($tab["enableGuestLogin"]); $this->_enableGuestAutoLogin = Settings::boolVal($tab["enableGuestAutoLogin"]); + $this->_enable2FactorAuthentication = Settings::boolVal($tab["enable2FactorAuthentication"]); $this->_enablePasswordForgotten = Settings::boolVal($tab["enablePasswordForgotten"]); $this->_passwordStrength = intval($tab["passwordStrength"]); $this->_passwordStrengthAlgorithm = strval($tab["passwordStrengthAlgorithm"]); @@ -764,6 +767,7 @@ class Settings { /* {{{ */ $node = $this->getXMLNode($xml, '/configuration/system', 'authentication'); $this->setXMLAttributValue($node, "enableGuestLogin", $this->_enableGuestLogin); $this->setXMLAttributValue($node, "enableGuestAutoLogin", $this->_enableGuestAutoLogin); + $this->setXMLAttributValue($node, "enable2FactorAuthentication", $this->_enable2FactorAuthentication); $this->setXMLAttributValue($node, "enablePasswordForgotten", $this->_enablePasswordForgotten); $this->setXMLAttributValue($node, "passwordStrength", $this->_passwordStrength); $this->setXMLAttributValue($node, "passwordStrengthAlgorithm", $this->_passwordStrengthAlgorithm); diff --git a/op/op.Settings.php b/op/op.Settings.php index f840d49d9..7d550ab91 100644 --- a/op/op.Settings.php +++ b/op/op.Settings.php @@ -112,6 +112,7 @@ if ($action == "saveSettings") // SETTINGS - SYSTEM - AUTHENTICATION $settings->_enableGuestLogin = getBoolValue("enableGuestLogin"); $settings->_enableGuestAutoLogin = getBoolValue("enableGuestAutoLogin"); + $settings->_enable2FactorAuthentication = getBoolValue("enable2FactorAuthentication"); $settings->_restricted = getBoolValue("restricted"); $settings->_enableUserImage = getBoolValue("enableUserImage"); $settings->_disableSelfEdit = getBoolValue("disableSelfEdit"); diff --git a/views/bootstrap/class.Settings.php b/views/bootstrap/class.Settings.php index 38cff7419..9b7cf4274 100644 --- a/views/bootstrap/class.Settings.php +++ b/views/bootstrap/class.Settings.php @@ -411,6 +411,10 @@ if(!is_writeable($settings->_configFilePath)) { : _enableGuestAutoLogin) echo "checked" ?> /> + "> + : + _enable2FactorAuthentication) echo "checked" ?> /> + "> : _restricted) echo "checked" ?> />