package com.decker.Essentials.User;

import java.net.HttpCookie;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class User
{
    private UserType Type;
    private Cookie[] Cookies;
    public User( HttpServletRequest request,HttpServletResponse response)
    {
	this.Cookies=request.getCookies();
	this.setUserType();
    }
    private void setUserType()
    {
	//if(seesen)
	this.Type=UserType.Anonymous;
    }	
    
    public UserType getUserType()
    {
	//if(seesen)
	return this.Type;
    }	
}

@@ -60,16 +60,81 @@
 Cookie;%0D
+%0Aimport java.security.MessageDigest;%0D%0Aimport java.sql.ResultSet;%0D
 %0A%0D%0Aimpor
@@ -300,16 +300,66 @@
 ion;%0D%0A%0D%0A
+import org.sipc.se.dao.factory.OperateFactory;%0D%0A%0D%0A
 public c
@@ -427,24 +427,26 @@
 %5D Cookies;%0D%0A
+%0D%0A
     public U
@@ -449,17 +449,16 @@
 ic User(
- 
 HttpServ
@@ -476,16 +476,17 @@
 request,
+ 
 HttpServ
@@ -528,17 +528,19 @@
 .Cookies
-=
+ = 
 request.
@@ -559,25 +559,85 @@
 ;%0D%0A%09
-this.setUserType(
+if (this.Cookies.length == 0)%0D%0A%09%7B%0D%0A%0D%0A%09%7D%0D%0A%09this.setUserType(UserType.Anonymous
 );%0D%0A
@@ -643,16 +643,18 @@
 %0A    %7D%0D%0A
+%0D%0A
     priv
@@ -666,32 +666,49 @@
 oid setUserType(
+UserType userType
 )%0D%0A    %7B%0D%0A%09//if(
@@ -696,32 +696,33 @@
 ype)%0D%0A    %7B%0D%0A%09//
+ 
 if(seesen)%0D%0A%09thi
@@ -731,35 +731,27 @@
 Type
-=U
+ = u
 serType
-.Anonymous
 ;%0D%0A    %7D
 %09%0D%0A 
@@ -750,15 +750,10 @@
    %7D
-%09
 %0D%0A
-    
 %0D%0A  
@@ -795,16 +795,17 @@
   %7B%0D%0A%09//
+ 
 if(seese
@@ -833,14 +833,628 @@
 ;%0D%0A    %7D
-%09
+%0D%0A%0D%0A    public static Cookie%5B%5D GetLoginCookies(String username, String password)%0D%0A    %7B%0D%0A%0D%0A%09try%0D%0A%09%7B%0D%0A%09    password = new String(MessageDigest.getInstance(%22MD5%22).digest(password.getBytes()));%0D%0A%09    ResultSet resultSet = OperateFactory.getInstance().getDAOInstance().doQuery(String.format(%22SELECT * FROM Essentials.User WHERE UserID = '%25s' and Password = '%25s' %22, username, password));%0D%0A%09    if (!resultSet.next())%0D%0A%09    %7B%0D%0A%09%09return new Cookie%5B%5D %7B new Cookie(%22UN%22, username), new Cookie(%22PW%22, password) %7D;%0D%0A%09    %7D%0D%0A%09%7D catch (Exception e)%0D%0A%09%7B%0D%0A%09    System.out.print(e.toString());%0D%0A%0D%0A%09%7D%0D%0A%0D%0A%09return new Cookie%5B0%5D;%0D%0A    %7D
 %0D%0A%7D%0D%0A

Add GetCookies