|

CakePHP ACL and Auth: Sample Website

View full index of ACL Tutorial Articles

In order to demonstrate real-world usage of CakePHP’s ACL and Authentication Components, I have created a sample website.

The sample website features the following features in it’s current 1.0 version:

  • two different users with different permissions
  • varying levels of content access
  • persistant user logins with cookies
  • a dynamic menu providing admin links
  • content creation forms for adding and editing content
  • usage of the ACL Behavior for synchronizing Users, Groups and Aros

This sample code is NOT an example of how to safely collect data from users in online forms. I do almost no data validation in the content creation forms, and I don’t escape any characters in the views. With that in mind, this is only usable as a learning vehicle, and not as some sort of enterprise ready CMS!

You can get the source code from this website two ways:

  • checkout the code from SVN at: http://www.aranworld.com/svn/kitchen/tags/1.01

To most quickly get up to speed with the sample site, follow these steps:

  1. load MySQL dump file located in kitchen/sql. This will create a database called kitchen containing tables used by the ACL and Auth components as well as two sample content tables.
  2. open up kitchen/app/config/database.php.default. enter your applicable values and save file as database.php.
  3. make changes to kitchen/app/webroot/index.php.default to accurately reflect your own environment, save as index.php.

That should be all you have to do. After correctly being configured, you should be able to login as one of two users, each with separate permissions:

Pierre Herme - Superuser
username: pherme
password: ILikeCake
Elizabeth Crocker - User
username: ecrocker
password: outofbox

The website is simple enough, that you should be able to navigate it’s source code while reading other tutorials about ACL and Authentication and begin to get an idea of what you need to do to get it all working.

I will be writing some more articles providing some more detailed deconstructions of what is going on.

View full index of ACL Tutorial Articles

Monday May 26, 2008

|

rss feed iconRSS / Atom

Aran World

My Amazon.com Wish List

I'm Aran Johnson and I make websites.

I primarily use: PHP, MySQL, SubVersion, CakePHP, TextPattern, Cream Text Editor, and Addi Turbo Needles

Contact Me

My website portfolio

Recently

Oakland Parking Violations and Fines

Tweet Design

CakePHP ACL and Auth: Record Level Protection

How To Play Hearts With Only Two Players

Facebook Privacy Settings

CakePHP Tutorials

CakePHP ACL and Auth: Record Level Protection

CakePHP ACL and Auth: Sample Website

CakePHP ACL and Auth Tutorial: Database Setup

CakePHP ACL Tutorial: Introduction

CakePHP ACL Tutorial: Usage With Auth Component

CakePHP ACL Tutorial: Initial Setup

CakePHP ACL Tutorial: Auth Component Example

CakePHP ACL Tutorial: How To Check Access

Cake PHP ACL Tutorial: The Database Tables

My Flickr

Advertisement:
Protect Your LCD or Plasma TV Screen From Accidents

All content © Aran Johnson