开发者

Controller to Model to Controller login issue

开发者 https://www.devze.com 2023-04-05 15:17 出处:网络
This is a confusing topic but here is the scenario.I have a web application that consists of the same set of pages, whether a user decides to login or not.Two buttons login in or guest.When the user c

This is a confusing topic but here is the scenario. I have a web application that consists of the same set of pages, whether a user decides to login or not. Two buttons login in or guest. When the user clicks login, they are sent to a MODEL functio开发者_Go百科n that checks to see if they are logged in and if not uses ldap to get them logged in. Now after that function I have a function call to continue to the next function/page. That function doesnt get executed after the user leaves the model. So when I press that button "log in" the second time, it does go to the next page, because the user is logged in.

Essentially how do I get the login function to return to the new function in the controller

       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
    }


use a redirect('controller/main') to send the user on, so that it will trigger another request after the user is logged in.

0

精彩评论

暂无评论...
验证码 换一张
取 消