mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
Check owner before operating player
This commit is contained in:
parent
b70004ec0f
commit
d8f08176a2
@ -483,11 +483,13 @@ class AdminController extends Controller
|
||||
return json(trans('general.unexistent-player'), 1);
|
||||
}
|
||||
|
||||
if ($player->user()->first()->uid !== $currentUser->uid) {
|
||||
if ($player->user->permission >= $currentUser->permission) {
|
||||
$owner = $player->user;
|
||||
if (
|
||||
$owner && $owner->uid !== $currentUser->uid &&
|
||||
$owner->permission >= $currentUser->permission
|
||||
) {
|
||||
return json(trans('admin.players.no-permission'), 1);
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'texture') {
|
||||
$this->validate($request, [
|
||||
@ -531,8 +533,7 @@ class AdminController extends Controller
|
||||
$player->name = $name;
|
||||
$player->save();
|
||||
|
||||
if (option('single_player', false)) {
|
||||
$owner = $player->user;
|
||||
if (option('single_player', false) && $owner) {
|
||||
$owner->nickname = $name;
|
||||
$owner->save();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user