Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. class Home extends CI_Controller
  4. {
  5. public function __construct()
  6. {
  7. parent::__construct();
  8. }
  9.  
  10. public function index()
  11. {
  12. $this->load->library('trinity');
  13. $this->trinity->BuildIndex();
  14. }
  15.  
  16. public function login()
  17. {
  18. $this->load->library('trinity');
  19. $this->load->library('session');
  20. $username = $this->input->post('username');
  21. $password = $this->input->post('password');
  22. var_dump($username);
  23. var_dump($password);
  24. var_dump($_POST);
  25. if($this->session->userdata('logged_in'))
  26. {
  27. show_error('You are already logged in!');
  28. }
  29. else
  30. {
  31. $this->trinity->Login($username, $password);
  32. redirect('home');
  33. }
  34. }
  35.  
  36. public function logout()
  37. {
  38. $this->load->library('trinity');
  39. $this->trinity->Logout();
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement