-
Notifications
You must be signed in to change notification settings - Fork 5
/
openmeetings_instructor.php
122 lines (111 loc) · 5.39 KB
/
openmeetings_instructor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
/************************************************************************/
/* ATutor */
/************************************************************************/
/* Copyright (c) 2002-2008 by Greg Gay, Cindy Qi Li, Harris Wong */
/* Adaptive Technology Resource Centre / University of Toronto */
/* http://atutor.ca */
/* */
/* This program is free software. You can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation. */
/************************************************************************/
// $Id: openmeetings_instructor.php 7575 2008-06-02 18:17:14Z hwong $
define('AT_INCLUDE_PATH', '../../include/');
require (AT_INCLUDE_PATH.'vitals.inc.php');
authenticate(AT_PRIV_OPENMEETINGS);
require ('lib/openmeetings.class.php');
require ('lib/openmeetings.inc.php');
//local variables
$course_id = $_SESSION['course_id'];
//Initiate Openmeeting
$om_obj = new Openmeetings($course_id, $_SESSION['member_id']);
//Login
$om_obj->om_login();
//Handle form action
if (isset($_POST['create_room']) && isset($_POST['room_id'])) {
//delete course room
$_POST['room_id'] = intval($_POST['room_id']);
$om_obj->om_deleteRoom($_POST['room_id']);
$msg->addFeedback('OPENMEETINGS_DELETE_SUCEEDED');
} elseif (isset($_POST['delete_room']) && isset($_POST['room_id'])){
$_POST['room_id'] = intval($_POST['room_id']);
$om_obj->om_deleteRoom($_POST['room_id']);
$msg->addFeedback('OPENMEETINGS_DELETE_SUCEEDED');
} elseif (isset($_POST['create_room']) || (isset($_POST['update_room']) && isset($_POST['room_id']))){
//mysql escape
$_POST['openmeetings_roomtype'] = intval($_POST['openmeetings_roomtype']);
$_POST['openmeetings_num_of_participants'] = intval($_POST['openmeetings_num_of_participants']);
(intval($_POST['openmeetings_ispublic']) == 1)?$_POST['openmeetings_ispublic']='true':$_POST['openmeetings_ispublic']='false';
$_POST['openmeetings_vid_w'] = intval($_POST['openmeetings_vid_w']);
$_POST['openmeetings_vid_h'] = intval($_POST['openmeetings_vid_h']);
(intval($_POST['openmeetings_show_wb']) == 1)?$_POST['openmeetings_show_wb']='true':$_POST['openmeetings_show_wb']='false';
$_POST['openmeetings_wb_w'] = intval($_POST['openmeetings_wb_w']);
$_POST['openmeetings_wb_h'] = intval($_POST['openmeetings_wb_h']);
(intval($_POST['openmeetings_show_fp']) == 1)?$_POST['openmeetings_show_fp']='true':$_POST['openmeetings_show_fp']='false';
$_POST['openmeetings_fp_w'] = intval($_POST['openmeetings_fp_w']);
$_POST['openmeetings_fp_h'] = intval($_POST['openmeetings_fp_h']);
//create a new room
if (isset($_POST['create_room'])){
//Get the room id
//TODO: Course title added/removed after creation. Affects the algo here.
if (isset($_SESSION['course_title']) && $_SESSION['course_title']!=''){
$room_name = $_SESSION['course_title'];
} else {
$room_name = 'course_'.$course_id;
}
//add the room with the given parameters.
$om_obj->om_addRoom($room_name, $_POST);
$msg->addFeedback('OPENMEETINGS_ADDED_SUCEEDED');
header('Location: index.php');
exit;
} elseif (isset($_POST['update_room'])){
//update a room
$om_obj->om_updateRoom(intval($_POST['room_id']), $_POST);
$msg->addFeedback('OPENMEETINGS_UPDATE_SUCEEDED');
header('Location: index.php');
exit;
}
} elseif (isset($_POST['edit_room']) && isset($_POST['room_id'])){
//Log into the room
$room_id = $om_obj->om_getRoom();
//Get the room obj
$room_obj = $om_obj->om_getRoomById($room_id);
//Assign existing variables to the room
$_POST['openmeetings_roomtype'] = intval($room_obj['return']['roomtype']['roomtypes_id']);
$_POST['openmeetings_room_name'] = $addslashes($room_obj['return']['name']);
$_POST['openmeetings_num_of_participants'] = $addslashes($room_obj['return']['numberOfPartizipants']);
(($room_obj['return']['ispublic'])=='true')?$_POST['openmeetings_ispublic']=1:$_POST['openmeetings_ispublic']=0;
$_POST['openmeetings_vid_w'] = intval($room_obj['return']['videoPodWidth']);
$_POST['openmeetings_vid_h'] = intval($room_obj['return']['videoPodHeight']);
(($room_obj['return']['showWhiteBoard'])=='true')?$_POST['openmeetings_show_wb']=1:$_POST['openmeetings_show_wb']=0;
$_POST['openmeetings_wb_w'] = intval($room_obj['return']['whiteBoardPanelWidth']);
$_POST['openmeetings_wb_h'] = intval($room_obj['return']['whiteBoardPanelHeight']);
(($room_obj['return']['showFilesPanel'])=='true')?$_POST['openmeetings_show_fp']=1:$_POST['openmeetings_show_fp']=0;
$_POST['openmeetings_fp_w'] = intval($room_obj['return']['filesPanelWidth']);
$_POST['openmeetings_fp_h'] = intval($room_obj['return']['filesPanelHeight']);
include (AT_INCLUDE_PATH.'header.inc.php');
include ('html/update_room.inc.php');
include (AT_INCLUDE_PATH.'footer.inc.php');
exit;
} elseif (isset($_POST['cancel'])){
$msg->addFeedback('OPENMEETINGS_CANCELLED');
header('Location: index.php');
exit;
} elseif (isset($_GET['action']) && $_GET['action'] == 'view'){
$room_id = intval($_GET['room_id']);
$sid = $addslashes($_GET['sid']);
header('Location: view_meetings.php?room_id='.$room_id.SEP.'sid='.$sid);
exit;
}
//Log into the room
$room_id = $om_obj->om_getRoom();
require (AT_INCLUDE_PATH.'header.inc.php');
if ($room_id == false) {
include ('html/create_room.inc.php');
} else {
//include page
include ('html/edit_room.inc.php');
}
require (AT_INCLUDE_PATH.'footer.inc.php');
?>