-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbbb_create.php
More file actions
171 lines (165 loc) · 8.52 KB
/
Copy pathbbb_create.php
File metadata and controls
171 lines (165 loc) · 8.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
//********************************************************************
//* Description: Create meeting
//* Author: Automatix <github@unattended.ch>
//* Created at: Tue Aug 31 16:00:47 UTC 2021
//*
//* Copyright (c) 2021 Automatix All rights reserved.
//*
//********************************************************************
namespace BigBlueButton;
$serverid = $_GET['sid'];
require_once('./bbb_load.php');
use BigBlueButton\BigBlueButton;
use BigBlueButton\Parameters\CreateMeetingParameters;
$cfg = $GLOBALS['cfg'];
$invite = 'https://'.$cfg->invite.'?sid='.$serverid.'&exit=1';
foreach($cfg->access as $val)
{
$moderatorPW = $val;
break;
}
foreach($cfg->access as $pw)
$acc = $pw;
$mpw = RandomString();
$apw = RandomString();
if(isset($_POST['Submit']))
{
$bbb = new BigBlueButton();
$meetingName = $_POST['meetingName'];
$meetingID = $_POST['meetingID'];
$moderator_password = $_POST['moderator_password'];
$attendee_password = $_POST['attendee_password'];
$urlLogout = $_POST['urlLogout'];
$duration = $_POST['duration'];
$pdffile = $_FILES['filename'];
$logofile = $_POST['logoname'];
$pdffile0 = $_POST['meetingPdfSel'];
printf("Create meeting [%s] [%s]<br>", $meetingName, $meetingID);
$createMeetingParams = new CreateMeetingParameters($meetingID, $meetingName);
$createMeetingParams->setAttendeePassword($attendee_password);
$createMeetingParams->setModeratorPassword($moderator_password);
$createMeetingParams->setDuration($duration);
$createMeetingParams->setLogoutUrl($urlLogout);
$createMeetingParams->setLogo($logofile);
$createMeetingParams->setWelcomeMessage($$meetingName);
$createMeetingParams->setModeratorOnlyMessage($$meetingName);
$createMeetingParams->setMuteOnStart(false);
if ($_POST['muteonstart'] == 'yes') {
$createMeetingParams->setMuteOnStart(true);
}
if ($pdffile['name'] !== '') {
$createMeetingParams->addPresentation($pdffile['name'], file_get_contents($pdffile['tmp_name']));
} elseif ($pdffile0 !== '') {
$createMeetingParams->addPresentation(basename($pdffile0), file_get_contents($pdffile0));
}
$isRecordingTrue = false;
if ($_POST['recording'] == 'yes') {
$isRecordingTrue = true;
}
if ($isRecordingTrue) {
$createMeetingParams->setRecord(true);
$createMeetingParams->setAllowStartStopRecording(true);
$createMeetingParams->setAutoStartRecording(false);
}
$createMeetingParams->setCopyright($cfg->copyright);
$response = $bbb->createMeeting($createMeetingParams);
if ($response->getReturnCode() == 'FAILED') {
die(sprintf("%s<br>", $response->getMessage()));
} else {
printf("%s<br>", $response->getMessage());
}
$url = './bbb_join.php?sid='.$serverid;
$url = $url . '&mID='.$meetingID;
$url = $url . '&userName='.$cfg->moderator;
$url = $url . '&moderator_password='.$moderator_password;
$url = $url . '&attendee_password='.$attendee_password;
$url = $url . '&Submit=send';
echo '<br><a href="'.$url.'">"'.$url.'</a>';
header( "Location: $url" );
}
else
{
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo lang('CREATEMEETING'); ?> [<?php echo $servername; ?>]</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body onload="setMetName(); setMetID(); setMetLogo();">
<script>
function setMetName() {
document.getElementById('meetingName').setAttribute('value', document.getElementById('meetingNameSel').value);
document.getElementById('meetingIDSel').selectedIndex = document.getElementById('meetingNameSel').selectedIndex;
document.getElementById('meetingAccSel').selectedIndex = document.getElementById('meetingNameSel').selectedIndex;
document.getElementById('meetingID').setAttribute('value', document.getElementById('meetingIDSel').value);
}
function setMetID() {
document.getElementById('meetingID').setAttribute('value', document.getElementById('meetingIDSel').value);
}
function setMetAcc() {
document.getElementById('meetingAccSel').setAttribute('selectedIndex', document.getElementById('meetingNameSel').selectedIndex);
}
function setMetLogout() {
document.getElementById('urlLogout').setAttribute('value', document.getElementById('urlLogoutSel').value);
}
function setMetLogo() {
document.getElementById('logoname').setAttribute('value', document.getElementById('logonameSel').value);
}
function setModPass() {
document.getElementById('moderator_password').setAttribute('value', '<?php echo $moderatorPW ?>');
}
function setAttPass() {
var acc = document.getElementById('meetingAccSel').value;
if (acc === '')
acc = '<?php echo $acc ?>';
document.getElementById('attendee_password').setAttribute('value', acc);
}
</script>
<div id="topStats">
<center><table class="main"><tr><td>
<div class="chartWrapper">
<div class="chartLabel"><?php echo lang('CREATEMEETING'); ?></div>
<div class="chartHolder">
<form action="" method="POST" enctype="multipart/form-data"><table><tr>
<td><label for="servername" id="srv_id_label">Server </label></td>
<td><input type="text" name="servername" id="servername" value="<?php echo $servername?>" size="30" readonly></td></tr><tr>
<td><br><label for="meetingName" id="app_name_label"><?php echo lang('MEETINGNAME'); ?></label></td>
<td><?php printf(ServerRoomName())?><br>
<input type="text" name="meetingName" id="meetingName" size="35"></td></tr><tr>
<td><br><label for="meetingID" id="app_id_label"><?php echo lang('MEETINGID'); ?></label></td>
<td><?php printf(ServerRoomId())?><br>
<input type="text" name="meetingID" id="meetingID" size="35"></td></tr><tr>
<td><label for="moderator_password" id="mod_pass_label"><?php echo lang('MODERATORPW'); ?></label></td>
<td><input type="text" name="moderator_password" id="moderator_password" value="<?php echo $mpw; ?>" size="30"><input type="button" value="Default password" onclick="setModPass()"></td></tr><tr>
<td><br><label for="attendee_password" id="mod_pass_label"><?php echo lang('ATTENDEEPW'); ?></label></td>
<td><?php printf(ServerRoomAccess())?><br>
<input type="text" name="attendee_password" id="attendee_password" value="<?php echo $apw; ?>" size="30"><input type="button" value="Default password" onclick="setAttPass()"></td></tr><tr>
<td><label for="duration" id="mod_dur_label" ><?php echo lang('DURATIONMIN'); ?></label></td>
<td><input type="text" name="duration" id="duration" value="0"></td></tr><tr>
<td><br><label for="urlLogout" id="mod_pass_label" ><?php echo lang('LOGOUTURL'); ?></label></td>
<td><?php printf(ReturnURL())?><br>
<input type="text" name="urlLogout" id="urlLogout" size="35" value="<?php echo $invite?>"></td></tr><tr>
<td><label for="filename"><?php echo lang('PRESENTATION'); ?></label>
<td><?php printf(ServerRoomPdf())?><br>
<input type="file" id="filename" name="filename" accept=".pdf"></td></tr><tr>
<td><br><label for="logoname"><?php echo lang('LOGOURL'); ?></label>
<td><?php printf(RoomLogos())?><br>
<input type="text" id="logoname" name="logoname" size="35"></td></tr><tr>
<td><label for="muteonstart"><?php echo lang('MUTEONSTART'); ?></label></td>
<td><input type="checkbox" id="muteonstart" name="muteonstart" value="yes" checked></td></tr><tr>
<td><label for="recording"><?php echo lang('RECORDING'); ?></label></td>
<td><input type="checkbox" id="recording" name="recording" value="yes"></td></tr><tr>
</table>
<br><center><input type="submit" name="Submit" value="<?php echo lang('CREATEMEETING'); ?>" class="bigbutton"> <input type="button" class="bigbutton" value="<?php echo lang('BACK'); ?>" onclick="javascript:history.back()"></center>
</form>
</div>
</div>
</td></tr></table></center>
</div>
</body>
</html>
<?php
//Show($cfg);
}