Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a new contact on iPhone works, searching for it does not #3

Open
fortiko opened this issue Apr 4, 2012 · 0 comments
Open

Comments

@fortiko
Copy link

fortiko commented Apr 4, 2012

Creating a new contact on an iPhone via PHP-Push works just fine, as can be seen from the log output below. Only problem: some fields (address, ...) are not missing, and therefore missing after creation even though the user entered them! I will file an additional issue for that.

HOWEVER, that contact is not visible/searchable via the Exchange group in contacts after creating it.

Surprisingly, the contact IS visible in the underlying LDAP directory (that I configured as an independent account)...

04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::New Record:: dn will be uid=1333554315890912,cn=[email protected],ou=private,ou=rcabook,dc=domain,dc=tld
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::Attribute set for: o
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::Attribute set for: mail
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::Attribute set for: homePhone
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::Attribute set for: givenName
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::Attribute set for: sn
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::Attribute set for: mobile
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::Attribute set for: labeledURI
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::Attribute set for: cn
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::Array Dump:
Array(
[o] => Company
[mail] => [email protected]
[homePhone] => 5678
[givenName] => First
[sn] => Last
[mobile] => 1234
[labeledURI] => home.com
[cn] => Last, First
[objectClass] => Array
(
[0] => inetOrgPerson
)
)
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::Record sucessfully added. LDAP said: Success
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts:: Got 1 match for new record
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::entryUUID eaa4fc22-12b8-1031-8bd9-7917677c3178
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts:: New id is eaa4fc22-12b8-1031-8bd9-7917677c3178
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::StatMessage(root, eaa4fc22-12b8-1031-8bd9-7917677c3178)
04/04/12 17:45:15 [21937] [[email protected]] LdapContacts::GetMessageEntry(root, eaa4fc22-12b8-1031-8bd9-7917677c3178)

An idea for improving the code:

replace in backend/ldap_contacts.php

        # No matching record so we need to create it...
        # First we need a new dn value. Methodology respectfully pinched from Contagged Project.
        # Only problem with this is that it can lead to duplicates as 'time' is only seconds.
        $new_uid = time() .str_pad(mt_rand(0,999999),6,"0", STR_PAD_LEFT);

with a SHA512 hash, with time() as the salt? It is very unlikely that two exact same contacts will be created within the same second ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant