> -----Original Message----- > From: Marc MENDEZ [mailto:cnmm600@xxxxxxxx] > Sent: Tuesday, August 15, 2006 2:32 PM > To: users@xxxxxxxxxxxxxxxx > Subject: [users@httpd] How to detect failed authentification ? > > Hi, > > On one of my website, the access is controled with a .htaccess file. > I defined my own 401 document > > At the top of this file, I added a php code which sends a mail to the > administrator as soon as a user failed to log. > > I was very surprised to receive mail everytime ! Even if the > user succeeds > in loging ! I guess your PHP page is executed anytime the server sends a 401? If so, this is exactly what will happen... The server sends a 401 for any request that comes in without valid credentials. So the *first* request, which is sent when the client doesn't even know yet that the resource is protected, already triggers a 401. If this surprises you, read this http://en.wikipedia.org/wiki/Basic_authentication_scheme to see how basic auth really works... > > Why ? How can I solve this ? I don't think you can - the server doesn't distinguish between no credentials and bad credentials. Rgds, Owen Boyle Disclaimer: Any disclaimer attached to this message may be ignored. > > > > p4.vert.ukl.yahoo.com uncompressed Tue Aug 15 12:27:00 GMT 2006 > > > ______________________________________________________________ > _____________ > Découvrez un nouveau moyen de poser toutes vos questions > quelque soit le sujet ! > Yahoo! Questions/Réponses pour partager vos connaissances, > vos opinions et vos expériences. > http://fr.answers.yahoo.com > > > --------------------------------------------------------------------- > The official User-To-User support forum of the Apache HTTP > Server Project. > See <URL:http://httpd.apache.org/userslist.html> for more info. > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx > " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx > This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please notify the sender urgently and then immediately delete the message and any copies of it from your system. Please also immediately destroy any hardcopies of the message. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. The sender's company reserves the right to monitor all e-mail communications through their networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorised to state them to be the views of the sender's company. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx