You definitely don't want to modify the jrUser module - there's no need to. Instead you want to create your own custom small module that has an event listener inside that watches for signups and can check the incoming password for whatever rules you would like. Something like this:
1) Create a new directory in your modules directory called "pwCheck" or whatever you want to call it.
2) create a new file inside that directory called "include.php" with the following inside:
<?php
function pwCheck_meta(){
$_tmp = array(
'name' => 'Password Checker',
'url' => 'pwcheck',
'version' => '1.0.0',
'developer' => 'Your Name',
'description' => 'Checks users passwords on signup',
'category' => 'users'
);
return $_tmp;
}
function pwCheck_init(){
jrCore_register_event_listener('jrCore', 'form_validate_exit', 'pwCheck_listener');
return true;
}
function pwCheck_listener($_data, $_user, $_conf, $_args, $event)
{
global $_post;
if ($_post['module'] == 'jrUser' && $_post['option'] == 'signup_save') {
if ($_post['user_passwd1'] != 'abcdefg') {
jrCore_set_form_notice('error', 'Your password is not abcdefg!');
jrCore_form_field_hilight('user_passwd1');
jrCore_form_field_hilight('user_passwd2');
jrCore_form_result();
}
}
return $_data;
}
?>
Just adjust this part:
if ($_post['user_passwd1'] != 'abcdefg') {
to suit your needs.
3) You can add a small “icon.png” file in the same directory if you’d like an icon in ACP.
Hope this helps!
--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
updated by @brian: 03/18/14 06:26:47AM