Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Home extends CI_Controller
- {
- public function __construct()
- {
- parent::__construct();
- }
- public function index()
- {
- $this->output->enable_profiler(TRUE);
- $this->load->library('trinity');
- if(!$this->session->userdata('logged_in'))
- {
- $this->trinity->BuildIndex('index');
- }
- else
- {
- $this->trinity->BuildIndex('index2');
- }
- }
- public function login()
- {
- $this->load->library('trinity');
- $username = $this->input->post('username');
- $password = $this->input->post('password');
- if($this->session->userdata('logged_in'))
- {
- show_error('You are already logged in!');
- }
- else
- {
- $this->trinity->Login($username, $password);
- }
- }
- public function logout()
- {
- $this->load->library('trinity');
- $this->trinity->Logout();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement