1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Set /app PHP code to PSR-2 standard

Also adde draw.io to attribution list.

Closes #649
This commit is contained in:
Dan Brown
2018-01-28 16:58:52 +00:00
parent 30b4f81fc6
commit 62342433f4
80 changed files with 593 additions and 335 deletions

View File

@ -6,7 +6,8 @@ use BookStack\User;
use BookStack\Repos\UserRepo;
use Illuminate\Console\Command;
class DeleteUsers extends Command{
class DeleteUsers extends Command
{
/**
* The name and signature of the console command.
@ -37,14 +38,11 @@ class DeleteUsers extends Command{
{
$confirm = $this->ask('This will delete all users from the system that are not "admin" or system users. Are you sure you want to continue? (Type "yes" to continue)');
$numDeleted = 0;
if (strtolower(trim($confirm)) === 'yes')
{
if (strtolower(trim($confirm)) === 'yes') {
$totalUsers = $this->user->count();
$users = $this->user->where('system_name', '=', null)->with('roles')->get();
foreach ($users as $user)
{
if ($user->hasSystemRole('admin'))
{
foreach ($users as $user) {
if ($user->hasSystemRole('admin')) {
// don't delete users with "admin" role
continue;
}
@ -52,11 +50,8 @@ class DeleteUsers extends Command{
++$numDeleted;
}
$this->info("Deleted $numDeleted of $totalUsers total users.");
}
else
{
} else {
$this->info('Exiting...');
}
}
}