public function share(Request $request)
 {
     $room = Room::findOrFail($request->room_id);
     if (!roomController::checkOwner($room)) {
         throw new Exception('Unauthorized');
     }
     $bbb = new BigBlueButton($request->server_id);
     $recUrl = substr($bbb->getUrl(), 0, -14) . 'playback/presentation/0.9.0/playback.html?meetingId=' . $request->rec_id;
     $recordings = self::get($room);
     foreach ($recordings as $rec) {
         if ($rec['id'] == $request->rec_id) {
             $time = $rec['time'];
         }
     }
     foreach ($room->participants as $part) {
         Mail::send('emails.share_rec', ['recUrl' => $recUrl, 'recTime' => $time, 'owner_mail' => $user->mail], function ($message) use($request, $part) {
             $message->to($part->mail)->subject('Recording Share');
         });
     }
     return redirect()->back()->with('message', trans('room.show.recording.sent'));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $room = Room::findOrFail($id);
     if (!roomController::checkOwner($room)) {
         throw new Exception('Unauthorized');
     }
     //get all servers meeting existed and destroy
     $bbb_servers = $room->meetings()->groupBy('bbb_server')->get(['bbb_server']);
     $recordings = array();
     //end meeting in bbb if running
     $bbb_id = bbbController::running($room);
     if ($bbb_id) {
         $bbb = new BigBlueButton($bbb_id);
         if ($bbb->isUp()) {
             $endParams = array('meetingId' => $room->bbb_meeting_id, 'password' => $room->mod_pass);
             $bbb->endMeetingWithXmlResponseArray($endParams);
         }
     }
     //delete recordings
     $recordings = recordingsController::get($room);
     if ($recordings) {
         //keep recordings from each server
         foreach ($recordings as $rec) {
             $rids[$rec->server_id] = $rec['recordId'] . ',';
         }
         //send requests to servers
         foreach ($rids as $server_id => $recordind_ids) {
             $bbb = new BigBlueButton($server_id);
             if ($bbb->isUp()) {
                 $bbb->deleteRecordingsWithXmlResponseArray(array('recordId' => $recording_ids));
             }
         }
     }
     //delete room from database
     $room->delete();
     return Redirect::action('roomController@own');
 }
Beispiel #3
0
 public function join($id)
 {
     $room = Room::findOrFail($id);
     $access = roomController::checkAccess($room);
     if (!$access) {
         throw new Exception('Unauthorized');
     } else {
         if ($access == 1) {
             $pass = $room->mod_pass;
         } else {
             $pass = $room->att_pass;
         }
     }
     //check if meeting running and create if needed
     $bbb_id = bbbController::running($room);
     if (!$bbb_id) {
         $bbb_id = bbbController::create($room);
     }
     $user = Auth::user();
     //join meeting
     $bbb = new BigBlueButton($bbb_id);
     $params = array('meetingId' => $room->bbb_meeting_id, 'username' => $user->mail, 'userId' => '', 'webVoiceConf' => '', 'password' => $pass);
     try {
         $result = $bbb->getJoinMeetingURL($params);
     } catch (Exception $e) {
         throw new Exception($e->getMessage() . "\n");
     }
     return redirect($result);
 }