I only agree to it "depending" if I have to write my own function using a
regular expression to parse the .htaccess file, but I was wondering if it is
already available from a PHP function or variable.

In the .htaccess file, the AuthMySQLDB directive:
1) may not be present
2) may be commented out
3) may appear like the following starting in the first columns:
AuthMySQLDB             aDataBaseName
4) may be commented out with a valid entry present
#AuthMySQLDB            oldInactiveDataBaseName
AuthMySQLDB             newActiveDataBaseName
5) who knows? -- it may have other "white space" and not start in the first
        AuthMySQLDB             newActiveDataBaseName  

Is that what you meant?  How else can it be specified in the .htaccess file?

It does not appear in $_ENV.
I also didn't see anything in the Apache specific functions catching my eye,
however I did see the mod_auth_mysql module loaded with
"apache_get_modules()" (but I can't rely on this because I need to know
which database is being used).

apache_getenv seems to load what I already see in phpinfo().  I just don't
see an AuthMySQLDB entry.

> -----Original Message-----
> From: Chris [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 18, 2007 7:28 PM
> To: Dwight Altman
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] Determine AuthMySQL* directives in script?
> Dwight Altman wrote:
> > Is there an existing way via a function or variable to determine Apache
> > mod_auth_mysql directives (specifically AuthMySQLDB) in use for the
> current
> > script?
> >
> > On our servers, some directories use a basic .htaccess file while some
> use a
> > database under mod_auth_mysql while the latest user management system
> uses a
> > different database still using mod_auth_mysql.
> >
> > I would like to have my PHP script determine which .htaccess technique
> is
> > being used for its directory, so that the script checks the correct
> database
> > for more fine grained ACL role privileges.
> >
> > An alternative is that I'd have to write a routine to parse the
> .htaccess
> > file to check for the directive in a regular expression (and if that
> > directive is in use {regardless of whitespace} or commented out and not
> in
> > use).
> Depends. How are you specifying the variables in the .htaccess file?
> Are they 'ENV' variables? Do a print_r($_ENV); and they should show up..
> --
> Postgresql & php tutorials
> http://www.designmagick.com/

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to