Category Archives: PHP

Crazy fast AJAX search suggest in CakePHP

The fastest AJAX call is the one that is never made. Network latency makes using AJAX applications like Google instant search, or even the common autocomplete field, feel like running in treacle*. Having the browser run to the server for more data every time the user pushes a key just doesn’t work well. Many times [...]

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 [...]