/**
  * Check and update recordings from WebEx.
  *
  * @param int    Number of days to look back. 0 for forever.
  * @return bool  True on success, false on failure.
  */
 public function update_recordings($daysback = 10)
 {
     $params = new \stdClass();
     if ($daysback) {
         $params->startdate = time() - $daysback * 24 * 3600;
         $params->enddate = time() + 12 * 3600;
     }
     $found = 0;
     $start = 0;
     $status = true;
     $urls = array();
     $params->servicetype = array();
     $setting = get_config('webexactivity', 'typemeetingcenter');
     if (stripos($setting, webex::WEBEXACTIVITY_TYPE_INSTALLED) !== false) {
         $params->servicetype[] = "MeetingCenter";
     }
     $setting = get_config('webexactivity', 'typetrainingcenter');
     if (stripos($setting, webex::WEBEXACTIVITY_TYPE_INSTALLED) !== false) {
         $params->servicetype[] = "TrainingCenter";
     }
     do {
         // Workaround for stupid WebEx bug.
         $params->start = $start;
         $xml = type\base\xml_gen::list_recordings($params);
         if (!($response = $this->get_response($xml))) {
             return false;
         }
         list($found, $start, $count) = self::get_list_info($response);
         $start += $count;
         $this->process_conf_urls($response, $urls);
     } while ($found > $start);
     unset($params->servicetype);
     $found = 0;
     $start = 0;
     $status = true;
     do {
         $params->start = $start;
         $xml = type\base\xml_gen::list_recordings($params);
         if (!($response = $this->get_response($xml))) {
             return false;
         }
         list($found, $start, $count) = self::get_list_info($response);
         $start += $count;
         $status = $this->proccess_recording_response($response, $urls) && $status;
     } while ($found > $start);
     if ($status && !$daysback) {
         $this->remove_missing_recordings();
     }
     return $status;
 }
 /**
  * Check and update recordings from WebEx.
  *
  * @param int    Number of days to look back. 0 for forever.
  * @return bool  True on success, false on failure.
  */
 public function update_recordings($daysback = 10)
 {
     $params = new \stdClass();
     if ($daysback) {
         $params->startdate = time() - $daysback * 24 * 3600;
         $params->enddate = time() + 12 * 3600;
     }
     $found = 0;
     $start = 0;
     $status = true;
     do {
         $params->start = $start;
         $xml = type\base\xml_gen::list_recordings($params);
         if (!($response = $this->get_response($xml))) {
             return false;
         }
         list($found, $start, $count) = self::get_list_info($response);
         $start += $count;
         $status = $this->proccess_recording_response($response) && $status;
     } while ($found > $start);
     if ($status && !$daysback) {
         $this->remove_missing_recordings();
     }
     return $status;
 }