Class Horde_Data_ldif

Description

Horde_Data implementation for LDAP Data Interchange Format (LDIF).

$Horde: turba/lib/Data/ldif.php,v 1.2.2.6 2010-09-21 16:20:40 jan Exp $

Copyright 2007-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /lib/Data/ldif.php (line 16)

Horde_Data
   |
   --Horde_Data_ldif
Variable Summary
Method Summary
 string exportData (array $data, [boolean $header = false])
 void exportFile (string $filename, array $data, [boolean $header = false])
 void importData ( $contents, [ $header = false])
 mixed nextStep (integer $action, [array $param = array()])
 boolean _is_safe_string (string $str)
Variables
mixed $_contentType = 'text/ldif' (line 20)
mixed $_extension = 'ldif' (line 18)
array $_mozillaAttr = array('cn', 'givenName', 'sn', 'mail', 'mozillaNickname',
'homeStreet', 'mozillaHomeStreet2', 'mozillaHomeLocalityName',
'mozillaHomeState', 'mozillaHomePostalCode',
'mozillaHomeCountryName', 'street',
'mozillaWorkStreet2', 'l', 'st', 'postalCode',
'c', 'homePhone', 'telephoneNumber', 'mobile',
'fax', 'title', 'company', 'description', 'mozillaWorkUrl',
'department', 'mozillaNickname')
(line 28)

Useful Mozilla address book attribute names.

  • private:
array $_turbaAttr = array('name', 'firstname', 'lastname', 'email', 'alias',
'homeAddress', 'homeStreet', 'homeCity',
'homeProvince', 'homePostalCode', 'homeCountry',
'workAddress', 'workStreet', 'workCity', 'workProvince',
'workPostalCode', 'workCountry',
'homePhone', 'workPhone', 'cellPhone',
'fax', 'title', 'company', 'notes', 'website',
'department', 'nickname')
(line 43)

Useful Turba address book attribute names.

  • private:
array $_turbaMozillaMap = array('name' => 'cn',
'firstname' => 'givenName',
'lastname' => 'sn',
'email' => 'mail',
'alias' => 'mozillaNickname',
'homePhone' => 'homePhone',
'workPhone' => 'telephoneNumber',
'cellPhone' => 'mobile',
'fax' => 'fax',
'title' => 'title',
'company' => 'company',
'notes' => 'description',
'homeAddress' => 'homeStreet',
'homeStreet' => 'mozillaHomeStreet2',
'homeCity' => 'mozillaHomeLocalityName',
'homeProvince' => 'mozillaHomeState',
'homePostalCode' => 'mozillaHomePostalCode',
'homeCountry' => 'mozillaHomeCountryName',
'workAddress' => 'street',
'workStreet' => 'mozillaWorkStreet2',
'workCity' => 'l',
'workProvince' => 'st',
'workPostalCode' => 'postalCode',
'workCountry' => 'c',
'website' => 'mozillaWorkUrl',
'department' => 'department',
'nickname' => 'mozillaNickname')
(line 57)

Turba address book attribute names and the corresponding Mozilla name.

  • private:
Methods
exportData (line 174)

Builds a LDIF file from a given data structure and returns it as a string.

  • return: The LDIF data.
string exportData (array $data, [boolean $header = false])
  • array $data: A two-dimensional array containing the data set.
  • boolean $header: If true, the rows of $data are associative arrays with field names as their keys.
exportFile (line 157)

Builds a LDIF file from a given data structure and triggers its download.

It DOES NOT exit the current script but only outputs the correct headers and data.

void exportFile (string $filename, array $data, [boolean $header = false])
  • string $filename: The name of the file to be downloaded.
  • array $data: A two-dimensional array containing the data set.
  • boolean $header: If true, the rows of $data are associative arrays with field names as their keys.
importData (line 122)
void importData ( $contents, [ $header = false])
  • $contents
  • $header
nextStep (line 224)

Takes all necessary actions for the given import step, parameters and form values and returns the next necessary step.

  • return: Either the next step as an integer constant or imported data set after the final step.
mixed nextStep (integer $action, [array $param = array()])
  • integer $action: The current step. One of the IMPORT_* constants.
  • array $param: An associative array containing needed parameters for the current step.
_is_safe_string (line 95)

Check if a string is safe according to RFC 2849, or if it needs to be base64 encoded.

  • return: True if the string is safe, false otherwise.
  • private:
boolean _is_safe_string (string $str)
  • string $str: The string to check.

Documentation generated on Sun, 30 Jan 2011 05:39:25 +0000 by phpDocumentor 1.4.3