public static ActionForward response(HttpServletResponse response,String content){
response.setContentType("text/html;charset=UTF-8");
PrintWriter out;
try {
out = response.getWriter();
out.print(content);
out.flush();
out.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package struts.action;
import java.util.Enumeration;
import java.util.NoSuchElementException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.Globals;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import org.hibernate.usertype.UserType;
import db.Userinfo;
import service.UserAuth;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import util.Common;
import util.GlobalConfigure;
import util.ServerToClient;
import util.SingleBeanFactory;
/**
* MyEclipse Struts
* Creation date: 10-14-2008
*
* XDoclet definition:
* @struts.action path="/userLogin" name="userLoginForm" input="/userLogin.jsp" scope="request" validate="true"
* @struts.action-forward name="loginFailure" path="/userLogin.jsp"
* @struts.action-forward name="chairmanLoginSuc" path="/chairman.jsp"
* @struts.action-forward name="viewerLoginSuc" path="/viewer.jsp"
* @struts.action-forward name="participantLoginSuc" path="/participant.jsp"
*/
public class UserLoginAction extends DispatchAction {
/*
* Generated Methods
*/
private UserAuth userAuthReq = SingleBeanFactory.getInstance().getUserAuth();
Log logger = LogFactory.getLog(UserLoginAction.class);
/**
* Method execute
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward login(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
HttpSession session = request.getSession();
// 获取用户名、密码和验证码
String name = request.getParameter("name");
String pass= request.getParameter("pass");
String check = request.getParameter("check");
logger.info("用户:"+name+"登录,密码为:"+pass);
///
BASE64Encoder encoder = new BASE64Encoder();
BASE64Decoder decoder = new BASE64Decoder();
pass = encoder.encode(pass.getBytes());
//
Userinfo userInfo = new Userinfo();
userInfo.setUserName(name);
userInfo.setUserPassword(pass);
Userinfo user=userAuthReq.getUser(userInfo);
/*
* 判断身份
*/
boolean bname=false;
boolean bpass=false;
boolean bcheck=false;
String logined = "failure";//表示用户是否已经登录过系统,登录过为success,未登录过表示为failure
String userType = "none";
// 获取校验码
String genCode = (String)session.getAttribute(GlobalConfigure.CHECKCODE);
//session.removeAttribute(GlobalConfigure.CHECKCODE);
if(genCode != null && genCode.equals(check)){ // 校验码正确
// 利用用户名、密码匹配数据库用户信息
if(user!=null){
logger.info("用户: "+user.getUserName()+"登录成功!");
if(Common.userLogin.contains(user.getUserId())){//用户已经登录过了
Common.userLogin.remove(user.getUserId()); //防止用户自己关闭网页没有清理内存
logined = "success";
/* 清理用户登陆过的痕迹 */
//关闭用户登陆过的网页
ServerToClient.logout(user.getUserId());
}
else{ //用户成功登陆平台
String subString = "closeWindow('/"+GlobalConfigure.PROJECT_NAME+"/userLogin.do?method=logout')";
ServerToClient.removeSubString(user.getUserId(), subString);
session.setAttribute("user", user);
Common.userLogin.add(user.getUserId());
userType = user.getUserType().toString();
}
}else{
// 用户名或者密码错误
// 需要分开用户名还是密码错误
if(userAuthReq.getUserByUserName(name)==null){
// 用户名错误,设置用户名错误信息
bname=true;
logger.info("用户登录失败");
}else{
// 密码错误,设置密码错误信息
bpass=true;
logger.info("用户登录失败");
}
}
}else{
bcheck=true;
logger.info("用户登录失败");
}
return util.Common.response(response,"{logined:'"+logined+"',name:"+bname+",pass:"+bpass+",check:"+bcheck+",type:'"+userType+"'}");
}
public ActionForward logout(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
//System.out.println("login outfsdf");
HttpSession session = request.getSession();
Userinfo user = (Userinfo) session.getAttribute("user");
try{
//清空session中的内容
Enumeration e = session.getAttributeNames();
for(;e.hasMoreElements();){
//System.out.println("session element names:"+e.nextElement());
String elementName = (String)e.nextElement();
//struts里面的东西不用清
if (elementName.equals(Globals.LOCALE_KEY)) continue;
session.removeAttribute(elementName);
if(Common.userLogin.contains(user.getUserId()))
Common.userLogin.remove(user.getUserId());
}
}catch(NoSuchElementException e){
}catch(Exception e){
}
//返回到登陆页面
session.invalidate();
logger.info("用户退出系统");
return mapping.findForward("logout");
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans SYSTEM " http://www.springframework.org/dtd/spring-beans.dtd" PUBLIC "-//SPRING//DTD BEAN//EN">
-<beans> -<bean class="org.logicalcobwebs.proxool.ProxoolDataSource" id="DataSource"> <property value="com.mysql.jdbc.Driver" name="driver"> </property> <property value="jdbc:mysql://localhost:3306/mmctest?useUnicode=true&characterEncoding=UTF-8" name="driverUrl"> </property> <property value="root" name="user"> </property> <property value="123456" name="password"> </property> -<property name="alias"> <value>mysql</value> </property> -<property name="prototypeCount"> <value>5</value> </property> -<property name="maximumConnectionCount"> <value>100</value> </property> -<property name="minimumConnectionCount"> <value>2</value> </property> -<property name="houseKeepingTestSql"> <value>SELECT CURRENT_DATE</value> </property> -<property name="testBeforeUse"> <value>true</value> </property> -<property name="testAfterUse"> <value>true</value> </property> -<property name="trace"> <value>true</value> </property> </bean> -<bean class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" id="SessionFactory"> -<property name="dataSource"> <ref bean="DataSource"/> </property> -<property name="hibernateProperties"> -<props> <prop key="hibernate.dialect"> org.hibernate.dialect.ExtendedMySQLDialect </prop> <prop key="hibernate.show_sql">false </prop> </props> </property> -<property name="mappingResources"> -<list> <value>db/Conferenceinfo.hbm.xml</value> <value>db/Participantinfo.hbm.xml</value> <value>db/Userinfo.hbm.xml</value> <value>db/Viewerinfo.hbm.xml</value> <value>db/Materialinfo.hbm.xml</value> <value>db/Groupinfo.hbm.xml</value> <value>db/Grouprelationinfo.hbm.xml</value> <value>db/Departmentinfo.hbm.xml</value> <value>db/Announcementinfo.hbm.xml</value> </list> </property> </bean> <bean class="util.RCBeanFactory" id="RCBeanFactory" init-method="init"/>
<!-- Transaction事务处理使用Spring来托管事务的处理 -->
-<bean class="org.springframework.orm.hibernate3.HibernateTransactionManager" id="transactionManager"> -<property name="sessionFactory"> <ref local="SessionFactory"/> </property> </bean>
<!--基础事务代理: TransactionProxyFactoryBean-->
-<bean class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" id="BaseServiceProxy" abstract="true"> -<property name="transactionManager"> <ref local="transactionManager"/> </property> -<property name="transactionAttributes"> -<props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean>
<!-- Service -->
-<bean id="departmentService" parent="BaseServiceProxy"> -<property name="target"> <ref local="departmentServiceTarget"/> </property> -<property name="transactionAttributes"> -<props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> -<bean class="service.impl.DepartmentServiceImpl" id="departmentServiceTarget"> -<property name="conferenceinfoDAO"> <ref bean="ConferenceinfoDAO"/> </property> -<property name="userinfoDAO"> <ref bean="UserinfoDAO"/> </property> -<property name="departmentinfoDAO"> <ref bean="DepartmentinfoDAO"/> </property> -<property name="groupinfoDAO"> <ref bean="GroupinfoDAO"/> </property> -<property name="groupRelationinfoDAO"> <ref bean="GrouprelationinfoDAO"/> </property> -<property name="announcementinfoDAO"> <ref bean="AnnouncementinfoDAO"/> </property> </bean> -<bean id="announcementService" parent="BaseServiceProxy"> -<property name="target"> <ref local="announcementServiceTarget"/> </property> -<property name="transactionAttributes"> -<props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> -<bean class="service.impl.AnnouncementServiceImpl" id="announcementServiceTarget"> -<property name="announcementInfoDAO"> <ref bean="AnnouncementinfoDAO"/> </property> </bean>
<!-- 用户认证鉴权模块 -->
-<bean id="userAuth" parent="BaseServiceProxy"> -<property name="target"> <ref local="userAuthTarget"/> </property> -<property name="transactionAttributes"> -<props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> -<bean class="service.impl.UserAuthImpl" id="userAuthTarget"> -<property name="userinfoDAO"> <ref bean="UserinfoDAO"/> </property> </bean> -<bean id="groupinfo" parent="BaseServiceProxy"> -<property name="target"> <ref local="groupinfoTarget"/> </property> -<property name="transactionAttributes"> -<props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> -<bean class="service.impl.GroupinfoImpl" id="groupinfoTarget"> -<property name="groupinfoDAO"> <ref bean="GroupinfoDAO"/> </property> -<property name="grouprelationinfoDAO"> <ref bean="GrouprelationinfoDAO"/> </property> -<property name="userinfoDAO"> <ref bean="UserinfoDAO"/> </property> -<property name="departmentinfoDAO"> <ref bean="DepartmentinfoDAO"/> </property> </bean> -<bean id="confInfo" parent="BaseServiceProxy"> -<property name="target"> <ref local="confInfoTarget"/> </property> -<property name="transactionAttributes"> -<props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> -<bean class="service.impl.ConfInfoImpl" id="confInfoTarget"> -<property name="userinfoDAO"> <ref bean="UserinfoDAO"/> </property> -<property name="conferenceinfoDAO"> <ref bean="ConferenceinfoDAO"/> </property> -<property name="materialinfoDAO"> <ref bean="MaterialinfoDAO"/> </property> -<property name="participantinfoDAO"> <ref bean="ParticipantinfoDAO"/> </property> -<property name="viewerinfoDAO"> <ref bean="ViewerinfoDAO"/> </property> </bean> -<bean id="confMaterial" parent="BaseServiceProxy"> -<property name="target"> <ref local="confMaterialTarget"/> </property> -<property name="transactionAttributes"> -<props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> -<bean class="service.impl.ConfMaterialImpl" id="confMaterialTarget"> -<property name="materialinfoDAO"> <ref bean="MaterialinfoDAO"/> </property> </bean>
<!-- DAO -->
-<bean class="db.DepartmentinfoDAO" id="DepartmentinfoDAO"> -<property name="sessionFactory"> <ref bean="SessionFactory"/> </property> </bean> -<bean class="db.AnnouncementinfoDAO" id="AnnouncementinfoDAO"> -<property name="sessionFactory"> <ref bean="SessionFactory"/> </property> </bean> -<bean class="db.ConferenceinfoDAO" id="ConferenceinfoDAO"> -<property name="sessionFactory"> <ref bean="SessionFactory"/> </property> </bean> -<bean class="db.ParticipantinfoDAO" id="ParticipantinfoDAO"> -<property name="sessionFactory"> <ref bean="SessionFactory"/> </property> </bean> -<bean class="db.UserinfoDAO" id="UserinfoDAO"> -<property name="sessionFactory"> <ref bean="SessionFactory"/> </property> </bean> -<bean class="db.ViewerinfoDAO" id="ViewerinfoDAO"> -<property name="sessionFactory"> <ref bean="SessionFactory"/> </property> </bean> -<bean class="db.MaterialinfoDAO" id="MaterialinfoDAO"> -<property name="sessionFactory"> <ref bean="SessionFactory"/> </property> </bean> -<bean class="db.GroupinfoDAO" id="GroupinfoDAO"> -<property name="sessionFactory"> <ref bean="SessionFactory"/> </property> </bean> -<bean class="db.GrouprelationinfoDAO" id="GrouprelationinfoDAO"> -<property name="sessionFactory"> <ref bean="SessionFactory"/> </property> </bean></beans>
<?xml version="1.0" encoding="UTF-8"?>
-<web-app xsi:schemaLocation="http://java.sun.com/xml/ns/javaee" version="2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"> -<context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/classes/applicationContext.xml</param-value> </context-param> -<filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> -<init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> -<filter-mapping> <filter-name>CharacterEncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> -<filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> </filter> -<filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> -<servlet> <description>JAX-WS endpoint - InformAllImplService</description> <display-name>InformAllImplService</display-name> <servlet-name>InformAllImplService</servlet-name> <servlet-class> com.sun.xml.ws.transport.http.servlet.WSServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> -<servlet-mapping> <servlet-name>InformAllImplService</servlet-name> <url-pattern>/informUser</url-pattern> </servlet-mapping> -<servlet-mapping> <servlet-name>InformAllImplService</servlet-name> <url-pattern>/informChairman</url-pattern> </servlet-mapping> -<servlet-mapping> <servlet-name>InformAllImplService</servlet-name> <url-pattern>/informAll</url-pattern> </servlet-mapping> -<taglib> <taglib-uri>sitemesh-page</taglib-uri> <taglib-location>/WEB-INF/sitemesh-page.tld</taglib-location> </taglib> -<taglib> <taglib-uri>sitemesh-decorator</taglib-uri> <taglib-location>/WEB-INF/sitemesh-decorator.tld</taglib-location> </taglib> -<listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> -<servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> -<init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> -<init-param> <param-name>debug</param-name> <param-value>3</param-value> </init-param> -<init-param> <param-name>detail</param-name> <param-value>3</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> -<servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> -<welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> -<listener> <listener-class> com.sun.xml.ws.transport.http.servlet.WSServletContextListener </listener-class> </listener></web-app>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<data-sources />
<form-beans >
<form-bean name="userLoginForm" type="struts.form.UserLoginForm" />
<form-bean name="departRegForm" type="struts.form.DepartRegForm" />
<form-bean name="confBookForm" type="struts.form.ConfBookForm" />
<form-bean name="upLoadForm" type="struts.form.UpLoadForm" />
<form-bean name="userInfoForm" type="struts.form.UserInfoForm" />
<form-bean name="modifyPwdForm" type="struts.form.ModifyPwdForm" />
<form-bean name="findPwdForm" type="struts.form.FindPwdForm" />
<form-bean name="departInfoForm" type="struts.form.DepartInfoForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
parameter= "method"
path="/userLogin"
scope="request"
type="struts.action.UserLoginAction">
<forward name="logout" path="/login.jsp"></forward>
</action>
<action
attribute="departRegForm"
parameter= "method"
name="departRegForm"
path="/department/departReg"
scope="request"
type="struts.action.DepartRegAction">
</action>
<action
parameter= "method"
name="confBookForm"
path="/conference/confBook"
scope="request"
type="struts.action.ConfBookAction">
</action>
<action
path="/checkCon"
scope="request"
type="struts.action.CheckConAction">
</action>
<action
path="/controlCon"
scope="request"
type="struts.action.ControlConAction">
</action>
<action
attribute="upLoadForm"
name="upLoadForm"
path="/upLoad"
scope="request"
type="struts.action.UpLoadAction">
</action>
<action
attribute="confRegForm"
name="confRegForm"
path="/updateCon"
scope="request"
type="struts.action.UpdateConAction" />
<action
parameter="method"
path="/conference/conferenceinfo"
scope="request"
type="struts.action.ConferenceinfoAction">
</action>
<action
parameter="method"
name="upLoadForm"
path="/conference/materialinfo"
scope="request"
type="struts.action.MaterialinfoAction">
</action>
<action
attribute="userInfoForm"
parameter="method"
name="userInfoForm"
path="/user/userInfo"
scope="request"
type="struts.action.UserInfoAction">
</action>
<action
parameter="method"
path="/user/groupinfo"
scope="request"
type="struts.action.GroupinfoAction" >
</action>
<action
path="/checkCode"
scope="request"
type="struts.action.CheckCodeAction">
</action>
<action
path="/download"
scope="request"
type="struts.action.DownLoadAction">
</action>
<action
path="/changeChairman"
scope="request"
type="struts.action.control.ChangeChairmanAction">
</action>
<action
path="/endConference"
scope="request"
type="struts.action.control.EndConferenceAction">
</action>
<action
path="/stopSpeaking"
scope="request"
type="struts.action.control.StopSpeakingAction" />
<action
path="/disconnectUser"
parameter= "method"
scope="request"
type="struts.action.control.DisconnectUserAction">
</action>
<action
path="/callUser"
scope="request"
type="struts.action.control.CallUserAction">
</action>
<action
path="/speakControl"
scope="request"
type="struts.action.control.SpeakControlAction">
</action>
<action
path="/applySpeaking"
scope="request"
type="struts.action.control.ApplySpeakingAction">
</action>
<action
path="/clientRefresh"
scope="session"
type="struts.action.ClientRefreshAction">
</action>
<action
path="/applyChange"
scope="request"
type="struts.action.control.ApplyChangeAction">
</action>
<action
path="/enterConf"
scope="request"
type="struts.action.control.EnterConfAction">
</action>
<action
path="/cancelConf"
scope="request"
type="struts.action.control.CancelConfAction">
</action>
<action
path="/startRecord"
scope="request"
type="struts.action.control.StartRecordAction">
</action>
<action
path="/endRecord"
scope="request"
type="struts.action.control.EndRecordAction">
</action>
<action
path="/phoneSpeak"
scope="request"
type="struts.action.control.PhoneSpeakAction" />
<action
path="/phoneNotSpeak"
scope="request"
type="struts.action.control.PhoneNotSpeakAction" />
<action
path="/mute"
scope="request"
type="struts.action.control.MuteAction"/>
<action
path="/applyChangeTerminal"
parameter= "method"
scope="request"
type="struts.action.control.ApplyChangeTerminalAction" />
<action
path="/userDownload"
scope="request"
type="struts.action.UserDownloadAction"/>
<action
path="/divideFour"
parameter="method"
scope="request"
type="struts.action.control.DivideFourAction" />
<action
attribute="findPwdForm"
name="findPwdForm"
path="/findPwd"
scope="request"
type="struts.action.FindPwdAction">
</action>
<action
path="/userUnReg"
scope="request"
type="struts.action.UserUnRegAction" />
<action
path="/downloadConfirm"
parameter= "method"
scope="request"
type="struts.action.DownloadConfirmAction" />
<action
path="/downloadApply"
scope="request"
type="struts.action.DownloadApplyAction" />
<action
path="/confTimeUp"
parameter= "method"
scope="request"
type="struts.action.ConfTimeUpAction" />
<action
parameter= "method"
attribute="departInfoForm"
name="departInfoForm"
path="/department/departInfo"
scope="request"
type="struts.action.DepartInfoAction" />
<action
path="/applyJoinIn"
scope="request"
type="struts.action.control.ApplyJoinInAction" />
<action
parameter="method"
path="/joinIn"
scope="request"
type="struts.action.control.JoinInAction" />
<action
parameter="method"
path="/dynamicJoinIn"
scope="request"
type="struts.action.control.DynamicJoinInAction" />
<action
parameter="method"
path="/department/announcementInfo"
scope="request"
type="struts.action.AnnouncementInfoAction" />
<action
parameter="method"
path="/conference/monitorConference"
scope="request"
type="struts.action.control.MonitorConferenceAction" />
</action-mappings>
<message-resources parameter="struts.ApplicationResources_zh" />
</struts-config>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import = "db.Userinfo,db.Conferenceinfo,service.ConfInfo,service.UserAuth"%>
<%@ page import = "util.Common,util.GlobalConfigure, java.net.InetAddress"%>
<%
Userinfo user = (Userinfo) session.getAttribute("user");
InetAddress[] ipsAddr=InetAddress.getAllByName(InetAddress.getLocalHost().getHostName().toString());
String s = null;
int pos = -1;
String terminalIP = null;
for (int i = 0; i < ipsAddr.length; i++) {
s = ipsAddr[i].getHostAddress().toString();
pos = s.indexOf(".");
if (!s.substring(0, pos).equalsIgnoreCase("0") && !s.substring(0, pos).equalsIgnoreCase("127")) {
terminalIP = ipsAddr[i].getHostAddress().toString();
break;
}
}
if(user==null){
response.sendRedirect("../login.jsp");}else{
int confId=Integer.valueOf(request.getParameter("confId"));
ConfInfo confinfo=util.SingleBeanFactory.getInstance().getConfInfo();
Conferenceinfo conf=confinfo.getConfByConfId(confId);
UserAuth userAuth=util.SingleBeanFactory.getInstance().getUserAuth();
%>
<html>
<head>
<title>多媒体会议系统-当前会议-参与会议</title>
<link href="../css/conference.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="../css/file-upload.css"/>
<script type="text/javascript" src="../js/FileUploadField.js"></script>
<script type="text/javascript" language="javascript">
var slider;
var timeInterval;
confId=<%=confId%>;
userId=<%=user.getUserId()%>;
var partStore;
var materialStore;
var userID='<%=user.getUserId()%>';
var passedTime=<%=new Date().getTime()-conf.getStartTime().getTime()%>;
var duration=<%=conf.getDuration()*600%>;
var secondcreate = parseInt(<%=conf.getStartTime().getTime()/1000%>);//得到创建会议时的服务器时间
var secondnow = parseInt(<%=new Date().getTime()/1000%>);//得到服务器的当前时间
var secondSub = secondnow - secondcreate; //两端时间秒差
var durationl=parseInt(<%=conf.getDuration()*60%>-secondSub); //seconds
function showremaintime(){
if(durationl >= 0)
{
var str = ""+parseInt(durationl/60)+"分"+durationl%60+"秒";
document.getElementById("timeDiv").innerHTML = str; //timediv的html是durationl这个字符串
durationl--;
setTimeout("showremaintime()",1000); //设置过1000毫秒就是1秒,调用showremaintime方法
}
else if (durationl <= 0)
{
document.getElementById("timeDiv").innerHTML = "0分钟";
Ext.Msg.alert('提示','会议持续时间已到');
}
}
function showSlider(){
passedTime+=2000;
var timeValue=Math.floor(passedTime/duration);
if(timeValue<100&&timeValue>=0)
slider.setValue(timeValue);
else
clearInterval(timeInterval);
}
function applySpeak(cId,uId){
$.ajax({type:"GET",url:"../applySpeaking.do?confId="+cId+"&userId="+uId,dataType:"json",cache: false,success: function(json){
if(json.result=='success')
Ext.Msg.alert('成功','申请发言成功');
else
Ext.Msg.alert('失败','申请发言失败');
}
});
}
function quit(cId,uId){
$.ajax({type:"GET",url:"../disconnectUser.do?method=leave&confId="+cId+"&userId="+uId,dataType:'json',cache:false,success: function(json){
if(json.result=='success')
Ext.Msg.alert('成功','退出成功');
else
Ext.Msg.alert('失败','退出失败');
}
});
}
function refreshParticipant(){
partStore.reload();
}
function refreshMaterial(){
materialStore.reload();
}
function enableApplySpeak(){
$("#applyS").attr('href','javascript:applySpeak('+confId+','+userID+')');
Ext.Msg.alert('提示','可以申请发言了');
}
function disableApplySpeak(){
$("#applyS").attr('href','javascript:alert("当前不能申请发言")');
}
function changeTerminal1(cId,uId,way){
var needVideo1 =$('#needvideo1 option:selected').val();
$.ajax({type:"GET",url:"../applyChangeTerminal.do?method=pcToPhone&confId="+cId+"&userId="+uId+"&way="+way+"&needVideo="+needVideo1,dataType:'json',cache:false,success: function(json){
if(json.result == 'success')
Ext.Msg.alert('成功','终端更换成功');
else if(json.result == 'unexisted'){
Ext.Msg.alert('失败','无该成员号码记录');
}else{
Ext.Msg.alert('失败','终端更换失败');
}
}
});
}
function changeTerminal2(cId,uId,way){
var needVideo2 =$('#needvideo2 option:selected').val();
$.ajax({type:"GET",url:"../applyChangeTerminal.do?method=phoneToPC&confId="+cId+"&userId="+uId+"&way="+way+"&needVideo="+needVideo2,dataType:'json',cache:false,success: function(json){
if(json.result == 'success')
Ext.Msg.alert('成功','终端更换成功');
else if(json.result == 'unexisted'){
Ext.Msg.alert('失败','无该成员号码记录');
}else{
Ext.Msg.alert('失败','终端更换失败');
}
}
});
}
timeInterval=setInterval(showSlider,2000);
$(document).ready(function(){
$(".departOn .hide").css('backgroundImage','url(../image/nav/navBG_on.jpg)');
slider=new Ext.Slider({
renderTo: 'timeSlider',
width: 130,
minValue: 0,
maxValue: 100,
clickToChange: false
});
slider.setValue(Math.floor(passedTime/duration));
var partRecord = Ext.data.Record.create([
{name: 'userId'},
{name: 'userName'},
{name: 'headUrl'},
{name: 'state'},
{name: 'speak'},
{name: 'leave'},
{name: 'callup'},
{name: 'silence'}
]);
partStore = new Ext.data.JsonStore({
url:'conferenceinfo.do?method=getCurrentParticipateList&confId='+<%=confId%>,
root:'rows',
fields: ['userId', 'userName','headUrl','state','speak','leave','callup','silence']
});
partStore.load();
var partGrid = new Ext.grid.GridPanel({
renderTo: 'memberList',
title: '会议成员列表',
style:'margin-top:20px;',
store: partStore,
columns: [
{header: "头像", width: 80, sortable: false, dataIndex: 'headUrl'},
{header: "用户名", width: 270, sortable: true, renderer: changeCSS, dataIndex: 'userName'},
{header: "状态", width: 170, sortable: true, renderer: changeCSS, dataIndex: 'state'},
{header: "发言情况", width: 170, sortable: true, renderer: changeCSS, dataIndex: 'speak'}
],
sm: new Ext.grid.RowSelectionModel(),
stripeRows: true,
iconCls:'icon-grid',
height:320,
width:729,
frame:true
});
$('#startRecord').click(function(){
$.ajax({type:"GET",url:"../startRecord.do?confId="+confId+"&userId="+userId,dataType:"json",cache: false,success: function(json){
if(json.result=='success')
Ext.Msg.alert('成功','已开始录音');
else
Ext.Msg.alert('失败','录音失败');
}
});
});
$('#endRecord').click(function(){
$.ajax({type:"GET",url:"../endRecord.do?confId="+confId,dataType:"json",cache: false,success: function(json){
if(json.result=='success')
Ext.Msg.alert('成功','录音已停止');
else
Ext.Msg.alert('失败','停止操作失败');
}
});
});
materialStore = new Ext.data.JsonStore({
url: 'materialinfo.do?method=getMaterialList&confId='+<%=conf.getConfId()%>,
root: 'rows',
fields: ['fileId', 'fileName','fileSize','userName','createTime','fileDownload','fileDelete']
});
materialStore.load();
var materialGrid = new Ext.grid.GridPanel({
//title: '会议资料',
//renderTo: 'materialList',
store: materialStore,
style:'margin-bottom:10px',
columns: [
{header: "文件名", width: 200, sortable: false, dataIndex: 'fileName'},
{header: "大小", width: 80, sortable: true, dataIndex: 'fileSize'},
{header: "上传者", width: 120, sortable: true, dataIndex: 'userName'},
{header: "上传时间", width: 120, sortable: false, dataIndex: 'createTime'},
{header: "下载", width: 80, sortable: false, dataIndex: 'fileDownload'},
{header: "删除", width: 80, sortable: false, dataIndex: 'fileDelete'}
],
stripeRows: true,
iconCls:'icon-grid',
height:200,
width:550,
frame: true
});
var maForm = new Ext.FormPanel({
renderTo: 'materialList',
fileUpload: true,
width: 729,
frame: true,
title: '会议资料',
autoHeight: true,
style:'margin-top:20px;text-align:left',
bodyStyle: 'padding: 10px 10px 0 10px;',
labelWidth: 0,
defaults: {
anchor: '100%',
allowBlank: false,
msgTarget: 'side'
},
items: [materialGrid,
{
xtype: 'fileuploadfield',
id: 'filePath',
anchor: '70%',
emptyText: '资料地址',
fieldLabel: '上传资料',
width:200,
name: 'filePath',
buttonCfg: {
text: '',
iconCls: 'upload-icon'
}
}],
buttons: [{
text: '上传',
handler: function(){
if(maForm.getForm().isValid()){
maForm.getForm().submit({
url: 'materialinfo.do?method=addFile&confId='+<%=conf.getConfId()%>+'&userId='+<%=user.getUserId()%>,
waitMsg: '正在上传你的资料',
success: function(fp, o){
materialStore.reload();
Ext.Msg.alert('上传成功', o.result.result);
},
failure: function(form, o) {
Ext.Msg.alert('上传失败', o.result.result);
}
});
}
}
}]
});
var param='<%if(request.getParameter("param")!=null) out.write(new String(request.getParameter("param").getBytes("ISO-8859-1"),"UTF-8"));%>';
if(param){
eval(param);
}
});
var oWinOfWhiteBoard;
function gotoWhiteBoard() {
var terminalIP = '<%=terminalIP%>';
var confId = '<%=confId%>';
var userId = '<%=user.getUserId()%>';
var chairmanId = '<%=conf.getChairmanId()%>';
var url = "http://"+terminalIP+":8888/whiteboard/whiteboard.jsp?confid="+confId+"&userid="+userId+"&chmid="+chairmanId;
oWinOfWhiteBoard = window.open(url);
}
function closeWhiteBoard(){
oWinOfWhiteBoard.close();
}
var oWinOfChatRoom;
function gotoChatRoom() {
var terminalIP = '<%=terminalIP%>';
var confId = '<%=confId%>';
var userName = '<%=user.getUserName()%>';
var url = "http://"+terminalIP+":8888/ChatRoom/testChat.jsp?confID="+confId+"&user="+userName;
oWinOfChatRoom = window.open(url);
}
function closeChatRoom(){
oWinOfChatRoom.close();
}
</script>
</head>
<body>
<div id="mainContent">
<div class="meetingLeftPannel">
<div class="h1Div"><h1>会议基本信息</h1></div>
<div class="meetingBasicInfo">
<table class="meetingBasicTable" cellpadding="0" cellspacing="0">
<tr>
<th class="meetingInfo">会议信息</th>
<th class="meetingName">会议名称</th>
<th class="meetingChairman">会议主席</th>
<th class="meetingTopic">会议主题</th>
<th class="meetingBegin">开始时间</th>
<th class="meetingTime">持续时间</th>
</tr>
<tr>
<td class="meetingInfo"><img src="..<%=conf.getPictureURL()%>"/></td>
<td><%=conf.getConfName() %></td>
<td id="meetingChairman"><%Userinfo chair=userAuth.getUserByUserId(conf.getChairmanId());out.write(chair.getUserName());%></td>
<td><%=conf.getSubject() %></td>
<td><%=conf.getStrStartTime() %></td>
<td><%=conf.getDuration()%>分钟</td>
</tr>
</table>
</div><!--meetingBasicInfo-->
<div class="h1Div"><h1>数据共享功能</h1></div>
<div class="meetingBasicInfo">
<table class="meetingBasicTable" cellpadding="0" cellspacing="0">
<tr>
<th class="dataShare"><a href="http://<%=terminalIP %>:8888/dataShare/sharing.jsp?confID=<%=confId%>&userID=<%=user.getUserId()%>&userName=<%=user.getUserName()%>&chmID=<%=conf.getChairmanId() %>" target=_blank>数据共享</a></th>
<td>多参会人员的协作平台,包括:共享白板、共享文档、共享桌面功能</td>
</tr>
</table>
</div>
<!--
<div class="strategy">
<div class="strategyTitle"><h1>会议录音</h1></div>
<div class="modelDiv">录音信息</div>
<div class="submitDiv">
<input name="startRecord" id="startRecord" type="button" value="开始录音" class="formButton" />
<input name="endRecord" id="endRecord" type="button" value="停止录音" class="formButton" />
</div>
</div>
-->
<div id="memberList"></div>
<div id="materialList"></div>
<div class="functionDiv">
<div class="functionTable">
<div class="needVideo">是否需要视频
<select name="needvideo1" id="needvideo1">
<option value="true" selected>需要</option>
<option value="false">不需要</option>
</select>
</div>
<div class="functionBlock lessSpace"> </div>
<div class="icon_terminalChange"> </div>
<div class="function"><a href="javascript:changeTerminal1('<%=confId %>','<%=user.getUserId()%>','mobile')">PC切换到手机</a></div>
<div class="icon_terminalChange moreSpace"> </div>
<div class="function"><a href="javascript:changeTerminal1('<%=confId %>','<%=user.getUserId()%>','fixphone')">PC切换到固话</a></div>
</div>
</div>
<div class="functionDiv">
<div class="functionTable">
<div class="needVideo">是否需要视频
<select name="needvideo2" id="needvideo2">
<option value="true" selected>需要</option>
<option value="false">不需要</option>
</select>
</div>
<div class="functionBlock lessSpace"> </div>
<div class="icon_terminalChange"> </div>
<div class="function"><a href="javascript:changeTerminal2('<%=confId %>','<%=user.getUserId()%>','mobile')">手机切换到PC</a></div>
<div class="icon_terminalChange moreSpace"> </div>
<div class="function"><a href="javascript:changeTerminal2('<%=confId %>','<%=user.getUserId()%>','fixphone')">固话切换到PC</a></div>
</div>
</div>
<div class="functionDiv">
<div class="functionTable">
<!--
<div class="icon_terminalChange"> </div>
<div class="function"><a href="javascript:transformScreen(<%=confId %>,<%=user.getUserId() %>)">更换终端</a></div>
<div class="functionBlock"> </div>
-->
<div class="icon_applySpeak"> </div>
<div class="function"><a href="javascript:alert('当前不能申请发言')" id="applyS">申请发言</a></div>
<div class="functionBlock"> </div>
<div class="icon_endConf"> </div>
<div class="function"><a href="javascript:quit(<%=confId %>,<%=user.getUserId() %>)" id="applyQ">离开会议</a></div>
</div>
</div>
</div><!--meetingLeftPannel-->
<div class="meetingRightPannel">
<div class="stateTip">您正在参与<a href="#"><%=conf.getConfName() %></a>会议</div>
<div class="progressBox">
<div class="progress">
<span>倒计时:</span><b id="timeDiv"></b>
<div id="timeSlider"></div>
</div>
</div>
<div class="welcomePic welcomeCurrent"></div>
</div><!--meetingRightPannel-->
<div class="clear"></div>
</div><!--#mainContent-->
<script language="javascript">
showremaintime();
</script>
</body>
</html>
<%} %>
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN">
<head>
<title>多媒体会议系统-首页</title>
<meta http-equiv="x-ua-compatible" content="ie=7" />
<link rel="stylesheet" type="text/css" href="css/ext-all.css" />
<link href="css/login.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script language="JavaScript" type="text/javascript" src="js/ext-jquery-adapter.js"></script>
<script language="JavaScript" type="text/javascript" src="js/ext-all.js"></script>
<script language="JavaScript" type="text/javascript" src="js/media.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function(){
$(document).keydown(function(event){
if(event.keyCode==13)
$('#login').click();
});
$('#login').click(function(){
var flag=true;
var name=$('#userName').attr('value');
var pass=$('#password').attr('value');
var check=$('#checkCode').attr('value');
if(isUserName(name)==false){
$('#nameError').show();
flag=false;
}else{
$('#nameError').hide();
}
if(isPasswd(pass)==false){
$('#passwordError').show();
flag=false;
}else{
$('#passwordError').hide();
}
if(check==null||check.length!=4){
$('#checkError').show();
flag=false;
location.href='login.jsp';
}else{
$('#checkError').hide();
}
if(flag){
$.ajax({type:"post",url:"userLogin.do",data:"method=login&name="+name+"&pass="+pass+"&check="+check,dataType:"json",cache: false,success: function(data){
if(data.logined=='success'){
Ext.Msg.alert('失败','请稍候刷新页面重新登陆');
}
else{
if(data.name)
$('#nameError').show();
if(data.pass)
$('#passwordError').show();
if(data.check)
$('#checkError').show();
if(data.type == 0)
location.href='index/super.jsp?param=teminalLogin()';
else if(data.type == 1)
location.href='index/admin.jsp?param=teminalLogin()';
else
location.href='index/user.jsp?param=teminalLogin()';
}
}
});
}
});
});
</script>
</head>
<body >
<div class="loginFrame">
<div class="logo"><img src="image/login/logo.jpg" /></div>
<div class="loginArea">
<div class="loginInfo">
<table class="loginTable" cellpadding="0" cellspacing="0">
<tr>
<th>用户名</th>
<td><input name="userName" id="userName" type="text" title="请填写用户名"/><div class="errorTip" id="nameError" > </div></td>
</tr>
<tr>
<th>密 码</th>
<td><input name="password" id="password" type="password" title="密码为6到15位数字"/><div class="errorTip" id="passwordError"> </div></td>
</tr>
<tr>
<th>验证码</th>
<td><input name="checkCode" id="checkCode" type="text" title="请输入四位验证码"/><div class="errorTip" id="checkError" > </div></td>
</tr>
<tr>
<th></th>
<td><img id="checkCodeImage" src="checkCode.do" /></td>
</tr>
<tr>
<td colspan=2 class="link">
<input name="login" id="login" type="button" class="formButton" value="登录" />
<a href="user/findPwd.jsp">找回密码</a>
</td>
</tr>
</table>
</div>
<div id="test"></div>
<div class="enter">欢迎光临</div>
</div>
</div>
</body>
</html>