Archive for the 'Web Technologies' Category

CakePHP ACL and Ajax

I’m building a web based application using ExtJS as the frontend and CakePHP as the backend. CakePHP built-in ACL returns 200 OK status even when the access was denied. The application uses Ajax a lot so I need CakePHP to returns appropriate response status so that I can inform the user if the requested access was denied. To configure ACL properly, you can follow the posts from Mark Story here and here for the part 2.

After that, just add the following code in app_controller.php

function beforeRender() {
        if ($this->RequestHandler->isAjax()) {
                if ($this->Session->check('Message.auth')) {
                        $this->Session->del('Message.auth');
                        header('HTTP/1.1 403 Forbidden');
                }
        }
}

Now, instead of receiving 200 OK status I get 403 Forbidden when access is denied. Hope this helps!

 If you like this post, please buy me a coffee.

Fun with ExtJS

These two weeks, I had the chances to play with ExtJS. The widgets are just amazing! Although I have lots of frustation (and hair losses) due to API docs are not beginner friendly (strictly my opinion), lots of other resources available on the net to help me to get started. Official user documentation would be helpful if they provided one, though. Fortunately, using the widgets couldn’t have been easier and they provided examples with the download. So now, with ExtJS, I can build desktop-like GUI in a jiffy so I have more times developing the backend.

In terms of licensing, I’m pretty much unclear of what I can and can’t do if I opted using GPL. But If I’m not mistaken, when a library is GPLed, everything built on top of that library needs to be GPLed too (is that correct?). Certainly, commercial license is the way to go if I want to sell a product that make use of ExtJS extensively but USD289 (that’s about RM965.26) for a single developer license is not a cheap price to pay. Despite the price, ExtJS is a robust javascript framework and I’ll be glad to support them, if I had money. :P

 If you like this post, please buy me a coffee.

Adobe AIR for JavaScript Developers Pocket Guide

Last month, Mike Chambers thru Ajaxian generously offered free copies of this book. Quickly, I send him an email. About three weeks after that, a mail package came in at my office. I was delighted to see that he managed to include extra freebies (Adobe RIA AS3 Reference Guide and a very nice AIR sticker) along with the book. Although the offer has ended, one can still freely download the pdf here or read it online at toString.org.

 If you like this post, please buy me a coffee.