From a0a3106f9617a8872616904c753f7cfba8997117 Mon Sep 17 00:00:00 2001 From: ebrahimi Date: Mon, 19 Jun 2023 23:53:15 +0330 Subject: [PATCH 1/5] fixed bug in AuthItem model, php 8 trim(): Passing null to parameter --- models/searchs/AuthItem.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/models/searchs/AuthItem.php b/models/searchs/AuthItem.php index 66cff4d..e6dbd9c 100644 --- a/models/searchs/AuthItem.php +++ b/models/searchs/AuthItem.php @@ -76,8 +76,15 @@ public function search($params) $this->load($params); if ($this->validate()) { - $search = mb_strtolower(trim((string)$this->name)); - $desc = mb_strtolower(trim((string)$this->description)); + $search = $desc = null; + + if (null !== $this->name && trim($this->name) != '') { + $search = mb_strtolower(trim($this->name)); + } + if (null !== $this->description && trim($this->description) != '') { + $desc = mb_strtolower(trim($this->description)); + } + $ruleName = $this->ruleName; foreach ($items as $name => $item) { $f = (empty($search) || mb_strpos(mb_strtolower($item->name), $search) !== false) && From 900157e27a642419bb5b4f54cab352c13e047ee7 Mon Sep 17 00:00:00 2001 From: ebrahimi Date: Tue, 20 Jun 2023 12:15:42 +0330 Subject: [PATCH 2/5] fixed bug in AuthItem model in null params --- models/searchs/AuthItem.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/searchs/AuthItem.php b/models/searchs/AuthItem.php index e6dbd9c..2cfa4ab 100644 --- a/models/searchs/AuthItem.php +++ b/models/searchs/AuthItem.php @@ -18,9 +18,9 @@ class AuthItem extends Model { const TYPE_ROUTE = 101; - public $name; + public $name = ''; public $type; - public $description; + public $description = ''; public $ruleName; public $data; From a2e062607405ab85e80cc55561ba855105d02c42 Mon Sep 17 00:00:00 2001 From: ebrahimi Date: Tue, 20 Jun 2023 12:37:20 +0330 Subject: [PATCH 3/5] update readme --- README.md | 59 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index c5c3062..a3df244 100644 --- a/README.md +++ b/README.md @@ -2,28 +2,9 @@ RBAC Manager for Yii 2 ====================== GUI manager for RBAC (Role Base Access Control) Yii2. Easy to manage authorization of user :smile:. -[![Latest Unstable Version](https://poser.pugx.org/mdmsoft/yii2-admin/v/unstable)](https://packagist.org/packages/mdmsoft/yii2-admin) -[![Total Downloads](https://poser.pugx.org/mdmsoft/yii2-admin/downloads.png)](https://packagist.org/packages/mdmsoft/yii2-admin) -[![Daily Downloads](https://poser.pugx.org/mdmsoft/yii2-admin/d/daily)](https://packagist.org/packages/mdmsoft/yii2-admin) -[![License](https://poser.pugx.org/mdmsoft/yii2-admin/license)](https://packagist.org/packages/mdmsoft/yii2-admin) -[![Reference Status](https://www.versioneye.com/php/mdmsoft:yii2-admin/reference_badge.svg)](https://www.versioneye.com/php/mdmsoft:yii2-admin/references) -[![Build Status](https://img.shields.io/travis/mdmsoft/yii2-admin.svg)](http://travis-ci.org/mdmsoft/yii2-admin) -[![Dependency Status](https://www.versioneye.com/php/mdmsoft:yii2-admin/dev-master/badge.png)](https://www.versioneye.com/php/mdmsoft:yii2-admin/dev-master) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mdmsoft/yii2-admin/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mdmsoft/yii2-admin/?branch=master) -[![Code Climate](https://img.shields.io/codeclimate/github/mdmsoft/yii2-admin.svg)](https://codeclimate.com/github/mdmsoft/yii2-admin) - Documentation ------------- -> **Important: If you install version 3.x, please see [this readme](https://github.com/mdmsoft/yii2-admin/blob/3.master/README.md#upgrade-from-2x).** - - -- [Change Log](CHANGELOG.md). -- [Authorization Guide](http://www.yiiframework.com/doc-2.0/guide-security-authorization.html). Important, read this first before you continue. -- [Basic Configuration](docs/guide/configuration.md) -- [Basic Usage](docs/guide/basic-usage.md). -- [User Management](docs/guide/user-management.md). -- [Using Menu](docs/guide/using-menu.md). -- [Api](https://mdmsoft.github.io/yii2-admin/index.html). +> **Important: This project fork from [mdmsoft/yii2-admin](https://github.com/mdmsoft/yii2-admin) please check document from here.** Installation ------------ @@ -35,41 +16,5 @@ The preferred way to install this extension is through [composer](http://getcomp Either run ``` -php composer.phar require mdmsoft/yii2-admin "~1.0" -or -php composer.phar require mdmsoft/yii2-admin "~2.0" -``` - -or for the dev-master - -``` -php composer.phar require mdmsoft/yii2-admin "2.x-dev" -``` - -Or, you may add - -``` -"mdmsoft/yii2-admin": "~2.0" +php composer.phar require reza2ebt/yii2-admin "~1.0" ``` - -to the require section of your `composer.json` file and execute `php composer.phar update`. - -### Install From the Archive - -Download the latest release from here [releases](https://github.com/mdmsoft/yii2-admin/releases), then extract it to your project. -In your application config, add the path alias for this extension. - -```php -return [ - ... - 'aliases' => [ - '@mdm/admin' => 'path/to/your/extracted', - // for example: '@mdm/admin' => '@app/extensions/mdm/yii2-admin-2.0.0', - ... - ] -]; -``` - -[**More...**](docs/guide/configuration.md) - -[screenshots](https://goo.gl/r8RizT) From 3df6a752945f5f2e75e679c87b6f56d4cb023ecc Mon Sep 17 00:00:00 2001 From: ebrahimi Date: Tue, 20 Jun 2023 12:44:54 +0330 Subject: [PATCH 4/5] update composer.json --- composer.json | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 7001d24..f012f96 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "mdmsoft/yii2-admin", + "name": "reza2ebt/yii2-admin", "description": "RBAC Auth manager for Yii2 ", "keywords": ["yii", "admin", "auth", "rbac"], "type": "yii2-extension", @@ -8,12 +8,6 @@ "issues": "https://github.com/mdmsoft/yii2-admin/issues", "source": "https://github.com/mdmsoft/yii2-admin" }, - "authors": [ - { - "name": "Misbahul Munir", - "email": "misbahuldmunir@gmail.com" - } - ], "minimum-stability": "dev", "require": { "yiisoft/yii2": "~2.0.7" @@ -26,14 +20,10 @@ }, "autoload": { "psr-4": { - "mdm\\admin\\": "" + "reza2ebt\\admin\\": "" } }, "extra": { - "branch-alias": { - "dev-1.0.master": "1.0.x-dev", - "dev-master": "2.x-dev" - }, "asset-installer-paths": { "npm-asset-library": "vendor/npm", "bower-asset-library": "vendor/bower" From 80bf8ca1af99908185ba07a1fdf332621e914d1b Mon Sep 17 00:00:00 2001 From: ebrahimi Date: Tue, 20 Jun 2023 12:55:20 +0330 Subject: [PATCH 5/5] update all namespace --- AnimateAsset.php | 2 +- AutocompleteAsset.php | 2 +- BaseObject.php | 2 +- Module.php | 2 +- components/AccessControl.php | 2 +- components/Configs.php | 2 +- components/DbManager.php | 2 +- components/GuestRule.php | 2 +- components/Helper.php | 2 +- components/ItemController.php | 2 +- components/MenuHelper.php | 2 +- components/RouteRule.php | 2 +- components/UserStatus.php | 2 +- controllers/AssignmentController.php | 2 +- controllers/DefaultController.php | 2 +- controllers/MenuController.php | 2 +- controllers/PermissionController.php | 2 +- controllers/RoleController.php | 2 +- controllers/RouteController.php | 2 +- controllers/RuleController.php | 2 +- controllers/UserController.php | 2 +- models/Assignment.php | 2 +- models/AuthItem.php | 2 +- models/BizRule.php | 2 +- models/Menu.php | 2 +- models/Route.php | 2 +- models/User.php | 2 +- models/form/ChangePassword.php | 2 +- models/form/Login.php | 2 +- models/form/PasswordResetRequest.php | 2 +- models/form/ResetPassword.php | 2 +- models/form/Signup.php | 2 +- models/searchs/Assignment.php | 2 +- models/searchs/AuthItem.php | 2 +- models/searchs/BizRule.php | 2 +- models/searchs/Menu.php | 2 +- models/searchs/User.php | 2 +- 37 files changed, 37 insertions(+), 37 deletions(-) diff --git a/AnimateAsset.php b/AnimateAsset.php index 31675f1..d3ccc46 100644 --- a/AnimateAsset.php +++ b/AnimateAsset.php @@ -1,6 +1,6 @@