<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: CakePHP: LDAP with full CRUD, a living example!</title>
	<atom:link href="http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/</link>
	<description>If I have seen a little further it is by standing on the shoulders of Giants. - Newton</description>
	<lastBuildDate>Wed, 30 Jun 2010 21:07:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Keber</title>
		<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/comment-page-1/#comment-1066</link>
		<dc:creator>Keber</dc:creator>
		<pubDate>Wed, 30 Jun 2010 21:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=13#comment-1066</guid>
		<description>I&#039;m very sorry, finally was a &#039;layer 8&#039; or rtfm issue.
&lt;code&gt;
$ldap2 = $this-&gt;User-&gt;find(&#039;all&#039;, array(&#039;conditions&#039; =&gt; array(&#039;uid&#039; =&gt; &#039;ernesto.*&#039;)));
&lt;/code&gt;

and after a few paints in the view, i&#039;m now retrieving my list. I&#039;ve restored the change made in my ldap_source file.</description>
		<content:encoded><![CDATA[<p>I&#8217;m very sorry, finally was a &#8216;layer 8&#8242; or rtfm issue.<br />
<code><br />
$ldap2 = $this-&gt;User-&gt;find('all', array('conditions' =&gt; array('uid' =&gt; 'ernesto.*')));<br />
</code></p>
<p>and after a few paints in the view, i&#8217;m now retrieving my list. I&#8217;ve restored the change made in my ldap_source file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keber</title>
		<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/comment-page-1/#comment-1065</link>
		<dc:creator>Keber</dc:creator>
		<pubDate>Wed, 30 Jun 2010 20:33:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=13#comment-1065</guid>
		<description>This is how i&#039;m showing the data from a simple database table, after sending to the view from the controller with $this-&gt;set(compact(

&lt;code&gt;

echo $html-&gt;tableHeaders(array(&#039;username&#039;,&#039;mail&#039;,&#039;firstname&#039;,&#039;lastname&#039;,&#039;Edit&#039;,&#039;Delete&#039;));
        foreach($ldapusuarios  as $usuario) {
                echo $html-&gt;tableCells(array(
                    array(
                        $usuario[&#039;Ldapusuario&#039;][&#039;uid&#039;],
                        $usuario[&#039;Ldapusuario&#039;][&#039;mail&#039;],
                        $usuario[&#039;Ldapusuario&#039;][&#039;givenname&#039;],
                        $usuario[&#039;Ldapusuario&#039;][&#039;sn&#039;],
                        
                        $html-&gt;link(&#039;Editar&#039;, &quot;/adms/edit/&quot;.$usuario[&#039;Ldapusuario&#039;][&#039;uid&#039;]),
                        $html-&gt;link(&#039;Eliminar&#039;, &quot;/adms/delete/&quot;.$usuario[&#039;Ldapusuario&#039;][&#039;uid&#039;])
                        )
                    ));
 
                echo &quot;&quot;;
 
        }//endforeach;
        echo &quot;&quot;;

&lt;/code&gt;

Something similar with the real ldap (here named ldap2)

&lt;code&gt;
        echo $html-&gt;tableHeaders(array(&#039;username&#039;,&#039;mail&#039;,&#039;firstname&#039;,&#039;lastname&#039;));//,&#039;Edit&#039;,&#039;Delete&#039;));
        foreach($ldap2  as $usuario) {
			if (isset($usuario[&#039;uid&#039;])) {    //ignores count array
        		echo $html-&gt;tableCells(array(
                    array(
                        $usuario[&#039;uid&#039;],
                        $usuario[&#039;mail&#039;],
                        $usuario[&#039;givenname&#039;],
                        $usuario[&#039;sn&#039;],
                        
                        )
                    ));
                //print_r($usuario);
                echo &quot;&quot;;			
            }
        }//endforeach;
&lt;/code&gt;

I&#039;ve tried replacing line 1025 (ldap_search call) to send 0 on limit param, but still shows the first row, althought the query debug shows

&lt;code&gt;
1	search &#124; cond: uid=ernesto.* &#124; targetDn: cn=Users,dc=foo,dc=org &#124; order: &#124; limit: 1			25	24084
2	search &#124; cond: username=ernesto.lastnameA &#124; targetDn: cn=Users,dc=foo,dc=org &#124; limit: 1			0	376
3	search &#124; cond: username=ernesto.lastnameB &#124; targetDn: cn=Users,dc=foo,dc=org &#124; limit: 1			0	226
4	search &#124; cond: username=ernesto.lastnameC &#124; targetDn: cn=Users,dc=foo,dc=org &#124; limit: 1			0	14
...
&lt;/code&gt;

Any ideas?</description>
		<content:encoded><![CDATA[<p>This is how i&#8217;m showing the data from a simple database table, after sending to the view from the controller with $this-&gt;set(compact(</p>
<p><code></p>
<p>echo $html-&gt;tableHeaders(array('username','mail','firstname','lastname','Edit','Delete'));<br />
        foreach($ldapusuarios  as $usuario) {<br />
                echo $html-&gt;tableCells(array(<br />
                    array(<br />
                        $usuario['Ldapusuario']['uid'],<br />
                        $usuario['Ldapusuario']['mail'],<br />
                        $usuario['Ldapusuario']['givenname'],<br />
                        $usuario['Ldapusuario']['sn'],</p>
<p>                        $html-&gt;link('Editar', "/adms/edit/".$usuario['Ldapusuario']['uid']),<br />
                        $html-&gt;link('Eliminar', "/adms/delete/".$usuario['Ldapusuario']['uid'])<br />
                        )<br />
                    ));</p>
<p>                echo "";</p>
<p>        }//endforeach;<br />
        echo "";</p>
<p></code></p>
<p>Something similar with the real ldap (here named ldap2)</p>
<p><code><br />
        echo $html-&gt;tableHeaders(array('username','mail','firstname','lastname'));//,'Edit','Delete'));<br />
        foreach($ldap2  as $usuario) {<br />
			if (isset($usuario['uid'])) {    //ignores count array<br />
        		echo $html-&gt;tableCells(array(<br />
                    array(<br />
                        $usuario['uid'],<br />
                        $usuario['mail'],<br />
                        $usuario['givenname'],<br />
                        $usuario['sn'],</p>
<p>                        )<br />
                    ));<br />
                //print_r($usuario);<br />
                echo "";<br />
            }<br />
        }//endforeach;<br />
</code></p>
<p>I&#8217;ve tried replacing line 1025 (ldap_search call) to send 0 on limit param, but still shows the first row, althought the query debug shows</p>
<p><code><br />
1	search | cond: uid=ernesto.* | targetDn: cn=Users,dc=foo,dc=org | order: | limit: 1			25	24084<br />
2	search | cond: username=ernesto.lastnameA | targetDn: cn=Users,dc=foo,dc=org | limit: 1			0	376<br />
3	search | cond: username=ernesto.lastnameB | targetDn: cn=Users,dc=foo,dc=org | limit: 1			0	226<br />
4	search | cond: username=ernesto.lastnameC | targetDn: cn=Users,dc=foo,dc=org | limit: 1			0	14<br />
...<br />
</code></p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keber</title>
		<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/comment-page-1/#comment-1064</link>
		<dc:creator>Keber</dc:creator>
		<pubDate>Wed, 30 Jun 2010 18:47:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=13#comment-1064</guid>
		<description>Hi! good job, great effort.

I&#039;m trying to develop a user interface to mantain accounts on an ldap and googleapps. Many of our sites and services authenticate against the ldap, and users (9k+) have email and other services on googleapps. Althought user authentication to googleapps is already being done against the ldap through a SSO page, we still need an app to quickly create or update users, names and passwords on both ldap and GApps.

I have to do this with cakephp, so i&#039;m trying to use your ldap_source datasource. The first issue is that althought our ldap it&#039;s implemented with OpenLDAP, setting this type results in a few warnings while trying to retrieve data. Instead, &#039;ActiveDirectory&#039; type setting does the job without warnings. The second one, is that when I try to retrieve data with:

$ldapusers = $this-&gt;User-&gt;find(&#039;uid=joe.*&#039;);

it retrieves only the first match and then returns a &quot;4: Size limit exceeded&quot; error. I&#039;ve checked our sizelimit on /etc/ldap/slapd.conf on the server and it is set to 50000 . So, at this point, i&#039;m not sure if I need to retrieve data with another function (but this doesn&#039;t seems to be the problem), but this happens with OpenLDAP type setting too.

Here is a portion of the code:

--------- adms_controller.php ----------
class AdmsController extends AppController {
    var $name = &#039;Adms&#039;;
    var $uses = array(&#039;User&#039;);

    function index(){
        $ldap2 = $this-&gt;User-&gt;find(&#039;uid=joe.*&#039;);
        $this-&gt;set(compact(&#039;ldap2&#039;));        
    }
}

---- index.ctp ----


--- The warnings when &#039;type&#039; =&gt;&quot;OpenLDAP&quot; on database.php ---
Notice (8): Undefined offset: 0 [APP/models/datasources/ldap_source.php, line 631]
Notice (8): Undefined index: attributetypes [APP/models/datasources/ldap_source.php, line 1255]
Warning (2): ksort() expects parameter 1 to be array, null given [APP/models/datasources/ldap_source.php, line 1256]

Thanks in advance for any help, and again for your work!</description>
		<content:encoded><![CDATA[<p>Hi! good job, great effort.</p>
<p>I&#8217;m trying to develop a user interface to mantain accounts on an ldap and googleapps. Many of our sites and services authenticate against the ldap, and users (9k+) have email and other services on googleapps. Althought user authentication to googleapps is already being done against the ldap through a SSO page, we still need an app to quickly create or update users, names and passwords on both ldap and GApps.</p>
<p>I have to do this with cakephp, so i&#8217;m trying to use your ldap_source datasource. The first issue is that althought our ldap it&#8217;s implemented with OpenLDAP, setting this type results in a few warnings while trying to retrieve data. Instead, &#8216;ActiveDirectory&#8217; type setting does the job without warnings. The second one, is that when I try to retrieve data with:</p>
<p>$ldapusers = $this-&gt;User-&gt;find(&#8216;uid=joe.*&#8217;);</p>
<p>it retrieves only the first match and then returns a &#8220;4: Size limit exceeded&#8221; error. I&#8217;ve checked our sizelimit on /etc/ldap/slapd.conf on the server and it is set to 50000 . So, at this point, i&#8217;m not sure if I need to retrieve data with another function (but this doesn&#8217;t seems to be the problem), but this happens with OpenLDAP type setting too.</p>
<p>Here is a portion of the code:</p>
<p>&#8212;&#8212;&#8212; adms_controller.php &#8212;&#8212;&#8212;-<br />
class AdmsController extends AppController {<br />
    var $name = &#8216;Adms&#8217;;<br />
    var $uses = array(&#8216;User&#8217;);</p>
<p>    function index(){<br />
        $ldap2 = $this-&gt;User-&gt;find(&#8216;uid=joe.*&#8217;);<br />
        $this-&gt;set(compact(&#8216;ldap2&#8242;));<br />
    }<br />
}</p>
<p>&#8212;- index.ctp &#8212;-</p>
<p>&#8212; The warnings when &#8216;type&#8217; =&gt;&#8221;OpenLDAP&#8221; on database.php &#8212;<br />
Notice (8): Undefined offset: 0 [APP/models/datasources/ldap_source.php, line 631]<br />
Notice (8): Undefined index: attributetypes [APP/models/datasources/ldap_source.php, line 1255]<br />
Warning (2): ksort() expects parameter 1 to be array, null given [APP/models/datasources/ldap_source.php, line 1256]</p>
<p>Thanks in advance for any help, and again for your work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jwb</title>
		<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/comment-page-1/#comment-1057</link>
		<dc:creator>jwb</dc:creator>
		<pubDate>Sat, 29 May 2010 15:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=13#comment-1057</guid>
		<description>Hello, there seems to be something wrong with the model/controller examples. There seems be a lot of coding missing and the &#039;&gt;&#039;-signs are changed to &gt; . Can you please email me your full examples?</description>
		<content:encoded><![CDATA[<p>Hello, there seems to be something wrong with the model/controller examples. There seems be a lot of coding missing and the &#8216;&gt;&#8217;-signs are changed to &gt; . Can you please email me your full examples?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Ciarlillo</title>
		<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/comment-page-1/#comment-1054</link>
		<dc:creator>Alex Ciarlillo</dc:creator>
		<pubDate>Tue, 25 May 2010 16:39:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=13#comment-1054</guid>
		<description>Thanks very much. Everything is working great now. Fantastic article, thanks for all the work you have put in</description>
		<content:encoded><![CDATA[<p>Thanks very much. Everything is working great now. Fantastic article, thanks for all the work you have put in</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: analogrithems</title>
		<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/comment-page-1/#comment-1053</link>
		<dc:creator>analogrithems</dc:creator>
		<pubDate>Sun, 23 May 2010 19:04:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=13#comment-1053</guid>
		<description>I&#039;ve written an example using the code.  There is no error, but I forgot to update the code in mention some new updates to the database.php please see notes above.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve written an example using the code.  There is no error, but I forgot to update the code in mention some new updates to the database.php please see notes above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: analogrithems</title>
		<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/comment-page-1/#comment-1052</link>
		<dc:creator>analogrithems</dc:creator>
		<pubDate>Sun, 23 May 2010 18:57:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=13#comment-1052</guid>
		<description>Nevermind, I forgot to mention that I added a new attribute to the database config.  See the previous comments.  I&#039;ll update the article.</description>
		<content:encoded><![CDATA[<p>Nevermind, I forgot to mention that I added a new attribute to the database config.  See the previous comments.  I&#8217;ll update the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: analogrithems</title>
		<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/comment-page-1/#comment-1050</link>
		<dc:creator>analogrithems</dc:creator>
		<pubDate>Sun, 23 May 2010 18:18:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=13#comment-1050</guid>
		<description>Actually I think I am seeing an issue, looks like the upload to github broke part of the file.  Working on it now, will have a new version later today.</description>
		<content:encoded><![CDATA[<p>Actually I think I am seeing an issue, looks like the upload to github broke part of the file.  Working on it now, will have a new version later today.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: analogrithems</title>
		<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/comment-page-1/#comment-1049</link>
		<dc:creator>analogrithems</dc:creator>
		<pubDate>Sun, 23 May 2010 18:01:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=13#comment-1049</guid>
		<description>I added a new attribute that needs to be added to the database config,  Here is my database.php  This is to make the datasource work with different ldap servers operational attributes and know how to find the schemas that exists in different locations between them.

vi config/core.php
&lt;pre&gt;
&lt;?php
 class DATABASE_CONFIG {
        //This will be used for extensions/plugins.  if you plugin needs a db, define it here.
        var $default = array(
                &#039;driver&#039; =&gt; &#039;mysql&#039;,
                &#039;persistent&#039; =&gt; false,
                &#039;host&#039; =&gt; &#039;localhost&#039;,
                &#039;login&#039; =&gt; &#039;user&#039;,
                &#039;password&#039; =&gt; &#039;password&#039;,
                &#039;database&#039; =&gt; &#039;database_name&#039;,
                &#039;prefix&#039; =&gt; &#039;&#039;,
        );
        var $ldap = array (
                &#039;datasource&#039; =&gt; &#039;ldap&#039;,
                &#039;host&#039; =&gt; &#039;localhost&#039;,
                &#039;port&#039; =&gt; 389,
                &#039;basedn&#039; =&gt; &#039;dc=analogrithems,dc=com&#039;,
                &#039;login&#039; =&gt; &#039;&#039;,     //For Proxy Userdn
                &#039;password&#039; =&gt; &#039;&#039;,  //For Proxy UserDN password
                &#039;database&#039; =&gt; &#039;&#039;,  //Needed to prevent cakePHP from throwing errors about database missing
                &#039;tls&#039; =&gt; &#039;&#039;, //Set this to true if using tls
                &#039;type&#039; =&gt; &#039;Netscape&#039;, //Type Can be either &#039;Netscape&#039;, &#039;OpenLDAP&#039;, &#039;ActiveDirectory&#039;
                &#039;version&#039; =&gt; 3 //LDAP Version 3
         );
 }
?&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I added a new attribute that needs to be added to the database config,  Here is my database.php  This is to make the datasource work with different ldap servers operational attributes and know how to find the schemas that exists in different locations between them.</p>
<p>vi config/core.php</p>
<pre>
< ?php
 class DATABASE_CONFIG {
        //This will be used for extensions/plugins.  if you plugin needs a db, define it here.
        var $default = array(
                'driver' => 'mysql',
                'persistent' => false,
                'host' => 'localhost',
                'login' => 'user',
                'password' => 'password',
                'database' => 'database_name',
                'prefix' => '',
        );
        var $ldap = array (
                'datasource' => 'ldap',
                'host' => 'localhost',
                'port' => 389,
                'basedn' => 'dc=analogrithems,dc=com',
                'login' => '',     //For Proxy Userdn
                'password' => '',  //For Proxy UserDN password
                'database' => '',  //Needed to prevent cakePHP from throwing errors about database missing
                'tls' => '', //Set this to true if using tls
                'type' => 'Netscape', //Type Can be either 'Netscape', 'OpenLDAP', 'ActiveDirectory'
                'version' => 3 //LDAP Version 3
         );
 }
?>
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Ciarlillo</title>
		<link>http://www.analogrithems.com/rant/2009/06/12/cakephp-with-full-crud-a-living-example/comment-page-1/#comment-1048</link>
		<dc:creator>Alex Ciarlillo</dc:creator>
		<pubDate>Thu, 20 May 2010 20:08:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=13#comment-1048</guid>
		<description>I am having an issue with the latest ldap_source.php from git and trying to use it in combination with the LDAP Auth article you wrote. I had auth somewhat working with the original version of the ldap_source you posted, but I was getting errors about the query() function not existing. After updating to the latest one from git, I am getting the following:

Notice (8): Undefined variable: return [ROOT/post/models/datasources/ldap_source.php, line 727]
Warning (2): ksort() expects parameter 1 to be array, null given [ROOT/post/models/datasources/ldap_source.php, line 1251]

And in the query output I get:
-1: Can&#039;t contact LDAP server

I have my database config and model setup just as they were when it was semi-working and just as you outline in the article. This is also running against Active Directory if that helps. Any ideas?
Thanks</description>
		<content:encoded><![CDATA[<p>I am having an issue with the latest ldap_source.php from git and trying to use it in combination with the LDAP Auth article you wrote. I had auth somewhat working with the original version of the ldap_source you posted, but I was getting errors about the query() function not existing. After updating to the latest one from git, I am getting the following:</p>
<p>Notice (8): Undefined variable: return [ROOT/post/models/datasources/ldap_source.php, line 727]<br />
Warning (2): ksort() expects parameter 1 to be array, null given [ROOT/post/models/datasources/ldap_source.php, line 1251]</p>
<p>And in the query output I get:<br />
-1: Can&#8217;t contact LDAP server</p>
<p>I have my database config and model setup just as they were when it was semi-working and just as you outline in the article. This is also running against Active Directory if that helps. Any ideas?<br />
Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
