Nice component for password reminder in joomla
1 answer
If you don't mind cracking the main code, you can look in the file components\com_user\controller.php
. In the function save()
around line 82, it extracts the user's password. At this point, you can paste in any code you like to check the strength of the password:
$passOK = true;
if($post['password'] != $post['password2']) {
$msg = JText::_('PASSWORDS_DO_NOT_MATCH');
$passOK = false;
} else if (strlen($post['password']) < 6 || !preg_match("/[0-9]/", $post['password'])) {
$msg = "The password is too short, or it doesn't contain any numbers.";
$passOK = false;
}
if (!$passOK) {
$return = @$_SERVER['HTTP_REFERER'];
if (empty($return) || !JURI::isInternal($return)) {
$return = JURI::base();
}
$this->setRedirect($return, $msg, 'error');
return false;
}
+1
source to share