application/controllers/Auth.php
/**
     * Check credentials passed from login form.
     */
Check credentials passed from login form.
Check credentials passed from login form .
public function check() {
        $authObject = $this->User_model->getAuthObject($this->input->post('pin'));
        if($authObject->authenticated) {
            $this->createUserSession($authObject->user);
                    $redirectTo = '/app/index';
                case 'developer':
                    $redirectTo = '/auth/index';
            }
            $this->session->set_flashdata('alert_success', 'You have logged in successfully.');
            redirect($redirectTo, 'refresh');
        }
        $this->session->set_flashdata('alert_danger', 'Invalid PIN. Please try again.');
        redirect('/auth/index', 'refresh');
    }
public function check ( ) { $ authObject = $ this -> User_model -> getAuthObject ( $ this -> input -> post ( 'pin' ) ) ; if ( $ authObject -> authenticated ) { $ this -> createUserSession ( $ authObject -> user ) ; $ redirectTo = '/app/index' ; $ this -> session -> set_flashdata ( 'alert_success' , 'You have logged in successfully.' ) ; redirect ( $ redirectTo , 'refresh' ) ; } $ this -> session -> set_flashdata ( 'alert_danger' , 'Invalid PIN. Please try again.' ) ; redirect ( '/auth/index' , 'refresh' ) ; }
Check credentials passed from login form.
Check credentials passed from login form .
//            switch($authObject->user->role) { //                case 'admin': //                    break; // //                case 'developer': //                    $redirectTo = '/auth/index'; //                    break; //            }