<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class User extends CI_Controller {

	public function create()
	{

		$this->load->library('form_validation');
		$this->form_validation->set_rules('nom', 'Nom', 'required');
		$this->form_validation->set_rules('prenom', 'Prénom', 'required');
		$this->form_validation->set_rules('email', 'Adresse mail', 'valid_email');
		$this->form_validation->set_rules('password', 'current password', 'min_length[5]|required');
		$this->form_validation->set_rules('cpassword', 'confirm password', 'required|matches[password]');


		if ($this->form_validation->run() === FALSE){
			$this->load->view('layout/header');
			$this->load->view('create_user_form');
			$this->load->view('layout/footer');
		}else{
			//
			// TODO
			// 
		}
	}

	public function auth()
	{
		//
		// TODO
		//

	}
}
