Chapter 8. Programmers API

Table of Contents
Login via the API
"Passive" login
Plug ins
Creating/Modifying the GenieGate libraries

GenieGate is not just an application, it also provides a complete API for programmers to use. Through this API it is possible to store and access properties, perform authentication and listen for events. (it is also possible to do a great deal more, you should consult the api documents if you are interested)

People interested in using GenieGate for basic authentication may skip this chapter. However, it should be reassuring to know that it is available should your needs grow beyond what is already provided.

The actual documentation for this API is not covered here, it is generated by a free tool called doxygen (at the time of this writing, doxygen does not support the DocBook format)

Login via the API

The PHP files in your web/examples/login directory demonstrate a PHP based approach to password protecting PHP documents. Both form based and HTTP authentication based methods are demonstrated.

After you've altered them with the correct file location, you may try them out. basic.php provides the HTTP (with fall-back to a builtin form) method. It involves adding 1 line to a PHP document you wish to protect.

The 2liner.php is slightly more elegant, it demonstrates how to use a form based approach, with a user defined form for the user to fill out.