function _disqus_migrate_import_now_validate in Disqus 6
Validate handler to ensure user entered proper strtotime syntax
1 string reference to '_disqus_migrate_import_now_validate'
- disqus_migrate_admin_import in include/
disqus_migrate.import.inc - Menu callback for importing actions
File
- include/
disqus_migrate.import.inc, line 100
Code
function _disqus_migrate_import_now_validate($form, &$form_state) {
if (!empty($form_state['values']['since']) && strtotime($form_state['values']['since']) === FALSE) {
form_set_error('sync][since', t('Invalid strtotime() syntax.'));
}
$secret_key = variable_get('disqus_secretkey', '');
if (empty($secret_key)) {
form_set_error('', t('Your secret key must be entered before using the import functionality. Please get your secret API key from your Disqus application and enter it in the settings.'));
}
if (!_disqus_migrate_api_exists()) {
form_set_error('', t('You need to upload the Disqus API to your libraries folder.'));
}
}