# encoding: UTF-8
class SedenieController < ApplicationController
  skip_before_filter :autorizacia
    
  def new

  end

  def create
    if zamestnanci = Zamestnanci.overenie_Zamestnanci(params[:Login_IS_Ucet].first, params[:password].first)
      session[:ID_Zam] = zamestnanci.ID_Zam
      redirect_to admin_path
    else
      redirect_to sedenie_path, :alert => "Neplatné meno alebo heslo"
    end
  end

  def destroy
    session[:ID_Zam] = nil
    redirect_to sedenie_path, :notice => "Odhlásený"
  end
end
