Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <?php
  2.  
  3. use App\Core\Controller as Controller;
  4.  
  5. use App\Models\AdminModel as AdminModel;
  6.  
  7. use App\Core\Session as Session;
  8.  
  9. class AdminController extends Controller
  10. {
  11.  
  12. private $AdminModel;
  13. private $session;
  14.  
  15. public function actionLogin()
  16. {
  17. $this->AdminModel = new AdminModel();
  18. self::viewPageDB($this->AdminModel->checkCofig("adminlogin"));
  19. }
  20.  
  21. public function actionPanel()
  22. {
  23. $this->session = new Session();
  24. if ($this->session->sessionCheck("ADMIN")) {
  25. $this->AdminModel = new AdminModel();
  26. self::viewPageDB($this->AdminModel->checkCofig("adminpanel"));
  27. } else {
  28. $this->AdminModel = new AdminModel();
  29. self::viewPageDB($this->AdminModel->checkCofig("404"));
  30. }
  31. }
  32.  
  33. public function actionCheckPostLogin()
  34. {
  35. if ($_POST['adminlog'] == "1" && $_POST['adminpass'] == "1") {
  36. $this->session = new Session();
  37. $this->session->sessionStart("ADMIN");
  38. header("location: /admin/panel");
  39. } else {
  40. $this->AdminModel = new AdminModel();
  41. self::viewPageDB($this->AdminModel->checkCofig("postinfo"));
  42. }
  43. }
  44.  
  45. public function actionCheckPostPanel()
  46. {
  47.  
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement