Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Autentica_Controller extends Base_Controller{
- public $restful = true;
- public function get_index(){
- $view = View::make('dashboard.login');
- if(Session::get('login_errors')){
- $view = $view->with('login_errors', true);
- }
- return $view;
- }
- public function post_login(){
- $userinfo = array(
- 'username' => Input::get('login'),
- 'password' => Input::get('senha')
- );
- if(Auth::attempt($userinfo)){
- return Redirect::to("/");
- }else{
- return Redirect::to_action('autentica')->with('login_errors', true);
- }
- }
- public function get_logout(){
- Auth::logout();
- return Redirect::to('/');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment