Example #1
0
 /**
  * 
  */
 private function do_login()
 {
     $user = new USERS(T_USERS, 'id', SESSION_NAME);
     $fields = array('user' => $_POST['user'], 'pass' => sha1($_POST['pass']));
     $data_user = $user->check_user_exists($fields);
     if ($data_user) {
         $user->set_session($data_user);
         $this->smarty->assign('session', $_SESSION[SESSION_NAME]);
         header('Location:' . URL_KAD);
         exit;
     } else {
         $tpl = array('in_main' => false, 'inc' => 'site.login.tpl');
         $msg = array('type' => 'error', 'text' => $this->_lang['msg']['user_wrong']);
         $this->smarty->assign('msg', $msg);
     }
     //fin else
     return $tpl;
 }