@@ -12,27 +12,27 @@ |
||
12 | 12 | const USER_LEVEL_SUPER = 9; |
13 | 13 | |
14 | 14 | const USER_STATUS = [ |
15 | - 0 => [ 'text' => 'users.disabled', |
|
15 | + 0 => ['text' => 'users.disabled', |
|
16 | 16 | 'icon' => '', |
17 | - 'unicon' => '' ], |
|
18 | - 1 => [ 'text' => 'users.enabled', |
|
17 | + 'unicon' => ''], |
|
18 | + 1 => ['text' => 'users.enabled', |
|
19 | 19 | 'icon' => 'fa-check', |
20 | - 'unicon' => '' ] |
|
20 | + 'unicon' => ''] |
|
21 | 21 | ]; |
22 | 22 | |
23 | 23 | const USER_LEVEL = [ |
24 | - 1 => [ 'text' => 'users.access.local', |
|
24 | + 1 => ['text' => 'users.access.local', |
|
25 | 25 | 'icon' => 'fa-support', |
26 | - 'unicon' => '' ], |
|
27 | - 3 => [ 'text' => 'users.access.global', |
|
26 | + 'unicon' => ''], |
|
27 | + 3 => ['text' => 'users.access.global', |
|
28 | 28 | 'icon' => 'fa-globe', |
29 | - 'unicon' => '' ], |
|
30 | - 5 => [ 'text' => 'users.access.admin', |
|
29 | + 'unicon' => ''], |
|
30 | + 5 => ['text' => 'users.access.admin', |
|
31 | 31 | 'icon' => 'fa-shield', |
32 | - 'unicon' => '' ], |
|
33 | - 9 => [ 'text' => 'users.access.super', |
|
32 | + 'unicon' => ''], |
|
33 | + 9 => ['text' => 'users.access.super', |
|
34 | 34 | 'icon' => 'fa-rocket', |
35 | - 'unicon' => '' ], |
|
35 | + 'unicon' => ''], |
|
36 | 36 | ]; |
37 | 37 | |
38 | 38 | const SEARCH_CRITERIA = [ |
@@ -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 | { |