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

class Redirect_edit extends CI_Controller {
	function user_edit(){
		#make sure that only admin level that can open the page
		if($this->session->userdata('idgroup')>2){
			redirect('login');
		}
		
		$this->setParams();
		redirect('user');
	}

	function setParams(){
		if($this->session->userdata('is_logged_in')===FALSE){
			redirect('login');
		}
		$segment = $this->uri->segment_array();
		#$this->nativesession->set_flash_session('segment', $segment);
		$this->nativesession->set_flash_session('security', TRUE);
		if($this->uri->segment(1)==='user_edit'){
			$this->nativesession->set_flash_session('page', $this->uri->segment(1));
			$this->nativesession->set_flash_session('enc', $this->uri->segment(2));
		}elseif($this->uri->segment(1)==='user_add'){

		}else{
			redirect('login');
		}
		
	}
}