Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
Class.UsercardLdif.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Class use to import and export Ldif format (like LDAP) with FREEDOM USER Family
9  *
10  * @author Anakeen 2001
11  * @version \$Id: Class.UsercardLdif.php,v 1.9 2005/02/01 16:23:25 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage USERCARD
15  */
16 /**
17  */
18 /**
19  * Class use to import and export Ldif format (like LDAP) with FREEDOM USER Family
20  *
21  * @deprecated use Method.User.php instead
22  */
24 {
25  var $import = array(
26  // Person Class
27  "sn" => "US_LNAME",
28  "cn" => "",
29  "userPassword" => "US_PASSWD",
30  "telephonenumber" => "US_PHONE",
31  // organizationalPerson
32  "title" => "",
33  "x121Address" => "",
34  "registeredAddress" => "",
35  "destinationIndicator" => "",
36  "preferredDeliveryMethod" => "",
37  "telexNumber" => "",
38  "telexTerminalIdentifier" => "",
39  "internationaliSDNNumner" => "",
40  "facsimiletelephonenumber" => "US_FAX",
41  "street" => "",
42  "postOfficeBox" => "",
43  "postalcode" => "US_WORKPOSTALCODE",
44  "postalAddress" => "US_WORKADDR",
45  "physicalDeliveryOfficeName" => "",
46  "ou" => "",
47  "st" => "",
48  "l" => "US_WORKTOWN",
49  // InetOrgPerson
50  "audio" => "",
51  "businessCategory" => "",
52  "carLicense" => "",
53  "departmentNumber" => "US_SERV",
54  "displayName" => "",
55  "employeeNumber" => "US_MATRICULE",
56  "employeeType" => "US_TYPE",
57  "givenName" => "US_FNAME",
58  "homePhone" => "US_HOMEPHONE",
59  "homePostalAddress" => "",
60  "initials" => "US_INITIALS",
61  "jpegPhoto" => "US_PHOTO",
62  "labeledURI" => "US_WORKWEB",
63  "mail" => "US_MAIL",
64  "manager" => "",
65  "mobile" => "US_MOBILE",
66  "o" => "US_SOCIETY",
67  "pager" => "",
68  "photo" => "",
69  "roomNumber" => "US_LOCALISATION",
70  "secretary" => "",
71  "uid" => "US_WHATID",
72  "userCertificate" => "",
73  "x500uniqueIdentifier" => "",
74  "preferredLanguage" => "",
75  "userSMIMECertificate" => "",
76  "userPKCS12" => ""
77  );
78 
79  function g_ReadCard(&$tattr)
80  {
81  // Read a structure of import file : return array ('name', 'value')
82  $tattr = array();
83  $endCardFound = false;
84  $beginCardFound = false;
85  $line = "";
86  // search begin of a card : dn line
87  while ((!feof($this->fd)) && (!$beginCardFound)) {
88  $line = fgets($this->fd, 4096);
89  $beginCardFound = preg_match("/dn:(.*)/", $line);
90  }
91  // search element of a card until : objectclass
92  while ((!feof($this->fd)) && (!$endCardFound)) {
93  if (!$endCardFound) {
94  //line like cellphone:05.61.15.54.54
95  if (preg_match("/([a-z;]*):(.*)/", $line, $reg)) $tattr[$reg[1]] = $reg[2];
96  }
97 
98  $line = fgets($this->fd, 4096);
99  $endCardFound = preg_match("/objectclass:(.*)/", $line);
100  }
101 
102  return (!feof($this->fd));
103  }
104 }
105 ?>
← centre documentaire © anakeen - published under CC License - Dynacase