Advertisement
Guest User

Untitled

a guest
Jun 4th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.83 KB | None | 0 0
  1. class Login extends CI_Controller{
  2. public function __construct()
  3. {
  4. parent::__construct();
  5. $this->load->model('Login_model');
  6. $this->load->helper('url_helper');
  7. $this->load->library('session');
  8. }
  9. public function index($error = "")
  10. {
  11.  
  12. if ( ! file_exists(APPPATH.'views/Login/index.php'))
  13. {
  14. // Whoops, we don't have a page for that!
  15. show_404();
  16. }
  17. $data['title'] = 'Middleware';
  18. $data['error'] = $error;
  19. if($this->session->userdata('id'))
  20. {
  21. redirect('/Home/index'); // Works on development
  22. }
  23. else
  24. {
  25. $this->load->view('Login/index', $data);
  26. }
  27. }
  28. public function process()
  29. {
  30.  
  31. $login = $this->input->post("Login");
  32. if($login !== NULL)
  33. {
  34. $username = $this->input->post("username");
  35. $password = $this->input->post("password");
  36. $user = $this->Login_model->validate_user($username, $password);
  37. if($user !== NULL)
  38. {
  39. $this->session->set_userdata($user);
  40. redirect('/Home/index'); // Works on development
  41. }
  42. else
  43. {
  44. $this->index("Login failed");
  45. }
  46. }
  47. }
  48. }
  49.  
  50. INFO - 2016-06-04 03:41:46 --> Config Class Initialized
  51. INFO - 2016-06-04 03:41:46 --> Hooks Class Initialized
  52. DEBUG - 2016-06-04 03:41:46 --> UTF-8 Support Enabled
  53. INFO - 2016-06-04 03:41:46 --> Utf8 Class Initialized
  54. INFO - 2016-06-04 03:41:46 --> URI Class Initialized
  55. DEBUG - 2016-06-04 03:41:46 --> No URI present. Default controller set.
  56. INFO - 2016-06-04 03:41:46 --> Router Class Initialized
  57. INFO - 2016-06-04 03:41:46 --> Output Class Initialized
  58. INFO - 2016-06-04 03:41:46 --> Security Class Initialized
  59. DEBUG - 2016-06-04 03:41:46 --> Global POST, GET and COOKIE data sanitized
  60. INFO - 2016-06-04 03:41:46 --> Input Class Initialized
  61. INFO - 2016-06-04 03:41:46 --> Language Class Initialized
  62. INFO - 2016-06-04 03:41:46 --> Loader Class Initialized
  63. INFO - 2016-06-04 03:41:46 --> Helper loaded: url_helper
  64. INFO - 2016-06-04 03:41:46 --> Helper loaded: utility_helper
  65. INFO - 2016-06-04 03:41:46 --> Controller Class Initialized
  66. INFO - 2016-06-04 03:41:46 --> Database Driver Class Initialized
  67. INFO - 2016-06-04 03:41:46 --> Session: Class initialized using 'files' driver.
  68. INFO - 2016-06-04 03:41:47 --> Config Class Initialized
  69. INFO - 2016-06-04 03:41:47 --> Hooks Class Initialized
  70. DEBUG - 2016-06-04 03:41:47 --> UTF-8 Support Enabled
  71. INFO - 2016-06-04 03:41:47 --> Utf8 Class Initialized
  72. INFO - 2016-06-04 03:41:47 --> URI Class Initialized
  73. INFO - 2016-06-04 03:41:47 --> Router Class Initialized
  74. INFO - 2016-06-04 03:41:47 --> Output Class Initialized
  75. INFO - 2016-06-04 03:41:47 --> Security Class Initialized
  76. DEBUG - 2016-06-04 03:41:47 --> Global POST, GET and COOKIE data sanitized
  77. INFO - 2016-06-04 03:41:47 --> Input Class Initialized
  78. INFO - 2016-06-04 03:41:47 --> Language Class Initialized
  79. INFO - 2016-06-04 03:41:47 --> Loader Class Initialized
  80. INFO - 2016-06-04 03:41:47 --> Helper loaded: url_helper
  81. INFO - 2016-06-04 03:41:47 --> Helper loaded: utility_helper
  82. INFO - 2016-06-04 03:41:47 --> Controller Class Initialized
  83. INFO - 2016-06-04 03:41:47 --> Database Driver Class Initialized
  84. INFO - 2016-06-04 03:41:47 --> Session: Class initialized using 'files' driver.
  85. INFO - 2016-06-04 03:41:47 --> File loaded: /hermes/bosnaweb21a/b2784/sl.kavishus/public_html/mystream/application/views/Login/index.php
  86. INFO - 2016-06-04 03:41:47 --> Final output sent to browser
  87. DEBUG - 2016-06-04 03:41:47 --> Total execution time: 0.1088
  88. INFO - 2016-06-04 03:41:53 --> Config Class Initialized
  89. INFO - 2016-06-04 03:41:53 --> Hooks Class Initialized
  90. DEBUG - 2016-06-04 03:41:53 --> UTF-8 Support Enabled
  91. INFO - 2016-06-04 03:41:54 --> Utf8 Class Initialized
  92. INFO - 2016-06-04 03:41:54 --> URI Class Initialized
  93. INFO - 2016-06-04 03:41:54 --> Router Class Initialized
  94. INFO - 2016-06-04 03:41:54 --> Output Class Initialized
  95. INFO - 2016-06-04 03:41:54 --> Security Class Initialized
  96. DEBUG - 2016-06-04 03:41:54 --> Global POST, GET and COOKIE data sanitized
  97. INFO - 2016-06-04 03:41:54 --> Input Class Initialized
  98. INFO - 2016-06-04 03:41:54 --> Language Class Initialized
  99. INFO - 2016-06-04 03:41:54 --> Loader Class Initialized
  100. INFO - 2016-06-04 03:41:54 --> Helper loaded: url_helper
  101. INFO - 2016-06-04 03:41:54 --> Helper loaded: utility_helper
  102. INFO - 2016-06-04 03:41:54 --> Controller Class Initialized
  103. INFO - 2016-06-04 03:41:54 --> Database Driver Class Initialized
  104. INFO - 2016-06-04 03:41:54 --> Session: Class initialized using 'files' driver.
  105. INFO - 2016-06-04 03:41:54 --> Final output sent to browser
  106. DEBUG - 2016-06-04 03:41:54 --> Total execution time: 0.1034
  107. INFO - 2016-06-04 03:41:59 --> Config Class Initialized
  108. INFO - 2016-06-04 03:41:59 --> Hooks Class Initialized
  109. DEBUG - 2016-06-04 03:41:59 --> UTF-8 Support Enabled
  110. INFO - 2016-06-04 03:41:59 --> Utf8 Class Initialized
  111. INFO - 2016-06-04 03:41:59 --> URI Class Initialized
  112. INFO - 2016-06-04 03:41:59 --> Router Class Initialized
  113. INFO - 2016-06-04 03:41:59 --> Output Class Initialized
  114. INFO - 2016-06-04 03:41:59 --> Security Class Initialized
  115. DEBUG - 2016-06-04 03:41:59 --> Global POST, GET and COOKIE data sanitized
  116. INFO - 2016-06-04 03:41:59 --> Input Class Initialized
  117. INFO - 2016-06-04 03:41:59 --> Language Class Initialized
  118. INFO - 2016-06-04 03:41:59 --> Loader Class Initialized
  119. INFO - 2016-06-04 03:41:59 --> Helper loaded: url_helper
  120. INFO - 2016-06-04 03:41:59 --> Helper loaded: utility_helper
  121. INFO - 2016-06-04 03:41:59 --> Controller Class Initialized
  122. INFO - 2016-06-04 03:41:59 --> Database Driver Class Initialized
  123. INFO - 2016-06-04 03:41:59 --> Session: Class initialized using 'files' driver.
  124. INFO - 2016-06-04 03:41:59 --> Final output sent to browser
  125. DEBUG - 2016-06-04 03:41:59 --> Total execution time: 0.0664
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement