Index: pro-violet-viettel/sourcecode/application/modules/ajax/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/ajax/controllers/user.php	(revision 439)
+++ pro-violet-viettel/sourcecode/application/modules/ajax/controllers/user.php	(revision 439)
@@ -0,0 +1,61 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+class User extends MX_Controller
+{
+
+	const TOKENPW = 'violet';
+
+	public function __construct() {
+		parent::__construct();		
+	}
+	
+	public function login($return_type = 'xml')
+	{
+		$user_info = $this->session->userdata('userInfo');
+		if ($user_info)
+		{
+			$user = $user_info['user'];
+			$data['content'] = $this->get_data($user);
+			if ($return_type == "xml"){
+				$this->load->view('user', $data);
+			}
+		}else
+		{
+			redirect('/frontend/home');
+		}
+	}
+	
+	
+	private function get_user($us_id)
+	{
+		$src = 'violet';
+		$token = md5($us_id.self::TOKENPW);
+		$this->load->model('user_model');
+		$data = $this->user_model->get_user_info($src, $us_id, $token);
+		return $data;
+	}
+	
+	private function get_data($user)
+	{
+		$this->load->model('us_model');
+		$arr_users = explode("&", $user);
+		$str_id = $arr_users[0];
+		$str_username = $arr_users[1];
+		$str_fullname = $arr_users[2];
+		$str_phone = $arr_users[5];
+		$str_school = $arr_users[6];
+		$str_province = $arr_users[6];
+		$str_money = $arr_users[8];
+		$str_level = $arr_users[9];
+		$arr_id = explode("=", $str_id);
+		$arr_username = explode("=", $str_username);
+		$arr_fullname = explode("=", $str_fullname);
+		$arr_phone = explode("=", $str_phone);
+		$arr_school = explode("=", $str_school);
+		$arr_province = explode("=", $str_province);
+		$arr_money = explode("=", $str_money);
+		$arr_level = explode("=", $str_level);
+		$us = $this->us_model->search_by_id($arr_id[1]);
+		return array("userId" => $arr_id[1], "userLevel" => 1, "userPhone" => $arr_phone[1], "userMoney" => $arr_money[1], "appUserName" => $arr_fullname[1], "appAddress" => $arr_school[1], "licType" => "SBG", "licCustomer" => $arr_username[1], "licCreate" => $us['created_time'], "licExpire" => $us['expire_date']);
+	}
+}
Index: pro-violet-viettel/sourcecode/application/modules/ajax/models/us_model.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/ajax/models/us_model.php	(revision 439)
+++ pro-violet-viettel/sourcecode/application/modules/ajax/models/us_model.php	(revision 439)
@@ -0,0 +1,12 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+class Us_model extends MY_Model
+{
+	protected $table_name = 'tbluser';
+	protected $id_name = 'us_id';
+
+	function __construct()
+	{
+		parent::__construct();
+	}
+}
Index: pro-violet-viettel/sourcecode/application/modules/ajax/views/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/ajax/views/user.php	(revision 439)
+++ pro-violet-viettel/sourcecode/application/modules/ajax/views/user.php	(revision 439)
@@ -0,0 +1,5 @@
+<?php header ("Content-Type:text/xml"); ?>
+<USER_INFO>
+	<DATA userId="<?php echo $content['userId']; ?>" userLevel="<?php echo $content['userLevel']; ?>" userPhone="<?php echo $content['userPhone']; ?>" userMoney="<?php echo $content['userMoney']; ?>" appUserName="<?php echo $content['appUserName']; ?>" appAddress="<?php echo $content['appAddress']; ?>" licType="<?php echo $content['licType']; ?>" licCustomer="<?php echo $content['licCustomer'];  ?>" licCreate="<?php echo $content['licCreate']; ?>" licExpire="<?php echo $content['licExpire']; ?>">
+	</DATA>
+</USER_INFO>
Index: pro-violet-viettel/sourcecode/application/modules/frontend/controllers/home.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/frontend/controllers/home.php	(revision 438)
+++ pro-violet-viettel/sourcecode/application/modules/frontend/controllers/home.php	(revision 439)
@@ -28,5 +28,5 @@
 			if(isset($_COOKIE[$cookie_name])){
 				$arr_user = parse_str($_COOKIE[$cookie_name]);
-				$user_info = array( 'username' => $arr_user['username'], "logined_in" => TRUE);
+				$user_info = array( 'username' => $arr_user['username'], 'user' => $arr_user['user'], "logined_in" => TRUE);
 				$this->session->set_userdata('userInfo', $user_info);
 				redirect('/frontend/lecture');
@@ -85,7 +85,7 @@
 						//$cookie_time = 7200;
 						$cookie_time = 3600*24*30;
-						setcookie($cookie_name, 'username='.$username, time() + $cookie_time);
+						setcookie($cookie_name, 'username='.$username.'&user='.$data, time() + $cookie_time);
 					}
-					$userdata = array('username' => $username, "logined_in" => TRUE);
+					$userdata = array('username' => $username, 'user'=>$data, "logined_in" => TRUE);
 					$this->session->set_userdata('userInfo', $userdata);
 					redirect('/frontend/lecture');
