MadHatter Posted May 29, 2014 Share Posted May 29, 2014 HI, I'm looking to implement some rules for password creation and I imagine I'll need to create a module for this. One thing I'd like to do is block the 10,000 most common passwords (From this article) by checking the entered password against the file containing the list. Are there any methods of hooking into the password reset page (or potentially any password entry pages I need to create) to validate against the list or will this require more than a module to accomplish? EDIT: Title is misleading, it should have been password validation rather than password entry. Apologies. 6 Link to comment Share on other sites More sharing options...
ryan Posted May 29, 2014 Share Posted May 29, 2014 As a basic test case, you could add this to your /site/templates/admin.php wire()->addHookAfter('InputfieldPassword::processInput', function($event) { $inputfield = $event->object; $password = $inputfield->attr('value'); $bad = array('test', 'abc', '123', 'password', 'unicorn'); if(in_array($password, $bad)) { $inputfield->error("That's not good enough of a password, try again"); $inputfield->attr('value', ''); } }); 5 Link to comment Share on other sites More sharing options...
apeisa Posted May 29, 2014 Share Posted May 29, 2014 I love the idea for your module! Link to comment Share on other sites More sharing options...
Pete Posted May 29, 2014 Share Posted May 29, 2014 Really neat idea (I changed the title by the way ). Link to comment Share on other sites More sharing options...
MadHatter Posted May 30, 2014 Author Share Posted May 30, 2014 Cool. I'll give this a go and see how I get on. I'd like to move this into a module at some point to allow easybuse by others but I'll work on getting it working before I think about that part 9f my plan. 1 Link to comment Share on other sites More sharing options...
MadHatter Posted June 10, 2014 Author Share Posted June 10, 2014 Hello, I've made this into a module and posted it in the Modules section (here). 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now