First yii Application: duplicate user

I’m just getting started with yii, following the tuturials and documentation best I can thus far.

I created the first app following this guide here, and changed the database to mysql as well. All good so far.

But in learning/testing, I was able to create a new/duplicate username of ‘test1’

Should that have been allowed to happen?

It depends on your database. You could make the username field unique. Then GII will autogenerate the right rules.

check the rules method in the model and add array(‘username’, ‘unique’)