From owner-freebsd-questions Sun Sep 23 0: 4: 4 2001 Delivered-To: freebsd-questions@freebsd.org Received: from rush.telenordia.se (mail.telenordia.se [194.213.64.42]) by hub.freebsd.org (Postfix) with SMTP id ED6C537B411 for ; Sun, 23 Sep 2001 00:03:59 -0700 (PDT) Received: (qmail 14474 invoked from network); 23 Sep 2001 09:03:58 +0200 Received: from bb-62-5-36-29.bb.tninet.se (HELO there) (62.5.36.29) by mail.telenordia.se with SMTP; 23 Sep 2001 09:03:58 +0200 Content-Type: text/plain; charset="iso-8859-1" From: Mark Rowlands To: Keith Spencer , fbsd Subject: Re: For script wizards-> Parse a delimited list to add htusers Date: Sun, 23 Sep 2001 09:05:04 +0200 X-Mailer: KMail [version 1.3] References: <20010923005845.88867.qmail@web12006.mail.yahoo.com> In-Reply-To: <20010923005845.88867.qmail@web12006.mail.yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20010923070359.ED6C537B411@hub.freebsd.org> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sunday 23 September 2001 2:58 am, Keith Spencer wrote: > Hi all, > I have an interesting problem. > I run a school network and have installed squid to > proxy for our ADSL fbsd gateway (4.3 releng) > I have figured out how to get a by-user/password > access challenge from squid. I need to be able to kick > kids off at times. > I am into VB but know nix of Perl etc. > The ideal thing would be to have a web driven user > database on the gateway but It is likely too tricky > for me to do. (see scenario at page bottom) > How can I parse a delimited file like... > user1,password1 > user2,password2 > .... etc > using htpasswd to add each entry to my /etc/inetusers > file > It would be even better if I could just somehow import > the users from the NT domain. But again...know not > how. > So maybe i'll just hit it with a hammer using ftp and > the script you might know how to do... > Anyway here is a scenario (best case) > Maybe you have suggestions for this or a neat solution > ############################# > files = bannedlist , schooluserlist, inetusers > student fires up browser > challenged for user password > if valid ok surf > else if on banned list goodbye > else if not in valid nor banned list then > get them to supply password > addit to htpassword file > let them in > ############################## > What do you think? well, we use a mysql database to store users / rights and then cgi to talk to that. ..... there are utilities to extract users from NT and it's not hard to code a bit of cgi.. I don't think you will find anything "off the shelf" to do this, but you could look at Webmin. (port is in sysutils) to get an idea as to how you can code this sort of thing..... maybe you have a student perl hacker who could help? -- He's got the heart of a little child, and he keeps it in a jar on his desk. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message