1
0
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:
Dan Brown
2017-12-29 16:14:20 +00:00
parent 3eb2246291
commit 0c1b1cd435
2 changed files with 4 additions and 4 deletions

View File

@ -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;