Menu

AuthMySQLUserCondition and vhost name?

Help
Guido Smit
2004-12-30
2013-04-23
  • Guido Smit

    Guido Smit - 2004-12-30

    How can I use the servername of the vhost in the AuthMySQLUserCondition config?

     
    • Jerry Stuckle

      Jerry Stuckle - 2004-12-30

      Guido,

      You can't use the server name in the AuthMySQLUserCondition.  Connection to the host (and database selection) is done before the SQL statement is executed.

      You can specify the host name or ip address in the AuthMySQLHost.

      Jerry

       
      • Guido Smit

        Guido Smit - 2004-12-31

        I think my question was not clear. Let me try to explain what my goal is:

        I want to use this mod to autheticate users to awstats. I have serveral virtual hosts, so when trying to authenticate, I need to know which virtual host is being called from the client in order to authenticate using the right credentials.

         
    • Guido Smit

      Guido Smit - 2004-12-31

      I figured it out. I had to modify the source of mod_auth_mysql.c

      I added a small routine for string replacement.
      Added this string replacement to the get_mysql_pw function.

      My AuthMySQLUserCondition:
      AuthMySQLUserCondition "Domain LIKE '%%v'"

      Everthing works the way I want.

       
    • Jerry Stuckle

      Jerry Stuckle - 2004-12-31

      Guido,

      Ok, now I understand what you're trying to do.

      This sounds like it might be a useful addition.  Could you please pass along the actualy patch you used?  We will consider it for inclusion in a new release (perhaps not the next one - it's almost ready to go - but the one after that).

      It would help if you'd post it in the Request for Enhancements (RFE) section.

      Jerry

      Jerry

       
    • Jerry Stuckle

      Jerry Stuckle - 2004-12-31

      Guido,

      OK, I found your patch in the Patches section.  Thanks for uploading it!

      I've moved it to the RFE section so we can look at it for the next release.

      Jerry

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.