function ParseContacts($uid) { if ($uid == "--all") { ParseAllcontacts(); return; } $ct = new user($uid); $f = new zarafa_contacts(); $f->connect(null, $ct->uid, $ct->password); $contacts = $f->ParseContacts(); while (list($num, $contact) = each($contacts)) { if ($contact["email1"] == null) { continue; } $_contact = new contacts($ct->uid); $employeeNumber = $_contact->employeeNumberByEmail($contact["email1"]); if ($employeeNumber != null) { $_contact = new contacts($ct->uid, $employeeNumber); if ($_contact->modifyTimestamp == $contact["last_modification_time"]) { continue; } } $_contact->displayName = $contact["display_name"]; $_contact->fileAs = $contact["fileas"]; $_contact->givenName = $contact["given_name"]; // First Name=$contact["gender"]; $_contact->telephoneNumber = $contact["office_telephone_number"]; $_contact->homePhone = $contact["home_telephone_number"]; $_contact->homePostalAddress = $contact["home_address_street"] . ", {$contact["home_address_postal_code"]} {$contact["home_address_city"]} {$contact["home_address_state"]} {$contact["home_address_country"]}"; $_contact->street = $contact["business_street"]; //$_contact->postOfficeBox=$contact["gender"];//Professional address $_contact->postalCode = $contact["business_postcode"]; $_contact->postalAddress = $contact["business_street"]; $_contact->l = $contact["business_city"]; // Business city $_contact->st = $contact["business_state"]; // Business state/province $_contact->c = $contact["business_country"]; // Country $_contact->mail = $contact["email1"]; $_contact->mobile = $contact["cellular_telephone_number"]; $_contact->labeledURI = $contact["business_home_page"]; // personal URL $_contact->modifyTimestamp = $contact["last_modification_time"]; //when entry was modified $_contact->department = $contact["department_name"]; $_contact->o = $contact["company_name"]; $_contact->note = $contact["notes"]; if (isset($contact["email2"])) { $_contact->mozillaSecondEmail[] = $contact["email2"]; } if (isset($contact["email3"])) { $_contact->mozillaSecondEmail[] = $contact["email3"]; } $_contact->mozillaNickname = $contact["nickname"]; $_contact->facsimileTelephoneNumber = $contact["primary_fax_number"]; $_contact->Fax = $contact["primary_fax_number"]; $_contact->nsMSNid = $contact["IM1"]; $_contact->businessRole = $contact["profession"]; $_contact->managerName = $contact["manager_name"]; $_contact->assistantName = $contact["assistant"]; if (isset($contact["birthday"])) { $_contact->birthDate = date("Y-m-d", $contact["birthday"]); } $_contact->spouseName = $contact["spouse_name"]; if (isset($contact["wedding_anniversary"])) { $_contact->anniversary = date("Y-m-d", $contact["wedding_anniversary"]); } $_contact->modifyTimestamp = $contact["last_modification_time"]; $_contact->title = $contact["title"]; //Working title, as opposed to personell title. e.g. "Project leader", etc. $_contact->sn = $contact["surname"]; // Last Name=$contact["gender"]; $_contact->NoExport = true; $_contact->Save(); sleep(1); } }