Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. private function changeState()
  4. {
  5. $userSession = $this->userStorage->loadUser();
  6.  
  7. if($userSession)
  8. {
  9. $this->loginModel->setIsLoggedIn(true);
  10. }
  11.  
  12. if($this->loginModel->getIsLoggedIn())
  13. {
  14. if($this->loginView->ifUserWantsToLogout())
  15. {
  16. $this->loginController->logout();
  17. }
  18. } else
  19. {
  20. if($this->registerView->ifUserWantsToRegister())
  21. {
  22. $this->signupController->register();
  23. } else if($this->loginView->ifUserWantsToLogin())
  24. {
  25. $this->loginModel->setIsLoggedIn($this->loginController->login());
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement