保存注册信息regSupplierSave.jsp源码如下:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="cn.myapps.core.user.action.WebUser"%>
<%@ page import="cn.myapps.constans.Web"%>
<%@ page import="cn.myapps.core.user.ejb.*"%>
<%@page import="cn.myapps.util.ProcessFactory"%>
<%@ page import="cn.myapps.util.Security"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>保存用户注册</title>
<%
String password = request.getParameter("passWord");
String userNo=request.getParameter("userName");
// out.println("=========" + password);
if (password != null && userNo != null && password.trim().length() >0 && userNo.trim().length() >0 ) {
out.println("-----------");
//
try{
UserProcess uprocessb =(UserProcess)ProcessFactory.createProcess(UserProcessBean.class);
//UserProcessBean uprocessb = new UserProcessBean();
UserVO user = uprocessb.login(userNo,
"11e4-2448-eb889786-8720-b9a2db17f360");//根据用户帐号,企业域id获取用户对象
if (user == null) {
UserVO uservo = new UserVO();
uservo.setName(userNo); //用户名称
uservo.setLoginno(userNo); //登录帐号
//加密
Security sc = new cn.myapps.util.Security();
String ss = sc.encryptPassword(password);
uservo.setLoginpwd(ss); //登录密码
uservo.setDomainid("11e4-2448-eb889786-8720-b9a2db17f360"); //所属企业域
uservo.setDefaultDepartment("11e4-47ac-4907273b-98ab-15705837f4d7"); //默认部门
uprocessb.doCreate(uservo);
}
String users[] = new String[1];
users[0] = user.getId();
uprocessb.addUserToDept(users,
"11e4-47ac-4907273b-98ab-15705837f4d7");//为用户添加所属部门
uprocessb.addUserToRole(users,
"11e4-47ad-89099be7-98ab-15705837f4d7");//为用户添加所属角色
}catch(Exception e){
out.print(e);
out.println("添加用户失败");
}
}
%>
</head>
<body>
<table width="500" border="0" align="center" cellpadding="2" cellspacing="0">
<tbody><tr align="center">
<td height="30" colspan="2">请牢记下面的账号和密码</td>
</tr>
<tr bgcolor="A4DFF6">
<td align="right">账号:</td>
<td><%=userNo%></td>
</tr>
<tr bgcolor="A4DFF6">
<td width="174" align="right">密码:</td>
<td width="318"><%=password%></td>
</tr>
<tr bgcolor="A4DFF6">
<td align="right">登录地址:</td>
<td><a href="http://www.ispowers.com/" target="_blank">http://www.ispowers.com/</a></td>
</tr>
</tbody>
</table>
</body>
</html> |