Thanks, I went through using the WordPress hashing functions.
So from a Perl CGI I execute this kind of php code (I will have to pass user and password in the call) that I saved into an .htaccess-protected directory so that it can only be called from the Perl script:
<?php
$username = 'myuser';
$plain_password = 'mypassword';
require_once('/path/to/wp-blog-header.php');
require_once('/path/to/class-phpass.php');
$userdata = get_user_by('login', $username);
$result = wp_check_password($plain_password, $userdata->user_pass, $us
+erdata->ID);
if ( $result ) {
echo "1";
} else {
echo "0";
}
?>
Then the Perl CGI calls it as
$ok = `php /path/to/check_password.php`;
The problem is that when I call the php from the browser it gives 1 or 0 back, but apparently from Perl it gives back an empty space.
Thanks you for any hint.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.