Nice component for password reminder in joomla

I would like to change the default behavior for the Joomla password reminder mechanism. I would like to have a password strength check and (optionally) with captcha capabilities. I was wondering if there is a free Joomla component that I could install and use out of the box.

+1


source to share


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







All Articles