You are here

function _disqus_migrate_export_api_validate in Disqus 6

When exporting via the API, make sure the user filled out the necessary info

1 string reference to '_disqus_migrate_export_api_validate'
disqus_migrate_admin_export in include/disqus_migrate.export.inc
Menu callback for the export actions

File

include/disqus_migrate.export.inc, line 81

Code

function _disqus_migrate_export_api_validate($form, &$form_state) {

  // Check for existance of Disqus API
  if (!file_exists('sites/all/libraries/disqusapi/disqusapi.php')) {
    form_set_error('', t('Download the <a href="@disqusapiurl">PHP API implementation here</a> and upload the disqusapi folder to your sites/all/libraries folder. Also ensure that you have authenticated with Disqus.', array(
      '@disqusapiurl' => url('https://github.com/disqus/disqus-php', array(
        'absolute' => TRUE,
      )),
    )));
  }

  // Make sure secret key is filled out
  $api_secret = variable_get('disqus_secretkey', '');
  if (empty($api_secret)) {
    form_set_error('', t('Your secret key must be entered before using this export functionality. Please get your application API keys from Disqus and enter them in the "Advanced" fieldset on the settings page.'));
  }
}