資源簡介
修正說明:
1. 登錄頁面只保留英文、簡體中文、繁體中文切換,去掉其他語種
2. 主標簽去除沒用的首頁、RSS和Chat
3. 選項對話框中去除RSS、Chat設置
4. 增加修改賬號密碼的功能,配合Apache James郵件服務器使用,密碼加密采用SHA
5. 修復Notes中的一個缺陷,由于MySQL不支持Timestamp空值導致出錯的問題
安裝說明:
1. Intouch2和James共享同一個數據庫
2. 數據庫連接要加上zeroDateTimeBehavior=convertToNull參數
jdbc:mysql://127.0.0.1/maildb?autoReconnect=true&characterEncoging=utf8&zeroDateTimeBehavior=convertToNull
3. 完整的配置參數參考intouch2.war!\WEB-INF\config\config.xml
4. 配置文件config.xml中的mail.upflow.com換成實際的服務器域名
代碼片段和文件信息
package?org.claros.chat.ajax;
import?java.io.IOException;
import?java.io.PrintWriter;
import?javax.servlet.ServletException;
import?javax.servlet.http.HttpServlet;
import?javax.servlet.http.HttpServletRequest;
import?javax.servlet.http.HttpServletResponse;
import?org.apache.commons.logging.Log;
import?org.apache.commons.logging.LogFactory;
import?org.claros.chat.controllers.TrafficController;
import?org.claros.chat.threads.ChatListener;
import?org.claros.chat.threads.ChatSender;
import?org.jivesoftware.smack.GoogleTalkConnection;
import?org.jivesoftware.smack.XMPPConnection;
import?org.jivesoftware.smack.XMPPException;
public?class?Authenticate?extends?HttpServlet?{
private?static?Log?log?=?LogFactory.getLog(Authenticate.class);
/**
?*?
?*/
private?static?final?long?serialVersionUID?=?6002125607784963740L;
/**
?*?Constructor?of?the?object.
?*/
public?Authenticate()?{
super();
}
/**
?*?The?doPost?method?of?the?servlet.?
?*
?*?This?method?is?called?when?a?form?has?its?tag?value?method?equals?to?post.
?*?
?*?@param?request?the?request?send?by?the?client?to?the?server
?*?@param?response?the?response?send?by?the?server?to?the?client
?*?@throws?ServletException?if?an?error?occurred
?*?@throws?IOException?if?an?error?occurred
?*/
public?void?doPost(HttpServletRequest?request?HttpServletResponse?response)
throws?ServletException?IOException?{
response.setHeader(“Expires““-1“);
response.setHeader(“Pragma““no-cache“);
response.setHeader(“Cache-control““no-cache“);
response.setContentType(“text/html“);
PrintWriter?out?=?response.getWriter();
String?username?=?request.getParameter(“username“);
request.getSession().setAttribute(“user“?username);
String?password?=?request.getParameter(“password“);
String?server?=?request.getParameter(“server“);
request.getSession().setAttribute(“defaultDomain“?null);
try?{
XMPPConnection?connection?=?null;
if?(server?==?null?||?server.equals(“Google?Talk“))?{
request.getSession().setAttribute(“defaultDomain“?“gmail.com“);
try?{
connection?=?new?GoogleTalkConnection();
if?(username.indexOf(“@“)?>?0)?{
username?=?username.substring(0?username.indexOf(“@“));
}
}?catch?(Exception?e1)?{
throw?e1;
}
}?else?{
try?{
request.getSession().setAttribute(“defaultDomain“?server);
connection?=?new?XMPPConnection(server?5222);
}?catch?(Exception?e1)?{
throw?e1;
}
}
try?{
connection.login(username?password);
log.debug(“connection?established?for?user:?“?+?username);
}?catch?(XMPPException?e)?{
log.info(e);
//?maybe?user?doesn‘t?exist?so?try?to?create?one.
try?{
connection.getAccountManager().createAccount(username?password);
connection.login(username?password);
}?catch?(Exception?e1)?{
log.info(e1);
throw?e1;
}
}
request.getSession().setAttribute(“conn“?connection);
//?start?the?user‘s?chat?listener?thread
String?user?=?c
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????825??2015-07-27?14:05??intouch2變更說明.txt
?????文件???????27686??2007-06-06?23:29??license.html
?????目錄???????????0??2015-07-25?17:07??intouch2\
?????文件???????23357??2007-06-10?23:10??intouch2\chat.jsp
?????文件????????7932??2007-06-10?23:10??intouch2\compose.jsp
?????文件???????18855??2007-06-10?23:10??intouch2\contacts.jsp
?????文件????????2125??2007-06-10?23:10??intouch2\contact_import.jsp
?????文件????????1492??2007-06-10?23:10??intouch2\contact_import_if
?????目錄???????????0??2015-07-21?13:21??intouch2\css\
?????文件???????37807??2007-06-10?23:10??intouch2\css\all.css
?????文件?????????232??2007-06-10?23:10??intouch2\css\body.css
?????文件????????3855??2007-06-10?23:10??intouch2\css\chat.css
?????文件?????????238??2007-06-10?23:10??intouch2\css\editor.css
?????文件?????????232??2007-06-10?23:10??intouch2\css\ie6.css
?????文件???????????0??2007-06-10?23:10??intouch2\css\other.css
?????文件?????????622??2007-06-10?23:10??intouch2\css\panel.css
?????文件????????1113??2007-06-10?23:10??intouch2\css\preview.css
?????文件????????1831??2015-07-25?17:07??intouch2\header.jsp
?????文件????????2657??2015-07-25?13:08??intouch2\home.jsp
?????目錄???????????0??2015-07-25?15:18??intouch2\images\
?????文件?????????152??2007-06-10?23:10??intouch2\images\accordion-header-bg.gif
?????文件?????????771??2007-06-10?23:10??intouch2\images\add-contact.gif
?????文件?????????806??2007-06-10?23:10??intouch2\images\add-group.gif
?????文件????????1877??2007-06-10?23:10??intouch2\images\ajax-load-mini.gif
?????文件?????????534??2007-06-10?23:10??intouch2\images\apply.gif
?????文件????????1061??2007-06-10?23:10??intouch2\images\arrowdown.gif
?????文件????????1052??2007-06-10?23:10??intouch2\images\arrowup.gif
?????文件?????????229??2007-06-10?23:10??intouch2\images\attach-bg-left.gif
?????文件?????????232??2007-06-10?23:10??intouch2\images\attach-bg-right.gif
?????文件??????????54??2007-06-10?23:10??intouch2\images\attach-bg.gif
?????文件?????????477??2007-06-10?23:10??intouch2\images\attach-download-ico.gif
............此處省略1869個文件信息
評論
共有 條評論