many things, comments working.

This commit is contained in:
jomo
2013-06-24 13:29:39 +02:00
parent 7a894f4f6a
commit fb52e8bed2
44 changed files with 490 additions and 223 deletions

View File

@@ -1,13 +1,9 @@
class SessionsController < ApplicationController
def new
end
def create
user = User.find_by_email(params[:email])
if user && user.authenticate(params[:password])
user.last_ip = request.remote_ip
user.last_login = Time.now
user.save
if user.banned
flash[:alert] = "You are banned!"
@@ -24,6 +20,6 @@ class SessionsController < ApplicationController
def destroy
session[:user_id] = nil
redirect_to root_path, :notice => "Logged out!"
redirect_to login_path, :notice => "Logged out!"
end
end