Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
bed5ee8e
Commit
bed5ee8e
authored
6 years ago
by
rlgy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
d84c726a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
16 deletions
+1
-16
AuthController.php
backend/controllers/AuthController.php
+1
-7
_form.php
backend/views/admin/_form.php
+0
-9
No files found.
backend/controllers/AuthController.php
View file @
bed5ee8e
...
@@ -70,11 +70,7 @@ class AuthController extends BaseController
...
@@ -70,11 +70,7 @@ class AuthController extends BaseController
if
(
!
$data
[
'name'
])
{
if
(
!
$data
[
'name'
])
{
$this
->
error
(
'请输入要添加的角色名!'
);
$this
->
error
(
'请输入要添加的角色名!'
);
}
else
{
}
else
{
if
(
Yii
::
$app
->
params
[
'admin'
]
==
Yii
::
$app
->
user
->
id
)
{
$role_name
=
$self_role
->
name
.
'.'
.
$data
[
'name'
];
$role_name
=
$data
[
'name'
];
}
else
{
$role_name
=
$self_role
->
name
.
'.'
.
$data
[
'name'
];
}
if
(
Yii
::
$app
->
authManager
->
getRole
(
$role_name
)
!=
null
)
{
if
(
Yii
::
$app
->
authManager
->
getRole
(
$role_name
)
!=
null
)
{
$this
->
error
(
'该角色名已存在!'
);
$this
->
error
(
'该角色名已存在!'
);
}
else
{
}
else
{
...
@@ -118,7 +114,6 @@ class AuthController extends BaseController
...
@@ -118,7 +114,6 @@ class AuthController extends BaseController
if
(
Yii
::
$app
->
authManager
->
getRole
(
$data
[
'name'
])
!=
null
)
{
if
(
Yii
::
$app
->
authManager
->
getRole
(
$data
[
'name'
])
!=
null
)
{
$this
->
error
(
'该角色名已存在!'
);
$this
->
error
(
'该角色名已存在!'
);
}
else
{
}
else
{
$role
->
name
=
$data
[
'name'
];
$role
->
name
=
$data
[
'name'
];
$role
->
description
=
$data
[
'description'
];
$role
->
description
=
$data
[
'description'
];
if
(
Yii
::
$app
->
authManager
->
update
(
$item_name
,
$role
))
{
if
(
Yii
::
$app
->
authManager
->
update
(
$item_name
,
$role
))
{
...
@@ -127,7 +122,6 @@ class AuthController extends BaseController
...
@@ -127,7 +122,6 @@ class AuthController extends BaseController
$this
->
error
(
'更新失败!'
);
$this
->
error
(
'更新失败!'
);
}
}
}
}
}
}
return
$this
->
render
(
'edit'
,
[
return
$this
->
render
(
'edit'
,
[
...
...
This diff is collapsed.
Click to expand it.
backend/views/admin/_form.php
View file @
bed5ee8e
...
@@ -13,15 +13,6 @@ use common\core\ActiveForm;
...
@@ -13,15 +13,6 @@ use common\core\ActiveForm;
]
]
]);
?>
]);
?>
<!--<span style="color: #32c5d2">绑定UID</span>-->
<?=
$form
->
field
(
$model
,
'bind_uid'
)
->
iconTextInput
([
'class'
=>
'form-control c-md-2'
,
'iconPos'
=>
'left'
,
'iconClass'
=>
'icon-link'
,
'placeholder'
=>
'UID(暂不提供修改)'
,
'readonly'
=>
'readonly'
,
])
->
label
(
false
)
?>
<?=
$form
->
field
(
$model
,
'username'
)
->
iconTextInput
([
<?=
$form
->
field
(
$model
,
'username'
)
->
iconTextInput
([
'class'
=>
'form-control c-md-2'
,
'class'
=>
'form-control c-md-2'
,
'iconPos'
=>
'left'
,
'iconPos'
=>
'left'
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment