Gossamer Forum
Home : Products : DBMan : Customization :

Using htaccess with dbman

Quote Reply
Using htaccess with dbman
First, I did find some posts on this topic - here and at LoisC's FAQ - but they were contradictory or otherwise not helpful. And the most recent seemed to be a couple of years old.

I am creating a web site that will have a user only area within which I will put dbman access, among other things. Rather than have the user login in twice (into the folder and into dbman) OR somehow synch htaccess and dbman's .pass file, I would like to use either htaccess or .pass for both.

I would appreciate any comments or suggestions before I start tearing apart auth.pl. I good challenge for our collective minds.

Thanks,

Bob
Quote Reply
Re: [BobLuttman] Using htaccess with dbman In reply to
Hi Bob,

This should be a bit hack into the auth.pl file. If you are on Dbsql Man, there is a plugin to do this. I have created one like this.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Using htaccess with dbman In reply to
Thanks, unfortunately I have several databases on plain old dbman and haven't had the time yet to start migrating everything to SQL.

This problem has two parts: getting htaccess and dbman to share the password file and getting dbman to use the permissions in the password file. The first is easy, and already done. They will share the password file without any problems, so far anyway.

The latter is a bit more complicated, judging from old posts. If I accept server authentication then dbman will not read the password file and pickup the permissions, making everybody a default user. It also seems to me that the .cfg files will need some work.

I also cannot see any way to get Apache to accept dbman's authentication.

I am hoping some kind stranger has done the hacking in auth.pl and could walk me through it.

Bob

Last edited by:

BobLuttman: Oct 16, 2002, 6:42 AM
Quote Reply
Re: [BobLuttman] Using htaccess with dbman In reply to
Hi,

Dbman can accept the Apache authenticated user. You should keep the same list of users in these files
Please see the below codes int the auth.pl

my ($pass, @passwd, $userid, $pw, @permissions, $file, $uid);
my ($server_auth) = $ENV{'REMOTE_USER'} || $ENV{'AUTH_USER'};

if ($auth_no_authentication || (($db_uid eq 'default') && $auth_allow_default)) {
return ('ok', 'default', @auth_default_permissions);
}
elsif ($server_auth) { # The user has logged in via server authentication.
return ('ok', $server_auth, &auth_check_permissions($server_auth));

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog