You are here

class FeedsDrupalUserLdapEntryFetcher in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_feeds/FeedsDrupalUserLdapEntryFetcher.inc \FeedsDrupalUserLdapEntryFetcher
  2. 7 ldap_feeds/FeedsDrupalUserLdapEntryFetcher.inc \FeedsDrupalUserLdapEntryFetcher

Fetches data via LDAP Query.

Hierarchy

Expanded class hierarchy of FeedsDrupalUserLdapEntryFetcher

2 string references to 'FeedsDrupalUserLdapEntryFetcher'
ldap_feeds_feeds_plugins in ldap_feeds/ldap_feeds.module
Implements hook_feeds_plugins().
ldap_feeds_form_feeds_ui_mapping_form_alter in ldap_feeds/ldap_feeds.module
show some sample ldap user data to help with mapping interface

File

ldap_feeds/FeedsDrupalUserLdapEntryFetcher.inc, line 82
FeedsDrupalUserLdapEntryFetcher

View source
class FeedsDrupalUserLdapEntryFetcher extends FeedsFetcher {

  /**
   * Implements FeedsFetcher::fetch().
   */
  public function fetch(FeedsSource $source) {
    $source_config = $source
      ->getConfigFor($this);
    $result = new FeedsDrupalUserLdapEntryFetcherResult($source_config);
    return $result;
  }

  /**
   * Override parent::configDefaults().
   */
  public function configDefaults() {
    return array(
      'filterLdapAuthenticated' => array(),
      'availableDrupalUserAttributes' => ldap_feeds_drupal_user_attributes(),
      'filterRoles' => array(),
    );
  }

  /**
   * Override parent::configForm().
   */
  public function configForm(&$form_state) {
    $form = array();
    $form['filterLdapAuthenticated'] = array(
      '#type' => 'checkbox',
      '#title' => t('Only return ldap authenticated users.'),
      '#default_value' => $this->config['filterLdapAuthenticated'],
      '#description' => t('If checked, only users who are associated with ldap accounts will be returned.'),
    );
    return $form;
  }

  /**
   * Override parent::sourceFormValidate().
   */
  public function sourceFormValidate(&$values) {
  }

  /**
   * Override parent::sourceForm().
   */
  public function sourceForm($source_config) {
    $tokens = array(
      '!edit_link' => l(t('Edit Feed'), 'admin/structure/feeds/edit/' . $this->id),
    );
    $form_state = array();
    $form = $this
      ->configForm($form_state);
    $form['addendum'] = array(
      '#type' => 'markup',
      '#markup' => t('This import is configured at !edit_link.', $tokens),
    );
    return $form;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FeedsDrupalUserLdapEntryFetcher::configDefaults public function Override parent::configDefaults().
FeedsDrupalUserLdapEntryFetcher::configForm public function Override parent::configForm().
FeedsDrupalUserLdapEntryFetcher::fetch public function Implements FeedsFetcher::fetch().
FeedsDrupalUserLdapEntryFetcher::sourceForm public function Override parent::sourceForm().
FeedsDrupalUserLdapEntryFetcher::sourceFormValidate public function Override parent::sourceFormValidate().