0
我目前正在研究一個CodeIgniter和IonAuth項目,並且我遇到了這個問題。CodeIgniter和IonAuth'如果用戶登錄'
場景:當我登錄時,我仍然可以訪問登錄頁面。我想要做的是消除這種訪問,因爲用戶已經登錄
這是在我的身份驗證類我的索引方法:
function index(){
if (!$this->ion_auth->logged_in())
{
//redirect them to the login page
redirect('auth/login', 'refresh');
}
elseif($this->ion_auth->logged_in())
{
//redirect them to the index page if logged in
redirect('/', 'refresh');
}
elseif (!$this->ion_auth->is_admin())
{
//redirect them to the home page because they must be an administrator to view this
redirect($this->config->item('base_url'), 'refresh');
}
}
任何想法將真棒!
謝謝你的回覆!我會盡快檢查! – yowza 2014-09-11 03:16:50
非常感謝,你真的幫了我很多!保持好狀況! – yowza 2014-09-11 03:22:49