<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Using FOP2 Phonebook with LDAP server]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I've a Freebpx installed with about 400 contacts in a openLDAP directory. My customer uses FOP2. He manages only the LDAP directory.</p>
<p dir="auto">Can I make a connection between FOP2 Phonebook and the LDAP directory ? So when he add a contact into LDAP, it will also be automaticaly add to FOP2 Phonebook ? And so on...</p>
<p dir="auto">Regards.</p>
]]></description><link>http://localhost:4567/topic/2492/using-fop2-phonebook-with-ldap-server</link><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 10:41:42 GMT</lastBuildDate><atom:link href="http://localhost:4567/topic/2492.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Jan 2017 22:48:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Fri, 18 Oct 2019 07:10:08 GMT]]></title><description><![CDATA[<p dir="auto">Yes! Thanks for pointing my fault. As I'm not using this query in a function, I forgot changing return $results; to echo $results;<br />
I firstly trying to add this code inside the original in a function with no luck. Then I have blank vphonebook.php and fill it with this code only but still not working. Finally Nicolas help me to fix the problem.</p>
]]></description><link>http://localhost:4567/post/10995</link><guid isPermaLink="true">http://localhost:4567/post/10995</guid><dc:creator><![CDATA[dsisevran]]></dc:creator><pubDate>Fri, 18 Oct 2019 07:10:08 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Thu, 17 Oct 2019 15:48:12 GMT]]></title><description><![CDATA[<p dir="auto">Here is the full fixed code:</p>
<pre><code>&lt;?php
$texto     = $_REQUEST['term'];

// ---------------------------- VARIABLES ----------------------------
$ldapURL = 'LDAP_URL';
$ldapPort = 389; // Port par defaut = 389
$ldapVersionProtocole = 3; // Version par defaut = 2
$ldapIdentifiant = 'cn=ADMIN,dc=DOMAIN,dc=COM';
$ldapMotDePasse = 'PASSWD';

// ---------------------------- CONNEXION ----------------------------
$ldap = ldap_connect($ldapURL, $ldapPort);
if (false === $ldap) die('Echec de la connexion');
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, $ldapVersionProtocole);
$retour = ldap_bind($ldap, $ldapIdentifiant, $ldapMotDePasse);
if (false === $retour) die('Echec de l\'authentification (ou de la connexion)');

// ---------------------------- RECHERCHE ----------------------------
$dn = "OU=PERSON,DC=DOMAIN,DC=COM";
$recherche = "UID=*$texto*";
$requete = ldap_search($ldap, $dn, $recherche);
if (false === $requete) die('La recherche a echoue');

// ---------------------------- RESULTAT ----------------------------
$resultats = ldap_get_entries($ldap, $requete);
$myArray = array();
for ($i=0; $i&lt;$resultats["count"]; $i++) {
    $myArray[] = "{\"name\":\"\",\"value\":\"" . $resultats[$i]["cn"][0] . " &lt;" . $resultats[$i]["telephonenumber"][0] . "&gt;\"}";
}

// ---------------------------- FORMATAGE ----------------------------
//print_r($myArray);
$results = json_encode($myArray,JSON_UNESCAPED_UNICODE);
$results = str_replace('\"', '"', $results);
$results = str_replace('"{', '{', $results);
$results = str_replace('}"', '}', $results);

// ---------------------------- FERMETURE ----------------------------
ldap_close($ldap);

echo $results;

?&gt;
</code></pre>
]]></description><link>http://localhost:4567/post/10994</link><guid isPermaLink="true">http://localhost:4567/post/10994</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Thu, 17 Oct 2019 15:48:12 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Thu, 17 Oct 2019 14:48:47 GMT]]></title><description><![CDATA[<p dir="auto">Thank Nicolas for your help.<br />
Finally as I only use ldap for my search my vphonebook.php look like</p>
<pre><code>&lt;?php

$texto     = $_REQUEST['term'];

// ---------------------------- VARIABLES ----------------------------
$ldapURL = 'LDAP_URL';
$ldapPort = 389; // Port par defaut = 389
$ldapVersionProtocole = 3; // Version par defaut = 2
$ldapIdentifiant = 'cn=ADMIN,dc=DOMAIN,dc=COM';
$ldapMotDePasse = 'PASSWD';

// ---------------------------- CONNEXION ----------------------------
$ldap = ldap_connect($ldapURL, $ldapPort);
if (false === $ldap) die('Echec de la connexion');
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, $ldapVersionProtocole);
$retour = ldap_bind($ldap, $ldapIdentifiant, $ldapMotDePasse);
if (false === $retour) die('Echec de l\'authentification (ou de la connexion)');

// ---------------------------- RECHERCHE ----------------------------
$dn = "OU=PERSON,DC=DOMAIN,DC=COM";
$recherche = "UID=*$texto*";
$requete = ldap_search($ldap, $dn, $recherche);
if (false === $requete) die('La recherche a echoue');

// ---------------------------- RESULTAT ----------------------------
$resultats = ldap_get_entries($ldap, $requete);
$myArray = array();
for ($i=0; $i&lt;$resultats["count"]; $i++) {
    $myArray[] = "{\"name\":\"\",\"value\":\"" . $resultats[$i]["cn"][0] . " &lt;" . $resultats[$i]["telephonenumber"][0] . "&gt;\"}";
}

// ---------------------------- FORMATAGE ----------------------------
//print_r($myArray);
$results = json_encode($myArray,JSON_UNESCAPED_UNICODE);
$results = str_replace('\"', '"', $results);
$results = str_replace('"{', '{', $results);
$results = str_replace('}"', '}', $results);

// ---------------------------- FERMETURE ----------------------------
ldap_close($ldap);

echo $results;

?&gt;
</code></pre>
]]></description><link>http://localhost:4567/post/10993</link><guid isPermaLink="true">http://localhost:4567/post/10993</guid><dc:creator><![CDATA[dsisevran]]></dc:creator><pubDate>Thu, 17 Oct 2019 14:48:47 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Thu, 17 Oct 2019 13:48:08 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">You must add before your code something like this:</p>
<pre><code>$texto     = $_REQUEST['term'];
</code></pre>
<p dir="auto">What happens when you use the dial box and start typing something?</p>
]]></description><link>http://localhost:4567/post/10992</link><guid isPermaLink="true">http://localhost:4567/post/10992</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Thu, 17 Oct 2019 13:48:08 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Thu, 17 Oct 2019 13:20:44 GMT]]></title><description><![CDATA[<p dir="auto">I have wrote a little script to query on LDAP and formating the result in a json array but not working when adding it in vphonebook.php</p>
<pre><code>&lt;?php

// ---------------------------- VARIABLES ----------------------------
$ldapURL = 'LDAP_URL';
$ldapPort = 389; // Port par defaut = 389
$ldapVersionProtocole = 3; // Version par defaut = 2
$ldapIdentifiant = 'cn=ADMIN,dc=DOMAIN,dc=COM';
$ldapMotDePasse = 'PASSWD';

// ---------------------------- CONNEXION ----------------------------
$ldap = ldap_connect($ldapURL, $ldapPort);
if (false === $ldap) die('Echec de la connexion');
ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, $ldapVersionProtocole);
$retour = ldap_bind($ldap, $ldapIdentifiant, $ldapMotDePasse);
if (false === $retour) die('Echec de l\'authentification (ou de la connexion)');

// ---------------------------- RECHERCHE ----------------------------
$dn = "OU=PERSON,DC=DOMAIN,DC=COM";
$recherche = "UID=*$texto*";
$requete = ldap_search($ldap, $dn, $recherche);
if (false === $requete) die('La recherche a echoue');

// ---------------------------- RESULTAT ----------------------------
$resultats = ldap_get_entries($ldap, $requete);
$myArray = array();
for ($i=0; $i&lt;$resultats["count"]; $i++) {
    $myArray[] = "{\"name\":\"\",\"value\":\"" . $resultats[$i]["cn"][0] . " &lt;" . $resultats[$i]["telephonenumber"][0] . "&gt;\"}";
}

// ---------------------------- FORMATAGE ----------------------------
//print_r($myArray);
$results = json_encode($myArray,JSON_UNESCAPED_UNICODE);
$results = str_replace('\"', '"', $results);
$results = str_replace('"{', '{', $results);
$results = str_replace('}"', '}', $results);

// ---------------------------- FERMETURE ----------------------------
ldap_close($ldap);

return $results;

?&gt;
</code></pre>
]]></description><link>http://localhost:4567/post/10991</link><guid isPermaLink="true">http://localhost:4567/post/10991</guid><dc:creator><![CDATA[dsisevran]]></dc:creator><pubDate>Thu, 17 Oct 2019 13:20:44 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Tue, 15 Oct 2019 13:33:59 GMT]]></title><description><![CDATA[<p dir="auto">Thanks <img src="http://localhost:4567/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=9c14fadbfa0" class="not-responsive emoji emoji-android emoji--wink" style="height:1.4em;width:auto;vertical-align:middle" title=";)" alt="😉" /><br />
Yes I am working on a separate php file for testing only and then I will modify vphonebook.php.</p>
]]></description><link>http://localhost:4567/post/10990</link><guid isPermaLink="true">http://localhost:4567/post/10990</guid><dc:creator><![CDATA[dsisevran]]></dc:creator><pubDate>Tue, 15 Oct 2019 13:33:59 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Tue, 15 Oct 2019 12:55:06 GMT]]></title><description><![CDATA[<p dir="auto">Hi,<br />
Ideallly you should work directly by modifying the vphonebook.php script and adding your custom query to it, replacing or not the ones provided. Return format is a json array like:</p>
<pre><code>[
  {"name":"","value":"John  &lt;1234567&gt;"},
  {"name":"","value":"Peter  &lt;7654321&gt;"}
]
</code></pre>
]]></description><link>http://localhost:4567/post/10989</link><guid isPermaLink="true">http://localhost:4567/post/10989</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Tue, 15 Oct 2019 12:55:06 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Tue, 15 Oct 2019 12:35:33 GMT]]></title><description><![CDATA[<p dir="auto">Whitch syntax does the result have to be return for matching contact form query?</p>
]]></description><link>http://localhost:4567/post/10988</link><guid isPermaLink="true">http://localhost:4567/post/10988</guid><dc:creator><![CDATA[dsisevran]]></dc:creator><pubDate>Tue, 15 Oct 2019 12:35:33 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Fri, 11 Oct 2019 07:53:05 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the answer. Will try to do something before paid for a full licence. I have also see VOP which could do the trick. Will give a try.<br />
Regards.</p>
]]></description><link>http://localhost:4567/post/10987</link><guid isPermaLink="true">http://localhost:4567/post/10987</guid><dc:creator><![CDATA[dsisevran]]></dc:creator><pubDate>Fri, 11 Oct 2019 07:53:05 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Thu, 10 Oct 2019 12:22:12 GMT]]></title><description><![CDATA[<p dir="auto">FOP2 has its own phonebook/contacts and scripts to tie that with the switchboard itself. Code is there for users to modify if they so like/need.<br />
The dial box will query the visual_phonebook table that the contacts app uses, but it can be modified, as I expalined originally, as it is a standard php script. You are free to modify it to query whatever you want instead of FOP2 tables.</p>
<p dir="auto">In any case, that feature is not on the roadmap, you can purchase development time if you want us to work on this particular integration, or just look at doing it yourself, it is just one php script (vphonebook.php) that is used for querying contacts from the dial box.</p>
]]></description><link>http://localhost:4567/post/10986</link><guid isPermaLink="true">http://localhost:4567/post/10986</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Thu, 10 Oct 2019 12:22:12 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Thu, 10 Oct 2019 10:48:54 GMT]]></title><description><![CDATA[<p dir="auto">Hi, not for now...</p>
]]></description><link>http://localhost:4567/post/10985</link><guid isPermaLink="true">http://localhost:4567/post/10985</guid><dc:creator><![CDATA[aratel]]></dc:creator><pubDate>Thu, 10 Oct 2019 10:48:54 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Thu, 10 Oct 2019 07:30:08 GMT]]></title><description><![CDATA[<p dir="auto">Dear,<br />
Is there any update concering this request?<br />
Regards.</p>
]]></description><link>http://localhost:4567/post/10984</link><guid isPermaLink="true">http://localhost:4567/post/10984</guid><dc:creator><![CDATA[dsisevran]]></dc:creator><pubDate>Thu, 10 Oct 2019 07:30:08 GMT</pubDate></item><item><title><![CDATA[Reply to Using FOP2 Phonebook with LDAP server on Sat, 28 Jan 2017 02:40:03 GMT]]></title><description><![CDATA[<p dir="auto">searches from the dial box are done via the vphonebook.php file, you could adapt that php code to look into openldap instead of doing mysql searches. Support is not done, but it is standard php and if you have time and a little bit of an idea, you can get that working.</p>
<p dir="auto">Best regards,</p>
]]></description><link>http://localhost:4567/post/10983</link><guid isPermaLink="true">http://localhost:4567/post/10983</guid><dc:creator><![CDATA[nicolas]]></dc:creator><pubDate>Sat, 28 Jan 2017 02:40:03 GMT</pubDate></item></channel></rss>