ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilLDAPAttributeMappingUtils.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
33 {
41  public static function _getMappingRulesByClass($a_class)
42  {
43  $mapping_rule = array();
44 
45  switch ($a_class) {
46  case 'inetOrgPerson':
47  $mapping_rule['firstname'] = 'givenName';
48  $mapping_rule['institution'] = 'o';
49  $mapping_rule['department'] = 'departmentNumber';
50  $mapping_rule['phone_home'] = 'homePhone';
51  $mapping_rule['phone_mobile'] = 'mobile';
52  $mapping_rule['email'] = 'mail';
53  $mapping_rule['photo'] = 'jpegPhoto';
54  // no break since it inherits from organizationalPerson and person
55 
56  case 'organizationalPerson':
57  $mapping_rule['fax'] = 'facsimileTelephoneNumber';
58  $mapping_rule['title'] = 'title';
59  $mapping_rule['street'] = 'street';
60  $mapping_rule['zipcode'] = 'postalCode';
61  $mapping_rule['city'] = 'l';
62  $mapping_rule['country'] = 'st';
63  // no break since it inherits from person
64 
65  case 'person':
66  $mapping_rule['lastname'] = 'sn';
67  $mapping_rule['phone_office'] = 'telephoneNumber';
68  break;
69 
70  case 'ad_2003':
71  $mapping_rule['firstname'] = 'givenName';
72  $mapping_rule['lastname'] = 'sn';
73  $mapping_rule['title'] = 'title';
74  $mapping_rule['institution'] = 'company';
75  $mapping_rule['department'] = 'department';
76  $mapping_rule['phone_home'] = 'telephoneNumber';
77  $mapping_rule['phone_mobile'] = 'mobile';
78  $mapping_rule['email'] = 'mail';
79  $mapping_rule['street'] = 'streetAddress';
80  $mapping_rule['city'] = 'l,st';
81  $mapping_rule['country'] = 'co';
82  $mapping_rule['zipcode'] = 'postalCode';
83  $mapping_rule['fax'] = 'facsimileTelephoneNumber';
84  break;
85  }
86  return $mapping_rule ? $mapping_rule : array();
87  }
88 }
A collection of static utility functions for LDAP attribute mapping.
static _getMappingRulesByClass($a_class)
Get mapping rule by objectClass.