You are here

function _is_cloudflare_configured in CloudFlare 7

Same name and namespace in other branches
  1. 6 cloudflare.module \_is_cloudflare_configured()

Check if Cloudflare has been configured.

1 call to _is_cloudflare_configured()
cloudflare_form_comment_admin_overview_alter in ./cloudflare.module
Implementation of hook_form_FORM_ID_alter().

File

./cloudflare.module, line 476

Code

function _is_cloudflare_configured() {

  // Retrieve the settings.
  $cf_settings = _cloudflare_settings();

  // TRUE if email and api key are configured.
  $cloudflare_configured = $cf_settings['cf_api_email'] && $cf_settings['cf_api_key'];

  // Set a friendly message to remind administrator to configure the module.
  if (!$cloudflare_configured && user_access('administer cloudflare')) {
    drupal_set_message(t('Oops! ') . l('Cloudflare', 'admin/config/people/cloudflare') . t(' has not been configured, so we are hiding some nifty features from you. Let\'s get \'er done shall we?'), 'status', FALSE);
  }
  return $cloudflare_configured;
}