LDAP to Domino on 7970
Blake,
Thanks for your most detailed response.
Here is another code I have been using too:
<?php
// This XML-PHP page searches contacts in LDAP and display it on CISCO directory service
// Script Provided by Gael Marronnier From Simstream Company
www.simstream.com [email protected]
//
// First I get the parameter
$filtre = $_REQUEST"filtre";
// Now I contuct the LDAP query
$ds=ldap_connect("serv3.simstream.com");
$myldap="dc=simstream,dc=com";
if ($ds) {
// $r=ldap_bind($ds);
$filtreldap="(&(objectclass=person)(|(givenname=*".$filtre."*)(sn=*".$filtre."*)(cn=*".$filtre."*)(mail=*".$filtre."*)))";
$sr=ldap_search($ds, $myldap, $filtreldap);
// Lets start displaying XML infos
echo "<CiscoIPPhoneDirectory>\n";
echo "<Title>IP Telephony Directory</Title>\n";
$info = ldap_get_entries($ds, $sr);
echo "<Prompt>";
echo $info"count";
echo " Reachable people</Prompt>\n";
for ($i=0; $i<$info"count"; $i++) {
if ($info$i"mobile"0) {
echo "<DirectoryEntry>\n";
echo "<Name>M:" . iconv("UTF-8","ISO-8859-1",$info$i"cn"0) . "</Name>\n";
// I replace the french international extension (+33) by 0. It s not really clean, fell free to improve
echo "<Telephone>" .str_replace(" ","",str_replace("+33","0", $info$i"mobile"0)) ."</Telephone>\n";
echo "</DirectoryEntry>\n";
}
if ($info$i"telephonenumber"0) {
echo "<DirectoryEntry>\n";
echo "<Name>T:" . iconv("UTF-8","ISO-8859-1",$info$i"cn"0) . "</Name>\n";
echo "<Telephone>" .str_replace(" ","",str_replace("+33","0", $info$i"telephonenumber"0)) ."</Telephone>\n";
echo "</DirectoryEntry>\n";
}
if ($info$i"telephonenumber"1) {
echo "<DirectoryEntry>\n";
echo "<Name>T:" . iconv("UTF-8","ISO-8859-1",$info$i"cn"0) . "</Name>\n";
echo "<Telephone>" .str_replace(" ","",str_replace("+33","0", $info$i"telephonenumber"1)) ."</Telephone>\n";
echo "</DirectoryEntry>\n";
}
if ($info$i"telephonenumber"2) {
echo "<DirectoryEntry>\n";
echo "<Name>T:" . iconv("UTF-8","ISO-8859-1",$info$i"cn"0) . "</Name>\n";
echo "<Telephone>" .str_replace(" ","",str_replace("+33","0", $info$i"telephonenumber"2)) ."</Telephone>\n";
echo "</DirectoryEntry>\n";
}
}
echo "</CiscoIPPhoneDirectory>";
ldap_close($ds);
} else {
echo "error";
}
?>
So here is what I don't get. I read your post about having the XML header set right, so that the format of the page could be interpreted correctly. I then, went and inserted that code into the header of the page and I am still getting a parse error. I am probably doing something wrong. Could I be so daring as to ask for you to post the entire XML file code top to bottom? Also with this code, I get the same Parse error. Surely, I'mdoing something wrong, just can't see what.
Thanks so much!
Shane