I am updating the cakephp application on my new assignment from l.1 to 1.2. I am replacing the authorization code 1.1 with the original Auth component. The problem is that passwords are not hashed in an obsolete database. How to temporarily disable password hashing so that I can start using the Auth component.
Do not worry, I will use the passwords and change this later.
Here is a solution adapted from another stack overflow answer. Overriding the User :: hashPassword model to do basically nothing.
How to replace cakephp password hashing algorithm?
<?php class User extends AppModel { var $name = 'User'; // this is used by the auth component to turn the password into its hash before comparing with the DB function hashPasswords($data) { return $data; } } ?>
, . !
UPDATE user_table SET password = SHA1(password)
CakePHP - SHA-1, , , . SHA1 - MySQL, , .
SHA1
Source: https://habr.com/ru/post/1725499/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1725494/is-it-possible-to-import-an-existing-svn-repository-into-google-code&usg=ALkJrhiJu-kUOU3-FtLF6JkzPfZ5lft5lQЧто такое раздувание интерфейса? - oopCopy files to Xcode - fileSQL Query builder in Delphi - sqljQuery: get identifiers from a class - jqueryhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1725500/how-do-i-acquire-a-cleansed-git-repository&usg=ALkJrhguvkJDu5GhUG1Q0dsBzWyakqqWFwjquery больше/меньше, чем только первый номер? - jqueryJ2me implementation for Linux or others - javaHow to manage a primary key without auto-increment in Rails? - ruby-on-railsClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver when trying to use JPA with Derby - javaAll Articles