mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-22 20:11:15 +08:00
parent
0a0fdd7f3e
commit
fd674d10e3
|
@ -197,7 +197,7 @@ class UserController extends Controller
|
|||
$this->checkPermissionOrCurrentUser('users-manage', $id);
|
||||
|
||||
$user = $this->userRepo->getById($id);
|
||||
$newOwnerId = $request->get('new_owner_id', null);
|
||||
$newOwnerId = intval($request->get('new_owner_id')) ?: null;
|
||||
|
||||
$this->userRepo->destroy($user, $newOwnerId);
|
||||
|
||||
|
|
|
@ -162,6 +162,16 @@ class UserManagementTest extends TestCase
|
|||
]);
|
||||
}
|
||||
|
||||
public function test_delete_with_empty_owner_migration_id_works()
|
||||
{
|
||||
$user = $this->users->editor();
|
||||
|
||||
$resp = $this->asAdmin()->delete("settings/users/{$user->id}", ['new_owner_id' => '']);
|
||||
$resp->assertRedirect('/settings/users');
|
||||
$this->assertActivityExists(ActivityType::USER_DELETE);
|
||||
$this->assertSessionHas('success');
|
||||
}
|
||||
|
||||
public function test_delete_removes_user_preferences()
|
||||
{
|
||||
$editor = $this->users->editor();
|
||||
|
|
Loading…
Reference in New Issue
Block a user