]> git.sur5r.net Git - contagged/blob - inc/fields.php
fix broken evolutionPerson fields (country not provided, but anniversary and categori...
[contagged] / inc / fields.php
1 <?php
2 /**
3  * Configures fieldname - LDAP attribute associations
4  *
5  * If you use other attributes you may change the assignments here.
6  * Note the arrays need to remain flippable, eg. both sides have to
7  * be unique
8  *
9  * Fields starting with a * may contain multiple values (needs to be
10  * handled by the template as well)
11  */
12
13 global $conf;
14
15 /**
16  * The object classes to store with contacts
17  */
18 $OCLASSES = $conf['oclasses'];
19
20 /**
21  * The standard fields suported by OpenLDAP's default schemas
22  */
23 $FIELDS = array(
24     'dn'           => 'dn',                          // don't touch!
25     'name'         => 'sn',
26     'displayname'  => 'cn',
27     'givenname'    => 'givenName',
28     'title'        => 'title',
29     'organization' => 'o',                           // aka. company
30     'office'       => 'physicalDeliveryOfficeName',
31     'street'       => 'postalAddress',
32     'zip'          => 'postalCode',
33     'location'     => 'l',                           // aka. city
34     'phone'        => 'telephoneNumber',
35     'fax'          => 'facsimileTelephoneNumber',
36     'mobile'       => 'mobile',                      // aka. cell phone
37     'pager'        => 'pager',
38     'homephone'    => 'homePhone',
39     'homestreet'   => 'homePostalAddress',
40     'photo'        => 'jpegPhoto',
41     'url'          => 'labeledURI',
42     'note'         => 'description',
43     'manager'      => 'manager',                     // aka. key account
44     '_mail'        => 'mail',
45 );
46
47 /**
48  * If the provided "extended" schema is used the following fields
49  * and object classes are added
50  */
51 if (array_search('contactPerson', $conf['oclasses']) !== false) {
52     $FIELDS['anniversary']  = 'anniversary';
53     $FIELDS['_marker']      = 'marker';                  // aka. tags
54     $FIELDS['country']      = 'c';
55 }
56
57 /**
58  * If the open exchange schema is used the following fields
59  * and object classes are added
60  */
61 if (array_search('OXUserObject', $conf['oclasses']) !== false) {
62     $FIELDS['country']          = 'userCountry';
63     $FIELDS['birthday']         = 'birthDay';
64     $FIELDS['ipphone']          = 'IPPhone';
65     $FIELDS['_marker']          = 'OXUserCategories';
66     $FIELDS['instantmessenger'] = 'OXUserInstantMessenger';
67     $FIELDS['timezone']         = 'OXTimeZone';
68     $FIELDS['position']         = 'OXUserPosition';
69     $FIELDS['certificate']      = 'relClientCert';
70     $FIELDS['domain']           = 'domain';
71 }
72
73 /**
74  * If the Evolution schema is used the following fields
75  * and object classes are added
76  */
77 if (array_search('evolutionPerson', $conf['oclasses']) !== false) {
78     $FIELDS['anniversary'] = 'anniversary';
79     $FIELDS['department']  = 'ou';
80     $FIELDS['state']       = 'st';
81     $FIELDS['phone']       = 'primaryPhone';
82     $FIELDS['switchboard'] = 'companyPhone';
83     $FIELDS['note']        = 'note';
84     $FIELDS['manager']     = 'seeAlso';
85     $FIELDS['birthday']    = 'birthDate';
86     $FIELDS['spouse']      = 'spouseName';
87     $FIELDS['_marker']     = 'categories'; // aka. tags
88 }
89
90 /**
91  * Flip the array
92  */
93 $RFIELDS = array_flip($FIELDS);
94