Advertisement
Guest User

Untitled

a guest
Sep 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 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->output->enable_profiler(TRUE);
  13.  
  14. $this->load->library('trinity');
  15. if(!$this->session->userdata('logged_in'))
  16. {
  17. $this->trinity->BuildIndex('index');
  18. }
  19. else
  20. {
  21. $this->trinity->BuildIndex('index2');
  22. }
  23. }
  24.  
  25. public function login()
  26. {
  27. $this->load->library('trinity');
  28. $username = $this->input->post('username');
  29. $password = $this->input->post('password');
  30. if($this->session->userdata('logged_in'))
  31. {
  32. show_error('You are already logged in!');
  33. }
  34. else
  35. {
  36. $this->trinity->Login($username, $password);
  37. }
  38. }
  39.  
  40. public function logout()
  41. {
  42. $this->load->library('trinity');
  43. $this->trinity->Logout();
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement