• Resolved youradds

    (@youradds)


    Hi,

    I’m trying to write a little perl script that will create a wordpress user , and also a user account in another system (in perl). I’ve almost got it working, apart from the password doesn’t seem to wanna work.

    I wrote a little PHP script to generate the password, and then I grab the password in Perl from this script:

    <?php
    include_once("../wp-config.php");
    
    	include_once("../wp-includes/class-phpass.php");
    
    	$wp_hasher = new PasswordHash(8, TRUE);
    
    	echo $wp_hasher->HashPassword($password) ;
    
    ?>

    ;

    As far as I can see that should work – it creates passwords like:

    $P$B9JuIfhNbvYk3zDfTeD7oU/ATfuZrj.

    ..and working passwords on my site look like:

    $P$BcZ1IHg.SjwqTAt0vrHI97/0K9KaGS0

    Anyone got any suggestions as to what else I can try? I’m a bit stumped!

    TIA

    Andy

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter youradds

    (@youradds)

    Just to update, I tested changing the password in wp-admin, and it works then

    The encoded password before was “$P$BFSMEgYCDFx1kKcyH9lHa1mXCHxpTk0” for the password “test”, but when updated in the admin panel, it was “$P$BIBLfCEsEoNPLQF3YqgAA1P1SM6wS9/” for the same password.

    Any suggestions are much appreciated!

    Cheers

    Andy

    You need to MD5 encrypt passwords.

    Thread Starter youradds

    (@youradds)

    Ah you beauty! I tried that before, but it didn’t work – not sure why

    Thanks!

    Andy

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Encoding password from an external script’ is closed to new replies.