|
@@ -14,7 +14,7 @@ discard block |
|
|
block discarded – undo |
|
14
|
14
|
|
|
15
|
15
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
16
|
16
|
|
|
17
|
|
-require_once(dirname(__FILE__).'/lib.php'); |
|
|
17
|
+require_once(dirname(__FILE__) . '/lib.php'); |
|
18
|
18
|
|
|
19
|
19
|
const BIGBLUEBUTTONBN_FORCED = true; |
|
20
|
20
|
|
|
@@ -33,21 +33,21 @@ discard block |
|
|
block discarded – undo |
|
33
|
33
|
const BIGBLUEBUTTON_EVENT_RECORDING_PUBLISHED = 'recording_published'; |
|
34
|
34
|
const BIGBLUEBUTTON_EVENT_RECORDING_UNPUBLISHED = 'recording_unpublished'; |
|
35
|
35
|
|
|
36
|
|
-function bigbluebuttonbn_logs(array $bbbsession, $event, array $overrides = [], $meta = NULL ) { |
|
|
36
|
+function bigbluebuttonbn_logs(array $bbbsession, $event, array $overrides = [], $meta = NULL) { |
|
37
|
37
|
global $DB; |
|
38
|
38
|
|
|
39
|
39
|
$log = new stdClass(); |
|
40
|
40
|
|
|
41
|
|
- $log->courseid = isset($overrides['courseid'])? $overrides['courseid']: $bbbsession['course']->id; |
|
42
|
|
- $log->bigbluebuttonbnid = isset($overrides['bigbluebuttonbnid'])? $overrides['bigbluebuttonbnid']: $bbbsession['bigbluebuttonbn']->id; |
|
43
|
|
- $log->userid = isset($overrides['userid'])? $overrides['userid']: $bbbsession['userID']; |
|
44
|
|
- $log->meetingid = isset($overrides['meetingid'])? $overrides['meetingid']: $bbbsession['meetingid']; |
|
45
|
|
- $log->timecreated = isset($overrides['timecreated'])? $overrides['timecreated']: time(); |
|
|
41
|
+ $log->courseid = isset($overrides['courseid']) ? $overrides['courseid'] : $bbbsession['course']->id; |
|
|
42
|
+ $log->bigbluebuttonbnid = isset($overrides['bigbluebuttonbnid']) ? $overrides['bigbluebuttonbnid'] : $bbbsession['bigbluebuttonbn']->id; |
|
|
43
|
+ $log->userid = isset($overrides['userid']) ? $overrides['userid'] : $bbbsession['userID']; |
|
|
44
|
+ $log->meetingid = isset($overrides['meetingid']) ? $overrides['meetingid'] : $bbbsession['meetingid']; |
|
|
45
|
+ $log->timecreated = isset($overrides['timecreated']) ? $overrides['timecreated'] : time(); |
|
46
|
46
|
$log->log = $event; |
|
47
|
|
- if ( isset($meta) ) { |
|
|
47
|
+ if (isset($meta)) { |
|
48
|
48
|
$log->meta = $meta; |
|
49
|
|
- } else if( $event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
|
50
|
|
- $log->meta = '{"record":'.($bbbsession['record']? 'true': 'false').'}'; |
|
|
49
|
+ } else if ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) { |
|
|
50
|
+ $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}'; |
|
51
|
51
|
} |
|
52
|
52
|
|
|
53
|
53
|
$returnid = $DB->insert_record('bigbluebuttonbn_logs', $log); |
|
@@ -56,132 +56,132 @@ discard block |
|
|
block discarded – undo |
|
56
|
56
|
//////////////////////////// |
|
57
|
57
|
// BigBlueButton API Calls // |
|
58
|
58
|
//////////////////////////// |
|
59
|
|
-function bigbluebuttonbn_getJoinURL( $meetingID, $userName, $PW, $SALT, $URL, $logoutURL ) { |
|
60
|
|
- $url_join = $URL."api/join?"; |
|
61
|
|
- $params = 'meetingID='.urlencode($meetingID).'&fullName='.urlencode($userName).'&password='.urlencode($PW).'&logoutURL='.urlencode($logoutURL); |
|
62
|
|
- $url = $url_join.$params.'&checksum='.sha1("join".$params.$SALT); |
|
|
59
|
+function bigbluebuttonbn_getJoinURL($meetingID, $userName, $PW, $SALT, $URL, $logoutURL) { |
|
|
60
|
+ $url_join = $URL . "api/join?"; |
|
|
61
|
+ $params = 'meetingID=' . urlencode($meetingID) . '&fullName=' . urlencode($userName) . '&password=' . urlencode($PW) . '&logoutURL=' . urlencode($logoutURL); |
|
|
62
|
+ $url = $url_join . $params . '&checksum=' . sha1("join" . $params . $SALT); |
|
63
|
63
|
return $url; |
|
64
|
64
|
} |
|
65
|
65
|
|
|
66
|
|
-function bigbluebuttonbn_getCreateMeetingURL($name, $meetingID, $attendeePW, $moderatorPW, $welcome, $logoutURL, $SALT, $URL, $record = 'false', $duration=0, $voiceBridge=0, $maxParticipants=0, $metadata=array() ) { |
|
67
|
|
- $url_create = $URL."api/create?"; |
|
|
66
|
+function bigbluebuttonbn_getCreateMeetingURL($name, $meetingID, $attendeePW, $moderatorPW, $welcome, $logoutURL, $SALT, $URL, $record = 'false', $duration = 0, $voiceBridge = 0, $maxParticipants = 0, $metadata = array()) { |
|
|
67
|
+ $url_create = $URL . "api/create?"; |
|
68
|
68
|
|
|
69
|
|
- $params = 'name='.urlencode($name).'&meetingID='.urlencode($meetingID).'&attendeePW='.urlencode($attendeePW).'&moderatorPW='.urlencode($moderatorPW).'&logoutURL='.urlencode($logoutURL).'&record='.$record; |
|
|
69
|
+ $params = 'name=' . urlencode($name) . '&meetingID=' . urlencode($meetingID) . '&attendeePW=' . urlencode($attendeePW) . '&moderatorPW=' . urlencode($moderatorPW) . '&logoutURL=' . urlencode($logoutURL) . '&record=' . $record; |
|
70
|
70
|
|
|
71
|
71
|
$voiceBridge = intval($voiceBridge); |
|
72
|
|
- if ( $voiceBridge > 0 && $voiceBridge < 79999) { |
|
73
|
|
- $params .= '&voiceBridge='.$voiceBridge; |
|
|
72
|
+ if ($voiceBridge > 0 && $voiceBridge < 79999) { |
|
|
73
|
+ $params .= '&voiceBridge=' . $voiceBridge; |
|
74
|
74
|
} |
|
75
|
75
|
|
|
76
|
76
|
$duration = intval($duration); |
|
77
|
|
- if( $duration > 0 ) { |
|
78
|
|
- $params .= '&duration='.$duration; |
|
|
77
|
+ if ($duration > 0) { |
|
|
78
|
+ $params .= '&duration=' . $duration; |
|
79
|
79
|
} |
|
80
|
80
|
|
|
81
|
81
|
$maxParticipants = intval($maxParticipants); |
|
82
|
|
- if( $maxParticipants > 0 ) { |
|
83
|
|
- $params .= '&maxParticipants='.$maxParticipants; |
|
|
82
|
+ if ($maxParticipants > 0) { |
|
|
83
|
+ $params .= '&maxParticipants=' . $maxParticipants; |
|
84
|
84
|
} |
|
85
|
85
|
|
|
86
|
|
- if( trim( $welcome ) ) { |
|
87
|
|
- $params .= '&welcome='.urlencode($welcome); |
|
|
86
|
+ if (trim($welcome)) { |
|
|
87
|
+ $params .= '&welcome=' . urlencode($welcome); |
|
88
|
88
|
} |
|
89
|
89
|
|
|
90
|
90
|
foreach ($metadata as $key => $value) { |
|
91
|
|
- $params .= '&'.$key.'='.urlencode($value); |
|
|
91
|
+ $params .= '&' . $key . '=' . urlencode($value); |
|
92
|
92
|
} |
|
93
|
93
|
|
|
94
|
|
- $url = $url_create.$params.'&checksum='.sha1("create".$params.$SALT); |
|
|
94
|
+ $url = $url_create . $params . '&checksum=' . sha1("create" . $params . $SALT); |
|
95
|
95
|
return $url; |
|
96
|
96
|
} |
|
97
|
97
|
|
|
98
|
|
-function bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) { |
|
99
|
|
- $base_url = $URL."api/isMeetingRunning?"; |
|
100
|
|
- $params = 'meetingID='.urlencode($meetingID); |
|
101
|
|
- $url = $base_url.$params.'&checksum='.sha1("isMeetingRunning".$params.$SALT); |
|
|
98
|
+function bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT) { |
|
|
99
|
+ $base_url = $URL . "api/isMeetingRunning?"; |
|
|
100
|
+ $params = 'meetingID=' . urlencode($meetingID); |
|
|
101
|
+ $url = $base_url . $params . '&checksum=' . sha1("isMeetingRunning" . $params . $SALT); |
|
102
|
102
|
return $url; |
|
103
|
103
|
} |
|
104
|
104
|
|
|
105
|
|
-function bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) { |
|
106
|
|
- $base_url = $URL."api/getMeetingInfo?"; |
|
107
|
|
- $params = 'meetingID='.urlencode($meetingID).'&password='.urlencode($modPW); |
|
108
|
|
- $url = $base_url.$params.'&checksum='.sha1("getMeetingInfo".$params.$SALT); |
|
|
105
|
+function bigbluebuttonbn_getMeetingInfoURL($meetingID, $modPW, $URL, $SALT) { |
|
|
106
|
+ $base_url = $URL . "api/getMeetingInfo?"; |
|
|
107
|
+ $params = 'meetingID=' . urlencode($meetingID) . '&password=' . urlencode($modPW); |
|
|
108
|
+ $url = $base_url . $params . '&checksum=' . sha1("getMeetingInfo" . $params . $SALT); |
|
109
|
109
|
return $url; |
|
110
|
110
|
} |
|
111
|
111
|
|
|
112
|
|
-function bigbluebuttonbn_getMeetingsURL( $URL, $SALT ) { |
|
113
|
|
- $base_url = $URL."api/getMeetings?"; |
|
114
|
|
- $url = $base_url.'&checksum='.sha1("getMeetings".$SALT); |
|
|
112
|
+function bigbluebuttonbn_getMeetingsURL($URL, $SALT) { |
|
|
113
|
+ $base_url = $URL . "api/getMeetings?"; |
|
|
114
|
+ $url = $base_url . '&checksum=' . sha1("getMeetings" . $SALT); |
|
115
|
115
|
return $url; |
|
116
|
116
|
} |
|
117
|
117
|
|
|
118
|
|
-function bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $URL, $SALT ) { |
|
119
|
|
- $base_url = $URL."api/end?"; |
|
120
|
|
- $params = 'meetingID='.urlencode($meetingID).'&password='.urlencode($modPW); |
|
121
|
|
- $url = $base_url.$params.'&checksum='.sha1("end".$params.$SALT); |
|
|
118
|
+function bigbluebuttonbn_getEndMeetingURL($meetingID, $modPW, $URL, $SALT) { |
|
|
119
|
+ $base_url = $URL . "api/end?"; |
|
|
120
|
+ $params = 'meetingID=' . urlencode($meetingID) . '&password=' . urlencode($modPW); |
|
|
121
|
+ $url = $base_url . $params . '&checksum=' . sha1("end" . $params . $SALT); |
|
122
|
122
|
return $url; |
|
123
|
123
|
} |
|
124
|
124
|
|
|
125
|
|
-function bigbluebuttonbn_getRecordingsURL( $URL, $SALT, $meetingID=null ) { |
|
126
|
|
- $base_url_record = $URL."api/getRecordings?"; |
|
127
|
|
- if( $meetingID == null ) { |
|
|
125
|
+function bigbluebuttonbn_getRecordingsURL($URL, $SALT, $meetingID = null) { |
|
|
126
|
+ $base_url_record = $URL . "api/getRecordings?"; |
|
|
127
|
+ if ($meetingID == null) { |
|
128
|
128
|
$params = ""; |
|
129
|
129
|
} else { |
|
130
|
|
- $params = "meetingID=".urlencode($meetingID); |
|
|
130
|
+ $params = "meetingID=" . urlencode($meetingID); |
|
131
|
131
|
} |
|
132
|
|
- $url = $base_url_record.$params."&checksum=".sha1("getRecordings".$params.$SALT); |
|
|
132
|
+ $url = $base_url_record . $params . "&checksum=" . sha1("getRecordings" . $params . $SALT); |
|
133
|
133
|
return $url; |
|
134
|
134
|
} |
|
135
|
135
|
|
|
136
|
|
-function bigbluebuttonbn_getDeleteRecordingsURL( $recordID, $URL, $SALT ) { |
|
137
|
|
- $url_delete = $URL."api/deleteRecordings?"; |
|
138
|
|
- $params = 'recordID='.urlencode($recordID); |
|
139
|
|
- $url = $url_delete.$params.'&checksum='.sha1("deleteRecordings".$params.$SALT); |
|
|
136
|
+function bigbluebuttonbn_getDeleteRecordingsURL($recordID, $URL, $SALT) { |
|
|
137
|
+ $url_delete = $URL . "api/deleteRecordings?"; |
|
|
138
|
+ $params = 'recordID=' . urlencode($recordID); |
|
|
139
|
+ $url = $url_delete . $params . '&checksum=' . sha1("deleteRecordings" . $params . $SALT); |
|
140
|
140
|
return $url; |
|
141
|
141
|
} |
|
142
|
142
|
|
|
143
|
|
-function bigbluebuttonbn_getPublishRecordingsURL( $recordID, $set, $URL, $SALT ) { |
|
144
|
|
- $url_publish = $URL."api/publishRecordings?"; |
|
145
|
|
- $params = 'recordID='.$recordID."&publish=".$set; |
|
146
|
|
- $url = $url_publish.$params.'&checksum='.sha1("publishRecordings".$params.$SALT); |
|
|
143
|
+function bigbluebuttonbn_getPublishRecordingsURL($recordID, $set, $URL, $SALT) { |
|
|
144
|
+ $url_publish = $URL . "api/publishRecordings?"; |
|
|
145
|
+ $params = 'recordID=' . $recordID . "&publish=" . $set; |
|
|
146
|
+ $url = $url_publish . $params . '&checksum=' . sha1("publishRecordings" . $params . $SALT); |
|
147
|
147
|
return $url; |
|
148
|
148
|
} |
|
149
|
149
|
|
|
150
|
|
-function bigbluebuttonbn_getCreateMeetingArray( $username, $meetingID, $welcomeString, $mPW, $aPW, $SALT, $URL, $logoutURL, $record='false', $duration=0, $voiceBridge=0, $maxParticipants=0, $metadata=array(), $presentation_name=null, $presentation_url=null ) { |
|
|
150
|
+function bigbluebuttonbn_getCreateMeetingArray($username, $meetingID, $welcomeString, $mPW, $aPW, $SALT, $URL, $logoutURL, $record = 'false', $duration = 0, $voiceBridge = 0, $maxParticipants = 0, $metadata = array(), $presentation_name = null, $presentation_url = null) { |
|
151
|
151
|
$create_meeting_url = bigbluebuttonbn_getCreateMeetingURL($username, $meetingID, $aPW, $mPW, $welcomeString, $logoutURL, $SALT, $URL, $record, $duration, $voiceBridge, $maxParticipants, $metadata); |
|
152
|
|
- if( !is_null($presentation_name) && !is_null($presentation_url) ) { |
|
153
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( $create_meeting_url, |
|
|
152
|
+ if (!is_null($presentation_name) && !is_null($presentation_url)) { |
|
|
153
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file($create_meeting_url, |
|
154
|
154
|
BIGBLUEBUTTONBN_METHOD_POST, |
|
155
|
|
- "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".$presentation_url."' /></module></modules>" |
|
|
155
|
+ "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . $presentation_url . "' /></module></modules>" |
|
156
|
156
|
); |
|
157
|
157
|
} else { |
|
158
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( $create_meeting_url ); |
|
|
158
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file($create_meeting_url); |
|
159
|
159
|
} |
|
160
|
160
|
|
|
161
|
|
- if ( $xml ) { |
|
|
161
|
+ if ($xml) { |
|
162
|
162
|
if ($xml->meetingID) { |
|
163
|
|
- return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded ); |
|
|
163
|
+ return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey, 'meetingID' => $xml->meetingID, 'attendeePW' => $xml->attendeePW, 'moderatorPW' => $xml->moderatorPW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded); |
|
164
|
164
|
} else { |
|
165
|
|
- return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); |
|
|
165
|
+ return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
|
166
|
166
|
} |
|
167
|
167
|
} else { |
|
168
|
168
|
return null; |
|
169
|
169
|
} |
|
170
|
170
|
} |
|
171
|
171
|
|
|
172
|
|
-function bigbluebuttonbn_getMeetingsArray($meetingID, $URL, $SALT ) { |
|
173
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingsURL($URL, $SALT) ); |
|
|
172
|
+function bigbluebuttonbn_getMeetingsArray($meetingID, $URL, $SALT) { |
|
|
173
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingsURL($URL, $SALT)); |
|
174
|
174
|
|
|
175
|
|
- if ( $xml && $xml->returncode == 'SUCCESS' && $xml->messageKey ) { //The meetings were returned |
|
|
175
|
+ if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey) { //The meetings were returned |
|
176
|
176
|
return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
|
177
|
177
|
|
|
178
|
|
- } else if($xml && $xml->returncode == 'SUCCESS') { //If there were meetings already created |
|
|
178
|
+ } else if ($xml && $xml->returncode == 'SUCCESS') { //If there were meetings already created |
|
179
|
179
|
foreach ($xml->meetings->meeting as $meeting) { |
|
180
|
|
- $meetings[] = array( 'meetingID' => $meeting->meetingID, 'moderatorPW' => $meeting->moderatorPW, 'attendeePW' => $meeting->attendeePW, 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, 'running' => $meeting->running ); |
|
|
180
|
+ $meetings[] = array('meetingID' => $meeting->meetingID, 'moderatorPW' => $meeting->moderatorPW, 'attendeePW' => $meeting->attendeePW, 'hasBeenForciblyEnded' => $meeting->hasBeenForciblyEnded, 'running' => $meeting->running); |
|
181
|
181
|
} |
|
182
|
182
|
return $meetings; |
|
183
|
183
|
|
|
184
|
|
- } else if( $xml ) { //If the xml packet returned failure it displays the message to the user |
|
|
184
|
+ } else if ($xml) { //If the xml packet returned failure it displays the message to the user |
|
185
|
185
|
return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
|
186
|
186
|
|
|
187
|
187
|
} else { //If the server is unreachable, then prompts the user of the necessary action |
|
@@ -189,21 +189,21 @@ discard block |
|
|
block discarded – undo |
|
189
|
189
|
} |
|
190
|
190
|
} |
|
191
|
191
|
|
|
192
|
|
-function bigbluebuttonbn_getMeetingInfo( $meetingID, $modPW, $URL, $SALT ) { |
|
193
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) ); |
|
|
192
|
+function bigbluebuttonbn_getMeetingInfo($meetingID, $modPW, $URL, $SALT) { |
|
|
193
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); |
|
194
|
194
|
return $xml; |
|
195
|
195
|
} |
|
196
|
196
|
|
|
197
|
|
-function bigbluebuttonbn_getMeetingInfoArray( $meetingID, $modPW, $URL, $SALT ) { |
|
198
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getMeetingInfoURL( $meetingID, $modPW, $URL, $SALT ) ); |
|
|
197
|
+function bigbluebuttonbn_getMeetingInfoArray($meetingID, $modPW, $URL, $SALT) { |
|
|
198
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)); |
|
199
|
199
|
|
|
200
|
|
- if( $xml && $xml->returncode == 'SUCCESS' && $xml->messageKey == null){//The meeting info was returned |
|
201
|
|
- return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey ); |
|
|
200
|
+ if ($xml && $xml->returncode == 'SUCCESS' && $xml->messageKey == null) {//The meeting info was returned |
|
|
201
|
+ return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
|
202
|
202
|
|
|
203
|
|
- } else if($xml && $xml->returncode == 'SUCCESS'){ //If there were meetings already created |
|
204
|
|
- return array('returncode' => $xml->returncode, 'meetingID' => $xml->meetingID, 'moderatorPW' => $xml->moderatorPW, 'attendeePW' => $xml->attendeePW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, 'running' => $xml->running, 'recording' => $xml->recording, 'startTime' => $xml->startTime, 'endTime' => $xml->endTime, 'participantCount' => $xml->participantCount, 'moderatorCount' => $xml->moderatorCount, 'attendees' => $xml->attendees, 'metadata' => $xml->metadata ); |
|
|
203
|
+ } else if ($xml && $xml->returncode == 'SUCCESS') { //If there were meetings already created |
|
|
204
|
+ return array('returncode' => $xml->returncode, 'meetingID' => $xml->meetingID, 'moderatorPW' => $xml->moderatorPW, 'attendeePW' => $xml->attendeePW, 'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded, 'running' => $xml->running, 'recording' => $xml->recording, 'startTime' => $xml->startTime, 'endTime' => $xml->endTime, 'participantCount' => $xml->participantCount, 'moderatorCount' => $xml->moderatorCount, 'attendees' => $xml->attendees, 'metadata' => $xml->metadata); |
|
205
|
205
|
|
|
206
|
|
- } else if( ($xml && $xml->returncode == 'FAILED') || $xml) { //If the xml packet returned failure it displays the message to the user |
|
|
206
|
+ } else if (($xml && $xml->returncode == 'FAILED') || $xml) { //If the xml packet returned failure it displays the message to the user |
|
207
|
207
|
return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
|
208
|
208
|
|
|
209
|
209
|
} else { //If the server is unreachable, then prompts the user of the necessary action |
|
@@ -211,19 +211,19 @@ discard block |
|
|
block discarded – undo |
|
211
|
211
|
} |
|
212
|
212
|
} |
|
213
|
213
|
|
|
214
|
|
-function bigbluebuttonbn_getRecordingsArray( $meetingIDs, $URL, $SALT ) { |
|
|
214
|
+function bigbluebuttonbn_getRecordingsArray($meetingIDs, $URL, $SALT) { |
|
215
|
215
|
$recordings = array(); |
|
216
|
216
|
|
|
217
|
|
- if ( is_array($meetingIDs) ) { |
|
|
217
|
+ if (is_array($meetingIDs)) { |
|
218
|
218
|
// getRecordings is executed using a method POST (supported only on BBB 1.0 and later) |
|
219
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getRecordingsURL( $URL, $SALT ), BIGBLUEBUTTONBN_METHOD_POST, $meetingIDs ); |
|
|
219
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getRecordingsURL($URL, $SALT), BIGBLUEBUTTONBN_METHOD_POST, $meetingIDs); |
|
220
|
220
|
} else { |
|
221
|
221
|
// getRecordings is executed using a method GET (supported by all versions of BBB) |
|
222
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getRecordingsURL( $URL, $SALT, $meetingIDs ) ); |
|
|
222
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getRecordingsURL($URL, $SALT, $meetingIDs)); |
|
223
|
223
|
} |
|
224
|
224
|
|
|
225
|
|
- if ( $xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings) ) { //If there were meetings already created |
|
226
|
|
- foreach ( $xml->recordings->recording as $recording ) { |
|
|
225
|
+ if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { //If there were meetings already created |
|
|
226
|
+ foreach ($xml->recordings->recording as $recording) { |
|
227
|
227
|
$recordings[] = bigbluebuttonbn_getRecordingArrayRow($recording); |
|
228
|
228
|
} |
|
229
|
229
|
|
|
@@ -233,7 +233,7 @@ discard block |
|
|
block discarded – undo |
|
233
|
233
|
return $recordings; |
|
234
|
234
|
} |
|
235
|
235
|
|
|
236
|
|
-function bigbluebuttonbn_index_recordings($recordings, $index_key='recordID') { |
|
|
236
|
+function bigbluebuttonbn_index_recordings($recordings, $index_key = 'recordID') { |
|
237
|
237
|
$indexed_recordings = array(); |
|
238
|
238
|
|
|
239
|
239
|
foreach ($recordings as $recording) { |
|
@@ -243,14 +243,14 @@ discard block |
|
|
block discarded – undo |
|
243
|
243
|
return $indexed_recordings; |
|
244
|
244
|
} |
|
245
|
245
|
|
|
246
|
|
-function bigbluebuttonbn_getRecordingArray( $recordingID, $meetingID, $URL, $SALT ) { |
|
|
246
|
+function bigbluebuttonbn_getRecordingArray($recordingID, $meetingID, $URL, $SALT) { |
|
247
|
247
|
$recordingArray = array(); |
|
248
|
248
|
|
|
249
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getRecordingsURL( $URL, $SALT, $meetingID ) ); |
|
|
249
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getRecordingsURL($URL, $SALT, $meetingID)); |
|
250
|
250
|
|
|
251
|
|
- if ( $xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings) ) { //If there were meetings already created |
|
|
251
|
+ if ($xml && $xml->returncode == 'SUCCESS' && isset($xml->recordings)) { //If there were meetings already created |
|
252
|
252
|
foreach ($xml->recordings->recording as $recording) { |
|
253
|
|
- if( $recording->recordID == $recordingID ) { |
|
|
253
|
+ if ($recording->recordID == $recordingID) { |
|
254
|
254
|
$recordingArray = bigbluebuttonbn_getRecordingArrayRow($recording); |
|
255
|
255
|
break; |
|
256
|
256
|
} |
|
@@ -260,64 +260,64 @@ discard block |
|
|
block discarded – undo |
|
260
|
260
|
return $recordingArray; |
|
261
|
261
|
} |
|
262
|
262
|
|
|
263
|
|
-function bigbluebuttonbn_getRecordingArrayRow( $recording ) { |
|
|
263
|
+function bigbluebuttonbn_getRecordingArrayRow($recording) { |
|
264
|
264
|
|
|
265
|
265
|
$playbackArray = array(); |
|
266
|
|
- foreach ( $recording->playback->format as $format ) { |
|
267
|
|
- $playbackArray[(string) $format->type] = array( 'type' => (string) $format->type, 'url' => (string) $format->url, 'length' => (string) $format->length ); |
|
|
266
|
+ foreach ($recording->playback->format as $format) { |
|
|
267
|
+ $playbackArray[(string)$format->type] = array('type' => (string)$format->type, 'url' => (string)$format->url, 'length' => (string)$format->length); |
|
268
|
268
|
} |
|
269
|
269
|
|
|
270
|
270
|
//Add the metadata to the recordings array |
|
271
|
271
|
$metadataArray = array(); |
|
272
|
272
|
$metadata = get_object_vars($recording->metadata); |
|
273
|
|
- foreach ( $metadata as $key => $value ) { |
|
274
|
|
- if ( is_object($value) ) { |
|
|
273
|
+ foreach ($metadata as $key => $value) { |
|
|
274
|
+ if (is_object($value)) { |
|
275
|
275
|
$value = ''; |
|
276
|
276
|
} |
|
277
|
|
- $metadataArray['meta_'.$key] = $value; |
|
|
277
|
+ $metadataArray['meta_' . $key] = $value; |
|
278
|
278
|
} |
|
279
|
279
|
|
|
280
|
|
- $recordingArrayRow = array( 'recordID' => (string) $recording->recordID, 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackArray ) + $metadataArray; |
|
|
280
|
+ $recordingArrayRow = array('recordID' => (string)$recording->recordID, 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackArray) + $metadataArray; |
|
281
|
281
|
|
|
282
|
282
|
return $recordingArrayRow; |
|
283
|
283
|
} |
|
284
|
284
|
|
|
285
|
|
-function bigbluebuttonbn_recordingBuildSorter($a, $b){ |
|
286
|
|
- if ( $a['startTime'] < $b['startTime'] ) { |
|
|
285
|
+function bigbluebuttonbn_recordingBuildSorter($a, $b) { |
|
|
286
|
+ if ($a['startTime'] < $b['startTime']) { |
|
287
|
287
|
return -1; |
|
288
|
|
- } else if ( $a['startTime'] == $b['startTime']) { |
|
|
288
|
+ } else if ($a['startTime'] == $b['startTime']) { |
|
289
|
289
|
return 0; |
|
290
|
290
|
} else { |
|
291
|
291
|
return 1; |
|
292
|
292
|
} |
|
293
|
293
|
} |
|
294
|
294
|
|
|
295
|
|
-function bigbluebuttonbn_doDeleteRecordings( $recordIDs, $URL, $SALT ) { |
|
296
|
|
- $ids = explode(",", $recordIDs); |
|
297
|
|
- foreach( $ids as $id){ |
|
298
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getDeleteRecordingsURL($id, $URL, $SALT) ); |
|
299
|
|
- if( $xml && $xml->returncode != 'SUCCESS' ) { |
|
|
295
|
+function bigbluebuttonbn_doDeleteRecordings($recordIDs, $URL, $SALT) { |
|
|
296
|
+ $ids = explode(",", $recordIDs); |
|
|
297
|
+ foreach ($ids as $id) { |
|
|
298
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getDeleteRecordingsURL($id, $URL, $SALT)); |
|
|
299
|
+ if ($xml && $xml->returncode != 'SUCCESS') { |
|
300
|
300
|
return false; |
|
301
|
301
|
} |
|
302
|
302
|
} |
|
303
|
303
|
return true; |
|
304
|
304
|
} |
|
305
|
305
|
|
|
306
|
|
-function bigbluebuttonbn_doPublishRecordings( $recordIDs, $set, $URL, $SALT ) { |
|
307
|
|
- $ids = explode(",", $recordIDs); |
|
308
|
|
- foreach( $ids as $id){ |
|
309
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getPublishRecordingsURL($id, $set, $URL, $SALT) ); |
|
310
|
|
- if( $xml && $xml->returncode != 'SUCCESS' ) { |
|
|
306
|
+function bigbluebuttonbn_doPublishRecordings($recordIDs, $set, $URL, $SALT) { |
|
|
307
|
+ $ids = explode(",", $recordIDs); |
|
|
308
|
+ foreach ($ids as $id) { |
|
|
309
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getPublishRecordingsURL($id, $set, $URL, $SALT)); |
|
|
310
|
+ if ($xml && $xml->returncode != 'SUCCESS') { |
|
311
|
311
|
return false; |
|
312
|
312
|
} |
|
313
|
313
|
} |
|
314
|
314
|
return true; |
|
315
|
315
|
} |
|
316
|
316
|
|
|
317
|
|
-function bigbluebuttonbn_doEndMeeting( $meetingID, $modPW, $URL, $SALT ) { |
|
318
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getEndMeetingURL( $meetingID, $modPW, $URL, $SALT ) ); |
|
|
317
|
+function bigbluebuttonbn_doEndMeeting($meetingID, $modPW, $URL, $SALT) { |
|
|
318
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID, $modPW, $URL, $SALT)); |
|
319
|
319
|
|
|
320
|
|
- if( $xml ) { //If the xml packet returned failure it displays the message to the user |
|
|
320
|
+ if ($xml) { //If the xml packet returned failure it displays the message to the user |
|
321
|
321
|
return array('returncode' => $xml->returncode, 'message' => $xml->message, 'messageKey' => $xml->messageKey); |
|
322
|
322
|
} |
|
323
|
323
|
else { //If the server is unreachable, then prompts the user of the necessary action |
|
@@ -325,46 +325,46 @@ discard block |
|
|
block discarded – undo |
|
325
|
325
|
} |
|
326
|
326
|
} |
|
327
|
327
|
|
|
328
|
|
-function bigbluebuttonbn_isMeetingRunning( $meetingID, $URL, $SALT ) { |
|
329
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) ); |
|
330
|
|
- if ( $xml && $xml->returncode == 'SUCCESS' ) { |
|
331
|
|
- return ( ( $xml->running == 'true' ) ? true : false); |
|
|
328
|
+function bigbluebuttonbn_isMeetingRunning($meetingID, $URL, $SALT) { |
|
|
329
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT)); |
|
|
330
|
+ if ($xml && $xml->returncode == 'SUCCESS') { |
|
|
331
|
+ return (($xml->running == 'true') ? true : false); |
|
332
|
332
|
} else { |
|
333
|
|
- return ( false ); |
|
|
333
|
+ return (false); |
|
334
|
334
|
} |
|
335
|
335
|
} |
|
336
|
336
|
|
|
337
|
337
|
|
|
338
|
|
-function bigbluebuttonbn_getServerVersion( $URL ){ |
|
339
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( $URL."api" ); |
|
340
|
|
- if ( $xml && $xml->returncode == 'SUCCESS' ) { |
|
|
338
|
+function bigbluebuttonbn_getServerVersion($URL) { |
|
|
339
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file($URL . "api"); |
|
|
340
|
+ if ($xml && $xml->returncode == 'SUCCESS') { |
|
341
|
341
|
return $xml->version; |
|
342
|
342
|
} else { |
|
343
|
343
|
return NULL; |
|
344
|
344
|
} |
|
345
|
345
|
} |
|
346
|
346
|
|
|
347
|
|
-function bigbluebuttonbn_getMeetingXML( $meetingID, $URL, $SALT ) { |
|
348
|
|
- $xml = bigbluebuttonbn_wrap_xml_load_file( bigbluebuttonbn_getIsMeetingRunningURL( $meetingID, $URL, $SALT ) ); |
|
349
|
|
- if ( $xml && $xml->returncode == 'SUCCESS') { |
|
350
|
|
- return ( str_replace('</response>', '', str_replace("<?xml version=\"1.0\"?>\n<response>", '', $xml->asXML()))); |
|
|
347
|
+function bigbluebuttonbn_getMeetingXML($meetingID, $URL, $SALT) { |
|
|
348
|
+ $xml = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT)); |
|
|
349
|
+ if ($xml && $xml->returncode == 'SUCCESS') { |
|
|
350
|
+ return (str_replace('</response>', '', str_replace("<?xml version=\"1.0\"?>\n<response>", '', $xml->asXML()))); |
|
351
|
351
|
} else { |
|
352
|
352
|
return 'false'; |
|
353
|
353
|
} |
|
354
|
354
|
} |
|
355
|
355
|
|
|
356
|
|
-function bigbluebuttonbn_wrap_xml_load_file($url, $method=BIGBLUEBUTTONBN_METHOD_GET, $data=null) { |
|
357
|
|
- if ( bigbluebuttonbn_debugdisplay() ) error_log("Request to: ".$url); |
|
|
356
|
+function bigbluebuttonbn_wrap_xml_load_file($url, $method = BIGBLUEBUTTONBN_METHOD_GET, $data = null) { |
|
|
357
|
+ if (bigbluebuttonbn_debugdisplay()) error_log("Request to: " . $url); |
|
358
|
358
|
|
|
359
|
359
|
if (extension_loaded('curl')) { |
|
360
|
360
|
$c = new curl(); |
|
361
|
|
- $c->setopt( Array( "SSL_VERIFYPEER" => true)); |
|
362
|
|
- if( $method == BIGBLUEBUTTONBN_METHOD_POST ) { |
|
363
|
|
- if( !is_null($data) ) { |
|
364
|
|
- if( !is_array($data) ) { |
|
|
361
|
+ $c->setopt(Array("SSL_VERIFYPEER" => true)); |
|
|
362
|
+ if ($method == BIGBLUEBUTTONBN_METHOD_POST) { |
|
|
363
|
+ if (!is_null($data)) { |
|
|
364
|
+ if (!is_array($data)) { |
|
365
|
365
|
$options['CURLOPT_HTTPHEADER'] = array( |
|
366
|
366
|
'Content-Type: text/xml', |
|
367
|
|
- 'Content-Length: '.strlen($data), |
|
|
367
|
+ 'Content-Length: ' . strlen($data), |
|
368
|
368
|
'Content-Language: en-US' |
|
369
|
369
|
); |
|
370
|
370
|
$response = $c->post($url, $data, $options); |
|
@@ -386,9 +386,9 @@ discard block |
|
|
block discarded – undo |
|
386
|
386
|
try { |
|
387
|
387
|
$xml = new SimpleXMLElement($response, LIBXML_NOCDATA); |
|
388
|
388
|
return $xml; |
|
389
|
|
- } catch (Exception $e){ |
|
|
389
|
+ } catch (Exception $e) { |
|
390
|
390
|
libxml_use_internal_errors($previous); |
|
391
|
|
- $error = 'Caught exception: '.$e->getMessage(); |
|
|
391
|
+ $error = 'Caught exception: ' . $e->getMessage(); |
|
392
|
392
|
error_log($error); |
|
393
|
393
|
return NULL; |
|
394
|
394
|
} |
|
@@ -400,18 +400,18 @@ discard block |
|
|
block discarded – undo |
|
400
|
400
|
} else { |
|
401
|
401
|
$previous = libxml_use_internal_errors(true); |
|
402
|
402
|
try { |
|
403
|
|
- $xml = simplexml_load_file($url,'SimpleXMLElement', LIBXML_NOCDATA); |
|
|
403
|
+ $xml = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA); |
|
404
|
404
|
return $xml; |
|
405
|
|
- } catch (Exception $e){ |
|
|
405
|
+ } catch (Exception $e) { |
|
406
|
406
|
libxml_use_internal_errors($previous); |
|
407
|
407
|
return NULL; |
|
408
|
408
|
} |
|
409
|
409
|
} |
|
410
|
410
|
} |
|
411
|
411
|
|
|
412
|
|
-function bigbluebuttonbn_get_role_name($role_shortname){ |
|
|
412
|
+function bigbluebuttonbn_get_role_name($role_shortname) { |
|
413
|
413
|
$role = bigbluebuttonbn_get_db_moodle_roles($role_shortname); |
|
414
|
|
- if( $role != null && $role->name != "") { |
|
|
414
|
+ if ($role != null && $role->name != "") { |
|
415
|
415
|
$role_name = $role->name; |
|
416
|
416
|
} else { |
|
417
|
417
|
switch ($role_shortname) { |
|
@@ -431,13 +431,13 @@ discard block |
|
|
block discarded – undo |
|
431
|
431
|
return $role_name; |
|
432
|
432
|
} |
|
433
|
433
|
|
|
434
|
|
-function bigbluebuttonbn_get_roles($rolename='all', $format='json'){ |
|
|
434
|
+function bigbluebuttonbn_get_roles($rolename = 'all', $format = 'json') { |
|
435
|
435
|
$roles = bigbluebuttonbn_get_db_moodle_roles($rolename); |
|
436
|
436
|
$roles_array = array(); |
|
437
|
|
- foreach($roles as $role){ |
|
438
|
|
- if( $format=='json' ) { |
|
|
437
|
+ foreach ($roles as $role) { |
|
|
438
|
+ if ($format == 'json') { |
|
439
|
439
|
array_push($roles_array, |
|
440
|
|
- array( "id" => $role->shortname, |
|
|
440
|
+ array("id" => $role->shortname, |
|
441
|
441
|
"name" => bigbluebuttonbn_get_role_name($role->shortname) |
|
442
|
442
|
) |
|
443
|
443
|
); |
|
@@ -448,19 +448,19 @@ discard block |
|
|
block discarded – undo |
|
448
|
448
|
return $roles_array; |
|
449
|
449
|
} |
|
450
|
450
|
|
|
451
|
|
-function bigbluebuttonbn_get_roles_json($rolename='all'){ |
|
|
451
|
+function bigbluebuttonbn_get_roles_json($rolename = 'all') { |
|
452
|
452
|
return json_encode(bigbluebuttonbn_get_roles($rolename)); |
|
453
|
453
|
} |
|
454
|
454
|
|
|
455
|
|
-function bigbluebuttonbn_get_users_json($users, $full=false) { |
|
456
|
|
- if( $full ) { |
|
|
455
|
+function bigbluebuttonbn_get_users_json($users, $full = false) { |
|
|
456
|
+ if ($full) { |
|
457
|
457
|
return json_encode($users); |
|
458
|
458
|
} else { |
|
459
|
459
|
$users_array = array(); |
|
460
|
|
- foreach($users as $user){ |
|
|
460
|
+ foreach ($users as $user) { |
|
461
|
461
|
array_push($users_array, |
|
462
|
|
- array( "id" => $user->id, |
|
463
|
|
- "name" => $user->firstname.' '.$user->lastname |
|
|
462
|
+ array("id" => $user->id, |
|
|
463
|
+ "name" => $user->firstname . ' ' . $user->lastname |
|
464
|
464
|
) |
|
465
|
465
|
); |
|
466
|
466
|
} |
|
@@ -468,15 +468,15 @@ discard block |
|
|
block discarded – undo |
|
468
|
468
|
} |
|
469
|
469
|
} |
|
470
|
470
|
|
|
471
|
|
-function bigbluebuttonbn_get_participant_list($bigbluebuttonbn=null, $context=null){ |
|
|
471
|
+function bigbluebuttonbn_get_participant_list($bigbluebuttonbn = null, $context = null) { |
|
472
|
472
|
global $CFG, $USER; |
|
473
|
473
|
|
|
474
|
474
|
$participant_list_array = array(); |
|
475
|
475
|
|
|
476
|
|
- if( $bigbluebuttonbn != null ) { |
|
|
476
|
+ if ($bigbluebuttonbn != null) { |
|
477
|
477
|
$participant_list = json_decode($bigbluebuttonbn->participants); |
|
478
|
478
|
if (is_array($participant_list)) { |
|
479
|
|
- foreach($participant_list as $participant){ |
|
|
479
|
+ foreach ($participant_list as $participant) { |
|
480
|
480
|
array_push($participant_list_array, |
|
481
|
481
|
array( |
|
482
|
482
|
"selectiontype" => $participant->selectiontype, |
|
@@ -496,16 +496,16 @@ discard block |
|
|
block discarded – undo |
|
496
|
496
|
); |
|
497
|
497
|
|
|
498
|
498
|
$moderator_defaults = bigbluebuttonbn_get_cfg_moderator_default(); |
|
499
|
|
- if ( !isset($moderator_defaults) ) { |
|
|
499
|
+ if (!isset($moderator_defaults)) { |
|
500
|
500
|
$moderator_defaults = array('owner'); |
|
501
|
501
|
} else { |
|
502
|
502
|
$moderator_defaults = explode(',', $moderator_defaults); |
|
503
|
503
|
} |
|
504
|
|
- foreach( $moderator_defaults as $moderator_default ) { |
|
505
|
|
- if( $moderator_default == 'owner' ) { |
|
|
504
|
+ foreach ($moderator_defaults as $moderator_default) { |
|
|
505
|
+ if ($moderator_default == 'owner') { |
|
506
|
506
|
$users = bigbluebuttonbn_get_users($context); |
|
507
|
|
- foreach( $users as $user ){ |
|
508
|
|
- if( $user->id == $USER->id ){ |
|
|
507
|
+ foreach ($users as $user) { |
|
|
508
|
+ if ($user->id == $USER->id) { |
|
509
|
509
|
array_push($participant_list_array, |
|
510
|
510
|
array( |
|
511
|
511
|
"selectiontype" => "user", |
|
@@ -531,7 +531,7 @@ discard block |
|
|
block discarded – undo |
|
531
|
531
|
return $participant_list_array; |
|
532
|
532
|
} |
|
533
|
533
|
|
|
534
|
|
-function bigbluebuttonbn_get_participant_list_json($bigbluebuttonbnid=null){ |
|
|
534
|
+function bigbluebuttonbn_get_participant_list_json($bigbluebuttonbnid = null) { |
|
535
|
535
|
return json_encode(bigbluebuttonbn_get_participant_list($bigbluebuttonbnid)); |
|
536
|
536
|
} |
|
537
|
537
|
|
|
@@ -540,9 +540,9 @@ discard block |
|
|
block discarded – undo |
|
540
|
540
|
|
|
541
|
541
|
if (is_array($participant_list)) { |
|
542
|
542
|
// Iterate looking for all configuration |
|
543
|
|
- foreach($participant_list as $participant){ |
|
544
|
|
- if( $participant->selectiontype == 'all' ) { |
|
545
|
|
- if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) { |
|
|
543
|
+ foreach ($participant_list as $participant) { |
|
|
544
|
+ if ($participant->selectiontype == 'all') { |
|
|
545
|
+ if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) { |
|
546
|
546
|
return true; |
|
547
|
547
|
} |
|
548
|
548
|
} |
|
@@ -550,12 +550,12 @@ discard block |
|
|
block discarded – undo |
|
550
|
550
|
|
|
551
|
551
|
//Iterate looking for roles |
|
552
|
552
|
$db_moodle_roles = bigbluebuttonbn_get_db_moodle_roles(); |
|
553
|
|
- foreach($participant_list as $participant){ |
|
554
|
|
- if( $participant->selectiontype == 'role' ) { |
|
555
|
|
- foreach( $roles as $role ) { |
|
|
553
|
+ foreach ($participant_list as $participant) { |
|
|
554
|
+ if ($participant->selectiontype == 'role') { |
|
|
555
|
+ foreach ($roles as $role) { |
|
556
|
556
|
$db_moodle_role = bigbluebuttonbn_moodle_db_role_lookup($db_moodle_roles, $role->roleid); |
|
557
|
|
- if( $participant->selectionid == $db_moodle_role->shortname ) { |
|
558
|
|
- if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) { |
|
|
557
|
+ if ($participant->selectionid == $db_moodle_role->shortname) { |
|
|
558
|
+ if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) { |
|
559
|
559
|
return true; |
|
560
|
560
|
} |
|
561
|
561
|
} |
|
@@ -564,10 +564,10 @@ discard block |
|
|
block discarded – undo |
|
564
|
564
|
} |
|
565
|
565
|
|
|
566
|
566
|
//Iterate looking for users |
|
567
|
|
- foreach($participant_list as $participant){ |
|
568
|
|
- if( $participant->selectiontype == 'user' ) { |
|
569
|
|
- if( $participant->selectionid == $user ) { |
|
570
|
|
- if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR ) { |
|
|
567
|
+ foreach ($participant_list as $participant) { |
|
|
568
|
+ if ($participant->selectiontype == 'user') { |
|
|
569
|
+ if ($participant->selectionid == $user) { |
|
|
570
|
+ if ($participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR) { |
|
571
|
571
|
return true; |
|
572
|
572
|
} |
|
573
|
573
|
} |
|
@@ -579,8 +579,8 @@ discard block |
|
|
block discarded – undo |
|
579
|
579
|
} |
|
580
|
580
|
|
|
581
|
581
|
function bigbluebuttonbn_moodle_db_role_lookup($db_moodle_roles, $role_id) { |
|
582
|
|
- foreach( $db_moodle_roles as $db_moodle_role ){ |
|
583
|
|
- if( $role_id == $db_moodle_role->id ) { |
|
|
582
|
+ foreach ($db_moodle_roles as $db_moodle_role) { |
|
|
583
|
+ if ($role_id == $db_moodle_role->id) { |
|
584
|
584
|
return $db_moodle_role; |
|
585
|
585
|
} |
|
586
|
586
|
} |
|
@@ -588,25 +588,25 @@ discard block |
|
|
block discarded – undo |
|
588
|
588
|
|
|
589
|
589
|
function bigbluebuttonbn_get_error_key($messageKey, $defaultKey = null) { |
|
590
|
590
|
$key = $defaultKey; |
|
591
|
|
- if ( $messageKey == "checksumError" ) { |
|
|
591
|
+ if ($messageKey == "checksumError") { |
|
592
|
592
|
$key = 'index_error_checksum'; |
|
593
|
|
- } else if ( $messageKey == 'maxConcurrent' ) { |
|
|
593
|
+ } else if ($messageKey == 'maxConcurrent') { |
|
594
|
594
|
$key = 'view_error_max_concurrent'; |
|
595
|
595
|
} |
|
596
|
596
|
return $key; |
|
597
|
597
|
} |
|
598
|
598
|
|
|
599
|
|
-function bigbluebuttonbn_voicebridge_unique($voicebridge, $id=null) { |
|
|
599
|
+function bigbluebuttonbn_voicebridge_unique($voicebridge, $id = null) { |
|
600
|
600
|
global $DB; |
|
601
|
601
|
|
|
602
|
602
|
$is_unique = true; |
|
603
|
|
- if ( $voicebridge != 0 ) { |
|
|
603
|
+ if ($voicebridge != 0) { |
|
604
|
604
|
$table = "bigbluebuttonbn"; |
|
605
|
|
- $select = "voicebridge = ".$voicebridge; |
|
606
|
|
- if ( $id ) { |
|
607
|
|
- $select .= " AND id <> ".$id; |
|
|
605
|
+ $select = "voicebridge = " . $voicebridge; |
|
|
606
|
+ if ($id) { |
|
|
607
|
+ $select .= " AND id <> " . $id; |
|
608
|
608
|
} |
|
609
|
|
- if ( $rooms = $DB->get_records_select($table, $select) ) { |
|
|
609
|
+ if ($rooms = $DB->get_records_select($table, $select)) { |
|
610
|
610
|
$is_unique = false; |
|
611
|
611
|
} |
|
612
|
612
|
} |
|
@@ -619,8 +619,8 @@ discard block |
|
|
block discarded – undo |
|
619
|
619
|
|
|
620
|
620
|
$duration = 0; |
|
621
|
621
|
$now = time(); |
|
622
|
|
- if ( $closingtime > 0 && $now < $closingtime ) { |
|
623
|
|
- $duration = ceil(($closingtime - $now)/60); |
|
|
622
|
+ if ($closingtime > 0 && $now < $closingtime) { |
|
|
623
|
+ $duration = ceil(($closingtime - $now) / 60); |
|
624
|
624
|
$compensation_time = intval(bigbluebuttonbn_get_cfg_scheduled_duration_compensation()); |
|
625
|
625
|
$duration = intval($duration) + $compensation_time; |
|
626
|
626
|
} |
|
@@ -628,13 +628,13 @@ discard block |
|
|
block discarded – undo |
|
628
|
628
|
return $duration; |
|
629
|
629
|
} |
|
630
|
630
|
|
|
631
|
|
-function bigbluebuttonbn_get_presentation_array($context, $presentation, $id=null) { |
|
|
631
|
+function bigbluebuttonbn_get_presentation_array($context, $presentation, $id = null) { |
|
632
|
632
|
$presentation_name = null; |
|
633
|
633
|
$presentation_url = null; |
|
634
|
634
|
$presentation_icon = null; |
|
635
|
635
|
$presentation_mimetype_description = null; |
|
636
|
636
|
|
|
637
|
|
- if ( !empty($presentation) ) { |
|
|
637
|
+ if (!empty($presentation)) { |
|
638
|
638
|
$fs = get_file_storage(); |
|
639
|
639
|
$files = $fs->get_area_files($context->id, 'mod_bigbluebuttonbn', 'presentation', 0, 'itemid, filepath, filename', false); |
|
640
|
640
|
if (count($files) < 1) { |
|
@@ -648,12 +648,12 @@ discard block |
|
|
block discarded – undo |
|
648
|
648
|
$presentation_icon = file_file_icon($file, 24); |
|
649
|
649
|
$presentation_mimetype_description = get_mimetype_description($file); |
|
650
|
650
|
|
|
651
|
|
- if( !is_null($id) ) { |
|
|
651
|
+ if (!is_null($id)) { |
|
652
|
652
|
//Create the nonce component for granting a temporary public access |
|
653
|
653
|
$cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'presentation_cache'); |
|
654
|
654
|
$presentation_nonce_key = sha1($id); |
|
655
|
655
|
$presentation_nonce_value = bigbluebuttonbn_generate_nonce(); |
|
656
|
|
- $cache->set($presentation_nonce_key, array( "value" => $presentation_nonce_value, "counter" => 0 )); |
|
|
656
|
+ $cache->set($presentation_nonce_key, array("value" => $presentation_nonce_value, "counter" => 0)); |
|
657
|
657
|
|
|
658
|
658
|
//The item id was adapted for granting public access to the presentation once in order to allow BigBlueButton to gather the file |
|
659
|
659
|
$url = moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(), $file->get_filearea(), $presentation_nonce_value, $file->get_filepath(), $file->get_filename()); |
|
@@ -664,7 +664,7 @@ discard block |
|
|
block discarded – undo |
|
664
|
664
|
} |
|
665
|
665
|
} |
|
666
|
666
|
|
|
667
|
|
- $presentation_array = array( "url" => $presentation_url, "name" => $presentation_name, "icon" => $presentation_icon, "mimetype_description" => $presentation_mimetype_description); |
|
|
667
|
+ $presentation_array = array("url" => $presentation_url, "name" => $presentation_name, "icon" => $presentation_icon, "mimetype_description" => $presentation_mimetype_description); |
|
668
|
668
|
|
|
669
|
669
|
return $presentation_array; |
|
670
|
670
|
} |
|
@@ -674,13 +674,13 @@ discard block |
|
|
block discarded – undo |
|
674
|
674
|
$mt = microtime(); |
|
675
|
675
|
$rand = mt_rand(); |
|
676
|
676
|
|
|
677
|
|
- return md5($mt.$rand); |
|
|
677
|
+ return md5($mt . $rand); |
|
678
|
678
|
} |
|
679
|
679
|
|
|
680
|
|
-function bigbluebuttonbn_random_password( $length = 8 ) { |
|
|
680
|
+function bigbluebuttonbn_random_password($length = 8) { |
|
681
|
681
|
|
|
682
|
682
|
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; |
|
683
|
|
- $password = substr( str_shuffle( $chars ), 0, $length ); |
|
|
683
|
+ $password = substr(str_shuffle($chars), 0, $length); |
|
684
|
684
|
|
|
685
|
685
|
return $password; |
|
686
|
686
|
} |
|
@@ -772,7 +772,7 @@ discard block |
|
|
block discarded – undo |
|
772
|
772
|
global $CFG; |
|
773
|
773
|
|
|
774
|
774
|
$version_major = bigbluebuttonbn_get_moodle_version_major(); |
|
775
|
|
- if ( $version_major < '2014051200' ) { |
|
|
775
|
+ if ($version_major < '2014051200') { |
|
776
|
776
|
//This is valid before v2.7 |
|
777
|
777
|
bigbluebuttonbn_event_log_legacy($event_type, $bigbluebuttonbn, $context, $cm); |
|
778
|
778
|
|
|
@@ -782,7 +782,7 @@ discard block |
|
|
block discarded – undo |
|
782
|
782
|
} |
|
783
|
783
|
} |
|
784
|
784
|
|
|
785
|
|
-function bigbluebuttonbn_bbb_broker_get_recordings($meetingid, $password, $forced=false) { |
|
|
785
|
+function bigbluebuttonbn_bbb_broker_get_recordings($meetingid, $password, $forced = false) { |
|
786
|
786
|
global $CFG; |
|
787
|
787
|
|
|
788
|
788
|
$recordings = array(); |
|
@@ -798,19 +798,19 @@ discard block |
|
|
block discarded – undo |
|
798
|
798
|
$result = $cache->get($meetingid); |
|
799
|
799
|
$meeting_info = json_decode($result['meeting_info']); |
|
800
|
800
|
$meeting_info->participantCount += 1; |
|
801
|
|
- if( $is_moderator ) { |
|
|
801
|
+ if ($is_moderator) { |
|
802
|
802
|
$meeting_info->moderatorCount += 1; |
|
803
|
803
|
} |
|
804
|
|
- $cache->set($meetingid, array('creation_time' => $result['creation_time'], 'meeting_info' => json_encode($meeting_info) )); |
|
|
804
|
+ $cache->set($meetingid, array('creation_time' => $result['creation_time'], 'meeting_info' => json_encode($meeting_info))); |
|
805
|
805
|
} |
|
806
|
806
|
|
|
807
|
807
|
function bigbluebuttonbn_bbb_broker_is_meeting_running($meeting_info) { |
|
808
|
|
- $meeting_running = ( isset($meeting_info) && isset($meeting_info->returncode) && $meeting_info->returncode == 'SUCCESS' ); |
|
|
808
|
+ $meeting_running = (isset($meeting_info) && isset($meeting_info->returncode) && $meeting_info->returncode == 'SUCCESS'); |
|
809
|
809
|
|
|
810
|
810
|
return $meeting_running; |
|
811
|
811
|
} |
|
812
|
812
|
|
|
813
|
|
-function bigbluebuttonbn_bbb_broker_get_meeting_info($meetingid, $password, $forced=false) { |
|
|
813
|
+function bigbluebuttonbn_bbb_broker_get_meeting_info($meetingid, $password, $forced = false) { |
|
814
|
814
|
global $CFG; |
|
815
|
815
|
|
|
816
|
816
|
$meeting_info = array(); |
|
@@ -821,19 +821,19 @@ discard block |
|
|
block discarded – undo |
|
821
|
821
|
$cache = cache::make_from_params(cache_store::MODE_APPLICATION, 'mod_bigbluebuttonbn', 'meetings_cache'); |
|
822
|
822
|
$result = $cache->get($meetingid); |
|
823
|
823
|
$now = time(); |
|
824
|
|
- if( isset($result) && $now < ($result['creation_time'] + $cache_ttl) && !$forced ) { |
|
|
824
|
+ if (isset($result) && $now < ($result['creation_time'] + $cache_ttl) && !$forced) { |
|
825
|
825
|
//Use the value in the cache |
|
826
|
826
|
$meeting_info = json_decode($result['meeting_info']); |
|
827
|
827
|
} else { |
|
828
|
828
|
//Ping again and refresh the cache |
|
829
|
|
- $meeting_info = (array) bigbluebuttonbn_getMeetingInfo( $meetingid, $password, $endpoint, $shared_secret ); |
|
830
|
|
- $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meeting_info) )); |
|
|
829
|
+ $meeting_info = (array)bigbluebuttonbn_getMeetingInfo($meetingid, $password, $endpoint, $shared_secret); |
|
|
830
|
+ $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meeting_info))); |
|
831
|
831
|
} |
|
832
|
832
|
|
|
833
|
833
|
return $meeting_info; |
|
834
|
834
|
} |
|
835
|
835
|
|
|
836
|
|
-function bigbluebuttonbn_bbb_broker_do_end_meeting($meetingid, $password){ |
|
|
836
|
+function bigbluebuttonbn_bbb_broker_do_end_meeting($meetingid, $password) { |
|
837
|
837
|
global $CFG; |
|
838
|
838
|
|
|
839
|
839
|
$endpoint = bigbluebuttonbn_get_cfg_server_url(); |
|
@@ -842,16 +842,16 @@ discard block |
|
|
block discarded – undo |
|
842
|
842
|
bigbluebuttonbn_doEndMeeting($meetingid, $password, $endpoint, $shared_secret); |
|
843
|
843
|
} |
|
844
|
844
|
|
|
845
|
|
-function bigbluebuttonbn_bbb_broker_do_publish_recording($recordingid, $publish=true){ |
|
|
845
|
+function bigbluebuttonbn_bbb_broker_do_publish_recording($recordingid, $publish = true) { |
|
846
|
846
|
global $CFG; |
|
847
|
847
|
|
|
848
|
848
|
$endpoint = bigbluebuttonbn_get_cfg_server_url(); |
|
849
|
849
|
$shared_secret = bigbluebuttonbn_get_cfg_shared_secret(); |
|
850
|
850
|
|
|
851
|
|
- bigbluebuttonbn_doPublishRecordings($recordingid, ($publish)? 'true': 'false', $endpoint, $shared_secret); |
|
|
851
|
+ bigbluebuttonbn_doPublishRecordings($recordingid, ($publish) ? 'true' : 'false', $endpoint, $shared_secret); |
|
852
|
852
|
} |
|
853
|
853
|
|
|
854
|
|
-function bigbluebuttonbn_bbb_broker_do_publish_recording_imported($recordingid, $courseID, $bigbluebuttonbnID, $publish=true){ |
|
|
854
|
+function bigbluebuttonbn_bbb_broker_do_publish_recording_imported($recordingid, $courseID, $bigbluebuttonbnID, $publish = true) { |
|
855
|
855
|
global $DB; |
|
856
|
856
|
|
|
857
|
857
|
//Locate the record to be updated |
|
@@ -860,9 +860,9 @@ discard block |
|
|
block discarded – undo |
|
860
|
860
|
$recordings_imported = array(); |
|
861
|
861
|
foreach ($records as $key => $record) { |
|
862
|
862
|
$meta = json_decode($record->meta, true); |
|
863
|
|
- if( $recordingid == $meta['recording']['recordID'] ) { |
|
|
863
|
+ if ($recordingid == $meta['recording']['recordID']) { |
|
864
|
864
|
// Found, prepare data for the update |
|
865
|
|
- $meta['recording']['published'] = ($publish)? 'true': 'false'; |
|
|
865
|
+ $meta['recording']['published'] = ($publish) ? 'true' : 'false'; |
|
866
|
866
|
$records[$key]->meta = json_encode($meta); |
|
867
|
867
|
|
|
868
|
868
|
// Proceed with the update |
|
@@ -871,7 +871,7 @@ discard block |
|
|
block discarded – undo |
|
871
|
871
|
} |
|
872
|
872
|
} |
|
873
|
873
|
|
|
874
|
|
-function bigbluebuttonbn_bbb_broker_do_delete_recording($recordingid){ |
|
|
874
|
+function bigbluebuttonbn_bbb_broker_do_delete_recording($recordingid) { |
|
875
|
875
|
global $CFG; |
|
876
|
876
|
|
|
877
|
877
|
$endpoint = bigbluebuttonbn_get_cfg_server_url(); |
|
@@ -880,7 +880,7 @@ discard block |
|
|
block discarded – undo |
|
880
|
880
|
bigbluebuttonbn_doDeleteRecordings($recordingid, $endpoint, $shared_secret); |
|
881
|
881
|
} |
|
882
|
882
|
|
|
883
|
|
-function bigbluebuttonbn_bbb_broker_do_delete_recording_imported($recordingid, $courseID, $bigbluebuttonbnID){ |
|
|
883
|
+function bigbluebuttonbn_bbb_broker_do_delete_recording_imported($recordingid, $courseID, $bigbluebuttonbnID) { |
|
884
|
884
|
global $DB; |
|
885
|
885
|
|
|
886
|
886
|
//Locate the record to be updated |
|
@@ -889,7 +889,7 @@ discard block |
|
|
block discarded – undo |
|
889
|
889
|
$recordings_imported = array(); |
|
890
|
890
|
foreach ($records as $key => $record) { |
|
891
|
891
|
$meta = json_decode($record->meta, true); |
|
892
|
|
- if( $recordingid == $meta['recording']['recordID'] ) { |
|
|
892
|
+ if ($recordingid == $meta['recording']['recordID']) { |
|
893
|
893
|
// Execute delete |
|
894
|
894
|
$DB->delete_records("bigbluebuttonbn_logs", array('id' => $key)); |
|
895
|
895
|
} |
|
@@ -899,18 +899,18 @@ discard block |
|
|
block discarded – undo |
|
899
|
899
|
function bigbluebuttonbn_bbb_broker_validate_parameters($params) { |
|
900
|
900
|
$error = ''; |
|
901
|
901
|
|
|
902
|
|
- if ( !isset($params['callback']) ) { |
|
|
902
|
+ if (!isset($params['callback'])) { |
|
903
|
903
|
$error = bigbluebuttonbn_bbb_broker_add_error($error, 'This call must include a javascript callback.'); |
|
904
|
904
|
} |
|
905
|
905
|
|
|
906
|
|
- if ( !isset($params['action']) ) { |
|
|
906
|
+ if (!isset($params['action'])) { |
|
907
|
907
|
$error = bigbluebuttonbn_bbb_broker_add_error($error, 'Action parameter must be included.'); |
|
908
|
908
|
} else { |
|
909
|
|
- switch ( strtolower($params['action']) ){ |
|
|
909
|
+ switch (strtolower($params['action'])) { |
|
910
|
910
|
case 'server_ping': |
|
911
|
911
|
case 'meeting_info': |
|
912
|
912
|
case 'meeting_end': |
|
913
|
|
- if ( !isset($params['id']) ) { |
|
|
913
|
+ if (!isset($params['id'])) { |
|
914
|
914
|
$error = bigbluebuttonbn_bbb_broker_add_error($error, 'The meetingID must be specified.'); |
|
915
|
915
|
} |
|
916
|
916
|
break; |
|
@@ -920,76 +920,76 @@ discard block |
|
|
block discarded – undo |
|
920
|
920
|
case 'recording_unpublish': |
|
921
|
921
|
case 'recording_delete': |
|
922
|
922
|
case 'recording_import': |
|
923
|
|
- if ( !isset($params['id']) ) { |
|
|
923
|
+ if (!isset($params['id'])) { |
|
924
|
924
|
$error = bigbluebuttonbn_bbb_broker_add_error($error, 'The recordingID must be specified.'); |
|
925
|
925
|
} |
|
926
|
926
|
break; |
|
927
|
927
|
case 'recording_ready': |
|
928
|
|
- if( empty($params['signed_parameters']) ) { |
|
|
928
|
+ if (empty($params['signed_parameters'])) { |
|
929
|
929
|
$error = bigbluebuttonbn_bbb_broker_add_error($error, 'A JWT encoded string must be included as [signed_parameters].'); |
|
930
|
930
|
} |
|
931
|
931
|
break; |
|
932
|
932
|
default: |
|
933
|
|
- $error = bigbluebuttonbn_bbb_broker_add_error($error, 'Action '.$params['action'].' can not be performed.'); |
|
|
933
|
+ $error = bigbluebuttonbn_bbb_broker_add_error($error, 'Action ' . $params['action'] . ' can not be performed.'); |
|
934
|
934
|
} |
|
935
|
935
|
} |
|
936
|
936
|
|
|
937
|
937
|
return $error; |
|
938
|
938
|
} |
|
939
|
939
|
|
|
940
|
|
-function bigbluebuttonbn_bbb_broker_add_error($org_msg, $new_msg='') { |
|
|
940
|
+function bigbluebuttonbn_bbb_broker_add_error($org_msg, $new_msg = '') { |
|
941
|
941
|
$error = $org_msg; |
|
942
|
942
|
|
|
943
|
|
- if( !empty($new_msg) ) { |
|
944
|
|
- if( !empty($error) ) $error .= ' '; |
|
|
943
|
+ if (!empty($new_msg)) { |
|
|
944
|
+ if (!empty($error)) $error .= ' '; |
|
945
|
945
|
$error .= $new_msg; |
|
946
|
946
|
} |
|
947
|
947
|
|
|
948
|
948
|
return $error; |
|
949
|
949
|
} |
|
950
|
950
|
|
|
951
|
|
-function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools=["publishing", "deleting"]) { |
|
|
951
|
+function bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools = ["publishing", "deleting"]) { |
|
952
|
952
|
global $OUTPUT, $CFG, $USER; |
|
953
|
953
|
|
|
954
|
954
|
$row = null; |
|
955
|
955
|
|
|
956
|
|
- if ( $bbbsession['managerecordings'] || $recording['published'] == 'true' ) { |
|
957
|
|
- $startTime = isset($recording['startTime'])? floatval($recording['startTime']):0; |
|
|
956
|
+ if ($bbbsession['managerecordings'] || $recording['published'] == 'true') { |
|
|
957
|
+ $startTime = isset($recording['startTime']) ? floatval($recording['startTime']) : 0; |
|
958
|
958
|
$startTime = $startTime - ($startTime % 1000); |
|
959
|
959
|
$duration = intval(array_values($recording['playbacks'])[0]['length']); |
|
960
|
960
|
|
|
961
|
961
|
//For backward compatibility |
|
962
|
|
- if( isset($recording['meta_contextactivity']) ) { |
|
|
962
|
+ if (isset($recording['meta_contextactivity'])) { |
|
963
|
963
|
$meta_activity = str_replace('"', '\"', $recording['meta_contextactivity']); |
|
964
|
|
- } if( isset($recording['meta_bbb-recording-name']) ) { |
|
|
964
|
+ } if (isset($recording['meta_bbb-recording-name'])) { |
|
965
|
965
|
$meta_activity = str_replace('"', '\"', $recording['meta_bbb-recording-name']); |
|
966
|
966
|
} else { |
|
967
|
967
|
$meta_activity = str_replace('"', '\"', $recording['meetingName']); |
|
968
|
968
|
} |
|
969
|
969
|
|
|
970
|
|
- if( isset($recording['meta_contextactivitydescription']) ) { |
|
|
970
|
+ if (isset($recording['meta_contextactivitydescription'])) { |
|
971
|
971
|
$meta_description = str_replace('"', '\"', $recording['meta_contextactivitydescription']); |
|
972
|
|
- } else if( isset($recording['meta_bbb-recording-description']) ) { |
|
|
972
|
+ } else if (isset($recording['meta_bbb-recording-description'])) { |
|
973
|
973
|
$meta_description = str_replace('"', '\"', $recording['meta_bbb-recording-description']); |
|
974
|
974
|
} else { |
|
975
|
975
|
$meta_description = ''; |
|
976
|
976
|
} |
|
977
|
977
|
|
|
978
|
978
|
//Set recording_types |
|
979
|
|
- if ( isset($recording['imported']) ) { |
|
980
|
|
- $attributes = 'data-imported="true" title='.get_string('view_recording_link_warning', 'bigbluebuttonbn'); |
|
|
979
|
+ if (isset($recording['imported'])) { |
|
|
980
|
+ $attributes = 'data-imported="true" title=' . get_string('view_recording_link_warning', 'bigbluebuttonbn'); |
|
981
|
981
|
} else { |
|
982
|
982
|
$attributes = 'data-imported="false"'; |
|
983
|
983
|
} |
|
984
|
984
|
|
|
985
|
985
|
$recording_types = ''; |
|
986
|
986
|
if ($recording['published'] == 'true') { |
|
987
|
|
- $recording_types .= '<div id="playbacks-'.$recording['recordID'].'" '.$attributes.'>'; |
|
|
987
|
+ $recording_types .= '<div id="playbacks-' . $recording['recordID'] . '" ' . $attributes . '>'; |
|
988
|
988
|
} else { |
|
989
|
|
- $recording_types .= '<div id="playbacks-'.$recording['recordID'].'" '.$attributes.'" hidden>'; |
|
|
989
|
+ $recording_types .= '<div id="playbacks-' . $recording['recordID'] . '" ' . $attributes . '" hidden>'; |
|
990
|
990
|
} |
|
991
|
|
- foreach ( $recording['playbacks'] as $playback ) { |
|
992
|
|
- $recording_types .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'), 'target' => '_new') ).' '; |
|
|
991
|
+ foreach ($recording['playbacks'] as $playback) { |
|
|
992
|
+ $recording_types .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'), 'target' => '_new')) . ' '; |
|
993
|
993
|
} |
|
994
|
994
|
$recording_types .= '</div>'; |
|
995
|
995
|
|
|
@@ -998,11 +998,11 @@ discard block |
|
|
block discarded – undo |
|
998
|
998
|
|
|
999
|
999
|
//Set actionbar, if user is allowed to manage recordings |
|
1000
|
1000
|
$actionbar = ''; |
|
1001
|
|
- if ( $bbbsession['managerecordings'] ) { |
|
|
1001
|
+ if ($bbbsession['managerecordings']) { |
|
1002
|
1002
|
// Set style for imported links |
|
1003
|
|
- if( isset($recording['imported']) ) { |
|
|
1003
|
+ if (isset($recording['imported'])) { |
|
1004
|
1004
|
$recordings_imported_count = 0; |
|
1005
|
|
- $tag_tail = ' '.get_string('view_recording_link', 'bigbluebuttonbn'); |
|
|
1005
|
+ $tag_tail = ' ' . get_string('view_recording_link', 'bigbluebuttonbn'); |
|
1006
|
1006
|
$head = '<i>'; |
|
1007
|
1007
|
$tail = '</i>'; |
|
1008
|
1008
|
} else { |
|
@@ -1016,53 +1016,53 @@ discard block |
|
|
block discarded – undo |
|
1016
|
1016
|
|
|
1017
|
1017
|
if (in_array("publishing", $tools)) { |
|
1018
|
1018
|
///Set action [show|hide] |
|
1019
|
|
- if ( $recording['published'] == 'true' ){ |
|
|
1019
|
+ if ($recording['published'] == 'true') { |
|
1020
|
1020
|
$manage_tag = 'hide'; |
|
1021
|
1021
|
$manage_action = 'unpublish'; |
|
1022
|
1022
|
} else { |
|
1023
|
1023
|
$manage_tag = 'show'; |
|
1024
|
1024
|
$manage_action = 'publish'; |
|
1025
|
1025
|
} |
|
1026
|
|
- $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("'.$manage_action.'", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
|
1026
|
+ $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("' . $manage_action . '", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
1027
|
1027
|
|
|
1028
|
|
- if ( bigbluebuttonbn_get_cfg_recording_icons_enabled() ) { |
|
|
1028
|
+ if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
1029
|
1029
|
//With icon for publish/unpublish |
|
1030
|
|
- $icon_attributes = array('id' => 'recording-btn-'.$manage_action.'-'.$recording['recordID']); |
|
1031
|
|
- $icon = new pix_icon('t/'.$manage_tag, get_string($manage_tag).$tag_tail, 'moodle', $icon_attributes); |
|
1032
|
|
- $link_attributes = array('id' => 'recording-link-'.$manage_action.'-'.$recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
|
1030
|
+ $icon_attributes = array('id' => 'recording-btn-' . $manage_action . '-' . $recording['recordID']); |
|
|
1031
|
+ $icon = new pix_icon('t/' . $manage_tag, get_string($manage_tag) . $tag_tail, 'moodle', $icon_attributes); |
|
|
1032
|
+ $link_attributes = array('id' => 'recording-link-' . $manage_action . '-' . $recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
1033
|
1033
|
$actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
|
1034
|
1034
|
} else { |
|
1035
|
1035
|
//With text for publish/unpublish |
|
1036
|
|
- $link_attributes = array('title' => get_string($manage_tag).$tag_tail, 'class' => 'btn btn-xs', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
1037
|
|
- $actionbar .= $OUTPUT->action_link($url, get_string($manage_tag).$tag_tail, $action, $link_attributes); |
|
|
1036
|
+ $link_attributes = array('title' => get_string($manage_tag) . $tag_tail, 'class' => 'btn btn-xs', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
|
1037
|
+ $actionbar .= $OUTPUT->action_link($url, get_string($manage_tag) . $tag_tail, $action, $link_attributes); |
|
1038
|
1038
|
$actionbar .= " "; |
|
1039
|
1039
|
} |
|
1040
|
1040
|
} |
|
1041
|
1041
|
|
|
1042
|
1042
|
if (in_array("deleting", $tools)) { |
|
1043
|
|
- $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("delete", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
|
1043
|
+ $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("delete", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
1044
|
1044
|
|
|
1045
|
|
- if ( bigbluebuttonbn_get_cfg_recording_icons_enabled() ) { |
|
|
1045
|
+ if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
1046
|
1046
|
//With icon for delete |
|
1047
|
|
- $icon_attributes = array('id' => 'recording-btn-delete-'.$recording['recordID']); |
|
1048
|
|
- $icon = new pix_icon('t/delete', get_string('delete').$tag_tail, 'moodle', $icon_attributes); |
|
1049
|
|
- $link_attributes = array('id' => 'recording-link-delete-'.$recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
|
1047
|
+ $icon_attributes = array('id' => 'recording-btn-delete-' . $recording['recordID']); |
|
|
1048
|
+ $icon = new pix_icon('t/delete', get_string('delete') . $tag_tail, 'moodle', $icon_attributes); |
|
|
1049
|
+ $link_attributes = array('id' => 'recording-link-delete-' . $recording['recordID'], 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
1050
|
1050
|
$actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
|
1051
|
1051
|
} else { |
|
1052
|
1052
|
//With text for delete |
|
1053
|
|
- $link_attributes = array('title' => get_string('delete').$tag_tail, 'class' => 'btn btn-xs btn-danger', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
1054
|
|
- $actionbar .= $OUTPUT->action_link($url, get_string('delete').$tag_tail, $action, $link_attributes); |
|
|
1053
|
+ $link_attributes = array('title' => get_string('delete') . $tag_tail, 'class' => 'btn btn-xs btn-danger', 'onclick' => $onclick, 'data-links' => $recordings_imported_count); |
|
|
1054
|
+ $actionbar .= $OUTPUT->action_link($url, get_string('delete') . $tag_tail, $action, $link_attributes); |
|
1055
|
1055
|
} |
|
1056
|
1056
|
} |
|
1057
|
1057
|
|
|
1058
|
1058
|
if (in_array("importing", $tools)) { |
|
1059
|
|
- $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("import", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");'; |
|
|
1059
|
+ $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("import", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");'; |
|
1060
|
1060
|
|
|
1061
|
|
- if ( bigbluebuttonbn_get_cfg_recording_icons_enabled() ) { |
|
|
1061
|
+ if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) { |
|
1062
|
1062
|
//With icon for import |
|
1063
|
|
- $icon_attributes = array('id' => 'recording-btn-import-'.$recording['recordID']); |
|
|
1063
|
+ $icon_attributes = array('id' => 'recording-btn-import-' . $recording['recordID']); |
|
1064
|
1064
|
$icon = new pix_icon('i/import', get_string('import'), 'moodle', $icon_attributes); |
|
1065
|
|
- $link_attributes = array('id' => 'recording-link-import-'.$recording['recordID'], 'onclick' => $onclick); |
|
|
1065
|
+ $link_attributes = array('id' => 'recording-link-import-' . $recording['recordID'], 'onclick' => $onclick); |
|
1066
|
1066
|
$actionbar .= $OUTPUT->action_icon($url, $icon, $action, $link_attributes, false); |
|
1067
|
1067
|
} else { |
|
1068
|
1068
|
//With text for import |
|
@@ -1073,7 +1073,7 @@ discard block |
|
|
block discarded – undo |
|
1073
|
1073
|
} |
|
1074
|
1074
|
|
|
1075
|
1075
|
//Set corresponding format |
|
1076
|
|
- $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z'; |
|
|
1076
|
+ $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z'; |
|
1077
|
1077
|
$formattedStartDate = userdate($startTime / 1000, $dateformat, usertimezone($USER->timezone)); |
|
1078
|
1078
|
|
|
1079
|
1079
|
$row = new stdClass(); |
|
@@ -1084,7 +1084,7 @@ discard block |
|
|
block discarded – undo |
|
1084
|
1084
|
$row->date_formatted = "{$head}{$formattedStartDate}{$tail}"; |
|
1085
|
1085
|
$row->duration = "{$duration}"; |
|
1086
|
1086
|
$row->duration_formatted = "{$head}{$duration}{$tail}"; |
|
1087
|
|
- if ( $bbbsession['managerecordings'] ) { |
|
|
1087
|
+ if ($bbbsession['managerecordings']) { |
|
1088
|
1088
|
$row->actionbar = $actionbar; |
|
1089
|
1089
|
} |
|
1090
|
1090
|
} |
|
@@ -1110,21 +1110,21 @@ discard block |
|
|
block discarded – undo |
|
1110
|
1110
|
array("key" =>"duration", "label" => $view_recording_duration, "width" => "50px") |
|
1111
|
1111
|
); |
|
1112
|
1112
|
|
|
1113
|
|
- if ( $bbbsession['managerecordings'] ) { |
|
|
1113
|
+ if ($bbbsession['managerecordings']) { |
|
1114
|
1114
|
array_push($recordingsbn_columns, array("key" =>"actionbar", "label" => $view_recording_actionbar, "width" => "75px", "allowHTML" => true)); |
|
1115
|
1115
|
} |
|
1116
|
1116
|
|
|
1117
|
1117
|
return $recordingsbn_columns; |
|
1118
|
1118
|
} |
|
1119
|
1119
|
|
|
1120
|
|
-function bigbluebuttonbn_get_recording_data($bbbsession, $recordings, $tools=["publishing", "deleting"]) { |
|
|
1120
|
+function bigbluebuttonbn_get_recording_data($bbbsession, $recordings, $tools = ["publishing", "deleting"]) { |
|
1121
|
1121
|
$table_data = array(); |
|
1122
|
1122
|
|
|
1123
|
1123
|
///Build table content |
|
1124
|
|
- if ( isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
1125
|
|
- foreach ( $recordings as $recording ) { |
|
|
1124
|
+ if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
|
1125
|
+ foreach ($recordings as $recording) { |
|
1126
|
1126
|
$row = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools); |
|
1127
|
|
- if( $row != null ) { |
|
|
1127
|
+ if ($row != null) { |
|
1128
|
1128
|
array_push($table_data, $row); |
|
1129
|
1129
|
} |
|
1130
|
1130
|
} |
|
@@ -1133,7 +1133,7 @@ discard block |
|
|
block discarded – undo |
|
1133
|
1133
|
return $table_data; |
|
1134
|
1134
|
} |
|
1135
|
1135
|
|
|
1136
|
|
-function bigbluebuttonbn_get_recording_table($bbbsession, $recordings, $tools=['publishing','deleting']) { |
|
|
1136
|
+function bigbluebuttonbn_get_recording_table($bbbsession, $recordings, $tools = ['publishing', 'deleting']) { |
|
1137
|
1137
|
global $OUTPUT, $CFG; |
|
1138
|
1138
|
|
|
1139
|
1139
|
///Set strings to show |
|
@@ -1152,20 +1152,20 @@ discard block |
|
|
block discarded – undo |
|
1152
|
1152
|
$table->data = array(); |
|
1153
|
1153
|
|
|
1154
|
1154
|
///Initialize table headers |
|
1155
|
|
- if ( $bbbsession['managerecordings'] ) { |
|
1156
|
|
- $table->head = array ($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration, $view_recording_actionbar); |
|
1157
|
|
- $table->align = array ('left', 'left', 'left', 'left', 'center', 'left'); |
|
|
1155
|
+ if ($bbbsession['managerecordings']) { |
|
|
1156
|
+ $table->head = array($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration, $view_recording_actionbar); |
|
|
1157
|
+ $table->align = array('left', 'left', 'left', 'left', 'center', 'left'); |
|
1158
|
1158
|
} else { |
|
1159
|
|
- $table->head = array ($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration); |
|
1160
|
|
- $table->align = array ('left', 'left', 'left', 'left', 'center'); |
|
|
1159
|
+ $table->head = array($view_recording_recording, $view_recording_activity, $view_recording_description, $view_recording_date, $view_recording_duration); |
|
|
1160
|
+ $table->align = array('left', 'left', 'left', 'left', 'center'); |
|
1161
|
1161
|
} |
|
1162
|
1162
|
|
|
1163
|
1163
|
///Build table content |
|
1164
|
|
- if ( isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
1165
|
|
- foreach ( $recordings as $recording ){ |
|
|
1164
|
+ if (isset($recordings) && !array_key_exists('messageKey', $recordings)) { // There are recordings for this meeting |
|
|
1165
|
+ foreach ($recordings as $recording) { |
|
1166
|
1166
|
$row = new html_table_row(); |
|
1167
|
|
- $row->id = 'recording-td-'.$recording['recordID']; |
|
1168
|
|
- if ( isset($recording['imported']) ) { |
|
|
1167
|
+ $row->id = 'recording-td-' . $recording['recordID']; |
|
|
1168
|
+ if (isset($recording['imported'])) { |
|
1169
|
1169
|
$row->attributes['data-imported'] = 'true'; |
|
1170
|
1170
|
$row->attributes['title'] = get_string('view_recording_link_warning', 'bigbluebuttonbn'); |
|
1171
|
1171
|
} else { |
|
@@ -1173,12 +1173,12 @@ discard block |
|
|
block discarded – undo |
|
1173
|
1173
|
} |
|
1174
|
1174
|
|
|
1175
|
1175
|
$row_data = bigbluebuttonbn_get_recording_data_row($bbbsession, $recording, $tools); |
|
1176
|
|
- if( $row_data != null ) { |
|
|
1176
|
+ if ($row_data != null) { |
|
1177
|
1177
|
$row_data->date_formatted = str_replace(" ", " ", $row_data->date_formatted); |
|
1178
|
|
- if ( $bbbsession['managerecordings'] ) { |
|
1179
|
|
- $row->cells = array ($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted, $row_data->actionbar ); |
|
|
1178
|
+ if ($bbbsession['managerecordings']) { |
|
|
1179
|
+ $row->cells = array($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted, $row_data->actionbar); |
|
1180
|
1180
|
} else { |
|
1181
|
|
- $row->cells = array ($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted ); |
|
|
1181
|
+ $row->cells = array($row_data->recording, $row_data->activity, $row_data->description, $row_data->date_formatted, $row_data->duration_formatted); |
|
1182
|
1182
|
} |
|
1183
|
1183
|
|
|
1184
|
1184
|
array_push($table->data, $row); |
|
@@ -1198,12 +1198,12 @@ discard block |
|
|
block discarded – undo |
|
1198
|
1198
|
/// Build the message_body |
|
1199
|
1199
|
$msg->activity_type = ""; |
|
1200
|
1200
|
$msg->activity_title = $bigbluebuttonbn->name; |
|
1201
|
|
- $message_text = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.$msg->activity_type.' "'.$msg->activity_title.'" '.get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>'; |
|
|
1201
|
+ $message_text = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>'; |
|
1202
|
1202
|
|
|
1203
|
1203
|
bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $message_text); |
|
1204
|
1204
|
} |
|
1205
|
1205
|
|
|
1206
|
|
-function bigbluebuttonbn_server_offers($capability_name){ |
|
|
1206
|
+function bigbluebuttonbn_server_offers($capability_name) { |
|
1207
|
1207
|
global $CFG; |
|
1208
|
1208
|
|
|
1209
|
1209
|
$capability_offered = null; |
|
@@ -1217,12 +1217,12 @@ discard block |
|
|
block discarded – undo |
|
1217
|
1217
|
$host_ends = explode(".", $host); |
|
1218
|
1218
|
$host_ends_length = count($host_ends); |
|
1219
|
1219
|
|
|
1220
|
|
- if( $host_ends_length > 0 && $host_ends[$host_ends_length -1] == 'com' && $host_ends[$host_ends_length -2] == 'blindsidenetworks' ) { |
|
|
1220
|
+ if ($host_ends_length > 0 && $host_ends[$host_ends_length - 1] == 'com' && $host_ends[$host_ends_length - 2] == 'blindsidenetworks') { |
|
1221
|
1221
|
//Validate the capabilities offered |
|
1222
|
|
- $capabilities = bigbluebuttonbn_getCapabilitiesArray( $endpoint, $shared_secret ); |
|
1223
|
|
- if( $capabilities ) { |
|
|
1222
|
+ $capabilities = bigbluebuttonbn_getCapabilitiesArray($endpoint, $shared_secret); |
|
|
1223
|
+ if ($capabilities) { |
|
1224
|
1224
|
foreach ($capabilities as $capability) { |
|
1225
|
|
- if ( $capability["name"] == $capability_name) { |
|
|
1225
|
+ if ($capability["name"] == $capability_name) { |
|
1226
|
1226
|
$capability_offered = $capability; |
|
1227
|
1227
|
} |
|
1228
|
1228
|
} |
|
@@ -1232,14 +1232,14 @@ discard block |
|
|
block discarded – undo |
|
1232
|
1232
|
return $capability_offered; |
|
1233
|
1233
|
} |
|
1234
|
1234
|
|
|
1235
|
|
-function bigbluebuttonbn_server_offers_bn_capabilities(){ |
|
|
1235
|
+function bigbluebuttonbn_server_offers_bn_capabilities() { |
|
1236
|
1236
|
//Validates if the server may have extended capabilities |
|
1237
|
1237
|
$parsed_url = parse_url(bigbluebuttonbn_get_cfg_server_url()); |
|
1238
|
1238
|
$host = isset($parsed_url['host']) ? $parsed_url['host'] : ''; |
|
1239
|
1239
|
$host_ends = explode(".", $host); |
|
1240
|
1240
|
$host_ends_length = count($host_ends); |
|
1241
|
1241
|
|
|
1242
|
|
- return ( $host_ends_length > 0 && $host_ends[$host_ends_length -1] == 'com' && $host_ends[$host_ends_length -2] == 'blindsidenetworks' ); |
|
|
1242
|
+ return ($host_ends_length > 0 && $host_ends[$host_ends_length - 1] == 'com' && $host_ends[$host_ends_length - 2] == 'blindsidenetworks'); |
|
1243
|
1243
|
} |
|
1244
|
1244
|
|
|
1245
|
1245
|
function bigbluebuttonbn_get_locales_for_ui() { |
|
@@ -1284,89 +1284,89 @@ discard block |
|
|
block discarded – undo |
|
1284
|
1284
|
|
|
1285
|
1285
|
function bigbluebuttonbn_get_cfg_server_url_default() { |
|
1286
|
1286
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1287
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url: (isset($CFG->bigbluebuttonbn_server_url)? $CFG->bigbluebuttonbn_server_url: (isset($CFG->BigBlueButtonBNServerURL)? $CFG->BigBlueButtonBNServerURL: BIGBLUEBUTTONBN_DEFAULT_SERVER_URL))); |
|
|
1287
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url : (isset($CFG->bigbluebuttonbn_server_url) ? $CFG->bigbluebuttonbn_server_url : (isset($CFG->BigBlueButtonBNServerURL) ? $CFG->BigBlueButtonBNServerURL : BIGBLUEBUTTONBN_DEFAULT_SERVER_URL))); |
|
1288
|
1288
|
} |
|
1289
|
1289
|
|
|
1290
|
1290
|
function bigbluebuttonbn_get_cfg_shared_secret_default() { |
|
1291
|
1291
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1292
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret: (isset($CFG->bigbluebuttonbn_shared_secret)? $CFG->bigbluebuttonbn_shared_secret: (isset($CFG->BigBlueButtonBNSecuritySalt)? $CFG->BigBlueButtonBNSecuritySalt: BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET))); |
|
|
1292
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_shared_secret : (isset($CFG->bigbluebuttonbn_shared_secret) ? $CFG->bigbluebuttonbn_shared_secret : (isset($CFG->BigBlueButtonBNSecuritySalt) ? $CFG->BigBlueButtonBNSecuritySalt : BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET))); |
|
1293
|
1293
|
} |
|
1294
|
1294
|
|
|
1295
|
1295
|
function bigbluebuttonbn_get_cfg_voicebridge_editable() { |
|
1296
|
1296
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1297
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable: (isset($CFG->bigbluebuttonbn_voicebridge_editable)? $CFG->bigbluebuttonbn_voicebridge_editable: false)); |
|
|
1297
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_voicebridge_editable : (isset($CFG->bigbluebuttonbn_voicebridge_editable) ? $CFG->bigbluebuttonbn_voicebridge_editable : false)); |
|
1298
|
1298
|
} |
|
1299
|
1299
|
|
|
1300
|
1300
|
function bigbluebuttonbn_get_cfg_recording_default() { |
|
1301
|
1301
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1302
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default: (isset($CFG->bigbluebuttonbn_recording_default)? $CFG->bigbluebuttonbn_recording_default: true)); |
|
|
1302
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_default : (isset($CFG->bigbluebuttonbn_recording_default) ? $CFG->bigbluebuttonbn_recording_default : true)); |
|
1303
|
1303
|
} |
|
1304
|
1304
|
|
|
1305
|
1305
|
function bigbluebuttonbn_get_cfg_recording_editable() { |
|
1306
|
1306
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1307
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable: (isset($CFG->bigbluebuttonbn_recording_editable)? $CFG->bigbluebuttonbn_recording_editable: true)); |
|
|
1307
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_editable : (isset($CFG->bigbluebuttonbn_recording_editable) ? $CFG->bigbluebuttonbn_recording_editable : true)); |
|
1308
|
1308
|
} |
|
1309
|
1309
|
|
|
1310
|
1310
|
function bigbluebuttonbn_get_cfg_recording_tagging_default() { |
|
1311
|
1311
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1312
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default: (isset($CFG->bigbluebuttonbn_recordingtagging_default)? $CFG->bigbluebuttonbn_recordingtagging_default: false)); |
|
|
1312
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_default : (isset($CFG->bigbluebuttonbn_recordingtagging_default) ? $CFG->bigbluebuttonbn_recordingtagging_default : false)); |
|
1313
|
1313
|
} |
|
1314
|
1314
|
|
|
1315
|
1315
|
function bigbluebuttonbn_get_cfg_recording_tagging_editable() { |
|
1316
|
1316
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1317
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable: (isset($CFG->bigbluebuttonbn_recordingtagging_editable)? $CFG->bigbluebuttonbn_recordingtagging_editable: false)); |
|
|
1317
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingtagging_editable : (isset($CFG->bigbluebuttonbn_recordingtagging_editable) ? $CFG->bigbluebuttonbn_recordingtagging_editable : false)); |
|
1318
|
1318
|
} |
|
1319
|
1319
|
|
|
1320
|
1320
|
function bigbluebuttonbn_get_cfg_recording_icons_enabled() { |
|
1321
|
1321
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1322
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled: (isset($CFG->bigbluebuttonbn_recording_icons_enabled)? $CFG->bigbluebuttonbn_recording_icons_enabled: true)); |
|
|
1322
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recording_icons_enabled : (isset($CFG->bigbluebuttonbn_recording_icons_enabled) ? $CFG->bigbluebuttonbn_recording_icons_enabled : true)); |
|
1323
|
1323
|
} |
|
1324
|
1324
|
|
|
1325
|
1325
|
function bigbluebuttonbn_get_cfg_importrecordings_enabled() { |
|
1326
|
1326
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1327
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled: (isset($CFG->bigbluebuttonbn_importrecordings_enabled)? $CFG->bigbluebuttonbn_importrecordings_enabled: false)); |
|
|
1327
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_enabled : (isset($CFG->bigbluebuttonbn_importrecordings_enabled) ? $CFG->bigbluebuttonbn_importrecordings_enabled : false)); |
|
1328
|
1328
|
} |
|
1329
|
1329
|
|
|
1330
|
1330
|
function bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled() { |
|
1331
|
1331
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1332
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled: (isset($CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled)? $CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled: false)); |
|
|
1332
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled : (isset($CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled) ? $CFG->bigbluebuttonbn_importrecordings_from_deleted_activities_enabled : false)); |
|
1333
|
1333
|
} |
|
1334
|
1334
|
|
|
1335
|
1335
|
function bigbluebuttonbn_get_cfg_waitformoderator_default() { |
|
1336
|
1336
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1337
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default: (isset($CFG->bigbluebuttonbn_waitformoderator_default)? $CFG->bigbluebuttonbn_waitformoderator_default: false)); |
|
|
1337
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_default : (isset($CFG->bigbluebuttonbn_waitformoderator_default) ? $CFG->bigbluebuttonbn_waitformoderator_default : false)); |
|
1338
|
1338
|
} |
|
1339
|
1339
|
|
|
1340
|
1340
|
function bigbluebuttonbn_get_cfg_waitformoderator_editable() { |
|
1341
|
1341
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1342
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable: (isset($CFG->bigbluebuttonbn_waitformoderator_editable)? $CFG->bigbluebuttonbn_waitformoderator_editable: true)); |
|
|
1342
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_editable : (isset($CFG->bigbluebuttonbn_waitformoderator_editable) ? $CFG->bigbluebuttonbn_waitformoderator_editable : true)); |
|
1343
|
1343
|
} |
|
1344
|
1344
|
|
|
1345
|
1345
|
function bigbluebuttonbn_get_cfg_waitformoderator_ping_interval() { |
|
1346
|
1346
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1347
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval: (isset($CFG->bigbluebuttonbn_waitformoderator_ping_interval)? $CFG->bigbluebuttonbn_waitformoderator_ping_interval: 15)); |
|
|
1347
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_ping_interval : (isset($CFG->bigbluebuttonbn_waitformoderator_ping_interval) ? $CFG->bigbluebuttonbn_waitformoderator_ping_interval : 15)); |
|
1348
|
1348
|
} |
|
1349
|
1349
|
|
|
1350
|
1350
|
function bigbluebuttonbn_get_cfg_waitformoderator_cache_ttl() { |
|
1351
|
1351
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1352
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl: (isset($CFG->bigbluebuttonbn_waitformoderator_cache_ttl)? $CFG->bigbluebuttonbn_waitformoderator_cache_ttl: 60)); |
|
|
1352
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_waitformoderator_cache_ttl : (isset($CFG->bigbluebuttonbn_waitformoderator_cache_ttl) ? $CFG->bigbluebuttonbn_waitformoderator_cache_ttl : 60)); |
|
1353
|
1353
|
} |
|
1354
|
1354
|
|
|
1355
|
1355
|
function bigbluebuttonbn_get_cfg_userlimit_default() { |
|
1356
|
1356
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1357
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default: (isset($CFG->bigbluebuttonbn_userlimit_default)? $CFG->bigbluebuttonbn_userlimit_default: 0)); |
|
|
1357
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_default : (isset($CFG->bigbluebuttonbn_userlimit_default) ? $CFG->bigbluebuttonbn_userlimit_default : 0)); |
|
1358
|
1358
|
} |
|
1359
|
1359
|
|
|
1360
|
1360
|
function bigbluebuttonbn_get_cfg_userlimit_editable() { |
|
1361
|
1361
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1362
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable: (isset($CFG->bigbluebuttonbn_userlimit_editable)? $CFG->bigbluebuttonbn_userlimit_editable: false)); |
|
|
1362
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_userlimit_editable : (isset($CFG->bigbluebuttonbn_userlimit_editable) ? $CFG->bigbluebuttonbn_userlimit_editable : false)); |
|
1363
|
1363
|
} |
|
1364
|
1364
|
|
|
1365
|
1365
|
function bigbluebuttonbn_get_cfg_preuploadpresentation_enabled() { |
|
1366
|
1366
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1367
|
1367
|
if (extension_loaded('curl')) { |
|
1368
|
1368
|
// This feature only works if curl is installed |
|
1369
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled: (isset($CFG->bigbluebuttonbn_preuploadpresentation_enabled)? $CFG->bigbluebuttonbn_preuploadpresentation_enabled: false)); |
|
|
1369
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_preuploadpresentation_enabled : (isset($CFG->bigbluebuttonbn_preuploadpresentation_enabled) ? $CFG->bigbluebuttonbn_preuploadpresentation_enabled : false)); |
|
1370
|
1370
|
} else { |
|
1371
|
1371
|
return false; |
|
1372
|
1372
|
} |
|
@@ -1374,37 +1374,37 @@ discard block |
|
|
block discarded – undo |
|
1374
|
1374
|
|
|
1375
|
1375
|
function bigbluebuttonbn_get_cfg_sendnotifications_enabled() { |
|
1376
|
1376
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1377
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled: (isset($CFG->bigbluebuttonbn_sendnotifications_enabled)? $CFG->bigbluebuttonbn_sendnotifications_enabled: false)); |
|
|
1377
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_sendnotifications_enabled : (isset($CFG->bigbluebuttonbn_sendnotifications_enabled) ? $CFG->bigbluebuttonbn_sendnotifications_enabled : false)); |
|
1378
|
1378
|
} |
|
1379
|
1379
|
|
|
1380
|
1380
|
function bigbluebuttonbn_get_cfg_recordingready_enabled() { |
|
1381
|
1381
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1382
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled: (isset($CFG->bigbluebuttonbn_recordingready_enabled)? $CFG->bigbluebuttonbn_recordingready_enabled: false)); |
|
|
1382
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_recordingready_enabled : (isset($CFG->bigbluebuttonbn_recordingready_enabled) ? $CFG->bigbluebuttonbn_recordingready_enabled : false)); |
|
1383
|
1383
|
} |
|
1384
|
1384
|
|
|
1385
|
1385
|
function bigbluebuttonbn_get_cfg_moderator_default() { |
|
1386
|
1386
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1387
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default: (isset($CFG->bigbluebuttonbn_moderator_default)? $CFG->bigbluebuttonbn_moderator_default: 'owner')); |
|
|
1387
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_moderator_default : (isset($CFG->bigbluebuttonbn_moderator_default) ? $CFG->bigbluebuttonbn_moderator_default : 'owner')); |
|
1388
|
1388
|
} |
|
1389
|
1389
|
|
|
1390
|
1390
|
function bigbluebuttonbn_get_cfg_scheduled_duration_enabled() { |
|
1391
|
1391
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1392
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled: (isset($CFG->bigbluebuttonbn_scheduled_duration_enabled)? $CFG->bigbluebuttonbn_scheduled_duration_enabled: false)); |
|
|
1392
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_enabled : (isset($CFG->bigbluebuttonbn_scheduled_duration_enabled) ? $CFG->bigbluebuttonbn_scheduled_duration_enabled : false)); |
|
1393
|
1393
|
} |
|
1394
|
1394
|
|
|
1395
|
1395
|
function bigbluebuttonbn_get_cfg_scheduled_duration_compensation() { |
|
1396
|
1396
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1397
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_compensation)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_compensation: (isset($CFG->bigbluebuttonbn_scheduled_duration_compensation)? $CFG->bigbluebuttonbn_scheduled_duration_compensation: 10)); |
|
|
1397
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_compensation) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_duration_compensation : (isset($CFG->bigbluebuttonbn_scheduled_duration_compensation) ? $CFG->bigbluebuttonbn_scheduled_duration_compensation : 10)); |
|
1398
|
1398
|
} |
|
1399
|
1399
|
|
|
1400
|
1400
|
function bigbluebuttonbn_get_cfg_scheduled_pre_opening() { |
|
1401
|
1401
|
global $BIGBLUEBUTTONBN_CFG, $CFG; |
|
1402
|
|
- return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_pre_opening)? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_pre_opening: (isset($CFG->bigbluebuttonbn_scheduled_pre_opening)? $CFG->bigbluebuttonbn_scheduled_pre_opening: 10)); |
|
|
1402
|
+ return (isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_pre_opening) ? $BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_scheduled_pre_opening : (isset($CFG->bigbluebuttonbn_scheduled_pre_opening) ? $CFG->bigbluebuttonbn_scheduled_pre_opening : 10)); |
|
1403
|
1403
|
} |
|
1404
|
1404
|
|
|
1405
|
1405
|
function bigbluebuttonbn_import_get_courses_for_select(array $bbbsession) { |
|
1406
|
1406
|
|
|
1407
|
|
- if( $bbbsession['administrator'] ) { |
|
|
1407
|
+ if ($bbbsession['administrator']) { |
|
1408
|
1408
|
$courses = get_courses('all', 'c.id ASC', 'c.id,c.shortname,c.fullname'); |
|
1409
|
1409
|
//It includes the name of the site as a course (category 0), so remove the first one |
|
1410
|
1410
|
unset($courses["1"]); |
|
@@ -1413,21 +1413,21 @@ discard block |
|
|
block discarded – undo |
|
1413
|
1413
|
} |
|
1414
|
1414
|
|
|
1415
|
1415
|
$courses_for_select = []; |
|
1416
|
|
- foreach($courses as $course) { |
|
1417
|
|
- if( $course->id != $bbbsession['course']->id ) { |
|
|
1416
|
+ foreach ($courses as $course) { |
|
|
1417
|
+ if ($course->id != $bbbsession['course']->id) { |
|
1418
|
1418
|
$courses_for_select[$course->id] = $course->fullname; |
|
1419
|
1419
|
} |
|
1420
|
1420
|
} |
|
1421
|
1421
|
return $courses_for_select; |
|
1422
|
1422
|
} |
|
1423
|
1423
|
|
|
1424
|
|
-function bigbluebuttonbn_getRecordedMeetingsDeleted($courseID, $bigbluebuttonbnID=NULL) { |
|
|
1424
|
+function bigbluebuttonbn_getRecordedMeetingsDeleted($courseID, $bigbluebuttonbnID = NULL) { |
|
1425
|
1425
|
global $DB; |
|
1426
|
1426
|
|
|
1427
|
1427
|
$records_deleted = array(); |
|
1428
|
1428
|
|
|
1429
|
|
- $filter = array('courseid' => $courseID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_DELETE ); |
|
1430
|
|
- if ( $bigbluebuttonbnID != NULL ) { |
|
|
1429
|
+ $filter = array('courseid' => $courseID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_DELETE); |
|
|
1430
|
+ if ($bigbluebuttonbnID != NULL) { |
|
1431
|
1431
|
$filter['id'] = $bigbluebuttonbnID; |
|
1432
|
1432
|
} |
|
1433
|
1433
|
|
|
@@ -1436,17 +1436,17 @@ discard block |
|
|
block discarded – undo |
|
1436
|
1436
|
foreach ($bigbluebuttonbns_deleted as $key => $bigbluebuttonbn_deleted) { |
|
1437
|
1437
|
$records = $DB->get_records('bigbluebuttonbn_logs', array('courseid' => $courseID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_CREATE)); |
|
1438
|
1438
|
|
|
1439
|
|
- if( !empty($records) ) { |
|
|
1439
|
+ if (!empty($records)) { |
|
1440
|
1440
|
//Remove duplicates |
|
1441
|
1441
|
$unique_records = array(); |
|
1442
|
1442
|
foreach ($records as $key => $record) { |
|
1443
|
|
- if (array_key_exists($record->meetingid, $unique_records) ) { |
|
|
1443
|
+ if (array_key_exists($record->meetingid, $unique_records)) { |
|
1444
|
1444
|
unset($records[$key]); |
|
1445
|
1445
|
} else { |
|
1446
|
1446
|
$meta = json_decode($record->meta); |
|
1447
|
|
- if ( !$meta->record ) { |
|
|
1447
|
+ if (!$meta->record) { |
|
1448
|
1448
|
unset($records[$key]); |
|
1449
|
|
- } else if ( $bigbluebuttonbn_deleted->meetingid != substr($record->meetingid, 0, strlen($bigbluebuttonbn_deleted->meetingid))) { |
|
|
1449
|
+ } else if ($bigbluebuttonbn_deleted->meetingid != substr($record->meetingid, 0, strlen($bigbluebuttonbn_deleted->meetingid))) { |
|
1450
|
1450
|
unset($records[$key]); |
|
1451
|
1451
|
} else { |
|
1452
|
1452
|
array_push($unique_records, $record->meetingid); |
|
@@ -1461,27 +1461,27 @@ discard block |
|
|
block discarded – undo |
|
1461
|
1461
|
return $records_deleted; |
|
1462
|
1462
|
} |
|
1463
|
1463
|
|
|
1464
|
|
-function bigbluebuttonbn_getRecordedMeetings($courseID, $bigbluebuttonbnID=NULL) { |
|
|
1464
|
+function bigbluebuttonbn_getRecordedMeetings($courseID, $bigbluebuttonbnID = NULL) { |
|
1465
|
1465
|
global $DB; |
|
1466
|
1466
|
|
|
1467
|
1467
|
$records = Array(); |
|
1468
|
1468
|
|
|
1469
|
1469
|
$filter = array('course' => $courseID); |
|
1470
|
|
- if ( $bigbluebuttonbnID != NULL ) { |
|
|
1470
|
+ if ($bigbluebuttonbnID != NULL) { |
|
1471
|
1471
|
$filter['id'] = $bigbluebuttonbnID; |
|
1472
|
1472
|
} |
|
1473
|
1473
|
$bigbluebuttonbns = $DB->get_records('bigbluebuttonbn', $filter); |
|
1474
|
1474
|
|
|
1475
|
|
- if ( !empty($bigbluebuttonbns) ) { |
|
|
1475
|
+ if (!empty($bigbluebuttonbns)) { |
|
1476
|
1476
|
$table = 'bigbluebuttonbn_logs'; |
|
1477
|
1477
|
|
|
1478
|
1478
|
//Prepare select for loading records based on existent bigbluebuttonbns |
|
1479
|
1479
|
$select = ""; |
|
1480
|
1480
|
foreach ($bigbluebuttonbns as $key => $bigbluebuttonbn) { |
|
1481
|
|
- $select .= strlen($select) == 0? "(": " OR "; |
|
1482
|
|
- $select .= "bigbluebuttonbnid=".$bigbluebuttonbn->id; |
|
|
1481
|
+ $select .= strlen($select) == 0 ? "(" : " OR "; |
|
|
1482
|
+ $select .= "bigbluebuttonbnid=" . $bigbluebuttonbn->id; |
|
1483
|
1483
|
} |
|
1484
|
|
- $select .= ") AND log='".BIGBLUEBUTTONBN_LOG_EVENT_CREATE."'"; |
|
|
1484
|
+ $select .= ") AND log='" . BIGBLUEBUTTONBN_LOG_EVENT_CREATE . "'"; |
|
1485
|
1485
|
|
|
1486
|
1486
|
//Execute select for loading records based on existent bigbluebuttonbns |
|
1487
|
1487
|
$records = $DB->get_records_select($table, $select); |
|
@@ -1489,8 +1489,8 @@ discard block |
|
|
block discarded – undo |
|
1489
|
1489
|
//Remove duplicates |
|
1490
|
1490
|
$unique_records = array(); |
|
1491
|
1491
|
foreach ($records as $key => $record) { |
|
1492
|
|
- $record_key = $record->meetingid.','.$record->bigbluebuttonbnid.','.$record->meta; |
|
1493
|
|
- if( array_search($record_key, $unique_records) === false ) { |
|
|
1492
|
+ $record_key = $record->meetingid . ',' . $record->bigbluebuttonbnid . ',' . $record->meta; |
|
|
1493
|
+ if (array_search($record_key, $unique_records) === false) { |
|
1494
|
1494
|
array_push($unique_records, $record_key); |
|
1495
|
1495
|
} else { |
|
1496
|
1496
|
unset($records[$key]); |
|
@@ -1500,7 +1500,7 @@ discard block |
|
|
block discarded – undo |
|
1500
|
1500
|
//Remove the ones with record=false |
|
1501
|
1501
|
foreach ($records as $key => $record) { |
|
1502
|
1502
|
$meta = json_decode($record->meta); |
|
1503
|
|
- if ( !$meta || !$meta->record ) { |
|
|
1503
|
+ if (!$meta || !$meta->record) { |
|
1504
|
1504
|
unset($records[$key]); |
|
1505
|
1505
|
} |
|
1506
|
1506
|
} |
|
@@ -1513,15 +1513,15 @@ discard block |
|
|
block discarded – undo |
|
1513
|
1513
|
$recordings = array(); |
|
1514
|
1514
|
|
|
1515
|
1515
|
// Load the meetingIDs to be used in the getRecordings request |
|
1516
|
|
- if ( is_numeric($courseID) ) { |
|
|
1516
|
+ if (is_numeric($courseID)) { |
|
1517
|
1517
|
$results = bigbluebuttonbn_getRecordedMeetings($courseID); |
|
1518
|
1518
|
|
|
1519
|
|
- if( bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled() ) { |
|
|
1519
|
+ if (bigbluebuttonbn_get_cfg_importrecordings_from_deleted_activities_enabled()) { |
|
1520
|
1520
|
$results_deleted = bigbluebuttonbn_getRecordedMeetingsDeleted($courseID); |
|
1521
|
1521
|
$results = array_merge($results, $results_deleted); |
|
1522
|
1522
|
} |
|
1523
|
1523
|
|
|
1524
|
|
- if( $results ) { |
|
|
1524
|
+ if ($results) { |
|
1525
|
1525
|
$mIDs = array(); |
|
1526
|
1526
|
//Eliminates duplicates |
|
1527
|
1527
|
foreach ($results as $result) { |
|
@@ -1529,10 +1529,10 @@ discard block |
|
|
block discarded – undo |
|
1529
|
1529
|
} |
|
1530
|
1530
|
|
|
1531
|
1531
|
// If there are mIDs excecute a paginated getRecordings request |
|
1532
|
|
- if ( !empty($mIDs) ) { |
|
|
1532
|
+ if (!empty($mIDs)) { |
|
1533
|
1533
|
$pages = floor(sizeof($mIDs) / 25) + 1; |
|
1534
|
|
- for ( $page = 1; $page <= $pages; $page++ ) { |
|
1535
|
|
- $meetingIDs = array_slice($mIDs, ($page-1)*25, 25); |
|
|
1534
|
+ for ($page = 1; $page <= $pages; $page++) { |
|
|
1535
|
+ $meetingIDs = array_slice($mIDs, ($page - 1) * 25, 25); |
|
1536
|
1536
|
$fetched_recordings = bigbluebuttonbn_getRecordingsArray(implode(',', $meetingIDs), $URL, $SALT); |
|
1537
|
1537
|
$recordings = array_merge($recordings, $fetched_recordings); |
|
1538
|
1538
|
} |
|
@@ -1559,37 +1559,37 @@ discard block |
|
|
block discarded – undo |
|
1559
|
1559
|
$recordings_already_imported_indexed = bigbluebuttonbn_index_recordings($recordings_already_imported); |
|
1560
|
1560
|
|
|
1561
|
1561
|
foreach ($recordings as $key => $recording) { |
|
1562
|
|
- if( isset($recordings_already_imported_indexed[$recording['recordID']]) ) { |
|
|
1562
|
+ if (isset($recordings_already_imported_indexed[$recording['recordID']])) { |
|
1563
|
1563
|
unset($recordings[$key]); |
|
1564
|
1564
|
} |
|
1565
|
1565
|
} |
|
1566
|
1566
|
return $recordings; |
|
1567
|
1567
|
} |
|
1568
|
1568
|
|
|
1569
|
|
-function bigbluebutton_output_recording_table($bbbsession, $recordings, $tools=['publishing','deleting']) { |
|
|
1569
|
+function bigbluebutton_output_recording_table($bbbsession, $recordings, $tools = ['publishing', 'deleting']) { |
|
1570
|
1570
|
|
|
1571
|
|
- if ( isset($recordings) && !empty($recordings) ) { // There are recordings for this meeting |
|
|
1571
|
+ if (isset($recordings) && !empty($recordings)) { // There are recordings for this meeting |
|
1572
|
1572
|
$table = bigbluebuttonbn_get_recording_table($bbbsession, $recordings, $tools); |
|
1573
|
1573
|
} |
|
1574
|
1574
|
|
|
1575
|
1575
|
$output = ''; |
|
1576
|
|
- if( isset($table->data) ) { |
|
|
1576
|
+ if (isset($table->data)) { |
|
1577
|
1577
|
//Print the table |
|
1578
|
|
- $output .= '<div id="bigbluebuttonbn_html_table">'."\n"; |
|
1579
|
|
- $output .= html_writer::table($table)."\n"; |
|
1580
|
|
- $output .= '</div>'."\n"; |
|
|
1578
|
+ $output .= '<div id="bigbluebuttonbn_html_table">' . "\n"; |
|
|
1579
|
+ $output .= html_writer::table($table) . "\n"; |
|
|
1580
|
+ $output .= '</div>' . "\n"; |
|
1581
|
1581
|
|
|
1582
|
1582
|
} else { |
|
1583
|
|
- $output .= get_string('view_message_norecordings', 'bigbluebuttonbn').'<br>'."\n"; |
|
|
1583
|
+ $output .= get_string('view_message_norecordings', 'bigbluebuttonbn') . '<br>' . "\n"; |
|
1584
|
1584
|
} |
|
1585
|
1585
|
|
|
1586
|
1586
|
return $output; |
|
1587
|
1587
|
} |
|
1588
|
1588
|
|
|
1589
|
|
-function bigbluebuttonbn_getRecordingsImported($courseID, $bigbluebuttonbnID=NULL) { |
|
|
1589
|
+function bigbluebuttonbn_getRecordingsImported($courseID, $bigbluebuttonbnID = NULL) { |
|
1590
|
1590
|
global $DB; |
|
1591
|
1591
|
|
|
1592
|
|
- if ( $bigbluebuttonbnID != NULL ) { |
|
|
1592
|
+ if ($bigbluebuttonbnID != NULL) { |
|
1593
|
1593
|
// Fetch only those related to the $courseID and $bigbluebuttonbnID requested |
|
1594
|
1594
|
$recordings_imported = $DB->get_records('bigbluebuttonbn_logs', array('courseid' => $courseID, 'bigbluebuttonbnid' => $bigbluebuttonbnID, 'log' => BIGBLUEBUTTONBN_LOG_EVENT_IMPORT)); |
|
1595
|
1595
|
} else { |
|
@@ -1599,7 +1599,7 @@ discard block |
|
|
block discarded – undo |
|
1599
|
1599
|
return $recordings_imported; |
|
1600
|
1600
|
} |
|
1601
|
1601
|
|
|
1602
|
|
-function bigbluebuttonbn_getRecordingsImportedArray($courseID, $bigbluebuttonbnID=NULL) { |
|
|
1602
|
+function bigbluebuttonbn_getRecordingsImportedArray($courseID, $bigbluebuttonbnID = NULL) { |
|
1603
|
1603
|
$recordings_imported = bigbluebuttonbn_getRecordingsImported($courseID, $bigbluebuttonbnID); |
|
1604
|
1604
|
$recordings_imported_array = bigbluebuttonbn_import_get_recordings_imported($recordings_imported); |
|
1605
|
1605
|
return $recordings_imported_array; |
|
@@ -1608,7 +1608,7 @@ discard block |
|
|
block discarded – undo |
|
1608
|
1608
|
function bigbluebuttonbn_getRecordingsImportedAllInstances($recordID) { |
|
1609
|
1609
|
global $DB, $CFG; |
|
1610
|
1610
|
|
|
1611
|
|
- $recordings_imported = $DB->get_records_sql('SELECT * FROM '.$CFG->prefix.'bigbluebuttonbn_logs WHERE log=? AND '.$DB->sql_like('meta', '?'), array( BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, '%'.$recordID.'%' )); |
|
|
1611
|
+ $recordings_imported = $DB->get_records_sql('SELECT * FROM ' . $CFG->prefix . 'bigbluebuttonbn_logs WHERE log=? AND ' . $DB->sql_like('meta', '?'), array(BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, '%' . $recordID . '%')); |
|
1612
|
1612
|
return $recordings_imported; |
|
1613
|
1613
|
} |
|
1614
|
1614
|
|
|
@@ -1627,8 +1627,8 @@ discard block |
|
|
block discarded – undo |
|
1627
|
1627
|
function bigbluebuttonbn_html2text($html, $len) { |
|
1628
|
1628
|
$text = strip_tags($html); |
|
1629
|
1629
|
$text = str_replace(" ", ' ', $text); |
|
1630
|
|
- if( strlen($text) > $len ) { |
|
1631
|
|
- $text = substr($text, 0, $len)."..."; |
|
|
1630
|
+ if (strlen($text) > $len) { |
|
|
1631
|
+ $text = substr($text, 0, $len) . "..."; |
|
1632
|
1632
|
} else { |
|
1633
|
1633
|
$text = substr($text, 0, $len); |
|
1634
|
1634
|
} |