i'm making a unit testing suite. i want to autheticate users using http authentication if they access the tests url via the web, but i still want users to be able to set up a cron job that runs the tests automatically. how can I do both?
Have two different scripts requiring the same library. In one script you just run whatever function you want - this is the one you call from crontab. In the other one, you do the auth, then invoke the main function.
All this is even not necessary if you're using basic http auth, and not care about the identity - then .htaccess and .htpasswd are all you need. Apache will check the user, crontab will ignore the auth mechanism.