View Single Post
Old 08-09-2010, 02:08 AM  
CHMOD
Confirmed User
 
CHMOD's Avatar
 
Join Date: Jun 2003
Posts: 1,697
Quote:
Originally Posted by borked View Post
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

Ultimatly, I could use this solution...
I'll try to see if it work !

But I would still prefer to have the banned names in an external flat file.
CHMOD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote