Admin user creation refuses to accept password

Admin user creation refuses to accept password

by Pankaj Shrivastava -
Number of replies: 8

I just installed Moodle 2.2.2. I am using PHP 5.3.5 with MySQL 5.0.67. I have reached a stage where the Admin user is to be created. 

The password requirement is 

Passwords must have at least 1 digit(s).
Passwords must have at least 1 lower case letter(s).
Passwords must have at least 1 upper case letter(s).
Passwords must have at least 1 non-alphanumeric character(s).
 
I have tried many combinations which satisfy the above criteria and yet, the page refuses to go forward. It keeps coming back to user/editadvanced.php and keeps highlighting in red the criteria for the password. 
I have used the unmask feature and verified that the passwords I am entering indeed satisfy ALL the criteria. 
What could be wrong? Or where can I relax this criteria and see if it accepts easier password?
Average of ratings: -
In reply to Pankaj Shrivastava

Re: Admin user creation refuses to accept password

by Ken Task -
Picture of Particularly helpful Moodlers

That should not fail (obviously) so check that you've the supports needed for PHP.  Passwords are md5 hashed. 

Check mysql logs for errors.  Using correct mysql user and password?  Check apache error logs for clues.

Not sure if on can re-enter the installation process at the point of creating the Admin user (which is one of a kind).  Could try this … not tried it myself at the stage of install where you are so can't verify that it will work.

In the config.php file, add a line:

$CFG->passwordpolicy='0'

No need to restart apache, just access Moodle.

Whatever issue is found, one might need to remove the config.php file to get Moodle into the install mode again.   Might have to dump all tables in the DB then start the install again. Right after it reports it's successfully created the config.php file, then make the addition to the config.php file.

Again, think there might be other issues that need checking.

'spirit of sharing', Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Admin user creation refuses to accept password

by Pankaj Shrivastava -

This solution (of setting $CFG->passwordpolicy) worked for me.

Thanks a lot!

-Pankaj

In reply to Ken Task

Re: Admin user creation refuses to accept password

by Daniel Garcia Sanchez -

Hi Ken! Great solution! smile

I also needed create one user with one 'simple' password, this is, one password without alfanumeric caracters...and thanks to you, I solved my problem.

Regards, Daniel

In reply to Daniel Garcia Sanchez

Re: Admin user creation refuses to accept password

by Ken Task -
Picture of Particularly helpful Moodlers

Welcome.  Glad it worked.  Can't help but think there might be some other issues lurking with the installation, however, so check out anything/everything related to user accounts/logins/passwords.

Not a bad idea to have a more secure password policy in place ... unless using LDAP or some other primary means of authentication which is in-compat with the requirements. 

That addition to the config.php file can be commented out (thus it is still there to re-enable if testing logins/passwords/authentication methods fail).  Would recommend commenting it out in running the Moodle for a while to see if any other related issues rear their ugly head! :\

'spirit of sharing', Ken

In reply to Pankaj Shrivastava

Re: Admin user creation refuses to accept password

by Isaac Gómez -

In order to change the password critetia, go into Settings>Site management>Security>Site Policies.

You can find the Password policies to disable it at all (like the last php config post) or change the settings for Password lenght, Digits, lowercase chars, upper case chars, alphanumeric chars and ammount of consecutive chars.

In reply to Pankaj Shrivastava

Re: Admin user creation refuses to accept password

by Guillermo Madero -

Hi Pankaj,

Are you also complying with the minimum 8 character length?

In reply to Guillermo Madero

Re: Admin user creation refuses to accept password

by Pankaj Shrivastava -

Yes, I was complying to the length of minimum 8 chars. If I didn't I would get additional message about the length in the list of error messages.

Finally, I have set the $CFG->passwortdpolicy to '0' and got going.

Thanks.

-Pankaj

In reply to Pankaj Shrivastava

Re: Admin user creation refuses to accept password

by Deleted user -

I know this thread is not active and *solved*, but I had the same problem and ended figuring out why. Just posting for googlers.

I had upgraded PHP to 5.3.6 before installing Moodle 2.3.1+ , and everything worked fine but it complained about PCRE unicode (it was just a warning, not required) not being found.

When an admin password was requested and seemed not to be correctly checked, I backtraced the problem to lib/moodlelib.php where function check_password_policy was indeed using preg_match_all('/:digit:/u', $password, $matches)

So PCRE unicode SHOULD be a requirement.

 Dån