页面未重定向到URL?

时间:2018-07-11 06:49:27

标签: php codeigniter-3 ion-auth

我正在从事PHP-CodeIgniter项目。我正在使用ION Auth library进行身份验证。

我的问题是,当我将粘贴表数据复制到Excel工作表,然后单击复制到excel的链接时not properly redirect到特定页面。如果我hover mouse on the link it shows proper address,但是在单击它时却redirects to Dashboard不是particular page,则它们是Active session data,但仅重定向到仪表板。

控制器代码:

<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

class Auth extends CI_Controller
{

function __construct()
{
    parent::__construct();
    // $this->load->library('');
    $this->load->model('Landlord_m', 'l');

}

public function index()
{
    redirect('auth/login');
}

public function login()
{
    if( $this->ion_auth->logged_in() ) redirect('dashboard');

    $this->form_validation->set_rules('email', 'email', 'required|valid_email|trim');
    $this->form_validation->set_rules('password', 'password', 'required|trim');

    $this->form_validation->set_message('required', 'Please enter your %s');

    //  Validate form
    if( $this->form_validation->run() )
    {
        $remember   =   (bool) $this->input->post('remember');

        //  Check login
        if( $this->ion_auth->login($this->input->post('email'), $this->input->post('password'), $remember) )
        {
            //  Login was successful
            redirect('dashboard', 'refresh');
        }
        else
        {
            //  Login was un-successful
            $this->session->set_flashdata('message', $this->ion_auth->errors());
            redirect('auth/login', 'refresh');
        }
    }
    else
    {
        $data['message']    =   $this->session->flashdata('message');

        $this->load->view('auth/login', $data);
    }
}

public function logout()
{
    if( $this->ion_auth->logout() )
        redirect('auth/login');
    else
        die("There was an error logging you out");
}

欢迎任何帮助,谢谢。

0 个答案:

没有答案
相关问题