Get mapping rule by objectClass.
{
$mapping_rule = array();
switch($a_class)
{
case 'inetOrgPerson':
$mapping_rule['firstname'] = 'givenName';
$mapping_rule['institution'] = 'o';
$mapping_rule['department'] = 'departmentNumber';
$mapping_rule['phone_home'] = 'homePhone';
$mapping_rule['phone_mobile'] = 'mobile';
$mapping_rule['email'] = 'mail';
$mapping_rule['photo'] = 'jpegPhoto';
case 'organizationalPerson':
$mapping_rule['fax'] = 'facsimileTelephoneNumber';
$mapping_rule['title'] = 'title';
$mapping_rule['street'] = 'street';
$mapping_rule['zipcode'] = 'postalCode';
$mapping_rule['city'] = 'l';
$mapping_rule['country'] = 'st';
case 'person':
$mapping_rule['lastname'] = 'sn';
$mapping_rule['phone_office'] = 'telephoneNumber';
break;
case 'ad_2003':
$mapping_rule['firstname'] = 'givenName';
$mapping_rule['lastname'] = 'sn';
$mapping_rule['title'] = 'title';
$mapping_rule['institution'] = 'company';
$mapping_rule['department'] = 'department';
$mapping_rule['phone_home'] = 'telephoneNumber';
$mapping_rule['phone_mobile'] = 'mobile';
$mapping_rule['email'] = 'mail';
$mapping_rule['street'] = 'streetAddress';
$mapping_rule['city'] = 'l,st';
$mapping_rule['country'] = 'co';
$mapping_rule['zipcode'] = 'postalCode';
$mapping_rule['fax'] = 'facsimileTelephoneNumber';
break;
}
return $mapping_rule ? $mapping_rule : array();
}