Book Image

Learning Phalcon PHP

Book Image

Learning Phalcon PHP

Overview of this book

Table of Contents (17 chapters)
Learning Phalcon PHP
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Developing an authentication system


There are always parts within your application that need to be protected. In this section, we will implement an authentication system that is partially based on the user tables that we created in the previous chapters, and we will use Phalcon's ACL component.

We are not going to reinvent the wheel, so parts of the HTML code are taken from the official Bootstrap website (http://getbootstrap.com). In addition, you can find parts of the PHP code in a plugin that I developed a long time ago and which can be found at https://github.com/calinrada/PhalconUserPlugin. That being said, let's start developing our authentication system.

The database structure

We will add a few more tables for users, and we will create new ones for the ACL according to the example found at https://github.com/phalcon/incubator/tree/master/Library/Phalcon/Acl/Adapter because we will use the database adapter. The incubator page contains a structure for the SQLite database, but we are going...