Project

General

Profile

Actions

Feature #30368

closed

How save crypt style password to extra filed in users table

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

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Accounts / authentication
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid

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

Actions #1

Updated by Go MAEDA about 5 years ago

  • Category set to Accounts / authentication
Actions #2

Updated by Go MAEDA 3 months ago

  • Status changed from New to Closed
  • Resolution set to Invalid

Please use forums for asking questions.

Actions

Also available in: Atom PDF