mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Standardised admin role check
This commit is contained in:
@ -39,11 +39,11 @@ class DeleteUsers extends Command{
|
||||
$numDeleted = 0;
|
||||
if (strtolower(trim($confirm)) === 'yes')
|
||||
{
|
||||
$totalUsers = User::count();
|
||||
$totalUsers = $this->user->count();
|
||||
$users = $this->user->where('system_name', '=', null)->with('roles')->get();
|
||||
foreach ($users as $user)
|
||||
{
|
||||
if ($user->hasRole('admin'))
|
||||
if ($user->hasSystemRole('admin'))
|
||||
{
|
||||
// don't delete users with "admin" role
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user