f1b20a33c1f979d7e8a2ee0d6b4b69a2390031f1
[atutor.git] / mods / openmeetings / view_meetings.php
1 <?php
2 /************************************************************************/
3 /* ATutor                                                                                                                               */
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Cindy Qi Li, Harris Wong                */
6 /* Adaptive Technology Resource Centre / University of Toronto                  */
7 /* http://atutor.ca                                                                                                             */
8 /*                                                                                                                                              */
9 /* This program is free software. You can redistribute it and/or                */
10 /* modify it under the terms of the GNU General Public License                  */
11 /* as published by the Free Software Foundation.                                                */
12 /************************************************************************/
13 // $Id: view_meetings.php 7575 2008-06-02 18:17:14Z hwong $
14
15 define('AT_INCLUDE_PATH', '../../include/');
16 require (AT_INCLUDE_PATH.'vitals.inc.php');
17 //require ('openmeetings.class.php');
18 //$_custom_css = $_base_path . 'mods/openmeetings/module.css'; // use a custom stylesheet
19
20 //local variables
21 $course_id = $_SESSION['course_id'];
22
23 /*
24  * Check access
25  * Disallowing improper accesses from a GET request
26  */
27 $sql    = "SELECT `access` FROM ".TABLE_PREFIX."courses WHERE course_id=$course_id";
28 $result = mysql_query($sql, $db);
29 $course_info = mysql_fetch_assoc($result);
30
31 if ($course_info['access']!='public' && ($_SESSION['enroll'] == AT_ENROLL_NO || $_SESSION['enroll'] == AT_ENROLL_ALUMNUS)) {
32         require(AT_INCLUDE_PATH.'header.inc.php');
33         $msg->printInfos('NOT_ENROLLED');
34         require(AT_INCLUDE_PATH.'footer.inc.php');
35         exit;
36 }
37
38 if (!isset($_config['openmeetings_username']) || !isset($_config['openmeetings_userpass'])){
39         require(AT_INCLUDE_PATH.'header.inc.php');
40         echo 'Contact admin plz';
41         //Please contact your administrator, om needs to be setup.
42         require(AT_INCLUDE_PATH.'footer.inc.php');
43         exit;
44 }
45
46
47 //Header begins here
48 require (AT_INCLUDE_PATH.'header.inc.php'); 
49
50 $_GET['room_id']        = abs($_GET['room_id']);
51 $_GET['sid']            = addslashes($_GET['sid']);
52 ?>
53
54 <div>
55 <a href="<?php echo $_SERVER['PHP_SELF']; ?>" onclick="window.open('<?php echo $_config['openmeetings_location']; ?>/main.lzx.lzr=swf8.swf?roomid=<?php echo $_GET['room_id']; ?>&sid=<?php echo $_GET['sid'];?>','marratechwin','width=800,height=720,scrollbars=yes, resizable=yes'); return false"><?php echo  _AT('openmeetings_own_window'); ?></a> </li>
56
57 <iframe name="openmeetings" id="openmeetings" title="Openmeetings" frameborder="1" scrolling="auto" src="<?php echo $_config['openmeetings_location']; ?>/main.lzx.lzr=swf8.swf?roomid=<?php echo $_GET['room_id']; ?>&sid=<?php echo $_GET['sid'];?>" height="700" width="90%" align="center" style="border:thin white solid; align:center;" allowautotransparency="true"></iframe>
58
59 </div>
60 <?php require (AT_INCLUDE_PATH.'footer.inc.php'); ?>