This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Generate a new random password for an eZ Platform user. You have to run the SQL update statement yourself, with the correct user ID. | |
$password = bin2hex(random_bytes(8)); // 16-char hex password | |
print("New password: $password\n"); | |
$hash = password_hash($password, PASSWORD_DEFAULT); // this is bcrypt, for now | |
print("New password hash: $hash\n"); | |
print("Update SQL:\nUPDATE ezuser SET password_hash = '$hash', password_hash_type = 7 WHERE contentobject_id = INSERT YOUR ID HERE, ADMIN IS 14;\n"); |