コード例 #1
0
             break;
             // no point in trying to add other people
         }
         // Check if we are waitlisting or booking
         //if ($session->datetimeknown) {
         //      $status = WEBINAR_STATUS_BOOKED;
         //}
         //else {
         $status = WEBINAR_STATUS_WAITLISTED;
         //}
         if (!webinar_user_signup($session, $webinar, $course, '', WEBINAR_BOTH, $status, $adduser, !$suppressemail)) {
             $erruser = $DB->get_record('user', array('id' => $adduser), 'id, firstname, lastname');
             $errors[] = get_string('error:addattendee', 'webinar', fullname($erruser));
         } else {
             //Sign up user to this webinar through Adobe Connect API call
             signup_meeting($webinar, $session, $user);
             //Send registration email to user
             send_email_signup($webinar, $session, $cm, $user);
         }
     }
 } else {
     if ($remove and !empty($frm->removeselect) and confirm_sesskey()) {
         require_capability('mod/webinar:removeattendees', $context);
         foreach ($frm->removeselect as $removeuser) {
             if (!($removeuser = clean_param($removeuser, PARAM_INT))) {
                 continue;
                 // invalid userid
             }
             if (webinar_user_cancel($session, $removeuser, true, $cancelerr)) {
                 // Notify the user of the cancellation if the session hasn't started yet
                 $timenow = time();
コード例 #2
0
ファイル: signup.php プロジェクト: pavelsokolov/webinar
 if (!$session->datetimeknown) {
     $statuscode = WEBINAR_STATUS_WAITLISTED;
 } elseif (webinar_get_num_attendees($session->id) < $session->capacity) {
     // Save available
     $statuscode = WEBINAR_STATUS_BOOKED;
 } else {
     $statuscode = WEBINAR_STATUS_WAITLISTED;
 }
 if (!webinar_session_has_capacity($session, $context)) {
     print_error('sessionisfull', 'webinar', $returnurl);
 } elseif (webinar_manager_needed($webinar) && !webinar_get_manageremail($USER->id)) {
     print_error('error:manageremailaddressmissing', 'webinar', $returnurl);
 } elseif ($submissionid = webinar_user_signup($session, $webinar, $course, $fromform->discountcode, $fromform->notificationtype, $statuscode)) {
     add_to_log($course->id, 'webinar', 'signup', "signup.php?s={$session->id}", $session->id, $cm->id);
     //Sign up user to this webinar through Adobe Connect API call
     signup_meeting($webinar, $session, $USER);
     //Send registration email to user
     send_email_signup($webinar, $session, $cm, $USER);
     $PAGE->set_pagetype('webinar');
     $PAGE->set_title($webinar->name);
     $PAGE->set_heading($webinar->name);
     echo $OUTPUT->header();
     $heading = get_string('registersuccess', 'webinar');
     echo $OUTPUT->heading($heading);
     $message = get_string('registrationsuccessful', 'webinar', $webinar->name);
     $timemessage = 4;
     $message = '<div style="height: 10px;">&nbsp;</div>' . $message;
     redirect($returnurl, $message, $timemessage);
 } else {
     add_to_log($course->id, 'webinar', 'signup (FAILED)', "signup.php?s={$session->id}", $session->id, $cm->id);
     print_error('error:problemsigningup', 'webinar', $returnurl);