Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Auth extends CI_Controller
- {
- public function __construct()
- {
- parent::__construct();
- $this->load->library('session');
- $this->load->helper(array('url', 'form'));
- $this->load->model('auth_mod');
- $this->output->enable_profiler(TRUE);
- }
- public function index()
- {
- if ($this->input->server('REQUEST_METHOD') == 'POST')
- {
- $action = $this->input->post('action');
- if ($action == 'login')
- {
- $email = $this->input->post('email');
- $password = $this->input->post('password');
- $this->auth_mod->login($email, $password);
- }
- elseif ($action == 'register')
- {
- $name = $this->input->post('name');
- $email = $this->input->post('email');
- $password = $this->input->post('password');
- $role = $this->input->post('role');
- $this->auth_mod->create_user($name, $email, $password, $role);
- }
- elseif ($action == 'forgotten_password')
- {
- }
- }
- $this->load->view('auth_view');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement