Generate passwords encrypted with bcrypt in an already existing user table |
3/30/2023 01:58:21 | |
| PHPRunner General questions | ||
|
A
alfonso authorDevClub member
I have a table with 700 records and in a field of this table I have the access password. My question is how can I generate, in another field of the table, the password with bcrypt for the already registered users. For new users it's easy with the phprunner "Registration and passwords" options |
||
|
|
mbintex 3/30/2023 |
|
Try it with this code for selected records. A field "Passwortkopie" is used for saving the password without encryption as a way back in case something went wrong. $altespasswort is the old password, $verschlpasswort is the encrypted version. $sql="update Benutzer set Passwort='".$verschlpasswort."' where Email='".$email."';"; //$valid=password_verify ( $altespasswort , $verschlpasswort ) ; ` |
|
|
A
|
alfonso authorDevClub member 3/30/2023 |
|
In which event do I have to add that code? Is there no way that with one code you can generate all the passwords without having to go through one by one? |
|
|
|
mbintex 3/30/2023 |
|
It is the code for a custom button and it changes the passwords for all marked users (getNextSelectedRecord) ... |
|