Welcome Guest, Not a member yet? Register   Sign In
I Can't Get My Sessions To Work Right
#5

[eluser]ShoeLace1291[/eluser]
The login controller
Code:
<?php

class Login extends MY_Controller {
    
    function __construct(){
        
        parent::__construct();
        
    }
    
    function index(){                
        
        if($this->user['id'] == 0){
            
            $this->load->library('form_validation');
            
            $this->form_validation->set_error_delimiters('<span class="error">', '</span>');
            
            if($this->form_validation->run('signin') == FALSE){
            
             $this->template->overall_header("Member Login");
                
                $data = array(
                    'breadcrumbs' => $this->template->breadcrumbs(
                                        array(
                                            'Home' => 'home',
                                            'Members' => 'members',
                                            'Login' => 'members/login'
                                        )
                    )
                );
                
                $this->load->view('members/login_body', $data);
                
            } else {
                
                $remember = ($this->input->post('remember') == '1') ? TRUE : FALSE;
                $this->member->login($remember);
                
                if($this->member->error == NULL){
                
                 $this->template->overall_header("Login Successful");
                    
                    $data = array(
                       'error_title' => "Login Success",
                       'error_message' => "You are now logged in and will be redirected to your account page.",
                       'redirect' => 'members/login'
                       );
                      
                   $this->load->view('error_body', $data);
                    
                } else {
                
                 $this->template->overall_header("Login Failed");
                    
                   $data = array(
                       'error_title' => "Login Failed",
                       'error_message' => $this->member->error,
                       'redirect' => 'members/login'
                       );
                      
                   $this->load->view('error_body', $data);
                    
                }
                
            }
            
        } else {
            
            $this->template->overall_header("Oops!");
                    
                    $data = array(
                       'error_title' => "Oops!",
                       'error_message' => "You are already logged into a member account!",
                       'redirect' => 'members/account'
                       );
                      
                   $this->load->view('error_body', $data);
            
        }
        
    }


Messages In This Thread
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 12:49 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 12:50 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 12:59 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 01:00 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 01:02 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-18-2014, 01:02 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-19-2014, 05:11 AM
I Can't Get My Sessions To Work Right - by El Forum - 10-20-2014, 05:39 AM
I Can't Get My Sessions To Work Right - by El Forum - 10-20-2014, 02:22 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-20-2014, 02:41 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-20-2014, 02:52 PM
I Can't Get My Sessions To Work Right - by El Forum - 10-20-2014, 03:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB