WiFiDog is a complete and embeddable captive portal solution for wireless community groups or individuals who wish to open a free HotSpot while still preventing abuse of their Internet connection.
It's client-side half is written in C and is light enough to run on the Linksys WRT54G. It's auth-server half is currently a PHP implementation.
More information at the WiFiDog home page at IleSansFil