<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
On 03/08/2010 22:01, Brad Beckenhauer wrote:
<blockquote cite="mid:4C583D4C020000680005B321@smtp.aafp.org"
 type="cite">
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <meta name="GENERATOR" content="MSHTML 8.00.7600.16588">
  <div>Hi Julian,</div>
  <div>&nbsp;</div>
  <div>I've tested the LDAP authenticator and it is "working" using the
last NSSLDAPAuthenticator.php file you sent to me.&nbsp;&nbsp;&nbsp; During testing I
managed to lock my account several times and did not know it until I
examined the zendto.log ( I wasted an hour figuring that out).</div>
  <div>&nbsp;</div>
  <div>My configuration:</div>
  <div>Running the&nbsp;&nbsp; <a moz-do-not-send="true"
 href="http://www.zendto.com/files/ZendTo-CentOS-x64-3.55-3.zip">ZendTo
version 3.59-1 64-bit CentOS Virtual Machine</a>&nbsp;from the download page.</div>
  <div>LDAP:&nbsp;&nbsp;The authLDAPServers I tested where both Netware 6.5 and
SLES 10sp2.&nbsp; I could not get the SSL=true to work ( the issue could be
on my end).</div>
  <div>&nbsp;</div>
  <div>Suggestions:</div>
  <div>1) How about an email_admin setting in the preferences. file
that notifies&nbsp;the administrator when an account is locked?</div>
</blockquote>
It would only be able to email the admin every time someone tries to
login to a locked account, for the reason described below.<br>
<blockquote cite="mid:4C583D4C020000680005B321@smtp.aafp.org"
 type="cite">
  <div>&nbsp;</div>
  <div>2) when an account is locked, add a commentsto the zendto.log
file stating the account is "locked" rather than wait until the next
login attempt.</div>
</blockquote>
Bit difficult that one. When it gets a login attempt, it counts the
number of successive failure attempts in the login log table. It
doesn't lock out a user as such, it merely works out that the user
should be locked out when a login attempt happens. Much safer that way,
as there's no "user locked out" flag that could somehow not be set when
it should be. It's all dependent on what it finds in the login log
table instead.<br>
<blockquote cite="mid:4C583D4C020000680005B321@smtp.aafp.org"
 type="cite">
  <div>&nbsp;</div>
  <div>3) the bin/README does not list the unlockuser utility.&nbsp;&nbsp; </div>
</blockquote>
Good point. Will fix that.<br>
<blockquote cite="mid:4C583D4C020000680005B321@smtp.aafp.org"
 type="cite">
  <div>&nbsp;</div>
  <div>4) food for thought:&nbsp; perhaps rather than create separate
utilities (adduser, deleteuser, listusers, setpassword, combine them
into one utility</div>
  <div>&nbsp;</div>
  <div>ie&nbsp; user.php</div>
  <div>&nbsp;</div>
  <div>user.php add john password <a moz-do-not-send="true"
 href="mailto:email@address.com">email@address.com</a> 'john doe'
'organization'</div>
  <div>user.php delete john</div>
  <div>user.php unlock john</div>
  <div>
  <div>user.php unlock all</div>
  </div>
  <div>user.php listusers</div>
  <div>user.php setpasswd john new_password</div>
</blockquote>
Possible, but it doesn't make a whole load of difference.<br>
<blockquote cite="mid:4C583D4C020000680005B321@smtp.aafp.org"
 type="cite">
  <div>&nbsp;</div>
  <div>&nbsp;</div>
  <div>5) perhaps allow the admin to unlock a user via the webpage
rather than have to do it at the command line?</div>
</blockquote>
Yes, good idea. Will try to work on that.<br>
<blockquote cite="mid:4C583D4C020000680005B321@smtp.aafp.org"
 type="cite">
  <div>&nbsp;</div>
  <div>6)&nbsp;&nbsp;in the preferences.php&nbsp; add the following to enable LDAP</div>
  <div>&nbsp;</div>
  <div>example 1:&nbsp; Search LDAP using only One LDAPServer and from the
top of the 'O".</div>
  <div>
  <div>&nbsp; //<br>
&nbsp; // Settings for the LDAP authenticator.<br>
&nbsp; //<br>
&nbsp; //&nbsp; "authLDAPServers"&nbsp;&nbsp;&nbsp;&nbsp; Array of hostnames to try binding to<br>
&nbsp; //&nbsp; "authLDAPBaseDN"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Base distinguished name for search/bind<br>
&nbsp; //&nbsp; "authLDAPAdmins"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cheap way to grant admin privs to users; an<br>
&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array of uname's<br>
&nbsp; //&nbsp; "authLDAPUseSSL"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect using SSL/TLS.&nbsp; [ true|false ]</div>
  <div>&nbsp;</div>
  <div>&nbsp; 'authenticator'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'LDAP',<br>
&nbsp; 'authLDAPServers'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; array('192.168.1.1'),<br>
&nbsp;&nbsp;'authLDAPBaseDN'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'o=level1',<br>
&nbsp; 'authLDAPAdmins'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; array('admin1','admin2','admin3'),<br>
&nbsp; 'authLDAPUseSSL'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; false,<br>
  </div>
  <div>Example 2:&nbsp;&nbsp; Search LDAP using two LDAPServers and using and OU=.</div>
  </div>
  <div>&nbsp; //<br>
&nbsp; // Settings for the LDAP authenticator.<br>
&nbsp; //<br>
&nbsp; //&nbsp; "authLDAPServers"&nbsp;&nbsp;&nbsp;&nbsp; Array of hostnames to try binding to<br>
&nbsp; //&nbsp; "authLDAPBaseDN"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Base distinguished name for search/bind<br>
&nbsp; //&nbsp; "authLDAPAdmins"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cheap way to grant admin privs to users; an<br>
&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array of uname's<br>
&nbsp; //&nbsp; "authLDAPUseSSL"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; connect using SSL/TLS.&nbsp; [ true|false ]</div>
  <div>&nbsp;</div>
  <div>&nbsp; 'authenticator'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'LDAP',<br>
&nbsp; 'authLDAPServers'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; array('192.168.1.1','192.168.1.2'),<br>
&nbsp;&nbsp;'authLDAPBaseDN'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'ou=level1,o=level2',</div>
  <div>&nbsp; 'authLDAPAdmins'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt;
array('admin1','admin2','admin3'),<br>
&nbsp; 'authLDAPUseSSL'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; false,<br>
  </div>
</blockquote>
Thanks for that.<br>
<blockquote cite="mid:4C583D4C020000680005B321@smtp.aafp.org"
 type="cite">
  <div>Note:&nbsp;&nbsp;authLDAPUseSSL = false works.&nbsp; I could not get&nbsp;it to work
with a 'true' setting, but that may only be a fault on my systems.</div>
</blockquote>
That's purely down to the configuration of your systems.<br>
<blockquote cite="mid:4C583D4C020000680005B321@smtp.aafp.org"
 type="cite">
  <div>Note: On authLDAPServers, I tested with both one and two
configured servers, both work, even if the first one listed does not
respond to the bind.</div>
  <div>FYI: If the authLDAPServers is set high in the tree ( ie:
o=top), then ldap does search down to lower levels looking for
matches.&nbsp; Some organizations may want to exclude some lower ou's.&nbsp;&nbsp; I
did not test if the BaseDN could contain multiple search ou's.</div>
</blockquote>
Again that depends on the permissions of the username you give it to
search with. Only LDAP trees that user has permission to access would
be searched. It's all down to your LDAP server configuration.<br>
<blockquote cite="mid:4C583D4C020000680005B321@smtp.aafp.org"
 type="cite">
  <div>&nbsp;</div>
  <div>Perhaps something the emailDomainRegexp would work to&nbsp;include
only specific ou's below the o? (I've not looked at it myself).</div>
  <div>&nbsp;</div>
  <div>7) In the comments of the NSSLDAPAuthenticator.php&nbsp; please
add&nbsp;comments to make it look more like the comments section in the
NSSADAuthenticator.php file.&nbsp; Sample below:</div>
  <div>&nbsp;</div>
  <div>Example for preferences.php:</div>
  <div>&nbsp;</div>
  <div>&nbsp;&nbsp;&nbsp; 'authenticator'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'LDAP',<br>
&nbsp;&nbsp;&nbsp; 'authLDAPServers'&nbsp;&nbsp;&nbsp;&nbsp; =&gt; array('192.168.1.1','192.168.1.2'),<br>
&nbsp;&nbsp;&nbsp; 'authLDAPBaseDN'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'ou=users,o=domain',</div>
  <div>&nbsp;&nbsp;&nbsp;&nbsp; // or&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'authLDAPBaseDN'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; 'o=domain',<br>
&nbsp;&nbsp;&nbsp; 'authLDAPUseSSL'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =&gt; false,</div>
</blockquote>
Yes, I've already added something very like that.<br>
<blockquote cite="mid:4C583D4C020000680005B321@smtp.aafp.org"
 type="cite">
  <div><br>
8)&nbsp; THANK YOU JULIAN!</div>
</blockquote>
No worries :-)<br>
Always good to make the software better for everyone.<br>
<br>
Many thanks for all your comments and suggestions.<br>
<br>
Jules<br>
<pre class="moz-signature" cols="72">
-- 
Julian Field MEng CITP CEng
<a class="moz-txt-link-abbreviated" href="http://www.ZendTo.com">www.ZendTo.com</a>

Need help fixing or optimising your systems?
Contact me!
Need help getting you started solving new requirements from your boss?
Contact me!

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
Follow me at twitter.com/JulesFM
</pre>
</body>
</html>