One of the downsides of coding is that you tend to do the same type of task over and over. This hit me as I was ramping up for a new personal project - I needed a basic system that did user logins, and some limited access control. In addition, a simple user management system was needed. And I had decided to use Zend Framework. Instead of writing one from scratch yet again, I decided to create a shell project that provided these features. This way, when I start my next project I have a head start seeing as the code is already done.
Download this starter application
Usage:
- Decompress the file into a temporary directory
- read the login/support/README file
- Copy the 'login' folder to your web server. NOTE: only the "public" folder should be accessible by the general public. This is a typical Zend Framework setup and is well documented online.
- Rename the "login" folder to match your application name
- Create your database. Use the support/database/mysql.sql file to build the users table.
- Edit the application/configs/application.ini file to meet your needs. Specifically, change the database connection information and the timezone (if needed).
- Load the application in your browser. In my case I do so via http://localhost/dev/login/public. This will of course depend on where you placed the directory, what you named it, and/or how you set up your websever to access the directory.
- You should be presented with the "standard" Zend Framework index page for a new project, with the addition of some links across the top.
- Click the Login link. Register a user account.
- Click the Login link again. This time login as the user you just created.
- Notice the top links change. You can now Manage Users.
- Modify the application to meet your needs.
More information:
- The starter app makes use of Zend Framework 1.8.4.
- Both manual forms and Zend_Form type forms are used. The idea being that newer Zend Framework developers sometimes like to see sample code before deciding which approach to use.
- Access control is done via a Front Controller Plugin.
- You must be logged in to view the user management pages.
Contact me if you encounter any problems with the code, or if you see ways it can be improved.