@@ -50,6 +50,9 @@ |
||
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | + /** |
|
| 54 | + * @param boolean $isWhiteList |
|
| 55 | + */ |
|
| 53 | 56 | private function exportProxyList($type, $isWhiteList) |
| 54 | 57 | { |
| 55 | 58 | $items = ProxyListItem::where('type', $type) |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | public function handle() |
| 43 | 43 | { |
| 44 | 44 | $whitelist = empty($this->option('blacklist')); |
| 45 | - if ( false === empty($this->option('list'))) { |
|
| 45 | + if (false === empty($this->option('list'))) { |
|
| 46 | 46 | $this->exportProxyList($this->option('list'), $whitelist); |
| 47 | 47 | } else { |
| 48 | 48 | $this->exportProxyList('domain', $whitelist); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | /** |
| 109 | 109 | * Add a new account. |
| 110 | 110 | * |
| 111 | - * @return Response |
|
| 111 | + * @return \Illuminate\Http\RedirectResponse |
|
| 112 | 112 | */ |
| 113 | 113 | public function addAccount(Request $request) |
| 114 | 114 | { |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * |
| 150 | 150 | * @param Request $request |
| 151 | 151 | * @param int $id |
| 152 | - * @return Response |
|
| 152 | + * @return \Illuminate\Http\RedirectResponse |
|
| 153 | 153 | */ |
| 154 | 154 | public function updateAccount(Request $request, $id) |
| 155 | 155 | { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * Add a new user. |
| 78 | 78 | * |
| 79 | - * @return Response |
|
| 79 | + * @return \Illuminate\Http\RedirectResponse |
|
| 80 | 80 | */ |
| 81 | 81 | public function addUser(Request $request) |
| 82 | 82 | { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * |
| 115 | 115 | * @param Request $request |
| 116 | 116 | * @param int $id |
| 117 | - * @return Response |
|
| 117 | + * @return \Illuminate\Http\RedirectResponse |
|
| 118 | 118 | */ |
| 119 | 119 | public function updateUser(Request $request, $id = 0) |
| 120 | 120 | { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | * Enable an user. |
| 170 | 170 | * |
| 171 | 171 | * @param int $id |
| 172 | - * @return Response |
|
| 172 | + * @return \Illuminate\Http\RedirectResponse |
|
| 173 | 173 | */ |
| 174 | 174 | public function enableUser($id) |
| 175 | 175 | { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * Disable an user. |
| 187 | 187 | * |
| 188 | 188 | * @param int $id |
| 189 | - * @return Response |
|
| 189 | + * @return \Illuminate\Http\RedirectResponse |
|
| 190 | 190 | */ |
| 191 | 191 | public function disableUser($id) |
| 192 | 192 | { |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | * Remove an user. |
| 204 | 204 | * |
| 205 | 205 | * @param int $id |
| 206 | - * @return Response |
|
| 206 | + * @return \Illuminate\Http\RedirectResponse |
|
| 207 | 207 | */ |
| 208 | 208 | public function removeUser($id) |
| 209 | 209 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | /** |
| 49 | 49 | * XXXXXXXXXX |
| 50 | 50 | * |
| 51 | - * @return \Illuminate\View\View |
|
| 51 | + * @return \Illuminate\Http\RedirectResponse |
|
| 52 | 52 | */ |
| 53 | 53 | public function stepStoreApp(Request $request, Redirector $redirect) |
| 54 | 54 | { |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | /** |
| 76 | 76 | * XXXXXXXXXX |
| 77 | 77 | * |
| 78 | - * @return \Illuminate\View\View |
|
| 78 | + * @return \Illuminate\Http\RedirectResponse |
|
| 79 | 79 | */ |
| 80 | 80 | public function stepStoreDb(Request $request, Redirector $redirect) |
| 81 | 81 | { |
@@ -161,7 +161,6 @@ discard block |
||
| 161 | 161 | /** |
| 162 | 162 | * Processes the newly saved environment configuration and continue. |
| 163 | 163 | * |
| 164 | - * @param Request $input |
|
| 165 | 164 | * @param Redirector $redirect |
| 166 | 165 | * @return \Illuminate\Http\RedirectResponse |
| 167 | 166 | */ |
@@ -205,7 +204,7 @@ discard block |
||
| 205 | 204 | /** |
| 206 | 205 | * XXXXXXXXXX |
| 207 | 206 | * |
| 208 | - * @return \Illuminate\View\View |
|
| 207 | + * @return \Illuminate\Http\RedirectResponse |
|
| 209 | 208 | */ |
| 210 | 209 | public function stepMigrate(DatabaseManager $databaseManager) |
| 211 | 210 | { |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - if(!empty($request->announce)) { |
|
| 133 | + if (!empty($request->announce)) { |
|
| 134 | 134 | $filename = 'announce.md'; |
| 135 | 135 | $mdfile = public_path("markdown/{$filename}"); |
| 136 | 136 | try { |
| 137 | 137 | file_put_contents($mdfile, $request->announce); |
| 138 | - } catch(Exception $e) { |
|
| 138 | + } catch (Exception $e) { |
|
| 139 | 139 | return $redirect->route('KleisInstaller::stepCustomization') |
| 140 | 140 | ->withInput(); |
| 141 | 141 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | { |
| 170 | 170 | $status = $environmentManager->saveFile($request); |
| 171 | 171 | |
| 172 | - if($status) { |
|
| 172 | + if ($status) { |
|
| 173 | 173 | return $redirect->route('KleisInstaller::stepRequirements') |
| 174 | 174 | ->with(['message' => session('message')]); |
| 175 | 175 | } else { |
@@ -29,6 +29,7 @@ discard block |
||
| 29 | 29 | /** |
| 30 | 30 | * Get the content of the .env file. |
| 31 | 31 | * |
| 32 | + * @param Request $request |
|
| 32 | 33 | * @return string |
| 33 | 34 | */ |
| 34 | 35 | public function getEnvContent($request) |
@@ -48,7 +49,6 @@ discard block |
||
| 48 | 49 | /** |
| 49 | 50 | * Save the edited content to the file. |
| 50 | 51 | * |
| 51 | - * @param Request $input |
|
| 52 | 52 | * @return boolean |
| 53 | 53 | */ |
| 54 | 54 | public function saveFile(Request $request) |
@@ -36,9 +36,9 @@ discard block |
||
| 36 | 36 | $data = $request->session()->all(); |
| 37 | 37 | |
| 38 | 38 | $env = ''; |
| 39 | - foreach($data as $key => $value) { |
|
| 40 | - if(preg_match('/^[A-Z]+_[A-Z]+$/', $key)) { |
|
| 41 | - $env .= "${key}=${value}" . PHP_EOL; |
|
| 39 | + foreach ($data as $key => $value) { |
|
| 40 | + if (preg_match('/^[A-Z]+_[A-Z]+$/', $key)) { |
|
| 41 | + $env .= "${key}=${value}".PHP_EOL; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | try { |
| 60 | 60 | file_put_contents($this->envPath, $request->get('envConfig')); |
| 61 | - } catch(Exception $e) { |
|
| 61 | + } catch (Exception $e) { |
|
| 62 | 62 | $status = false; |
| 63 | 63 | } |
| 64 | 64 | |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | * |
| 76 | 76 | * @param $folder |
| 77 | 77 | * @param $permission |
| 78 | - * @param $isSet |
|
| 78 | + * @param boolean $isSet |
|
| 79 | 79 | */ |
| 80 | 80 | private function addFileAndSetErrors($folder, $permission, $isSet) |
| 81 | 81 | { |
@@ -29,9 +29,9 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | public function check(array $folders) |
| 31 | 31 | { |
| 32 | - foreach($folders as $folder => $permission) |
|
| 32 | + foreach ($folders as $folder => $permission) |
|
| 33 | 33 | { |
| 34 | - if(!($this->getPermission($folder) >= $permission)) |
|
| 34 | + if (!($this->getPermission($folder) >= $permission)) |
|
| 35 | 35 | { |
| 36 | 36 | $this->addFileAndSetErrors($folder, $permission, false); |
| 37 | 37 | } |
@@ -49,9 +49,9 @@ |
||
| 49 | 49 | return; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - foreach ($categories as $category){ |
|
| 52 | + foreach ($categories as $category) { |
|
| 53 | 53 | $name = static::stringNormalise($category->name); |
| 54 | - $filename = 'export/categories/' . $name . '.txt'; |
|
| 54 | + $filename = 'export/categories/'.$name.'.txt'; |
|
| 55 | 55 | $accounts = Account::where('status', 1) |
| 56 | 56 | ->where('category_id', $category->id) |
| 57 | 57 | ->orderBy('netlogin', 'desc') |
@@ -49,9 +49,9 @@ |
||
| 49 | 49 | return; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - foreach ($groups as $group){ |
|
| 52 | + foreach ($groups as $group) { |
|
| 53 | 53 | $name = static::stringNormalise($group->name); |
| 54 | - $filename = 'export/groups/' . $name . '.txt'; |
|
| 54 | + $filename = 'export/groups/'.$name.'.txt'; |
|
| 55 | 55 | $accounts = Account::where('status', 1) |
| 56 | 56 | ->where('group_id', $group->id) |
| 57 | 57 | ->orderBy('netlogin', 'desc') |
@@ -7,27 +7,27 @@ |
||
| 7 | 7 | class User extends Authenticatable |
| 8 | 8 | { |
| 9 | 9 | const USER_STATUS = [ |
| 10 | - 0 => [ 'text' => 'users.disabled', |
|
| 10 | + 0 => ['text' => 'users.disabled', |
|
| 11 | 11 | 'icon' => '', |
| 12 | - 'unicon' => '' ], |
|
| 13 | - 1 => [ 'text' => 'users.enabled', |
|
| 12 | + 'unicon' => ''], |
|
| 13 | + 1 => ['text' => 'users.enabled', |
|
| 14 | 14 | 'icon' => 'fa-check', |
| 15 | - 'unicon' => '' ] |
|
| 15 | + 'unicon' => ''] |
|
| 16 | 16 | ]; |
| 17 | 17 | |
| 18 | 18 | const USER_LEVEL = [ |
| 19 | - 1 => [ 'text' => 'users.access.local', |
|
| 19 | + 1 => ['text' => 'users.access.local', |
|
| 20 | 20 | 'icon' => 'fa-support', |
| 21 | - 'unicon' => '' ], |
|
| 22 | - 3 => [ 'text' => 'users.access.global', |
|
| 21 | + 'unicon' => ''], |
|
| 22 | + 3 => ['text' => 'users.access.global', |
|
| 23 | 23 | 'icon' => 'fa-globe', |
| 24 | - 'unicon' => '' ], |
|
| 25 | - 5 => [ 'text' => 'users.access.admin', |
|
| 24 | + 'unicon' => ''], |
|
| 25 | + 5 => ['text' => 'users.access.admin', |
|
| 26 | 26 | 'icon' => 'fa-shield', |
| 27 | - 'unicon' => '' ], |
|
| 28 | - 9 => [ 'text' => 'users.access.super', |
|
| 27 | + 'unicon' => ''], |
|
| 28 | + 9 => ['text' => 'users.access.super', |
|
| 29 | 29 | 'icon' => 'fa-rocket', |
| 30 | - 'unicon' => '' ], |
|
| 30 | + 'unicon' => ''], |
|
| 31 | 31 | ]; |
| 32 | 32 | |
| 33 | 33 | const SEARCH_CRITERIA = [ |