Tutorial: Role-Based Access Control with CakePHP

In an earlier post I talked about access control with CakePHP‘s AclComponent and how it might be used for the simple-yet-powerful roled-based access control, where users can have multiple roles and permission checks are reduced to verifying if the user has a certain role. In this tutorial we’ll add role based access to the CakeBB sample app. It …

Simpler role-based access control for CakePHP

It’s been a rough ride but I think I’m finally getting the hang of CakePHP‘s AclComponent. The official documentation kind of sucks, unless you’re a Lord of the Rings fan. Great, but how do I apply this in a real world application. I needed full role-based access control in a -application I’m working on. In the end …

Not so poor man’s cron jobs for CakePHP

A.k.a. “How to make AuthComponent think the user is someone else” The other day I needed to add subscribable email reports to a CakePHP web application. The system should generate the reports automatically every few days and send them automatically to their owners. In a Unix setting that would be job for cron. Unfortunately my hosting, while …

Fixing mangled characters in MySQL

Some 30000 UTF-8 encoded posts in a popular Spanish forum had been stored in a column defined as latin1 with the usual consequences: accented characters like á é ó ñ got mangled into á é ó ñ, also known as mojibake. To complicate matters more, the more recent content was properly encoded in latin1, so a …