Skip to content

Instantly share code, notes, and snippets.

@nfreear
Created June 15, 2012 11:03
Show Gist options
  • Select an option

  • Save nfreear/2935884 to your computer and use it in GitHub Desktop.

Select an option

Save nfreear/2935884 to your computer and use it in GitHub Desktop.
Drupal ldap_integration: PHP to filter attributes / E-PD / N.D.Freear 15 June 2012
<?php
/* Drupal 6.x ldap_integration: PHP to filter attributes.
* ietatou_pd:admin/settings/ldap/ldapdata/edit/1.edit-attributes-ldapdata-filter-php
*
* N.D.Freear, 15 June 2012.
*
* Don't include this comment or the <-?php line above!
*/
if ($attributes['cn'][0]) {
$attributes['mail'][0] = strtolower($attributes['cn'][0]) . '@open.ac.uk';
}
$attributes['sig'][] = $attributes['givenname'][0] .' '. $attributes['sn'][0];
$attributes['telx'][] = '+44 (0)1908 X-'. $attributes['telephone'][0];
return $attributes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment