Ejemplo n.º 1
0
 function process_login()
 {
     $this->form_validation->set_rules('username', 'username', 'required|xss_clean');
     $this->form_validation->set_rules('password', 'password', 'required|xss_clean');
     $this->form_validation->set_error_delimiters('', '<br/>');
     //if (no_ser()==addCopy()){
     if ($this->form_validation->run() == TRUE) {
         $username = $this->input->post('username');
         $password = $this->input->post('password');
         $login_data = $this->Admin_model->cek_user_login($username, $password);
         if ($login_data->num_rows() == 1) {
             foreach ($login_data->result_array() as $lgn) {
                 $session_data = array('userid' => $lgn['userid'], 'username' => $lgn['username'], 'idlevel' => $lgn['idlevel'], 'login' => TRUE, 'version' => addCopy() == '' ? 'Demo Version' : addCopy());
             }
             $this->session->set_userdata($session_data);
             //encode_php();
             //redirect('admin/index');
             $this->index();
         } else {
             $data['error'] = "Username or password incorrect please try again";
             $data['version'] = addCopy() == '' ? 'Demo Version' : addCopy();
             $this->load->view('admin/header');
             $this->load->view('admin/login', $data);
             $this->load->view('admin/footer');
         }
     } else {
         $this->logout();
     }
     /*       }else{
     					$data['error']="It's ilegal copy, please contact via email to : contact@smarthome-kanz.com and put this code in your email \nKode : ".no_ser();
     					$this->load->view('admin/header');
     					$this->load->view('admin/login',$data);
     					$this->load->view('admin/footer');
     	
     		$this->index();
     		}
     */
 }
Ejemplo n.º 2
0
		}else if(e.keyCode==114){
			return false;
		}
	 })
	
    });
</script>
<title><?php 
echo $zz->rContent("WebPage", "Title", $z_config) . "-" . $zz->rContent("WebPage", "subtitle", $z_config);
?>
</title>
</head>
<body>
<?php 
$menul = $this->session->userdata('menus');
$verses = addCopy() == '' ? $this->session->userdata('version') : '';
$menune = empty($menul) ? '' : base64_decode($menul);
?>
<div id="menu-atas" style='z-index:9990'>
	<div class='logo' style=" vertical-align:middle">
    <?php 
echo empty($menul) ? $zz->rContent("InfoCo", "Name", $z_config) : 'Modul ' . base64_decode($menul);
?>
    </div><?php 
echo "<b><strong>" . $verses . "</strong></b>";
?>
    <div class="menu">
    <?php 
if ($this->session->userdata('login') == true) {
    echo "<div class='welcome judul sorot' style='padding:5px;display:none'>User Login \r\n    \t\t<span class='sorot'>" . $this->session->userdata('username') . "</span></div>\n";
}