Viewing file: login.php (1.81 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php class Login extends CI_Controller { private $ver_path;
function __construct() { parent::__construct(); $this->ver_path = $this->config->item('ver_folder'); }
function index() { $mn['menu'] = $this->load->view('info/v_prelogin','',true); $lv['body'] = $this->load->view('info/v_info','',true); $lv['head'] = $this->load->view('info/v_header',$mn,true); $lv['footer'] = $this->load->view('info/v_footer','',true); $this->load->view('info/v_in',$lv); }
function chk_user() { $this->load->model($this->ver_path.'m_umuser'); $this->load->model($this->ver_path.'m_umgroup'); $mus = $this->m_umuser; $mgp = $this->m_umgroup; $this->load->library('form_validation'); $this->form_validation->set_rules('txtUsername','','required|trim|xss_clean'); $this->form_validation->set_rules('txtPassword','','required|trim|xss_clean'); if($this->form_validation->run() == TRUE) { $mus->UsLogin = $this->input->post('txtUsername',TRUE); $mus->UsPassword = $this->input->post('txtPassword',TRUE); $qu_chk = $mus->check_user(); if($qu_chk->num_rows()) { $mus->UsID = $qu_chk->row()->UsID; $mus->get_by_key(TRUE); $arr = array( 'UsID'=>$mus->UsID, 'UsName'=>$mus->UsName, 'UsLogin'=>$mus->UsLogin, 'UsPsCode'=>$mus->UsPsCode, 'UsWgID'=>$mus->UsWgID, ); $this->session->set_userdata($arr); $mgp->GpID = $this->config->item('ver_gp'); $mgp->get_by_key(TRUE); unset($arr); $arr = array( 'GpID'=>$mgp->GpID, 'GpNameT'=>$mgp->GpNameT, 'GpNameE'=>$mgp->GpNameE, 'GpStID'=>$mgp->GpStID ); $this->session->set_userdata($arr); redirect($this->ver_path.'ver_client'); } else { redirect('login'); return; } } redirect('login'); }
} ?>
|