Model scenario question


if I use scenarios, for example username:unique on register.

But if I use mass assignment. Someone could modify the post data when changing the pw for example. What is the best solution for this in yii?

Uhm and another question:

$user->setAttributes($_POST['User'], 'register');

Doesnt work…it doesnt set the scenario to register? What did i miss?

Please check http://www.yiiframew…uide/form.model

You can set safeAttributes according to scenarios.

Ah ok thx, but the second question is not answered there oO

$model->setAttributes($_POST['LoginForm'], 'login');

should work? But the set  scenario is not set ( Ignored )