{"id":20523102,"url":"https://github.com/itstructure/yii2-users-module","last_synced_at":"2025-09-09T23:12:23.866Z","repository":{"id":56994569,"uuid":"120755191","full_name":"itstructure/yii2-users-module","owner":"itstructure","description":"Module to users manage for Yii2 Framework","archived":false,"fork":false,"pushed_at":"2018-06-16T14:30:39.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T10:50:19.232Z","etag":null,"topics":["manage","module","users","yii2"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itstructure.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-08T11:53:38.000Z","updated_at":"2018-08-19T14:42:07.000Z","dependencies_parsed_at":"2022-08-21T13:50:36.963Z","dependency_job_id":null,"html_url":"https://github.com/itstructure/yii2-users-module","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-users-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-users-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-users-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-users-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itstructure","download_url":"https://codeload.github.com/itstructure/yii2-users-module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242128319,"owners_count":20076177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["manage","module","users","yii2"],"created_at":"2024-11-15T22:37:57.276Z","updated_at":"2025-03-06T00:44:23.960Z","avatar_url":"https://github.com/itstructure.png","language":"PHP","readme":"Yii2 Users module\n==============\n\n1 Introduction\n----------------------------\n\n[![Latest Stable Version](https://poser.pugx.org/itstructure/yii2-users-module/v/stable)](https://packagist.org/packages/itstructure/yii2-users-module)\n[![Latest Unstable Version](https://poser.pugx.org/itstructure/yii2-users-module/v/unstable)](https://packagist.org/packages/itstructure/yii2-users-module)\n[![License](https://poser.pugx.org/itstructure/yii2-users-module/license)](https://packagist.org/packages/itstructure/yii2-users-module)\n[![Total Downloads](https://poser.pugx.org/itstructure/yii2-users-module/downloads)](https://packagist.org/packages/itstructure/yii2-users-module)\n[![Build Status](https://scrutinizer-ci.com/g/itstructure/yii2-users-module/badges/build.png?b=master)](https://scrutinizer-ci.com/g/itstructure/yii2-users-module/build-status/master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/itstructure/yii2-users-module/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/itstructure/yii2-users-module/?branch=master)\n\n**Users module** -- Module for the Yii2 framework, which provides user management with changing \nthe next default profile data:\n- name\n- login\n- email\n- password\n- status\n- roles (if authManager exists in application and rbacManage is true)\n\n2 Dependencies\n----------------------------\n- php \u003e= 7.1\n- composer\n- MySql \u003e= 5.5\n\n3 Installation\n----------------------------\n\nVia composer:\n\n```composer require \"itstructure/yii2-users-module\": \"^1.6.0\"```\n\nor in section **require** of composer.json file set the following:\n```\n\"require\": {\n    \"itstructure/yii2-users-module\": \"^1.6.0\"\n}\n```\nand command ```composer install```, if you install yii2 project extensions first,\n\nor command ```composer update```, if all yii2 project extensions are already installed.\n\n4 Usage\n----------------------------\n\n### 4.1 Main properties\n\n- The **name** of module: ```users```\n- The **namespace** for used classes: ```Itstructure\\UsersModule```.\n- The **alias** to access in to module root directory: ```@users```.\n- **There is not a layout !** It's taken from application layout **main** by default **or how it is \nconfigured**.\nYou cat set ```layout``` attribute in module by custom.\n- **View** component is taken by default from the framework like **yii\\web\\View**. You cat set \n**View** component in module by custom.\n\n### 4.2 Application config\n\nBase application config must be like in example below:\n\n```php\nuse Itstructure\\UsersModule\\Module;\nuse Itstructure\\UsersModule\\controllers\\ProfileController;\n```\n```php\n'modules' =\u003e [\n    'users' =\u003e [\n        'class' =\u003e Module::class,\n        'controllerMap' =\u003e [\n            'profile' =\u003e ProfileController::class,\n        ],\n    ],\n],\n```\n\n### 4.3 Useful module attributes\n\n- ```loginUrl``` - set url to be redirected if you are not authorized.\n- ```rbacManage``` - if **true**, here will be involved the following functional:\n    - ```roles``` field in **ProfileValidate** model to validate roles.\n    - ```roles``` field in **create**, **update** and **_form** template.\n    \n    Roles, which are exist, will be loaded via **authManager** from application automatically.\n        \n- ```accessRoles``` - The roles of users who are allowed access.\n- ```customRewrite``` - if **true**, there will be overwritten completely the next **profile** attributes instead of combining:\n    - ```rules```, ```attributes```, ```attributeLabels``` in **ProfileValidate** model by custom\n     values which can be set in **ProfileValidateComponent**.\n    - form fields in **_form** template by custom ```formFields``` value which can be set in **ProfileValidateComponent**.\n    - GridView columns in index template by custom ```indexViewColumns``` value which can be set in **ProfileValidateComponent**.\n    - DetailView attributes in view template by custom ```detailViewAttributes``` value which can\n     be set in **ProfileValidateComponent**.\n\n    If ```customRewrite``` is **false**, then the above listed parameters will be merged with custom values.\n\nExample:\n\n```php\nuse Itstructure\\UsersModule\\Module;\nuse Itstructure\\UsersModule\\components\\ProfileValidateComponent;\n```\n```php\n'modules' =\u003e [\n    'users' =\u003e [\n        'class' =\u003e Module::class,\n        'controllerMap' =\u003e [\n            'profile' =\u003e ProfileController::class,\n        ],\n        'accessRoles' =\u003e ['admin', 'manager'],\n        'components' =\u003e [\n            'profile-validate-component' =\u003e [\n                'class' =\u003e ProfileValidateComponent::class,\n                'rules' =\u003e [...],\n                'attributes' =\u003e [...],\n                'attributeLabels' =\u003e [...],\n                'formFields' =\u003e [...],\n                'indexViewColumns' =\u003e [...],\n                'detailViewAttributes' =\u003e [...],\n            ],\n        ]\n    ],\n],\n```\n\n**Warning!**\nTo set parameters of ProfileValidateComponent correctly, see how it's already done in the \nview profile templates and ProfileValidate model by default as example.\n\nLicense\n----------------------------\nCopyright © 2018 Andrey Girnik girnikandrey@gmail.com.\n\nLicensed under the [MIT license](http://opensource.org/licenses/MIT). See LICENSE.txt for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitstructure%2Fyii2-users-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitstructure%2Fyii2-users-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitstructure%2Fyii2-users-module/lists"}