2011-09-16 45 views
0

這是一個令人困惑的話題,但這裏是場景。我有一個由相同頁面組成的Web應用程序,無論用戶是否決定登錄。兩個按鈕登錄或客人。當用戶點擊登錄時,它們被髮送到一個MODEL函數,該函數檢查他們是否已登錄,如果不是,則使用ldap來登錄。現在,在該函數之後,我有一個函數調用來繼續下一個函數/頁面。該功能在用戶離開模型後不會執行。因此,當我第二次按下該按鈕「登錄」時,它會進入下一頁,因爲用戶已登錄。控制器模型到控制器登錄問題

本質上,如何讓登錄功能返回到控制器中的新功能

 if($submit == "Login") { 

    $postData['suppress'] = "No"; 
    $this->Login->requireLogin();//login using ldap 
    $this->session->set_userdata(array('is_user' => TRUE)); 
    $this->Tests->setAccountNumber($_SESSION['accountNumber']); 
    $this->Userr->setAccountNumber($_SESSION['accountNumber']); 
    $this->main(); 
    //not hitting main function until we hit login again 
    } 

回答

1

使用redirect('controller/main')發送的用戶,因此,在用戶登錄後會觸發另一個請求。