[AuthPG] AuthPGVirtual and custom AuthPGQuery
Brought to you by:
minskim
From: R D. <rdi...@ar...> - 2001-10-13 23:29:05
|
Hi...here's my problem. I have enabled AuthPGVirtual, and it works fine when I don't use AuthPGQuery. But I want some more control via a custom query, and this doesn't appear to work when I set a custom AuthPGQuery. Here's my pgsql table: uid | dte | username | passwd | domain | dir -----+------------------------+----------+---------------+----------------+------------- 1 | 2001-10-13 18:29:23-04 | xxxx | xxxxxxxxxxxxx | rdb/dbmp | /dbmp My .htaccess: AuthName "Some Realm" AuthType Basic AuthPGVirtual on AuthPGUser user AuthPGPassword passwd AuthPGHost localhost AuthPGDatabase httpauth AuthPGUserTable users AuthPGPasswordField passwd AuthPGUserNameField username AuthPGDomainField domain AuthPGEncrypted on AuthPGQuery "select passwd from users where username='%s' and dir like '/dbmp';" <Limit GET> require valid-user </Limit> I've tried this query with dir='/dbmp' as well. It doesn't appear the username %s gets split into its user @ domain elements to be checked against the entries in AuthPGUserNameField and AuthPGDomainField. Apache reports: [Sat Oct 13 19:00:46 2001] [error] access to /dbmp/index.php3 failed for somehost.com, reason: user xxxx@rdb/dbmp not found This setup works fine when AuthPGQuery is not used, problem is anyone with a valid login can successfully connect to any resource configured to use AuthPGVirtual. What I'm trying to do is further limit users access by having the query ALSO check to make sure their permitted to access the resource by querying against the dir field in the table. Any ideas what I may be doing wrong, or is there a limitation in AuthPGVirtual that disallows the use of AuthPGQuery? |