[Phpwm] .htaccess auth question
Phil Beynon
phil at infolinkelectronics.co.uk
Mon Aug 6 19:39:45 BST 2007
> > Can you run PHP (or another form of call) from within an .htaccess file
> > that's capable of retrieving that data from a file / database?
>
> I don't think it's possible to put php code inside a .htaccess file,
> although there may be some amazing technique for doing it that I've
> never heard of.
>
> I now have my application working so that it logs the users into the
> dev sites without a password prompt. One thing I noticed is that
> passing the username and password causes a slightly irritating prompt
> in firefox. So I added a check like this before the redirect:
>
> function testUrl($uri)
> {
> $client = new Zend_Http_Client();
> $client->setUri($uri);
> $response = $client->request();
> $status = $response->getStatus();
>
> return ($status == '200');
> }
>
> I only pass the username and password when the http status is not 200,
> if it's 200 the site doesn't require authentication for this user
> currently.
>
> Pete
>
Pete,
isnt that only going to work when the goes back to the main sign in program?
i.e.
A -> B
A -> C
A -> D
but not
B -> C
C -> B
B -> D etc
Which if the developers have the different pages bookmarked / icon clickable
isn't actually going to be of any benefit, which is why I was thinking more
of having a script call / execution from within the .htaccess / .htpassword
set as that would cascade down the subdirectory tree and catch all logins.
P
More information about the Phpwm
mailing list