Gossamer Forum
Home : Products : Others : Fileman :

bug report (?)

Quote Reply
bug report (?)
Well, I have one bug to report. If this is not a bug and I am just not doing things right way, let me know...

When I try to password protect directory, which already has some .htaccess file inside (for example with words DirectoryIndex index.php), Fileman creates related file in the passwords' directory but it just doesn't change original .htaccess file, so the directory is still accessible by anyone.

I suppose that this is really an bug, but if isn't, let me please know how to configurate Fileman to do this correctly...

Thank you very much for any suggestions...

Robo
Quote Reply
Re: [Robo] bug report (?) In reply to
Hi,

Thanks for the feeback. Would you replace the command below within Commands.pm:

($faccess->{exist} and $faccess->{size} > 0) or _create_htaccess($htaccess, $htpasswd);

With:

Code:
if ( !$faccess->{exist} or $faccess->{size} == 0 ) {
_create_htaccess($htaccess, $htpasswd);
}
else {
open (HTACC, "< $htaccess") or die "Unable to open: $htpasswd ($!)";
my @info = <HTACC>;
close HTACC;
_create_htaccess($htaccess, $htpasswd) if ( @info[0] !=~ /$htpasswd/ );
}

The problem will be fixed.

TheStone.


B.
Quote Reply
Re: [TheStone] bug report (?) In reply to
>>@info[0]<<

Should'nt that be $info[0] ?
Quote Reply
Re: [TheStone] bug report (?) In reply to
You can use the script below that should be better:

my $found;
LINE: foreach { @info } {
if ( $_ =~ /$htpasswd/ ) {
$found = 1;last;
}
}
_create_htaccess($htaccess, $htpasswd) if ( !$found );

TheStone.

B.

Last edited by:

TheStone: Jun 3, 2002, 2:06 PM
Quote Reply
Re: [TheStone] bug report (?) In reply to
oops... ( @info) instead of { @info }

B.
Quote Reply
Re: [TheStone] bug report (?) In reply to
If you wanted, you could change:

if ( $_ =~ /$htpasswd/ ) {

to

if ( /$htpasswd/ ) {
Quote Reply
Re: [Paul] bug report (?) In reply to
Hello :-)

Thank you for fast responses! If you can, please write down how the final code change would look like. I think it would be better for me as well as for other code beginners (I am not sure which of those suggested "after"-changes are important and which aren't).

Thank you again :-)

Bob
Quote Reply
Re: [Robo] bug report (?) In reply to
You should upgrade the newest version which should be fixed this bug

TheStone.

B.
Quote Reply
Re: [TheStone] bug report (?) In reply to
Hello :-)

Look - I have tried ALL of the suggested patches but I just got error results!!!
I prefer if you could post tested code Wink

R.
Quote Reply
Re: [Robo] bug report (?) In reply to
>>You should upgrade the newest version which should be fixed this bug <<

Wink
Quote Reply
Re: [Paul] bug report (?) In reply to
Are these changes already implemented in v2.0.3 ???