2009-12-24 10:01:26 +08:00
<!--
BigBlueButton - http://www.bigbluebutton.org
Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
BigBlueButton is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
Author: Fred Dixon <ffdixon@bigbluebutton.org>
2010-02-15 07:57:13 +08:00
2010-05-04 09:14:40 +08:00
-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
%>
2010-02-15 07:57:13 +08:00
2009-12-24 10:01:26 +08:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
2010-05-04 09:14:40 +08:00
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
2010-02-15 07:57:13 +08:00
<title>Join a Course (Password Required)</title>
2009-12-24 10:01:26 +08:00
</head>
<body>
2009-12-31 02:36:20 +08:00
<%@ include file="bbb_api.jsp"%>
<br>
2009-12-24 10:01:26 +08:00
2010-02-15 07:57:13 +08:00
<%
2009-12-24 10:01:26 +08:00
2010-01-24 03:19:14 +08:00
//
2010-02-15 07:57:13 +08:00
// We're going to define some sample courses (meetings) below. This API exampe shows how you can create a login page for a course.
// The password below are not available to users as they are compiled on the server.
2010-01-24 03:19:14 +08:00
//
2009-12-24 10:01:26 +08:00
2010-02-15 07:57:13 +08:00
HashMap<String, HashMap> allMeetings = new HashMap<String, HashMap>();
HashMap<String, String> meeting;
2010-01-24 03:19:14 +08:00
2010-02-15 07:57:13 +08:00
String welcome = "<br>Welcome to %%CONFNAME%%!<br><br>For help see our <a href=\"event:http://www.bigbluebutton.org/content/videos\"><u>tutorial videos</u></a>.<br><br>To join the voice bridge for this meeting:<br> (1) click the headset icon in the upper-left, or<br> (2) dial xxx-xxx-xxxx (toll free:1-xxx-xxx-xxxx) and enter conference ID: %%CONFNUM%%.<br><br>";
2010-01-24 03:19:14 +08:00
2010-02-15 07:57:13 +08:00
//
// English courses
//
2009-12-31 02:36:20 +08:00
2010-02-15 07:57:13 +08:00
meeting = new HashMap<String, String>();
allMeetings.put( "ENGL-2013: Research Methods in English", meeting ); // The title that will appear in the drop-down menu
meeting.put("welcomeMsg", welcome); // The welcome mesage
meeting.put("moderatorPW", "prof123"); // The password for moderator
meeting.put("viewerPW", "student123"); // The password for viewer
meeting.put("voiceBridge", "82013"); // The extension number for the voice bridge (use if connected to phone system)
2010-02-15 08:16:55 +08:00
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp"); // The logout URL (use if you want to return to your pages)
2010-02-15 07:57:13 +08:00
meeting = new HashMap<String, String>();
allMeetings.put( "ENGL-2213: Drama Production I", meeting );
meeting.put("welcomeMsg", welcome);
meeting.put("moderatorPW", "prof123");
meeting.put("viewerPW", "student123");
meeting.put("voiceBridge", "82213");
2010-02-15 08:16:55 +08:00
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
2010-02-15 07:57:13 +08:00
meeting = new HashMap<String, String>();
allMeetings.put( "ENGL-2023: Survey of English Literature", meeting );
meeting.put("welcomeMsg", welcome);
meeting.put("moderatorPW", "prof123");
meeting.put("viewerPW", "student123");
meeting.put("voiceBridge", "82023");
2010-02-15 08:16:55 +08:00
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
2009-12-31 02:36:20 +08:00
2010-02-15 07:57:13 +08:00
//
// Law Courses
//
2009-12-31 02:36:20 +08:00
2010-02-15 07:57:13 +08:00
meeting = new HashMap<String, String>();
allMeetings.put( "LAW-1323: Fundamentals of Advocacy ", meeting );
meeting.put("welcomeMsg", welcome);
meeting.put("moderatorPW", "prof123");
meeting.put("viewerPW", "student123");
meeting.put("voiceBridge", "81232");
2010-02-15 08:16:55 +08:00
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
2010-02-15 07:57:13 +08:00
meeting = new HashMap<String, String>();
allMeetings.put( "LAW-2273: Business Organizations", meeting );
meeting.put("welcomeMsg", welcome);
meeting.put("moderatorPW", "prof123");
meeting.put("viewerPW", "student123");
meeting.put("voiceBridge", "82273");
2010-02-15 08:16:55 +08:00
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
2010-02-15 07:57:13 +08:00
meeting = new HashMap<String, String>();
allMeetings.put( "LAW-3113: Corporate Finance", meeting );
meeting.put("welcomeMsg", welcome);
meeting.put("moderatorPW", "theprof");
meeting.put("viewerPW", "student123");
meeting.put("voiceBridge", "81642");
2010-02-15 08:16:55 +08:00
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
2010-01-24 03:19:14 +08:00
2010-01-01 05:07:22 +08:00
2010-02-15 07:57:13 +08:00
//
// Professor's Virtaul Office Hours
//
2009-12-24 10:01:26 +08:00
2010-02-15 07:57:13 +08:00
meeting = new HashMap<String, String>();
allMeetings.put( "Virtual Office Hours - Steve Stoyan", meeting );
meeting.put("welcomeMsg", welcome);
meeting.put("moderatorPW", "prof123");
meeting.put("viewerPW", "student123");
meeting.put("voiceBridge", "80001");
2010-02-15 08:16:55 +08:00
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
2009-12-24 10:01:26 +08:00
2010-02-15 07:57:13 +08:00
meeting = new HashMap<String, String>();
allMeetings.put( "Virtual Office Hours - Michael Bailetti", meeting );
meeting.put("welcomeMsg", welcome);
meeting.put("moderatorPW", "prof123");
meeting.put("viewerPW", "student123");
meeting.put("voiceBridge", "80002");
2010-02-15 08:16:55 +08:00
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
2009-12-24 10:01:26 +08:00
2010-02-15 07:57:13 +08:00
meeting = new HashMap<String, String>();
allMeetings.put( "Virtual Office Hours - Tony Weiss", meeting );
meeting.put("welcomeMsg", welcome);
meeting.put("moderatorPW", "prof123");
meeting.put("viewerPW", "student123");
meeting.put("voiceBridge", "80003");
2010-02-15 08:16:55 +08:00
meeting.put("logoutURL", "/bigbluebutton/demo/demo3.jsp");
2009-12-24 10:01:26 +08:00
2010-02-15 07:57:13 +08:00
meeting = null;
2009-12-24 10:01:26 +08:00
2010-02-15 07:57:13 +08:00
Iterator<String> meetingIterator = new TreeSet<String>(allMeetings.keySet()).iterator();
2009-12-31 02:36:20 +08:00
2010-02-15 07:57:13 +08:00
if (request.getParameterMap().isEmpty()) {
2009-12-31 02:36:20 +08:00
//
2010-02-15 07:57:13 +08:00
// Assume we want to join a course
2009-12-31 02:36:20 +08:00
//
2010-02-15 07:57:13 +08:00
%>
2010-03-25 05:57:27 +08:00
<%@ include file="demo_header.jsp"%>
2010-01-24 03:19:14 +08:00
2010-02-15 10:11:47 +08:00
<h2>Demo #3: Join a Course (password required)</h2>
2010-01-24 03:19:14 +08:00
2009-12-24 10:01:26 +08:00
2010-02-15 07:57:13 +08:00
<FORM NAME="form1" METHOD="GET">
<table cellpadding="5" cellspacing="5" style="width: 400px; ">
2009-12-31 02:36:20 +08:00
<tbody>
<tr>
2010-02-15 07:57:13 +08:00
<td>
</td>
<td style="text-align: right; ">
Full Name:</td>
<td style="width: 5px; ">
</td>
<td style="text-align: left ">
<input type="text" name="username" /></td>
</tr>
<tr>
<td>
</td>
<td style="text-align: right; ">
Course:</td>
<td>
</td>
<td style="text-align: left ">
<select name="meetingID">
<%
String key;
while (meetingIterator.hasNext()) {
key = meetingIterator.next();
out.println("<option value=\"" + key + "\">" + key + "</option>");
}
%>
</select>
2009-12-31 02:36:20 +08:00
</td>
</tr>
2010-02-15 07:57:13 +08:00
<tr>
<td>
</td>
<td style="text-align: right; ">
Password:</td>
<td>
</td>
<td>
<input type="password" name="password" /></td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
<input type="submit" value="Join" /></td>
</tr>
2009-12-31 02:36:20 +08:00
</tbody>
</table>
2010-02-15 07:57:13 +08:00
<INPUT TYPE=hidden NAME=action VALUE="create">
</FORM>
Passwords:
<ul>
<li>prof123 - login as professor (moderator privlidges)</li>
<li>student123 - login as student (viewer privlidges)</li>
</ul>
2009-12-31 02:36:20 +08:00
<%
2010-02-15 07:57:13 +08:00
} else if (request.getParameter("action").equals("create")) {
2010-01-24 03:19:14 +08:00
//
2010-02-15 07:57:13 +08:00
// Got an action=create
2010-01-24 03:19:14 +08:00
//
2010-02-15 07:57:13 +08:00
String username = request.getParameter("username");
2010-01-24 03:19:14 +08:00
String meetingID = request.getParameter("meetingID");
2010-02-15 07:57:13 +08:00
String password = request.getParameter("password");
meeting = allMeetings.get( meetingID );
String welcomeMsg = meeting.get( "welcomeMsg" );
String logoutURL = meeting.get( "logoutURL" );
Integer voiceBridge = Integer.parseInt( meeting.get( "voiceBridge" ).trim() );
String viewerPW = meeting.get( "viewerPW" );
String moderatorPW = meeting.get( "moderatorPW" );
//
// Check if we have a valid password
//
if ( ! password.equals(viewerPW) && ! password.equals(moderatorPW) ) {
2010-01-24 03:19:14 +08:00
%>
2009-12-31 02:36:20 +08:00
2010-02-15 07:57:13 +08:00
Invalid Password, please <a href="javascript:history.go(-1)">try again</a>.
2009-12-24 10:01:26 +08:00
2010-02-15 07:57:13 +08:00
<%
return;
}
//
// Looks good, let's create the meeting
//
2010-05-14 23:52:56 +08:00
String meeting_ID = createMeeting( meetingID, welcomeMsg, moderatorPW, viewerPW, voiceBridge, logoutURL );
2010-02-15 07:57:13 +08:00
//
// Check if we have an error.
//
2010-05-14 23:52:56 +08:00
if( meeting_ID.startsWith("Error ")) {
2010-02-15 07:57:13 +08:00
%>
2009-12-24 10:01:26 +08:00
2010-02-15 07:57:13 +08:00
Error: createMeeting() failed
2010-05-14 23:52:56 +08:00
<p /><%=meeting_ID%>
2009-12-24 10:01:26 +08:00
2009-12-31 02:36:20 +08:00
<%
2010-02-15 07:57:13 +08:00
return;
}
2010-01-24 03:19:14 +08:00
//
2010-05-14 23:52:56 +08:00
// We've got a valid meeting_ID and passoword -- let's join!
2010-01-24 03:19:14 +08:00
//
2010-02-15 07:57:13 +08:00
2010-05-14 23:52:56 +08:00
String joinURL = getJoinMeetingURL(username, meeting_ID, password);
2010-01-24 03:19:14 +08:00
%>
2009-12-31 02:36:20 +08:00
2009-12-31 05:09:59 +08:00
<script language="javascript" type="text/javascript">
2010-01-24 03:19:14 +08:00
window.location.href="<%=joinURL%>";
2009-12-31 05:09:59 +08:00
</script>
2009-12-24 10:01:26 +08:00
2010-01-24 03:19:14 +08:00
<%
2010-02-15 07:57:13 +08:00
}
2010-01-24 03:19:14 +08:00
%>
2010-02-15 07:57:13 +08:00
2009-12-31 02:36:20 +08:00
<%@ include file="demo_footer.jsp"%>
2009-12-24 10:01:26 +08:00
</body>
2010-02-15 07:57:13 +08:00
</html>