Re: Apache: adding massive amount of users for .htaccess from text file
On Fri, Feb 20, 2004 at 04:05:15PM +0100, Erik D?rnbach wrote:
> Hi again,
>
> > untested, quick and dirty
> >
> > #!/usr/bin/perl
> >
> > while (<>) {
chomp;
> > ($username, $password)=split /:/, $_, 2;
> > system("/usr/bin/htpasswd", "-b", "/path/to/htaccess",
> > $username, $password);
> > }
>
> Mmmh, I'm not sure why, it looks right, but now I noticed, it doesn't
> work. The output looks okay, if I change the password of one user
> manually in the same htaccess (user:crytpass) it works again for that
> user. Maybe something wrong gets parsed after the split part (which I
> don't understand myself) into the password?
Maybe it doesn't like the EOL characters. Try the "chomp;" above.
> Help appreciated, please safe me from typing hundreds of users'
> credentials! ;)
:)
--
Michael Wood <mwood@its.uct.ac.za>
Reply to: