View Single Post
Old 08-08-2010, 11:20 PM  
borked
Totally Borked
 
borked's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 6,284
Varius is correct - htaccess cannot prepend/append files, so your only way is to prepend the htaccess file with the list of banned users as this format:

setenvif remote_user "username1" banned
setenvif remote_user "username2" banned


so that in htaccess, you have something like this:

Code:
##BANNED USERS##
setenvif remote_user "username1" banned
setenvif remote_user "username2" banned

AuthName 'My Protected Area'
AuthType Basic
AuthUserFile /home/var/etc/.htpasswd (or authmysql if you're using that)


<Files *>
deny from env=banned
</Files>
if you add the
##BANNED USERS##
line, you can have a script automatically update your htaccess by replacing

##BANNED USERS##

with
##BANNED USERS##
setenvif remote_user "username3" banned


that should take care of things
__________________

For coding work - hit me up on andy // borkedcoder // com
(consider figuring out the email as test #1)



All models are wrong, but some are useful. George E.P. Box. p202
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote