Can anybody tell me, what the "user state" in the ZfcUser is doing exactly and why we may need it? What does this user state mean (I assume it's not the role meant by it)?
相关问题
- Why does recursive submodule update from github fa
- How to pass options/params to formCollection field
- Compress html output from zend framework 2
- zend smtp mail crashes after 100+ mails
- 404 HTTP errors not being rendered in JSON using Z
相关文章
- Zend Framework 2 Forms Array notation for drop dow
- Use spiffy navigation with zfcrbac module
- Best practice to call another controller action fr
- How to use Zend Service Amazon?
- Difference between init() and onBootStrap() in Zen
- Does Zend Framework 2.0 leave out the amazon s3 li
- Zend Framework 2 Flash Messenger returning no mess
- doctrine migrations 2 + zend framework 2 = is it p
User state can be used by adding two values to your config array in zfcuser.global.php
In order to use state as active/inactive for example you can add this:
'enable_user_state' => true, 'allowed_login_states' => array(1),
Now the user state has to be set to 1 from an admin, otherwise login will fail for that specific user.
Basically it's a flag to indicate the state of a user. Sometimes you need to be able to disable users, or otherwise affect their 'state' without actually deleting them from the table. That's what the state column is intended for if you use such a system.
As a simple example, think of a temporarily banned user on a forum, you don't want to delete them, so you set their state to banned, and only allow users who aren't banned to log in.
Of course there could be more states to indicate other things, such as an account that hasn't yet been validated by way of confirmation email, or requires administrator approval, whatever makes sense in your user ecosystem really. It could be you don't need any at all, in which case you can safely ignore it.