Moodle password check on external script
<p>I have Moodle 2.7. Users logins and passwords hashes is stored in mdl_user table. I want to create external script that can check - if login and password are correct.</p>

<p>As i see - this moodle version use some function php like <strong>password_hash()</strong> to generate password hash.  </p>

<p>My php version is 5.4 so i can't use this function. So i use this library <a href="https://github.com/ircmaxell/password_compat" rel="nofollow">https://github.com/ircmaxell/password_compat</a> with this code </p>

<pre><code>$password_hash = password_hash( $password , PASSWORD_DEFAULT, array());
</code></pre>

<p>The problem is that hash is different each time i calculate it. So i cant compare this hash to string that is placed in mdl_user table.</p>