[KLUG Members] LDAP & PHP
Adam Williams
members@kalamazoolinux.org
Tue, 5 Aug 2003 10:07:54 -0400 (EDT)
>> > I don't want to use htaccess.
>> > I want users to login so I have their information. Not neccisarily for
>> > security.
>> You can still have the information if you use htaccess. Apache stores
>> the name of the athenticated user in a variable accessible to PHP.
>> $username = getenv("REMOTE_USER");
>I'd still have to maintain an .htaccess file though. Wouldn't I?
Something like -
<Files index.php>
AuthType Basic
AuthName "intranet"
require valid-user
</Files>
...
<Files no_detail_specids.php>
AuthType Basic
AuthName "intranet"
require user barnosky adam darrell steve rhopkins
</Files>
...
<Files td_hm_class.php>
AuthType Basic
AuthName "intranet"
AuthLDAPURL ldap://littleboy:389/o=Morrison Industries ,c=US?uid
require group cn=Intranet Training Application,ou=ACLGroups,o=Morrison
Industries,c=US
</Files>
if you have directives in your httpd.conf -
<Directory "/var/www/html">
...
AuthType Basic
AuthName "intranet"
AllowOverride AuthConfig
AuthLDAPURL ldap://localhost:389/o=Morrison Industries,c=US?uid
...
</Directory>