/**
  * Do the task.
  */
 public function execute()
 {
     $webex = new \mod_webexactivity\webex();
     $webex->update_recordings(0);
 }
/**
 * Run the WebEx cron functions.
 *
 * @return bool   true if successful.
 */
function webexactivity_cron()
{
    try {
        $webex = new \mod_webexactivity\webex();
        $lastlonglook = get_config('webexactivity', 'loadedallrecordingstime');
        if (time() - $lastlonglook > 3 * 25 * 3600) {
            $webex->update_recordings(0);
            set_config('loadedallrecordingstime', time(), 'webexactivity');
            set_config('loadedpastrecordingstime', time(), 'webexactivity');
        } else {
            $lastmedlook = get_config('webexactivity', 'loadedpastrecordingstime');
            if (time() - $lastmedlook > 9 * 3600) {
                $webex->update_recordings(120);
                set_config('loadedpastrecordingstime', time(), 'webexactivity');
            } else {
                $webex->update_recordings();
            }
        }
    } catch (Exception $e) {
        echo 'Exception thrown (and caught): ' . $e->getMessage();
    }
    try {
        $webex->update_open_sessions();
    } catch (Exception $e) {
        echo 'Exception thrown (and caught): ' . $e->getMessage();
    }
    try {
        $webex->remove_deleted_recordings();
    } catch (Exception $e) {
        echo 'Exception thrown (and caught): ' . $e->getMessage();
    }
    return true;
}
 /**
  * Do the task.
  */
 public function execute()
 {
     $webex = new \mod_webexactivity\webex();
     $webex->remove_deleted_recordings();
 }
 /**
  * Do the task.
  */
 public function execute()
 {
     $webex = new \mod_webexactivity\webex();
     $webex->update_open_sessions();
 }
 /**
  * Check if the auth credentials of the WebEx user are good.
  *
  * @return bool    True if auth succeeded, false if failed.
  */
 public function check_user_auth()
 {
     if (!isset($this->password)) {
         return false;
     }
     $xml = xml_gen::check_user_auth($this);
     $webex = new \mod_webexactivity\webex();
     try {
         $response = $webex->get_response($xml, $this);
     } catch (exception\bad_password $e) {
         return false;
     }
     if ($response) {
         return true;
     } else {
         return false;
     }
 }