Advertisement
Guest User

Untitled

a guest
Oct 19th, 2016
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.15 KB | None | 0 0
  1. <!--
  2.  
  3. BigBlueButton - http://www.bigbluebutton.org
  4.  
  5. Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
  6.  
  7. BigBlueButton is free software; you can redistribute it and/or modify it under the
  8. terms of the GNU Lesser General Public License as published by the Free Software
  9. Foundation; either version 3 of the License, or (at your option) any later
  10. version.
  11.  
  12. BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
  13. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  14. PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
  15.  
  16. You should have received a copy of the GNU Lesser General Public License along
  17. with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
  18.  
  19. Author: Fred Dixon <ffdixon@bigbluebutton.org>
  20.  
  21. -->
  22.  
  23. <%@ page language="java" contentType="text/html; charset=UTF-8"
  24. pageEncoding="UTF-8"%>
  25. <%
  26. request.setCharacterEncoding("UTF-8");
  27. response.setCharacterEncoding("UTF-8");
  28. %>
  29.  
  30. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  31. <html>
  32. <head>
  33. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  34. <title>Join Password</title>
  35. </head>
  36. <body>
  37.  
  38. <%@ include file="bbb_api.jsp"%>
  39.  
  40. <%
  41.  
  42. //
  43. // We're going to define some sample courses (meetings) below. This API exampe shows how you can create a login page for a course.
  44. // The password below are not available to users as they are compiled on the server.
  45. //
  46.  
  47. HashMap<String, HashMap> allMeetings = new HashMap<String, HashMap>();
  48. HashMap<String, String> meeting;
  49.  
  50. // 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>";
  51.  
  52. String welcome = "<br>Welcome to <b>%%CONFNAME%%</b>!<br><br>To understand how BigBlueButton works see our <a href=\"event:http://www.bigbluebutton.org/content/videos\"><u>tutorial videos</u></a>.<br><br>To join the audio bridge click the headset icon (upper-left hand corner). <b>You can mute yourself in the Listeners window.</b>";
  53.  
  54. //
  55. // English courses
  56. //
  57.  
  58. meeting = new HashMap<String, String>();
  59. allMeetings.put( "Meeting Room 1", meeting ); // The title that will appear in the drop-down menu
  60. meeting.put("welcomeMsg", welcome); // The welcome mesage
  61. meeting.put ("moderatorname", "moderator"); // username for moderator
  62. meeting.put("viewername", "viewer"); // username for viewer
  63. meeting.put("moderatorPW", "meet1"); // The password for moderator
  64. meeting.put("viewerPW", "room1"); // The password for viewer
  65.  
  66.  
  67. meeting.put("voiceBridge", "72013"); // The extension number for the voice bridge (use if connected to phone system)
  68. meeting.put("logoutURL", ""); // The logout URL (use if you want to return to your pages)
  69.  
  70. meeting = new HashMap<String, String>();
  71. allMeetings.put( "Meeting Room 2", meeting );
  72. meeting.put("welcomeMsg", welcome);
  73. meeting.put("moderatorPW", "meet2");
  74. meeting.put("viewerPW", "room2");
  75. meeting.put("voiceBridge", "72213");
  76. meeting.put("logoutURL", "");
  77.  
  78. meeting = new HashMap<String, String>();
  79. allMeetings.put( "Meeting Room 3", meeting );
  80. meeting.put("welcomeMsg", welcome);
  81. meeting.put("moderatorPW", "meet3");
  82. meeting.put("viewerPW", "room3");
  83. meeting.put("voiceBridge", "72023");
  84. meeting.put("logoutURL", "");
  85.  
  86. //
  87. // Law Courses
  88. //
  89.  
  90. meeting = new HashMap<String, String>();
  91. allMeetings.put( "Meeting Room 4 ", meeting );
  92. meeting.put("welcomeMsg", welcome);
  93. meeting.put("moderatorPW", "meet4");
  94. meeting.put("viewerPW", "room4");
  95. meeting.put("voiceBridge", "71232");
  96. meeting.put("logoutURL", "");
  97.  
  98. meeting = new HashMap<String, String>();
  99. allMeetings.put( "Meeting Room 5", meeting );
  100. meeting.put("welcomeMsg", welcome);
  101. meeting.put("moderatorPW", "meet5");
  102. meeting.put("viewerPW", "room5");
  103. meeting.put("voiceBridge", "72273");
  104. meeting.put("logoutURL", "");
  105.  
  106. meeting = new HashMap<String, String>();
  107. allMeetings.put( "Meeting Room 6", meeting );
  108. meeting.put("welcomeMsg", welcome);
  109. meeting.put("moderatorPW", "meet6");
  110. meeting.put("viewerPW", "room5");
  111. meeting.put("voiceBridge", "71642");
  112. meeting.put("logoutURL", "");
  113.  
  114.  
  115. //
  116. // Professor's Virtaul Office Hours
  117. //
  118.  
  119. meeting = new HashMap<String, String>();
  120. allMeetings.put( "Virtual Office Hours - Blanca", meeting );
  121. meeting.put("welcomeMsg", welcome);
  122. meeting.put("moderatorPW", "blanca");
  123. meeting.put("viewerPW", "help");
  124. meeting.put("voiceBridge", "70001");
  125. meeting.put("logoutURL", "");
  126.  
  127. meeting = new HashMap<String, String>();
  128. allMeetings.put( "Virtual Office - Mario", meeting );
  129. meeting.put("welcomeMsg", welcome);
  130. meeting.put("moderatorPW", "mario");
  131. meeting.put("viewerPW", "help");
  132. meeting.put("voiceBridge", "70002");
  133. meeting.put("logoutURL", "");
  134.  
  135. meeting = new HashMap<String, String>();
  136. allMeetings.put( "Virtual Office - Alexandria", meeting );
  137. meeting.put("welcomeMsg", welcome);
  138. meeting.put("moderatorPW", "alex");
  139. meeting.put("viewerPW", "help");
  140. meeting.put("voiceBridge", "70003");
  141. meeting.put("logoutURL", "");
  142.  
  143. meeting = new HashMap<String, String>();
  144. allMeetings.put( "Virtual Office - Eddie", meeting );
  145. meeting.put("welcomeMsg", welcome);
  146. meeting.put("moderatorPW", "eddie");
  147. meeting.put("viewerPW", "help");
  148. meeting.put("voiceBridge", "70004");
  149. meeting.put("logoutURL", "");
  150.  
  151. meeting = new HashMap<String, String>();
  152. allMeetings.put( "Virtual Office - Pauls", meeting );
  153. meeting.put("welcomeMsg", welcome);
  154. meeting.put("moderatorPW", "paul");
  155. meeting.put("viewerPW", "help");
  156. meeting.put("voiceBridge", "70005");
  157. meeting.put("logoutURL", "");
  158. meeting = null;
  159.  
  160. meeting = new HashMap<String, String>();
  161. allMeetings.put( "Virtual Office - ", meeting );
  162. meeting.put("welcomeMsg", welcome);
  163. meeting.put("moderatorPW", "");
  164. meeting.put("viewerPW", "help");
  165. meeting.put("voiceBridge", "70005");
  166. meeting.put("logoutURL", "");
  167. meeting = null;
  168.  
  169. meeting = new HashMap<String, String>();
  170. allMeetings.put( "Virtual Office - ", meeting );
  171. meeting.put("welcomeMsg", welcome);
  172. meeting.put("moderatorPW", "");
  173. meeting.put("viewerPW", "help");
  174. meeting.put("voiceBridge", "70005");
  175. meeting.put("logoutURL", "");
  176. meeting = null;
  177.  
  178. meeting = new HashMap<String, String>();
  179. allMeetings.put( "Virtual Office - ", meeting );
  180. meeting.put("welcomeMsg", welcome);
  181. meeting.put("moderatorPW", "");
  182. meeting.put("viewerPW", "help");
  183. meeting.put("voiceBridge", "70005");
  184. meeting.put("logoutURL", "");
  185. meeting = null;
  186. Iterator<String> meetingIterator = new TreeSet<String>(allMeetings.keySet()).iterator();
  187.  
  188. if (request.getParameterMap().isEmpty()) {
  189. //
  190. // Assume we want to join a course
  191. //
  192. %>
  193.  
  194.  
  195. <h2>Join a Session (password required)</h2>
  196.  
  197.  
  198. <FORM NAME="form1" METHOD="GET">
  199. <table cellpadding="5" cellspacing="5" style="width: 400px; ">
  200. <tbody>
  201. <tr>
  202. <td>
  203. &nbsp;</td>
  204. <td style="text-align: right; ">
  205. Full&nbsp;Name:</td>
  206. <td style="width: 5px; ">
  207. &nbsp;</td>
  208. <td style="text-align: left ">
  209. <input type="text" autofocus required name="username" /></td>
  210. </tr>
  211.  
  212.  
  213.  
  214. <tr>
  215. <td>
  216. &nbsp;</td>
  217. <td style="text-align: right; ">
  218. Session:</td>
  219. <td>
  220. &nbsp;
  221. </td>
  222. <td style="text-align: left ">
  223. <select name="meetingID">
  224. <%
  225. String key;
  226. while (meetingIterator.hasNext()) {
  227. key = meetingIterator.next();
  228. out.println("<option value=\"" + key + "\">" + key + "</option>");
  229. }
  230. %>
  231. </select>
  232.  
  233. </td>
  234. </tr>
  235. <tr>
  236. <td>
  237. &nbsp;</td>
  238. <td style="text-align: right; ">
  239. Password:</td>
  240. <td>
  241. &nbsp;</td>
  242. <td>
  243. <input type="password" required name="password" /></td>
  244. </tr>
  245. <tr>
  246. <td>
  247. &nbsp;</td>
  248. <td>
  249. &nbsp;</td>
  250. <td>
  251. &nbsp;</td>
  252. <td>
  253. <input type="submit" value="Join" /></td>
  254. </tr>
  255. </tbody>
  256. </table>
  257. <INPUT TYPE=hidden NAME=action VALUE="create">
  258. </FORM>
  259.  
  260. Passwords:
  261. <ul>
  262. <li>prof123 - login as professor (moderator privlidges)</li>
  263. <li>student123 - login as student (viewer privlidges)</li>
  264. </ul>
  265.  
  266.  
  267. <%
  268. } else if (request.getParameter("action").equals("create")) {
  269. //
  270. // Got an action=create
  271. //
  272.  
  273. String username = request.getParameter("username");
  274. String meetingID = request.getParameter("meetingID");
  275. String password = request.getParameter("password");
  276.  
  277. meeting = allMeetings.get( meetingID );
  278.  
  279. String welcomeMsg = meeting.get( "welcomeMsg" );
  280. String logoutURL = meeting.get( "logoutURL" );
  281. Integer voiceBridge = Integer.parseInt( meeting.get( "voiceBridge" ).trim() );
  282. String moderatorname = meeting.get("moderatorname");
  283. String viewername = meeting.get ("viewername");
  284. String viewerPW = meeting.get( "viewerPW" );
  285. String moderatorPW = meeting.get( "moderatorPW" );
  286.  
  287. //
  288. // Check if we have a valid password
  289. //
  290. if ( ! username.equals(viewername) && ! username.equals(moderatorname) )
  291. if ( ! password.equals(viewerPW) && ! password.equals(moderatorPW) ) {
  292. %>
  293.  
  294. Invalid Username or Password, please <a href="javascript:history.go(-1)">try again</a>.
  295.  
  296. <%
  297. return;
  298. }
  299.  
  300. //
  301. // Looks good, let's create the meeting
  302. //
  303. String meeting_ID = createMeeting( meetingID, welcomeMsg, moderatorname, moderatorPW, "Welcome moderator! (moderator only message)", viewername, viewerPW, voiceBridge, logoutURL );
  304.  
  305. //
  306. // Check if we have an error.
  307. //
  308. if( meeting_ID.startsWith("Error ")) {
  309. %>
  310.  
  311. Error: createMeeting() failed
  312. <p /><%=meeting_ID%>
  313.  
  314.  
  315. <%
  316. return;
  317. }
  318.  
  319. //
  320. // We've got a valid meeting_ID and passoword -- let's join!
  321. //
  322.  
  323. String joinURL = getJoinMeetingURL(username, meeting_ID, password, null);
  324. %>
  325.  
  326. <script language="javascript" type="text/javascript">
  327. window.location.href="<%=joinURL%>";
  328. </script>
  329.  
  330. <%
  331. }
  332. %>
  333.  
  334. <%@ include file="demo_footer.jsp"%>
  335.  
  336. </body>
  337. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement