You are here

function opigno_moxtra_app_cron in Opigno Moxtra App 7

Implements hook_cron

File

includes/opigno_moxtra_app.cron.inc, line 6

Code

function opigno_moxtra_app_cron() {
  $organization = variable_get('opigno_moxtra_app_org_id', NULL);
  $status = variable_get('opigno_moxtra_app_status', 0);
  if (!empty($organization)) {
    $info = opigno_moxtra_app_api_opigno_get_organization_info();

    // Let the Opigno instance know that it is active or not
    if (!isset($info->opigno_error_message)) {
      if ($info->active) {
        variable_set('opigno_moxtra_app_status', 1);
      }
      else {
        variable_set('opigno_moxtra_app_status', 0);
      }
    }
  }
}