<?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 for sam j levy</title>
	<atom:link href="http://samjlevy.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://samjlevy.com</link>
	<description></description>
	<lastBuildDate>Thu, 17 May 2012 05:31:16 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on PHP login script using LDAP, verify group membership by sam</title>
		<link>http://samjlevy.com/2010/09/php-login-script-using-ldap-verify-group-membership/comment-page-1/#comment-5932</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Thu, 17 May 2012 05:31:16 +0000</pubDate>
		<guid isPermaLink="false">http://samjlevy.com/?p=613#comment-5932</guid>
		<description>okello,

Can you use http://paste.samjlevy.com or if you are pasting the code into a reply, put &lt;code&gt; &lt;/code&gt; around it so it doesn&#039;t strip out text</description>
		<content:encoded><![CDATA[<p>okello,</p>
<p>Can you use <a href="http://paste.samjlevy.com" rel="nofollow">http://paste.samjlevy.com</a> or if you are pasting the code into a reply, put &lt;code&gt; &lt;/code&gt; around it so it doesn&#8217;t strip out text</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP login script using LDAP, verify group membership by okello</title>
		<link>http://samjlevy.com/2010/09/php-login-script-using-ldap-verify-group-membership/comment-page-1/#comment-5931</link>
		<dc:creator>okello</dc:creator>
		<pubDate>Thu, 17 May 2012 05:25:21 +0000</pubDate>
		<guid isPermaLink="false">http://samjlevy.com/?p=613#comment-5931</guid>
		<description>to add to the code above, the only change made was on, nothing else

   // Active Directory server
    $ldap_host = &quot;mydomain.com&quot;;
    // Active Directory DN
    $ldap_dn = &quot;OU=user,DC=mydomain,DC=com&quot;;
    // Active Directory user group
    $ldap_user_group = &quot;Users&quot;;
    // Active Directory manager group
    $ldap_manager_group = &quot;Administrators&quot;;
    // Domain, for purposes of constructing $user
    $ldap_usr_dom = &quot;@mydomain.com&quot;;</description>
		<content:encoded><![CDATA[<p>to add to the code above, the only change made was on, nothing else</p>
<p>   // Active Directory server<br />
    $ldap_host = &#8220;mydomain.com&#8221;;<br />
    // Active Directory DN<br />
    $ldap_dn = &#8220;OU=user,DC=mydomain,DC=com&#8221;;<br />
    // Active Directory user group<br />
    $ldap_user_group = &#8220;Users&#8221;;<br />
    // Active Directory manager group<br />
    $ldap_manager_group = &#8220;Administrators&#8221;;<br />
    // Domain, for purposes of constructing $user<br />
    $ldap_usr_dom = &#8220;@mydomain.com&#8221;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP login script using LDAP, verify group membership by okello</title>
		<link>http://samjlevy.com/2010/09/php-login-script-using-ldap-verify-group-membership/comment-page-1/#comment-5930</link>
		<dc:creator>okello</dc:creator>
		<pubDate>Thu, 17 May 2012 05:22:15 +0000</pubDate>
		<guid isPermaLink="false">http://samjlevy.com/?p=613#comment-5930</guid>
		<description>*removed incomplete code pasting*</description>
		<content:encoded><![CDATA[<p>*removed incomplete code pasting*</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP login script using LDAP, verify group membership by sam</title>
		<link>http://samjlevy.com/2010/09/php-login-script-using-ldap-verify-group-membership/comment-page-1/#comment-5926</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Thu, 17 May 2012 00:46:30 +0000</pubDate>
		<guid isPermaLink="false">http://samjlevy.com/?p=613#comment-5926</guid>
		<description>Can you paste your code? Be sure to remove any sensitive information

http://paste.samjlevy.com</description>
		<content:encoded><![CDATA[<p>Can you paste your code? Be sure to remove any sensitive information</p>
<p><a href="http://paste.samjlevy.com" rel="nofollow">http://paste.samjlevy.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on PHP login script using LDAP, verify group membership by okello</title>
		<link>http://samjlevy.com/2010/09/php-login-script-using-ldap-verify-group-membership/comment-page-1/#comment-5919</link>
		<dc:creator>okello</dc:creator>
		<pubDate>Wed, 16 May 2012 11:41:32 +0000</pubDate>
		<guid isPermaLink="false">http://samjlevy.com/?p=613#comment-5919</guid>
		<description>somehow,this script does not work forme, whether you provide the correct login details or the wrong ones, it continues without an error, something is not ok. Anyone got the same issue?</description>
		<content:encoded><![CDATA[<p>somehow,this script does not work forme, whether you provide the correct login details or the wrong ones, it continues without an error, something is not ok. Anyone got the same issue?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Upgrade to Ubuntu 12.04 &#8211; Ruby on Rails gem mysql2 error: libmysqlclient_r.so.16 by Larry</title>
		<link>http://samjlevy.com/2012/04/upgrade-to-ubuntu-12-04-ruby-on-rails-gem-mysql2-error-libmysqlclient_r-so-16/comment-page-1/#comment-5850</link>
		<dc:creator>Larry</dc:creator>
		<pubDate>Sat, 05 May 2012 17:26:53 +0000</pubDate>
		<guid isPermaLink="false">http://samjlevy.com/?p=1536#comment-5850</guid>
		<description>Hate to be redundant - but thanks!</description>
		<content:encoded><![CDATA[<p>Hate to be redundant &#8211; but thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Use PHP and LDAP to list members of an Active Directory group (Improved) by sam</title>
		<link>http://samjlevy.com/2011/10/use-php-and-ldap-to-list-members-of-an-active-directory-group-improved/comment-page-1/#comment-5812</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Wed, 02 May 2012 05:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://samjlevy.com/?p=1460#comment-5812</guid>
		<description>David,

What you need to do is add primaryGroupID=x to the LDAP query string

To make it work, you could do this--

Replace the foreach under &#039;Append each group&#039; with:
&lt;pre&gt;
// Append each group
foreach($group as $g) {
    if(is_numeric($g)) $query .= &quot;(primaryGroupID=$g)&quot;; else $query .= &quot;(memberOf=CN=$g,$ldap_dn)&quot;;
}
&lt;/pre&gt;

And replace the line under &#039;Just looking for membership of one group&#039; with:
&lt;pre&gt;
// Just looking for membership of one group
if(is_numeric($group)) $query .= &quot;(primaryGroupID=$group)&quot;; else $query .= &quot;(memberOf=CN=$group,$ldap_dn)&quot;;
&lt;/pre&gt;

The code we added will detect if you are using a number instead of a string, and will then check for users that have that number as their primaryGroupID.

The caveat being you have to use the ID of the group and not the CN, but you can mix it with CN&#039;s since our code checks for numerics:

&lt;pre&gt;
print_r(get_members(513)); // Gets all users that have primaryGroupID = 513
print_r(get_members(array(&quot;Test Group&quot;,513))); // EXCLUSIVE: Gets only members that belong to &#039;Test Group&#039; AND that have primaryGroupID = 513
print_r(get_members(array(&quot;Test Group&quot;,513),TRUE)); // INCLUSIVE: Gets members that belong to &#039;Test Group&#039; OR that have primaryGroupID = 513
&lt;/pre&gt;

513 is the &#039;Domain Users&#039; group

It&#039;s a bit of a hack, but it should get you in the right direction

The proper way to do it would probably be to have 2 LDAP queries run: one that looks up the group ID for each/single passed group, and the other would search against both the memberOf with the CN and the primaryGroupID with the ID</description>
		<content:encoded><![CDATA[<p>David,</p>
<p>What you need to do is add primaryGroupID=x to the LDAP query string</p>
<p>To make it work, you could do this&#8211;</p>
<p>Replace the foreach under &#8216;Append each group&#8217; with:</p>
<pre>
// Append each group
foreach($group as $g) {
    if(is_numeric($g)) $query .= "(primaryGroupID=$g)"; else $query .= "(memberOf=CN=$g,$ldap_dn)";
}
</pre>
<p>And replace the line under &#8216;Just looking for membership of one group&#8217; with:</p>
<pre>
// Just looking for membership of one group
if(is_numeric($group)) $query .= "(primaryGroupID=$group)"; else $query .= "(memberOf=CN=$group,$ldap_dn)";
</pre>
<p>The code we added will detect if you are using a number instead of a string, and will then check for users that have that number as their primaryGroupID.</p>
<p>The caveat being you have to use the ID of the group and not the CN, but you can mix it with CN&#8217;s since our code checks for numerics:</p>
<pre>
print_r(get_members(513)); // Gets all users that have primaryGroupID = 513
print_r(get_members(array("Test Group",513))); // EXCLUSIVE: Gets only members that belong to 'Test Group' AND that have primaryGroupID = 513
print_r(get_members(array("Test Group",513),TRUE)); // INCLUSIVE: Gets members that belong to 'Test Group' OR that have primaryGroupID = 513
</pre>
<p>513 is the &#8216;Domain Users&#8217; group</p>
<p>It&#8217;s a bit of a hack, but it should get you in the right direction</p>
<p>The proper way to do it would probably be to have 2 LDAP queries run: one that looks up the group ID for each/single passed group, and the other would search against both the memberOf with the CN and the primaryGroupID with the ID</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on MySQL Levenshtein and Damerau-Levenshtein UDF&#8217;s by sam</title>
		<link>http://samjlevy.com/2011/03/mysql-levenshtein-and-damerau-levenshtein-udfs/comment-page-1/#comment-5811</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Wed, 02 May 2012 04:27:29 +0000</pubDate>
		<guid isPermaLink="false">http://samjlevy.com/?p=1077#comment-5811</guid>
		<description>Unfortunately I&#039;m not sure how to go about doing that

Maybe try contacting one of the original UDF developers?</description>
		<content:encoded><![CDATA[<p>Unfortunately I&#8217;m not sure how to go about doing that</p>
<p>Maybe try contacting one of the original UDF developers?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on MySQL Levenshtein and Damerau-Levenshtein UDF&#8217;s by hashi101</title>
		<link>http://samjlevy.com/2011/03/mysql-levenshtein-and-damerau-levenshtein-udfs/comment-page-1/#comment-5808</link>
		<dc:creator>hashi101</dc:creator>
		<pubDate>Tue, 01 May 2012 17:22:08 +0000</pubDate>
		<guid isPermaLink="false">http://samjlevy.com/?p=1077#comment-5808</guid>
		<description>Hi

What about unicode characters? If we compare:
levenshtein(&#039;ół,&#039;ol&#039;);
How to develop your code to recognizing these string as identical? For &quot;ó Ó ł Ł&quot; and others: &quot;ą Ą ć Ć ę Ę ś Ś n Ń ź Ź ż Ż&quot;</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>What about unicode characters? If we compare:<br />
levenshtein(&#8216;ół,&#8217;ol&#8217;);<br />
How to develop your code to recognizing these string as identical? For &#8220;ó Ó ł Ł&#8221; and others: &#8220;ą Ą ć Ć ę Ę ś Ś n Ń ź Ź ż Ż&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

