Hello, Im a newb. Im trying to authenticate a user then print out the username. What am I doing wrong? Thanks jason unless session[:user] @user = Auth.find(:first , :conditions => ["username=? AND password=?", params[:username] , params[:password]]) session[:user] = @user if @user render(:inline=> "#{ session[:user].username } " ) && return; else
On 7/13/06, Jason Davis <mohadib@openactive.org> wrote:> Hello, > Im a newb. Im trying to authenticate a user then print out the > username. What am I doing wrong? > > Thanks > jason > > > unless session[:user] > @user = Auth.find(:first , :conditions => ["username=? AND password=?", params[:username] , params[:password]]) > session[:user] = @user if @user > render(:inline=> "#{ session[:user].username } " ) && return; > elseAre your passwords really stored in plaintext in your database?
On Fri, 2006-07-14 at 00:13 -0500, James Ludlow wrote:> On 7/13/06, Jason Davis <mohadib@openactive.org> wrote: > > Hello, > > Im a newb. Im trying to authenticate a user then print out the > > username. What am I doing wrong? > > > > Thanks > > jason > > > > > > unless session[:user] > > @user = Auth.find(:first , :conditions => ["username=? AND password=?", params[:username] , params[:password]]) > > session[:user] = @user if @user > > render(:inline=> "#{ session[:user].username } " ) && return; > > else > > Are your passwords really stored in plaintext in your database?yes :x its just a test database to play with ruby. Any idea why i can print the username? thanks, jason> _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails