Download the PHP package filsh/yii2-user without Composer
On this page you can find all versions of the php package filsh/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
Demo
Features
- Quick setup - works out of the box so you can see what it does
- Easily extendable (instructions below)
- Registration using email and/or username
- Login using email and/or username
- Email confirmation (+resend functionality)
- 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
How do I check user permissions?
This package contains a very simple 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/authorization.md).
Note: If you set up an component for RBAC, then will use that instead of this module's custom table.
How do I extend this package?
You can extend the classes directly. Depending on which ones you need to extend, set the proper config property:
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 .
I've created a helper command to copy the files for you.
-
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] (https://github.com/yiisoft/yii2-app-basic) app, 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 .
Changelog
- 2014/4/17 - Release 1.0.0-beta
Todo
- Tests
- Add functionality for user groups (possibly as another package)
- Issues/requests? Submit a github issue