Exemplo n.º 1
0
     break;
 case 'do_disable':
     disable_bbb_session($_GET['id']);
     break;
 case 'do_enable':
     enable_bbb_session($_GET['id']);
     break;
 case 'do_join':
     #check if there is any record-capable bbb server. Otherwise notify users
     if ($_GET['record'] == 'true' && Database::get()->querySingle("SELECT count(*) count FROM bbb_servers WHERE enabled='true' AND enable_recordings='true'")->count == 0) {
         $tool_content .= "<div class='alert alert-info'>{$langBBBNoServerForRecording}</div>";
         break;
     }
     if (bbb_session_running($_GET['meeting_id']) == false) {
         $mod_pw = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s", $_GET['meeting_id'])->mod_pw;
         create_meeting($_GET['title'], $_GET['meeting_id'], $mod_pw, $_GET['att_pw'], $_GET['record']);
     }
     if (isset($_GET['mod_pw'])) {
         header('Location: ' . bbb_join_moderator($_GET['meeting_id'], $_GET['mod_pw'], $_GET['att_pw'], $_SESSION['surname'], $_SESSION['givenname']));
     } else {
         # Get session capacity
         $c = Database::get()->querySingle("SELECT sessionUsers FROM bbb_session where meeting_id=?s", $_GET['meeting_id']);
         $sess = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s", $_GET['meeting_id']);
         $serv = Database::get()->querySingle("SELECT * FROM bbb_servers WHERE id=?d", $sess->running_at);
         if ($c->sessionUsers > 0 && $c->sessionUsers < get_meeting_users($serv->server_key, $serv->api_url, $_GET['meeting_id'], $sess->mod_pw)) {
             $tool_content .= "<p class='noteit'><b>{$langNote}</b>:<br />{$langBBBMaxUsersJoinError}</p>";
             break;
         } else {
             header('Location: ' . bbb_join_user($_GET['meeting_id'], $_GET['att_pw'], $_SESSION['surname'], $_SESSION['givenname']));
         }
     }
Exemplo n.º 2
0
     send_email_sessionupdated($webinar, $session, $cm, $date);
     $sessionid = $session->id;
     $todb->id = $session->id;
     if (!webinar_update_session($todb, $sessiondates)) {
         rollback_sql();
         add_to_log($course->id, 'webinar', 'update session (FAILED)', "sessions.php?s={$session->id}", $webinar->id, $cm->id);
         print_error('error:couldnotupdatesession', 'webinar', $returnurl);
     }
     // Remove old site-wide calendar entry
     if (!webinar_remove_session_from_site_calendar($session)) {
         rollback_sql();
         print_error('error:couldnotupdatecalendar', 'webinar', $returnurl);
     }
 } else {
     //Create meeting through Adobe Connect API call
     $webinardetails = create_meeting($webinar, $fromform, $date, $presenter_details);
     $todb->scoid = $webinardetails->scoid;
     $todb->urlpath = $webinardetails->urlpath;
     if (!($sessionid = webinar_add_session($todb, $sessiondates))) {
         rollback_sql();
         add_to_log($course->id, 'webinar', 'add session (FAILED)', 'sessions.php?f=' . $webinar->id, $webinar->id, $cm->id);
         print_error('error:couldnotaddsession', 'webinar', $returnurl);
     }
 }
 foreach ($customfields as $field) {
     $fieldname = "custom_{$field->shortname}";
     if (!isset($fromform->{$fieldname})) {
         $fromform->{$fieldname} = '';
         // need to be able to clear fields
     }
     if (!webinar_save_customfield_value($field->id, $fromform->{$fieldname}, $sessionid, 'session')) {
Exemplo n.º 3
0
$title = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->title;
$att_pw = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->att_pw;
$record = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->record;
$start_date = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->start_date;
$active = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->active;
$unlock_interval = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->unlock_interval;
$r_group = explode(",",Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->external_users);

if ($active<>'1' || date_diff_in_minutes($start_date,date('Y-m-d H:i:s'))> $unlock_interval || date_diff_in_minutes(date('Y-m-d H:i:s'),$start_date) > 1440 || get_total_bbb_servers()=='0' || !in_array($_GET['username'],$r_group))
{
    echo $langBBBNoteEnableJoin;
    exit;
}
if(bbb_session_running($_GET['meeting_id']) == false)
{
    //echo $title;
    create_meeting($title,$_GET['meeting_id'],$mod_pw,$att_pw,$record);
}
# Get session capacity
$c = Database::get()->querySingle("SELECT sessionUsers FROM bbb_session where meeting_id=?s",$_GET['meeting_id']);
$sess = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id']);
$serv = Database::get()->querySingle("SELECT * FROM bbb_servers WHERE id=?d", $sess->running_at);

if( ($c->sessionUsers > 0) && ($c->sessionUsers < get_meeting_users($serv->server_key,$serv->api_url,$_GET['meeting_id'],$sess->mod_pw)))
{
    $tool_content .= "<div class='alert alert-warning'>$langBBBMaxUsersJoinError</div>";
}
else {
        header('Location: ' . bbb_join_user($_GET['meeting_id'],$att_pw,$_GET['username'],""));
}