Zend_Acl part 2: different roles and resources, more on access

Tags:

Applications often have different resources: For example, you might have pages, some user generated content like comments, and an admin area. You might also have files, or even real-life objects like a coffee machine.

In the context of Zend_Acl, access to resources is given to roles: A role might be a user’s name, a group a user belongs to, or just roles, which have been assigned to a user from the admin panel.

Since Zend_Acl only defines an “abstract” role, resource and privilege, how do we deal with all of these using it?

Zend_Acl part 1: Misconceptions and simple ACLs

Tags:

I’m going to be writing a weekly series of posts on Zend_Acl. This first post will clear up some common misconceptions regarding Zend_Acl, introduce creating ACLs for simple applications, and give some examples on using the ACL in both non-Zend Framework and Zend Framework applications.

Even more PHP mistakes!

Tags:

I recently wrote a post about three PHP mistakes that can give you a bad headache. The blog readers commented even more mistakes, and there was a whole new article on another site with 8 mistakes of their own! This post is dedicated to the mistakes my readers posted in the comments, and lastly linking to the other mistake article.

Avoiding endless switch-case structures with classes

Tags:

Imagine the following: you have some form elements that need to render themselves. You have saved them in a database, as your users must be able to modify the forms. You have a bunch of different kinds of elements: a text field, a longer textarea field, maybe a field used for entering dates. How would you determine, which kind of …

Migrating user account databases

Tags:

As a part of my work at The Group, I’ve been developing a suite of applications for them. As most web applications do, these applications have to store their user data somewhere – in a database. As you may guess, the user’s password has been stored as a hash. As a part of some new developments, we are moving our …

GroupFight: My old PHP-based game

Tags:

First an announcement: During 2008, CodeUtopia had about 120 000 visitors! I think that’s amazing, and I want to thank everyone who has been reading the blog. I’m going to try and keep posting interesting things for you to read this year too. :D Now, to the post: Back in 2003 I wrote a game called GroupFight. The idea started …

Using models as criteria objects for querying the database

Tags:

If you have written a model layer which separates database access from the rest of the code, you probably know that you may end up with lots of methods like findByName, findByTitle or such, for cases where you want to find records based on specific criterias. You could also use arrays, for example findBy(array(‘title’=>’something’)). However, these are easy to type …

What would make template engines actually useful?

Tags:

Probably all of us have used template engines in one form or another. Some might even like template engines for whatever reason, but let’s think about it for a moment: are they actually making our lives easier? Most template engines simply wrap PHP (or some other language’s) syntax into their own syntax, and maybe they look a little bit cleaner …