Download the PHP package infoburp/yii2-user without Composer
On this page you can find all versions of the php package infoburp/yii2-user. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-user
Yii 2 User
Yii 2 User - User authentication module
Integrated with yii2-otp by infoburp, with thanks to sam002
New version released 01/31/2016
This release contains a few small updates and bug fixes. Most notably, I've changed
LoginForm.username
to LoginForm.email
and added a timezone field to app\models\Profile
(thanks mnglkhn)
If there are any issues, let me know and I'll get to it asap.
Demo
Features
- Quick setup - works out of the box so you can see what it does
- Easily extendable
- Registration using email and/or username
- Login using email and/or username
- Login/register via email (enter email > get link in inbox > click link to login/register)
- Email confirmation (+ resend functionality)
- Social authentication (facebook, twitter, google, linkedin, reddit, vkontakte)
- Account page
- Updates email, username, and password
- Requires current password
- Profile page
- Lists custom fields for users, e.g., full_name
- Password recovery
- Admin crud via GridView
Installation
- Install Yii 2 using your preferred method
- Install package via composer
-
Update config file config/web.php and config/db.php
- Run migration file
- Go to your application in your browser
- Log in as admin using (change it!)
- Set up module properties as desired
- Optional - Update the nav links in your main layout app/views/layouts/main.php
Development Notes
How do I check user permissions?
This package contains a custom permissions system. Every user has a role, and that role has permissions in the form of database columns. It should follow the format: .
For example, the table has a column named by default. To check if the user can perform admin actions:
Add more database columns for permissions as needed. If you need something more powerful, look into setting up [RBAC] (https://github.com/yiisoft/yii2/blob/master/docs/guide/security-authorization.md#role-based-access-control-rbac).
Note: If you set up an component for RBAC, then will use that instead of this module's custom table.
How do I add captcha to the forms?
Check out this great 3-step guide by dektrium. (Please note that the scenarios for the validation rules will depend on your project requirements.)
How do I add i18n?
How do I extend this package?
You can extend the classes directly. Depending on which ones you need, set the proper config property:
For view files, you can use the component.
I need more control. Can I just extend the whole thing?
You can always fork the package and modify it as needed.
Or, if you want, you can integrate the package directly into your app by copying the files. This would make it more difficult to get updates, but it also guarantees that your app won't break after running .
To do so, you can use the helper command .
-
Add the module to your config/console.php to gain access to the command (Note: this is CONSOLE config)
-
Use the command. For a [basic app] (https://github.com/yiisoft/yii2-app-basic), you can call the default command without any options
- Update config to point to your new package
Alternatively, you can do this manually. Just copy/paste the files wherever you'd like and change the namespaces in the files. Replace with .
Todo
- Tests
- Issues/requests? Submit a github issue