mailpw_change
mailpw_change copied to clipboard
Feature: Max 'n' changes per 'time'
Hi! Very nice script. Is it possible to add the feature you already proposed: Having a limit on sequential changes per time? That would increase the safety quite well.
It would need a database where to save the number of tries. You can add it with a few lines of python code
E.g. use redis for that. the key is the virtual user. And with every access you perform a INCR <virtualuser> and a EXPIRE <virtualuser> 3600. So the key will be deleted after one hour (that's a reset and your 'per time' value).
Then you have to check (if this than that) the number (GET <virtualuser>) before try to change. If the number is > 10 e.g., you don't forward the process.