ZfcUser 项目地址:https://github.com/ZF-Commons/ZfcUser
<?php /** * ZfcUser Configuration * * If you have a ./config/autoload/ directory set up for your project, you can * drop this config file in it and change the values as you wish. */ $settings = array( /** * ZendDbAdapterAdapter DI Alias * * Please specify the DI alias for the configured ZendDbAdapterAdapter * instance that ZfcUser should use. */ //'zend_db_adapter' => 'ZendDbAdapterAdapter', /** * User Model Entity Class * 用户实体类 * * Name of Entity class to use. Useful for using your own entity class * instead of the default one provided. Default is ZfcUserEntityUser. * The entity class should implement ZfcUserEntityUserInterface * 指定哪个类为用户实体类。可以使用你自己的类来替换系统提供的。默认是 * ZfcUserEntityUser。这个类实现了 ZfcUserEntityUserInterface 接口。 */ //'user_entity_class' => 'ZfcUserEntityUser', //'user_entity_class' => 'IchcmsEntityUser', /** * Enable registration * 是否开启注册 * * Allows users to register through the website. * * Accepted values: boolean true or false */ //'enable_registration' => true, /** * Enable Username * 是否开启用户名(默认不开启) * * Enables username field on the registration form, and allows users to log * in using their username OR email address. Default is false. * 开启后用户名将出现在注册表单中,并且允许用户使用用户名或者邮箱进行登录。 * * Accepted values: boolean true or false */ //'enable_username' => false, /** * Authentication Adapters * 鉴权适配器 * * Specify the adapters that will be used to try and authenticate the user * 指定用于鉴权的适配器 * * Default value: array containing 'ZfcUserAuthenticationAdapterDb' with priority 100 * Accepted values: array containing services that implement 'ZfcUserAuthenticationAdapterChainableAdapter' */ 'auth_adapters' => array( 100 => 'ZfcUserAuthenticationAdapterDb' ), /** * Enable Display Name * 是否开启昵称(默认关闭) * * Enables a display name field on the registration form, which is persisted * in the database. Default value is false. * 开启后,昵称表单将显示在注册表单,昵称将存储在数据库。 * Accepted values: boolean true or false */ //'enable_display_name' => true, /** * Modes for authentication identity match * 设置身份鉴权的id匹配模式 * * Specify the allowable identity modes, in the order they should be * checked by the Authentication plugin. * 设置可以使用作为身份鉴权的id模式,将提供给鉴权适配器使用。 * Default value: array containing 'email' * Accepted values: array containing one or more of: email, username * 值是一个数组,默认是 email,可以指定包括 email,username在内的一个或者多个选项 */ //'auth_identity_fields' => array( 'email' ), /** * Login form timeout * 设置登录超时 * * Specify the timeout for the CSRF security field of the login form * in seconds. Default value is 300 seconds. * * Accepted values: positive int value */ //'login_form_timeout' => 300, /** * Registration form timeout * 设置注册超时 * * Specify the timeout for the CSRF security field of the registration form * in seconds. Default value is 300 seconds. * * Accepted values: positive int value */ //'user_form_timeout' => 300, /** * Login After Registration * 设置注册成功后是否自动登录(默认是) * * Automatically logs the user in after they successfully register. Default * value is false. * * Accepted values: boolean true or false */ //'login_after_registration' => true, /** * Registration Form Captcha * 是否使用验证码注册 * * Determines if a captcha should be utilized on the user registration form. * Default value is false. * 指定是否显示一个验证码在用户注册表单,默认是否 */ //'use_registration_form_captcha' => false, /** * Form Captcha Options * 设置表单验证码 * * Currently used for the registration form, but re-usable anywhere. Use * this to configure which ZendCaptcha adapter to use, and the options to * pass to it. The default uses the Figlet captcha. * 此设置作用在注册表单,但是也可以用在其他地方。这里设置将对 ZendCaptcha 模块起作用。 * 注:默认提供的验证码并不是图片,而是非常囧的文字图验证码。 * * */ /*'form_captcha_options' => array( 'class' => 'figlet', 'options' => array( 'wordLen' => 5, 'expiration' => 300, 'timeout' => 300, ), ),*/ /** * Use Redirect Parameter If Present * 设置是否重定向跳转 * * Upon successful authentication, check for a 'redirect' POST or GET parameter * 如果登录成功,按照 POST 或者 GET 数据中是否存在 redirect 参数进行跳转。 * 默认是是。 * * Accepted values: boolean true or false */ //'use_redirect_parameter_if_present' => true, /** * Sets the view template for the user login widget * 设置用户登录的视图模板 * * Default value: 'zfc-user/user/login.phtml' * Accepted values: string path to a view script */ //'user_login_widget_view_template' => 'zfc-user/user/login.phtml', /** * Login Redirect Route * 登录后的重定向路由 * * Upon successful login the user will be redirected to the entered route * * Default value: 'zfcuser' * Accepted values: A valid route name within your application * */ //'login_redirect_route' => 'zfcuser', /** * Logout Redirect Route * 注销后的重定向路由 * * Upon logging out the user will be redirected to the entered route * * Default value: 'zfcuser/login' * Accepted values: A valid route name within your application */ //'logout_redirect_route' => 'zfcuser/login', /** * Password Security * 密码安全 * * DO NOT CHANGE THE PASSWORD HASH SETTINGS FROM THEIR DEFAULTS * Unless A) you have done sufficient research and fully understand exactly * what you are changing, AND B) you have a very specific reason to deviate * from the default settings and know what you're doing. * * The password hash settings may be changed at any time without * invalidating existing user accounts. Existing user passwords will be * re-hashed automatically on their next successful login. */ /** * Password Cost * * The number represents the base-2 logarithm of the iteration count used for * hashing. Default is 14 (about 10 hashes per second on an i5). * * Accepted values: integer between 4 and 31 */ //'password_cost' => 14, /** * Enable user state usage * 是否使用用户状态功能(视乎默认未开启) * * Should user's state be used in the registration/login process? */ //'enable_user_state' => true, /** * Default user state upon registration * 用户注册后的默认状态值(默认1),数据库对应 state 字段 * * What state user should have upon registration? * Allowed value type: integer */ //'default_user_state' => 1, /** * States which are allowing user to login * 哪一种状态值的用户允许登录(默认1) * * When user tries to login, is his/her state one of the following? * Include null if you want user's with no state to login as well. * Allowed value types: null and integer */ //'allowed_login_states' => array( null, 1 ), /** * User table name * 用户数据表 */ //'table_name' => 'user', /** * End of ZfcUser configuration */ ); /** * You do not need to edit below this line */ return array( 'zfcuser' => $settings, 'service_manager' => array( 'aliases' => array( 'zfcuser_zend_db_adapter' => (isset($settings['zend_db_adapter'])) ? $settings['zend_db_adapter']: 'ZendDbAdapterAdapter', ), ), );