Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: mdenizli on February 13, 2024, 06:18:29 AM

Title: How to disable a plugin 2FA for a specific IP address
Post by: mdenizli on February 13, 2024, 06:18:29 AM
If a connection is made with an IP other than a static IP, I want two factors to be active. How can I do that?

Local IP block: 172.16.x.x
static ip address: 31.223.10.104

config.inc.php open the file

// whitelist, CIDR format available
// NOTE: we need to use .0 IP to define LAN because the class CIDR have a issue about that (we can't use 129.168.1.2/24, for example)
$rcmail_config['whitelist'] = array('172.16.0.0/16', '31.223.10.104');

I edit it like this but it doesn't work. Where am I making a mistake?
Title: Re: How to disable a plugin 2FA for a specific IP address
Post by: SKaero on February 13, 2024, 09:02:10 AM
I haven't used the plugin so I can't say for sure what the configuration needs to be, but one think I noticed is that the config.inc.php no longer uses the "$rcmail_config" variable for the config it now uses the "$config" variable so try changing that.
Title: Re: How to disable a plugin 2FA for a specific IP address
Post by: mdenizli on February 14, 2024, 01:21:32 AM
But here's the thing. When 127.0.0.1 is added, two factors are disabled for all IPs. So doesn't it show that the system is working? But when we add the local IP and static IP we want, it doesn't work.