Displaying 20 results from an estimated 87 matches for "hashed_password".
2006 Apr 03
7
Getters and setters problem?
Hi list,
first evening of playing with rails, so please forgive me if I ask
something stupid. ;-)
I created a User model and tried to use ActiveRecord callbacks to
convert the password to sha1 just before saving it. For some reason
postgresql gives me a error because the given password is null. To
test even further I tried to change :login too, same error happens,
:login is empty too.
I am sure
2006 Feb 15
8
Agile book - getting confusing error
Working through the beginning phase from the Agile book on
''Administration''
undefined method `hashed_password='' for #<User:0xb7911324>
...
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1498:in `method_missing''
#{RAILS_ROOT}/app/models/user.rb:12:in `before_create''
./script/../config/../app/controllers/login_controller.rb:8:in
`add_user''...
2006 Mar 04
4
Two quick newbie questions
...;t:
@user = User.new(params[:user])
@user = User.new(params[:user => ''username'', :user => ''password''])
... given this model:
class User < ActiveRecord::Base
attr_accessor :password
attr_accessible :username, :password
def before_create
self.hashed_password = User.encrypt_password(self.password)
end
def after_create
@password = nil
end
def self.login(username, password)
hashed_password = encrypt_password(password || '''')
find(:first,
:conditions => [''username = ? and hashed_password =?'...
2005 Jul 13
0
Testing failing
So I''m trying to be a good agile programmer and write unit tests for
my objects, but I''ve got a test I just can''t keep from failing.
I have a profile object that I just added username and
hashed_password to. I used the method in the Rails book to handle
hashing the password. My code is strait out of the book. The whole
object is at the end of this email.
I want to test to make sure the hashed_password gets written out to
the database, so I wrote this test
def test_password_hash...
2006 Jun 05
2
When adding a record in console, a parameter comes in as null even when I set it
...ministrator", :username => "admin", :password =>
"1234", :email => "support@mydomain.com", :account_id => 1
Console gives me:
=> #<User:0x3b55158 @attributes={"name"=>"Administrator", "account_id"=>nil,
"hashed_password"=>"7110eda4d09e062aa5e4a390b0a572ac0d2c0220",
"username"=>"admin", "id"=>8, "created_at"=>Mon Jun 05 16:13:18 Pacific
Standard Time 2006, "email"=>"support@mydomain.com"},
@errors=#<ActiveRecord::Errors:0x3...
2007 Nov 17
18
Syntax Problem
...it in the new crypted_password
field.
Here is my code add on before the logged_in?:
def create
# if no password use old md5 and fill in with sha2
user = User.find_by_login(params[:login])
if #{user.crypted_password} == nil
#check_md5?
(params[:password],#{user.old_salt},#{user.hashed_password})
@p = Digest::MD5::hexdigest("#{params[:password]}")
@s = Digest::MD5::hexdigest(user.old_salt)
@pw = Digest::MD5.hexdigest(@s+@p)
if @pw == #{user.hashed_password}
flash.now[:notice] = "Passed"
# need to write pw
#user.cryp...
2006 Jun 16
2
Problem with User Login from Agile Web Development
...;'' instead of the name that was passed to
the self.login method.
I checked the code multiple times and even downloaded the files as the
book had an error in another part of the model but can''t find the
problem.
The code in the model is:
def self.login(user_name, password)
hashed_password = hash_password(password || "")
find(:first,
:conditions => ["user_name = ? and hashed_password = ?",
user_name, hashed_password])
end
# Log in if the name and password (after hashing) match the database,
# or if the name matches an entry in the database...
2007 Mar 12
0
Undefined method: hashed_password ?
I bought the Agile book to learn Rails, and everything was going
smooth until Iteration F1: Adding Users. I''ve double checked my
code, used the code provided by the book, and still it returns this
same error message:
****
NoMethodError in LoginController#add_user
undefined method `hashed_password='' for #<User:0x473f0d8>
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
C:/InstantRails-1.6-win/InstantRails/ruby/lib/ruby/gems/1.8/gems/
activerecord-1.15.2/lib/active_record/base.rb:1858:in `method_missing''
#{RAILS_ROOT}/app/models/user....
2006 Apr 21
2
destory Test Case Messes up all tests
...ord
validates_presence_of :firstname, :surname
validates_presence_of :password, :on => :create
validates_confirmation_of :password, :on => :create
validates_format_of :email, :with => /^(.+)@(.+)\.[A-z]{2,6}$/
validates_uniqueness_of :email
def self.login(email, password)
hashed_password = hashed_password(password || "")
find(:first,
:conditions => ["email = ? and hashed_password = ?", email,
hashed_password])
end
def try_to_login
User.login(self.email, self.password)
end
def before_create
self.hashed_password = User.hashed_pas...
2006 Jan 20
8
validates_confirmation_of not working
is there any special requirement for validates_confirmation_of ? I am
trying to make sure 2 passwords are equal (cleanly the rails way)..
In my view i have two fields with id user[password] and
user[password_confirmation].
in the model i have
validates_confirmation_of :password, :message =>"Passwords do not match "
Am i missing something here ?
thanks
adam
2006 Feb 22
15
Fixtures and Relationships
In my daily development, I migrate back and forth between versions, and
often do: rake load_fixtures...
... in order to populate my development database with fun data.
Now, with any HABTM relationship, there are failures, as there is no way to
say "which" fixtures to load first.
Within an actual functional or unit test case, you could simply load them in
the proper order, but
2007 Jul 09
3
NoMethodError when using find_by_sql
...y users on login. Here is my code:
def self.authenticate(username,password,account_code)
employee = self.find(:all,
:select => "e.id, e.first_name, e.last_name, e.username,
e.account_id, e.department_id, o.pay_type_id, o.admin_yn, o.payroll_yn,
o.files_yn, o.dept_report_yn,e.salt, e.hashed_password",
:conditions => ["e.deleted_yn=0 and e.username = ? and
a.account_code = ?", username, account_code],
:joins => "as e left outer join options o on e.id = o.employee_id
left outer join accounts a on e.account_id = a.id ")
if employee
expected_pa...
2006 Jul 06
1
Form not inserting data into database
I have a form to register a user. The issue I am having is the fact that
it only populates login, hashed_password and created_at fields.
DB table:
create table users (
id int not null auto_increment,
login varchar(100) default null,
hashed_password char(40) default null,
email varchar(255) default null,
salt varchar(255) default null,
addr...
2006 May 02
9
Updating only one field
At present, I use an update like this to set the user''s last login time:
authenticated_user.update_attribute(:last_login, Time.now)
However, this calls the following, updating all fields:
UPDATE users SET `last_login` = ''2006-05-02 13:27:41'', `hashed_password`
= ....
Is there any way I can tell ActionRecord to only update the one field?
I don''t really want the hashed_password (and other) fields sent back to
the database if possible. If there is a reason rails does it like this
that I''m missing, it would be good to hear what.
Tha...
2007 Nov 25
4
is notify resevered word?
...ECT * FROM `user_notifies` WHERE
(user_notifies.user_id = 1) LIMIT 1
User::Notify Load (0.000799) SELECT * FROM `user_notifies` WHERE
(user_notifies.user_id = 1) LIMIT 1
User Update (0.000362) UPDATE `users` SET `created_at` = ''2007-11-17
19:02:16'', `times_logged_in` = 0, `hashed_password` =
''e0195770807aa8c82b0b128d9c0423b5ad035172'', `logged_at` = ''2007-11-25
14:58:56'', `nickname` = ''Jamal'', `email` = ''jamal-fqskXWjLZVE@public.gmane.org'' WHERE `id` =
1
User::Notify Load (0.000768) SELECT * FROM `user_notifi...
2006 Jul 06
1
Problem implementing password and password confirmation
Hi,
I''m trying to implement password confirmation, based on the Agile
example, but just can''t make any progress.
User DB has these fields:
=========================
t.column :name, :string, :limit => 40
t.column :hashed_password, :string
t.column :salt, :string
User model has:
===============
attr_accessor :password_confirmation
validates_confirmation_of :password
# ''password'' is a virtual attribute
def password
@password
end
def password=(pwd)
@password = pwd
create_new_s...
2019 May 22
2
weakforced: Possible to access the ip address of report/allow?
Hi
I wonder if the information about the origin of report or allow can be
accessed somehow. lt.remote gives the IP of the client trying to login
but is there anything in lt which gives the ip of the system that
connects to wforced?
Thanks and have a good one
--
tobi
2006 Apr 05
0
Tests creating output?
Hi everyone,
I have this code in Person.rb:
def hashed_password(password)
require ''digest/sha1''
require ''base64''
new_password = Digest::SHA1.new
new_password << password
new_password = "{SHA}" << Base64.b64encode(new_password.digest).chop
end
And here''s my test:
def tes...
2006 Jan 24
3
AJAX Preview & Edit Page Problem
...</tr>
</table>
CONTROLLER
----------
def signup
if request.get?
if session[:context] == "signup_edit"
@user = User.new
@user.name = session[:name]
@user.phone = session[:phone]
@user.email = session[:email]
@user.phone_hide = session[:phone_hide]
@user.hashed_password = session[:hashed_password]
session[:context] = "signup"
else
@user = User.new
session[:context] = "signup"
end
else
if params[:signup_button] = "Preview"
@user = User.new(params[:user])
session[:name] = @user.name
session[:phone] = @user.phone
sessi...
2019 May 13
2
dovecot 2.2.36 and wforce
.../etc/dovecot/conf.d/95-wforce.conf
> auth_policy_server_url = http://REMOTE_IP:8084/
> auth_policy_hash_nonce = my_random
> auth_policy_server_api_header = Authorization: Basic <BASE64 of
wforce:my_password>
> auth_policy_request_attributes = login=%{requested_username}
pwhash=%{hashed_password} remote=%{rip} device_id=%{client_id} protocol=%s
restarted dovecot without errors, but upon testing via imap I cannot see
just one single tcp paket leaving direction REMOTE_IP on port 8084. It
looks like auth policy in not involved at all.
Thanks for any idea
tobi