[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] htaccess problem on raq3i



Hi there,

Newbie to this list (and colbalt) I am in the process of transferring
several sites to a RAQ3i.

I have a problem with .htaccess.

I give my users the opportunity to create a private directory inside one of
my sites , using a cgi-script.
When the create the directory, the script writes  an .htaccess file inside ,
crypts the user chosen password and writes it down to a password file.

here is the subroutine (perl):
******

     open (FILE, "<pswd.txt");
     while (<FILE>) { $pswdtmp .= $_; }
     close (FILE);

       foreach $key (keys (%in)) {
    my $svar = '\['.$key.'\]';
    my $rvar = $in{$key};
        $pswdtmp  =~ s/$svar/$rvar/g;

  }

     open (htaccessFILE, ">$Dirpath/$Dirname/st/.htaccess");
     print htaccessFILE ("$pswdtmp\n\n");
     close htaccessFILE;
     chmod (0666, "$Dirpath/$Dirname/st/.htaccess");

     open (htaccessFILE, ">$Dirpath/$Dirname/st/htaccess.txt");
     print htaccessFILE ("$pswdtmp\n\n");
     close htaccessFILE;
     chmod (0666, "$Dirpath/$Dirname/st/htaccess.txt");

$Password = "$in{'req-password'}";
$pswdpath= "/home/sites/site5/web/cgi-bin/password/sites";
 $passwd = crypt("$Password",MW);

   open (PSWDFILE, ">>$pswdpath");
    print PSWDFILE "$Dirname:$passwd\n";
     close PSWDFILE;

**** end of subroutine*****

pswd template 'pswd.txt' below:

******
AuthUserFile /home/sites/site5/web/cgi-bin/password/sites
Authname "[req-sitename]"
Authtype Basic
<Limit GET POST PUT>
Require valid-user
</Limit>
******
Everything runs well (directory creation, encryption,writing to the password
file 'sites')
but when given the right password directory access is denied!

this script worked fine for 6 months on an Apache server (hispeed.net
hosted).


So what's wrong?

Thanks for helping

hpm