/**
  * Retrieve a list of attendees
  * 
  * @return ItemList
  * @throws ErrorException If there is a problem with API call.
  */
 public function getAttendeeList()
 {
     $attendeeList = new ItemList();
     if ($this->isAuthenticated() && isset($this->meetingKey)) {
         $url = 'https://api.citrixonline.com/G2M/rest/meetings/' . $this->meetingKey . '/attendees' . '?startDate=' . date('c', $this->meetingStart) . '&endDate=' . date('c', $this->meetingEnd);
         $results = Utilities::callApi($url, $this->getAccessToken(), 'GET');
         if ($results) {
             foreach ($results as $person) {
                 $personDetails = array('name' => $person->attendeeName, 'email' => $person->attendeeEmail, 'meetingKey' => $this->getMeetingKey());
                 $attendeeList->addItem(new Attendee($this->getAuthInfo(), $personDetails));
             }
         }
     } else {
         if (!$this->isAuthenticated()) {
             throw new \ErrorException('User must be authenticated and an 
                 accessToken is needed to list attendees.', 181);
         } else {
             throw new \ErrorException('A meeting key is required to 
                 list attendees.', 182);
         }
     }
     return $attendeeList;
 }
 /**
  * Retrieve a list of attendees
  * 
  * @return ItemList
  * @throws ErrorException If there is a problem with API call.
  */
 public function getAttendeeList()
 {
     $attendeeList = new ItemList();
     $xml = $this->loadXml('ListAttendees');
     if ($xml) {
         $xml->body->bodyContent->sessionKey = $this->getMeetingKey();
         try {
             $results = $this->callApi($xml->asXML());
             if ($results) {
                 if ((int) $results->matchingRecords->returned->__toString() > 0) {
                     foreach ($results->attendee as $person) {
                         $personDetails = array('name' => $person->person->name->__toString(), 'email' => $person->person->email->__toString(), 'meetingKey' => $this->getMeetingKey());
                         $attendeeList->addItem(new Attendee($this->getAuthInfo(), $personDetails));
                     }
                 }
             }
         } catch (\ErrorException $e) {
             if (!preg_match('/000015/', $e->getMessage())) {
                 throw $e;
             }
         }
     }
     return $attendeeList;
 }
 /**
  * Retrieve meeting attendee history and store in $this->attendeeHistoryDetails. 
  * 
  * If $onlyThisMeeting is true, only this one meeting will be returned. If it
  * is false, a list of meetings will be returned ordered by start time.
  * 
  * @param boolean $onlyThisMeeting If true, the history call will only get
  *   history details for this meeting, if false, you can use $options
  *   to specify search criteria for multiple meetings. If false this method
  *   returns an ItemList of meetings.
  * @param array|false $options Search options when wanting to retrieve 
  *   history for more meetings than just this one. Valid options are: 
  *   startTimeRangeStart, startTimeRangeEnd, hostUsername, startFrom, 
  *   maximumNum
  * @return \Smx\SimpleMeetings\WebEx\Meeting|\Smx\SimpleMeetings\Base\ItemList 
  *   If $onlyThisMeeting is false, returns ItemList of meetings.
  * @throws \ErrorException In case of API failure
  */
 public function getAttendeeHistory($onlyThisMeeting = true, $options = false)
 {
     $xml = $this->loadXml('GetMeetingAttendeeHistory');
     if ($xml) {
         if ($onlyThisMeeting) {
             $xml->body->bodyContent->meetingKey = $this->meetingKey;
         }
         if (is_array($options)) {
             if (isset($options['startTimeRangeStart'])) {
                 $xml->body->bodyContent->startTimeScope->sessionStartTimeStart = $options['startTimeRangeStart'];
             }
             if (isset($options['startTimeRangeEnd'])) {
                 $xml->body->bodyContent->startTimeScope->sessionStartTimeEnd = $options['startTimeRangeEnd'];
             }
             if (isset($options['hostUsername'])) {
                 $xml->body->bodyContent->hostWebExID = $options['hostUsername'];
             }
             if (isset($options['startFrom'])) {
                 $xml->body->bodyContent->listControl->startFrom = $options['startFrom'];
             }
             if (isset($options['maximumNum'])) {
                 $xml->body->bodyContent->hostWebExID = $options['maximumNum'];
             }
         }
         $historyList = new ItemList();
         try {
             $results = $this->callApi($xml->asXML());
             if ($results) {
                 if ($onlyThisMeeting) {
                     $meet = $results->meetingAttendeeHistory;
                     $this->attendeeHistoryDetails = array('joinTime' => strtotime($meet->joinTime->__toString()), 'leaveTime' => strtotime($meet->leaveTime->__toString()), 'duration' => $meet->duration->__toString(), 'name' => $meet->name->__toString(), 'email' => $meet->email->__toString(), 'ipAddress' => $meet->ipAddress->__toString(), 'voipDuration' => $meet->voipDuration->__toString());
                     return $this;
                 } else {
                     foreach ($results->meetingAttendeeHistory as $meet) {
                         $mtgDetails = array('meetingKey' => $meet->meetingKey->__toString(), 'meetingName' => $meet->confName->__toString(), 'startTime' => strtotime($meet->joinTime->__toString()), 'duration' => $meet->duration->__toString(), 'sitename' => $this->getSitename());
                         $attendeeDetails = array('joinTime' => strtotime($meet->joinTime->__toString()), 'leaveTime' => strtotime($meet->leaveTime->__toString()), 'duration' => $meet->duration->__toString(), 'name' => $meet->name->__toString(), 'email' => $meet->email->__toString(), 'ipAddress' => $meet->ipAddress->__toString(), 'voipDuration' => $meet->voipDuration->__toString());
                         $newMeeting = new Meeting($this->getAuthInfo(), $mtgDetails);
                         $newMeeting->attendeeHistoryDetails = $attendeeDetails;
                         $historyList->addItem($newMeeting);
                     }
                     return $historyList;
                 }
             }
         } catch (\ErrorException $e) {
             if (!preg_match('/000015/', $e->getMessage())) {
                 throw $e;
             } elseif (!$onlyThisMeeting) {
                 return $historyList;
             }
         }
     }
     return $this;
 }
 public function getAttendeeList()
 {
     $attendeeList = new ItemList();
     $details = $this->getServerMeetingDetails();
     if ($details->attendees) {
         foreach ($details->attendees->attendee as $attendee) {
             $attendeeDetails = new \stdClass();
             $attendeeDetails->name = $attendee->fullName->__toString();
             $attendeeDetails->userId = $attendee->userID->__toString();
             $attendeeDetails->role = $attendee->role->__toString();
             $attendeeDetails->meetingKey = $this->meetingKey;
             $attendeeList->addItem($attendeeDetails);
         }
     }
     return $attendeeList;
 }
Exemple #5
0
 public function getUserList($options = false)
 {
     $userList = new ItemList();
     $xml = $this->loadXml('ListUsers');
     if ($xml) {
         if (is_array($options)) {
             if (isset($options['username'])) {
                 $xml->body->bodyContent->webExId = $options['username'];
             }
             if (isset($options['email'])) {
                 $xml->body->bodyContent->email = $options['email'];
             }
             if (isset($options['status'])) {
                 if ($options['status'] == User::STATUS_ACTIVE) {
                     $xml->body->bodyContent->active = 'ACTIVATED';
                 } elseif ($options['status'] == User::STATUS_INACTIVE) {
                     $xml->body->bodyContent->active = 'DEACTIVATED';
                 }
             }
             if (isset($options['regDateStart']) && isset($options['regDateEnd'])) {
                 $xml->body->bodyContent->dataScope->regDateStart = $options['regDateStart'];
                 $xml->body->bodyContent->dataScope->regDateEnd = $options['regDateEnd'];
             }
         }
         $results = $this->callApi($xml->asXML());
         foreach ($results->user as $user) {
             $userInfo = array('firstName' => $user->firstName->__toString(), 'lastName' => $user->lastName->__toString(), 'email' => $user->email->__toString(), 'username' => $user->webExId->__toString());
             if ($user->active->__toString() == 'ACTIVATED') {
                 $userInfo['status'] = User::STATUS_ACTIVE;
             } elseif ($user->active->__toString() == 'DEACTIVATED') {
                 $userInfo['status'] = User::STATUS_INACTIVE;
             }
             $userList->addItem(new User($this->getAuthInfo(), $userInfo));
         }
     }
     return $userList;
 }
 public function getMeetingList($options = false)
 {
     if ($this->isAuthenticated()) {
         if (!isset($options['startTime'])) {
             $startTime = date('c', time() - 2592000);
         }
         if (!isset($options['endTime'])) {
             $endTime = date('c', time() + 5184000);
         }
         $url = "https://api.citrixonline.com/G2M/rest/meetings" . "?scheduled=true&history=false&startDate={$startTime}" . "&endDate={$endTime}";
         $response = Utilities::callApi($url, $this->getAccessToken(), 'GET');
         $meetingList = new ItemList();
         if (is_array($response) && count($response) > 0) {
             foreach ($response as $meeting) {
                 $startTime = strtotime($meeting->startTime);
                 $duration = strtotime($meeting->endTime) - $startTime;
                 $mtgDetails = array('meetingName' => $meeting->subject, 'startTime' => $startTime, 'duration' => $duration, 'meetingKey' => $meeting->meetingId, 'telephonyInfo' => $meeting->conferenceCallInfo, 'organizerKey' => $meeting->organizerKey);
                 $meetingList->addItem(new Meeting($this->getAuthInfo(), $mtgDetails));
             }
         }
         return $meetingList;
     } else {
         throw new \ErrorException('User must be authenticated and an 
                 accessToken is needed to get meeting list.', 174);
     }
 }