Feature #30368

How save crypt style password to extra filed in users table

Added by Taipeng Luo over 3 years ago. Updated over 3 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Accounts / authentication
Target version:-
Resolution:

Description

ALTER TABLE `users` ADD `password` VARCHAR(255) NULL DEFAULT NULL AFTER `login`;

app/models/user.rb:332

  def salt_password(clear_password)
    self.salt = User.generate_salt
    self.hashed_password = User.hash_password("#{salt}#{User.hash_password clear_password}")
    self.passwd_changed_on = Time.now.change(:usec => 0)
  end

  def salt_password(clear_password)
    self.salt = User.generate_salt
    self.password = 'password'.crypt(clear_password)
    self.hashed_password = User.hash_password("#{salt}#{User.hash_password clear_password}")
    self.passwd_changed_on = Time.now.change(:usec => 0)
  end

Add a line `self.password = 'password'.crypt(clear_password)`, but not work.

https://httpd.apache.org/docs/2.4/mod/mod_authn_dbd.html

History

#1 Updated by Go MAEDA over 3 years ago

  • Category set to Accounts / authentication

Also available in: Atom PDF