php - concrete5 create password hash that is comparable to stored value -
i'm building front-end user profile section, user can change login password.
to on safe side, want user enter first current password before can enter new one.
but can't figure out how encrypt password way can checked against value in database. approach different string generated same input value.
do have idea?
here i'm trying right now:
$oldpassword = $ui->getuserpassword(); echo"<pre>"; var_dump($oldpassword); echo"</pre>"; $pw = user::getuserpasswordhasher(); //echo"<pre>"; var_dump($pw); echo"</pre>"; $controlpassword = user::getuserpasswordhasher()->hashpassword('stern3'); echo"<pre>"; var_dump($controlpassword); echo"</pre>";
i'm using concrete5 version 5.6.3.3.
how can see concrete5 use external library hautelook\phpass\passwordhash
, class has method checkpassword
:
so must user db , run method compare password hashes.
i hope help
Comments
Post a Comment