Login generator ALWAYS says login unseccesfull

Hey I just ran this “ruby script/generate login loging_in” here is my
SQL:
CREATE TABLE users (
id int(11) NOT NULL auto_increment,
user_name varchar(80) default NULL,
login varchar(120) NOT NULL default ‘’,
last_update timestamp NOT NULL default ‘0000-00-00 00:00:00’,
last_attack timestamp NOT NULL default ‘0000-00-00 00:00:00’,
password varchar(40) default NULL,
points int(30) NOT NULL default ‘0’,
activated int(1) NOT NULL default ‘0’,
a_key int(6) NOT NULL default ‘0’,
email varchar(100) NOT NULL default ‘’,
xw int(100) NOT NULL default ‘0’,
w int(100) NOT NULL default ‘0’,
m int(100) NOT NULL default ‘0’,
l int(100) NOT NULL default ‘0’,
xl int(100) NOT NULL default ‘0’,
s int(100) NOT NULL default ‘0’,
ss int(100) NOT NULL default ‘0’,
created_on timestamp NOT NULL default ‘0000-00-00 00:00:00’,
ds int(3) NOT NULL default ‘0’,
dm int(3) NOT NULL default ‘0’,
dl int(3) NOT NULL default ‘0’,
dss int(3) NOT NULL default ‘0’,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
I don’t know why it dosn’t work for some reasson any one know why?

The schema of your table isn’t all that helpful. Are you getting an
error message? What does your development.log say?

~ Ben

On 5/4/06, Mohammad [email protected] wrote:

activated int(1) NOT NULL default ‘0’,
ds int(3) NOT NULL default ‘0’,
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Ben R.
303-947-0446
http://www.benr75.com

No error messages, here is the log:
Processing LogingInController#login (for 127.0.0.1 at 2006-05-04
17:11:30) [POST]
Session ID: ad46b855212634e8c02524588dc654d7
Parameters: {“user_login”=>“admin”, “action”=>“login”,
“controller”=>“loging_in”, “user_password”=>“secret”, “login”=>“Login
\302\273”}
e[4;35;1mUser Load (0.000000)e[0m e[0mSELECT * FROM users WHERE
(login = ‘admin’ AND password =
‘3042a0c5cf8d4d2b5900d2a2ad869fb679870dac’) LIMIT 1e[0m
Rendering within layouts/scaffold
Rendering loging_in/login
Completed in 0.02000 (50 reqs/sec) | Rendering: 0.01000 (50%) | DB:
0.00000 (0%) | 200 OK [http://127.0.0.1/loging_in/login]

No no edits.

Do you have a User that matches the SQL where clause? If you don’t the
login will always fail as no User is returned.

WHERE (login = ‘admin’ AND password =
‘3042a0c5cf8d4d2b5900d2a2ad869fb679870dac’)

On 5/4/06, Mohammad [email protected] wrote:

No no edits.


Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Ben R.
303-947-0446
http://www.benr75.com

yup

SELECT * FROM users WHERE (login = ‘admin’ AND password =
‘3042a0c5cf8d4d2b5900d2a2ad869fb679870dac’)

Hmm… Are you writing your own sql for this? Login generator should
just select out the User with the corresponding login and then use
some methods in the Model for checking the password.

~ Ben

On 5/4/06, Mohammad [email protected] wrote:

Rendering within layouts/scaffold


Ben R.
303-947-0446
http://www.benr75.com