/*********************************** * 删除某用户 * *********************************/ public static Protocol Delete_User_Info(Protocol pro) { if (pro.Session != null && GlobalInfo.session.Find(pro.Session)) { UserHandle uh = new UserHandle(); Protocol returnPro = new Protocol(); if (uh.deleteUserInfo(GlobalInfo, pro)) { returnPro.protoType = ProtoType.SUCCESS; Log.WriteLog(LogLevel.MSG, GlobalInfo.session.getName(pro.Session) + " is trying to delete user"); } else { returnPro.protoType = ProtoType.ERROR; } return returnPro; } else { Protocol returnPro = new Protocol(); pro.protoType = ProtoType.OUT_OF_TIME; return returnPro; } }
/**************************************** * 取得权限列表 * **************************************/ public static Protocol Fetch_Authority_Lists(Protocol pro) { if (pro.Session != null && GlobalInfo.session.Find(pro.Session)) { UserHandle uh = new UserHandle(); Protocol returnPro = new Protocol(); returnPro.data = uh.fetchAuthorityLists(GlobalInfo,pro); if (returnPro.data!=null) { returnPro.protoType = ProtoType.SUCCESS; } else { returnPro.protoType = ProtoType.ERROR; } return returnPro; } else { Protocol returnPro = new Protocol(); pro.protoType = ProtoType.OUT_OF_TIME; return returnPro; } }
/************************************* * 获得要更改的用户的信息,包括用户的名字,权限等 * 同时获得权限列表 * ***********************************/ public static Protocol Get_Modifying_User_Info(Protocol pro) { if (pro.Session != null && GlobalInfo.session.Find(pro.Session)) { UserHandle uh = new UserHandle(); Protocol returnPro = new Protocol(); returnPro.mutilData = uh.getModifyingUserInfo(GlobalInfo, pro); Log.WriteLog(LogLevel.MSG, GlobalInfo.session.getName(pro.Session) + " is trying to update user's info"); if (null != returnPro.mutilData) { returnPro.protoType = ProtoType.SUCCESS; } else { returnPro.protoType = ProtoType.ERROR; } return returnPro; } else {//超时 Protocol returnPro = new Protocol(); pro.protoType = ProtoType.OUT_OF_TIME; return returnPro; } }
/******************************************* * 更新用户信息 * *****************************************/ public static Protocol Update_User_Info(Protocol pro) { if (pro.Session != null && GlobalInfo.session.Find(pro.Session)) { UserHandle uh = new UserHandle(); Protocol returnPro = new Protocol(); if (uh.updateUserInfo(GlobalInfo, pro)) { returnPro.protoType = ProtoType.SUCCESS; } else { returnPro.protoType = ProtoType.ERROR; } return returnPro; } else { Protocol returnPro = new Protocol(); pro.protoType = ProtoType.OUT_OF_TIME; return returnPro; } }
/************************************* * 获取用户信息 * **********************************/ public static Protocol Get_All_User_Info(Protocol pro) { if (pro.Session != null && GlobalInfo.session.Find(pro.Session)) { Log.WriteLog(LogLevel.MSG, GlobalInfo.session.getName(pro.Session) + " is trying to get all userinfo"); UserHandle uh = new UserHandle(); Protocol returnProtol = new Protocol(); returnProtol.data = uh.getAllUserInfo(GlobalInfo, pro); if (null != returnProtol.data) { returnProtol.protoType = ProtoType.SUCCESS; } else { returnProtol.protoType = ProtoType.ERROR; } return returnProtol; } else { //超时 Protocol returnPro = new Protocol(); pro.protoType = ProtoType.OUT_OF_TIME; return returnPro; } }