@@ -62,7 +62,7 @@ |
||
| 62 | 62 | public function handle() |
| 63 | 63 | { |
| 64 | 64 | $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
| 65 | - ->orderBy('netlogin', 'desc')->get(); |
|
| 65 | + ->orderBy('netlogin', 'desc')->get(); |
|
| 66 | 66 | |
| 67 | 67 | if ($accounts->isEmpty()) { |
| 68 | 68 | $this->info("No accounts to export"); |
@@ -55,32 +55,32 @@ |
||
| 55 | 55 | * |
| 56 | 56 | * @return mixed |
| 57 | 57 | */ |
| 58 | - public function handle() |
|
| 59 | - { |
|
| 60 | - $categories = Category::get(); |
|
| 58 | + public function handle() |
|
| 59 | + { |
|
| 60 | + $categories = Category::get(); |
|
| 61 | 61 | |
| 62 | - if ($categories->isEmpty()) { |
|
| 63 | - $this->info("No categories to export"); |
|
| 64 | - return; |
|
| 65 | - } |
|
| 62 | + if ($categories->isEmpty()) { |
|
| 63 | + $this->info("No categories to export"); |
|
| 64 | + return; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - foreach ($categories as $category){ |
|
| 68 | - $name = static::stringNormalise($category->name); |
|
| 69 | - $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 70 | - $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 67 | + foreach ($categories as $category){ |
|
| 68 | + $name = static::stringNormalise($category->name); |
|
| 69 | + $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 70 | + $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 71 | 71 | ->where('category_id', $category->id) |
| 72 | 72 | ->orderBy('netlogin', 'desc') |
| 73 | 73 | ->get(); |
| 74 | - Storage::disk('export')->put($filename, ''); |
|
| 75 | - $count = count($accounts); |
|
| 76 | - $bar = $this->output->createProgressBar($count); |
|
| 77 | - foreach ($accounts as $account) { |
|
| 78 | - Storage::disk('export')->prepend($filename, "{$account->netlogin}:{$account->netpass}"); |
|
| 79 | - $bar->advance(); |
|
| 80 | - } |
|
| 81 | - $bar->finish(); |
|
| 82 | - $url = Storage::disk('export')->path($filename); |
|
| 83 | - $this->info("\n{$count} accounts '{$category->name}' exported into file '{$url}'"); |
|
| 84 | - } |
|
| 85 | - } |
|
| 74 | + Storage::disk('export')->put($filename, ''); |
|
| 75 | + $count = count($accounts); |
|
| 76 | + $bar = $this->output->createProgressBar($count); |
|
| 77 | + foreach ($accounts as $account) { |
|
| 78 | + Storage::disk('export')->prepend($filename, "{$account->netlogin}:{$account->netpass}"); |
|
| 79 | + $bar->advance(); |
|
| 80 | + } |
|
| 81 | + $bar->finish(); |
|
| 82 | + $url = Storage::disk('export')->path($filename); |
|
| 83 | + $this->info("\n{$count} accounts '{$category->name}' exported into file '{$url}'"); |
|
| 84 | + } |
|
| 85 | + } |
|
| 86 | 86 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | return; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - foreach ($categories as $category){ |
|
| 67 | + foreach ($categories as $category) { |
|
| 68 | 68 | $name = static::stringNormalise($category->name); |
| 69 | 69 | $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
| 70 | 70 | $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
@@ -55,32 +55,32 @@ |
||
| 55 | 55 | * |
| 56 | 56 | * @return mixed |
| 57 | 57 | */ |
| 58 | - public function handle() |
|
| 59 | - { |
|
| 60 | - $groups = Group::get(); |
|
| 58 | + public function handle() |
|
| 59 | + { |
|
| 60 | + $groups = Group::get(); |
|
| 61 | 61 | |
| 62 | - if ($groups->isEmpty()) { |
|
| 63 | - $this->info("No groups to export"); |
|
| 64 | - return; |
|
| 65 | - } |
|
| 62 | + if ($groups->isEmpty()) { |
|
| 63 | + $this->info("No groups to export"); |
|
| 64 | + return; |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | - foreach ($groups as $group){ |
|
| 68 | - $name = static::stringNormalise($group->name); |
|
| 69 | - $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 70 | - $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 67 | + foreach ($groups as $group){ |
|
| 68 | + $name = static::stringNormalise($group->name); |
|
| 69 | + $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
| 70 | + $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
|
| 71 | 71 | ->where('group_id', $group->id) |
| 72 | 72 | ->orderBy('netlogin', 'desc') |
| 73 | 73 | ->get(); |
| 74 | - Storage::disk('export')->put($filename, ''); |
|
| 75 | - $count = count($accounts); |
|
| 76 | - $bar = $this->output->createProgressBar($count); |
|
| 77 | - foreach ($accounts as $account) { |
|
| 78 | - Storage::disk('export')->prepend($filename, "{$account->netlogin}:{$account->netpass}"); |
|
| 79 | - $bar->advance(); |
|
| 80 | - } |
|
| 81 | - $bar->finish(); |
|
| 82 | - $url = Storage::disk('export')->path($filename); |
|
| 83 | - $this->info("\n{$count} accounts '{$group->name}' exported into file '{$url}'"); |
|
| 84 | - } |
|
| 85 | - } |
|
| 74 | + Storage::disk('export')->put($filename, ''); |
|
| 75 | + $count = count($accounts); |
|
| 76 | + $bar = $this->output->createProgressBar($count); |
|
| 77 | + foreach ($accounts as $account) { |
|
| 78 | + Storage::disk('export')->prepend($filename, "{$account->netlogin}:{$account->netpass}"); |
|
| 79 | + $bar->advance(); |
|
| 80 | + } |
|
| 81 | + $bar->finish(); |
|
| 82 | + $url = Storage::disk('export')->path($filename); |
|
| 83 | + $this->info("\n{$count} accounts '{$group->name}' exported into file '{$url}'"); |
|
| 84 | + } |
|
| 85 | + } |
|
| 86 | 86 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | return; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - foreach ($groups as $group){ |
|
| 67 | + foreach ($groups as $group) { |
|
| 68 | 68 | $name = static::stringNormalise($group->name); |
| 69 | 69 | $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
| 70 | 70 | $accounts = Account::where('status', Account::ACCOUNT_ENABLE) |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | /** |
| 62 | 62 | * Handle an authentication attempt. |
| 63 | 63 | * |
| 64 | - * @return Response |
|
| 64 | + * @return \Illuminate\Http\RedirectResponse|null |
|
| 65 | 65 | */ |
| 66 | 66 | public function authenticate(Request $request) |
| 67 | 67 | { |
@@ -68,10 +68,10 @@ |
||
| 68 | 68 | $credentials = $request->only('email', 'password'); |
| 69 | 69 | |
| 70 | 70 | if (Auth::attempt([ |
| 71 | - 'email' => $credentials['email'], |
|
| 72 | - 'password' => $credentials['password'], |
|
| 73 | - 'status' => App\User::USER_ENABLED |
|
| 74 | - ])) { |
|
| 71 | + 'email' => $credentials['email'], |
|
| 72 | + 'password' => $credentials['password'], |
|
| 73 | + 'status' => App\User::USER_ENABLED |
|
| 74 | + ])) { |
|
| 75 | 75 | // Authentication passed... |
| 76 | 76 | return redirect()->intended('home'); |
| 77 | 77 | } |
@@ -15,27 +15,27 @@ |
||
| 15 | 15 | const USER_ENABLED = 1; |
| 16 | 16 | |
| 17 | 17 | const USER_STATUS = [ |
| 18 | - 0 => [ 'text' => 'users.disabled', |
|
| 18 | + 0 => ['text' => 'users.disabled', |
|
| 19 | 19 | 'icon' => '', |
| 20 | - 'unicon' => '' ], |
|
| 21 | - 1 => [ 'text' => 'users.enabled', |
|
| 20 | + 'unicon' => ''], |
|
| 21 | + 1 => ['text' => 'users.enabled', |
|
| 22 | 22 | 'icon' => 'fa-check', |
| 23 | - 'unicon' => '' ] |
|
| 23 | + 'unicon' => ''] |
|
| 24 | 24 | ]; |
| 25 | 25 | |
| 26 | 26 | const USER_LEVEL = [ |
| 27 | - 1 => [ 'text' => 'users.access.local', |
|
| 27 | + 1 => ['text' => 'users.access.local', |
|
| 28 | 28 | 'icon' => 'fa-support', |
| 29 | - 'unicon' => '' ], |
|
| 30 | - 3 => [ 'text' => 'users.access.global', |
|
| 29 | + 'unicon' => ''], |
|
| 30 | + 3 => ['text' => 'users.access.global', |
|
| 31 | 31 | 'icon' => 'fa-globe', |
| 32 | - 'unicon' => '' ], |
|
| 33 | - 5 => [ 'text' => 'users.access.admin', |
|
| 32 | + 'unicon' => ''], |
|
| 33 | + 5 => ['text' => 'users.access.admin', |
|
| 34 | 34 | 'icon' => 'fa-shield', |
| 35 | - 'unicon' => '' ], |
|
| 36 | - 9 => [ 'text' => 'users.access.super', |
|
| 35 | + 'unicon' => ''], |
|
| 36 | + 9 => ['text' => 'users.access.super', |
|
| 37 | 37 | 'icon' => 'fa-rocket', |
| 38 | - 'unicon' => '' ], |
|
| 38 | + 'unicon' => ''], |
|
| 39 | 39 | ]; |
| 40 | 40 | |
| 41 | 41 | const SEARCH_CRITERIA = [ |