2 /************************************************************************/
4 /************************************************************************/
5 /* Copyright (c) 2002-2008 by Greg Gay, Cindy Qi Li, Harris Wong */
6 /* Adaptive Technology Resource Centre / University of Toronto */
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: openmeetings_group.php 7575 2008-06-02 18:17:14Z hwong $
15 define('AT_INCLUDE_PATH', '../../include/');
16 require (AT_INCLUDE_PATH.'vitals.inc.php');
17 require ('lib/openmeetings.class.php');
18 require ('lib/openmeetings.inc.php');
19 //$_custom_css = $_base_path . 'mods/openmeetings/module.css'; // use a custom stylesheet
22 $course_id = $_SESSION['course_id'];
25 checkAccess($course_id);
27 $_GET['gid'] = intval($_GET['gid']);
29 //Initiate Openmeeting
30 $om_obj = new Openmeetings($course_id, $_SESSION['member_id']);
36 $sql = "SELECT title FROM ".TABLE_PREFIX."groups WHERE group_id=$_GET[gid] ORDER BY title";
37 //TODO: Check group permission from group table.
38 $result = mysql_query($sql, $db);
39 $row = mysql_fetch_assoc($result);
41 if (mysql_numrows($result) == 0){
42 echo '<div class="openmeetings">'._AT('openmeetings_no_group_meetings').'</div>';
43 require (AT_INCLUDE_PATH.'footer.inc.php');
47 //Check in the db and see if this group has a meeting alrdy, create on if not.
48 $om_obj->setGid($_GET['gid']);
49 if ($om_obj->om_getRoom()){
51 $room_id = $om_obj->om_addRoom($room_name);
52 header('Location: '.AT_BASE_HREF.'mods/openmeetings/view_meetings.php?room_id='.$room_id.SEP.'sid='.$om_obj->getSid());
56 require (AT_INCLUDE_PATH.'header.inc.php');
57 echo '<div class="openmeetings">'.$row['title'].'<a href="mods/openmeetings/add_group_meetings.php?group_id='.$_GET['gid'].'"> Start a conference </a></div>';
58 require (AT_INCLUDE_PATH.'footer.inc.php');