You are here

function connector_requirements in Connector 6

Implementation of hook_requirements().

File

./connector.install, line 34
Database and updating for the connector module

Code

function connector_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time
  $t = get_t();

  // Report Drupal version
  if ($phase == 'runtime') {
    if (variable_get('user_email_verification', TRUE)) {
      $requirements['user_email_verification'] = array(
        'title' => $t('User E-mail Address'),
        'value' => $t('Required'),
        'description' => $t("Since a user that's registered through a connector doesn't have an e-mail address it is recommended to !remove the requirement.", array(
          '!remove' => l($t('remove'), 'admin/user/settings'),
        )),
        'severity' => REQUIREMENT_WARNING,
      );
    }
    $count = db_result(db_query("SELECT COUNT(*) FROM {connector_info} WHERE max_life < %d", array(
      ':time' => time(),
    )));
    $old = $count > 0;
    $requirements['connector_old_cache'] = array(
      'title' => $t('Connector user cache'),
      'value' => $old ? $t('Too old') : $t('Up to date'),
      'severity' => $old ? REQUIREMENT_WARNING : REQUIREMENT_OK,
    );
    if ($old) {
      $requirements['connector_old_cache']['description'] = $t("The content of the Connector module's user information cache is too old - this might violate the terms of the third party we imported the information from. Fix this by running the cron job more often.");
    }
  }
  return $requirements;
}