@@ -124,8 +124,7 @@ discard block |
||
124 | 124 | { |
125 | 125 | return true; |
126 | 126 | } |
127 | - } |
|
128 | - else if (is_string($group)) |
|
127 | + } else if (is_string($group)) |
|
129 | 128 | { |
130 | 129 | $names = array_column($userGroups, 'name'); |
131 | 130 | |
@@ -754,8 +753,7 @@ discard block |
||
754 | 753 | if (is_numeric($group)) |
755 | 754 | { |
756 | 755 | return $this->groupModel->getPermissionsForGroup($group); |
757 | - } |
|
758 | - else |
|
756 | + } else |
|
759 | 757 | { |
760 | 758 | $g = $this->groupModel->where('name', $group)->first(); |
761 | 759 | return $this->groupModel->getPermissionsForGroup($g->id); |
@@ -775,8 +773,7 @@ discard block |
||
775 | 773 | if (is_numeric($group)) |
776 | 774 | { |
777 | 775 | return $this->groupModel->getUsersForGroup($group); |
778 | - } |
|
779 | - else |
|
776 | + } else |
|
780 | 777 | { |
781 | 778 | $g = $this->groupModel->where('name', $group)->first(); |
782 | 779 | return $this->groupModel->getUsersForGroup($g->id); |
@@ -23,7 +23,8 @@ discard block |
||
23 | 23 | <?= session('errors.login') ?> |
24 | 24 | </div> |
25 | 25 | </div> |
26 | - <?php else: ?> |
|
26 | + <?php else { |
|
27 | + : ?> |
|
27 | 28 | <div class="form-group"> |
28 | 29 | <label for="login"><?=lang('Auth.emailOrUsername')?></label> |
29 | 30 | <input type="text" class="form-control <?php if(session('errors.login')) : ?>is-invalid<?php endif ?>" |
@@ -32,7 +33,9 @@ discard block |
||
32 | 33 | <?= session('errors.login') ?> |
33 | 34 | </div> |
34 | 35 | </div> |
35 | - <?php endif; ?> |
|
36 | + <?php endif; |
|
37 | +} |
|
38 | +?> |
|
36 | 39 | |
37 | 40 | <div class="form-group"> |
38 | 41 | <label for="password"><?=lang('Auth.password')?></label> |
@@ -59,8 +59,7 @@ |
||
59 | 59 | $redirectURL = session('redirect_url') ?? '/'; |
60 | 60 | unset($_SESSION['redirect_url']); |
61 | 61 | return redirect()->to($redirectURL)->with('error', lang('Auth.notEnoughPrivilege')); |
62 | - } |
|
63 | - else { |
|
62 | + } else { |
|
64 | 63 | throw new PermissionException(lang('Auth.notEnoughPrivilege')); |
65 | 64 | } |
66 | 65 | } |
@@ -59,8 +59,7 @@ |
||
59 | 59 | $redirectURL = session('redirect_url') ?? '/'; |
60 | 60 | unset($_SESSION['redirect_url']); |
61 | 61 | return redirect()->to($redirectURL)->with('error', lang('Auth.notEnoughPrivilege')); |
62 | - } |
|
63 | - else { |
|
62 | + } else { |
|
64 | 63 | throw new PermissionException(lang('Auth.notEnoughPrivilege')); |
65 | 64 | } |
66 | 65 | } |
@@ -36,8 +36,7 @@ discard block |
||
36 | 36 | if (function_exists('user') && user()) |
37 | 37 | { |
38 | 38 | $user = user(); |
39 | - } |
|
40 | - else |
|
39 | + } else |
|
41 | 40 | { |
42 | 41 | $user = empty($data) ? $this->buildUserFromRequest() : $this->buildUserFromData($data); |
43 | 42 | } |
@@ -49,8 +48,7 @@ discard block |
||
49 | 48 | if (empty($data)) |
50 | 49 | { |
51 | 50 | $error1 = $checker->error(); |
52 | - } |
|
53 | - else |
|
51 | + } else |
|
54 | 52 | { |
55 | 53 | $error2 = $checker->error(); |
56 | 54 | } |
@@ -61,8 +61,7 @@ discard block |
||
61 | 61 | $response = $client->get('range/'.$rangeHash, |
62 | 62 | ['headers' => ['Accept' => 'text/plain']] |
63 | 63 | ); |
64 | - } |
|
65 | - catch(HTTPException $e) |
|
64 | + } catch(HTTPException $e) |
|
66 | 65 | { |
67 | 66 | $exception = AuthException::forHIBPCurlFail($e); |
68 | 67 | service('logger')->error('[ERROR] {exception}', ['exception' => $exception]); |
@@ -81,8 +80,7 @@ discard block |
||
81 | 80 | if($endPos !== false) |
82 | 81 | { |
83 | 82 | $hits = (int) substr($range, $startPos, $endPos - $startPos); |
84 | - } |
|
85 | - else |
|
83 | + } else |
|
86 | 84 | { |
87 | 85 | // match is the last item in the range which does not end with "\r\n" |
88 | 86 | $hits = (int) substr($range, $startPos); |
@@ -171,8 +171,7 @@ |
||
171 | 171 | if($maxSimilarity < 1) |
172 | 172 | { |
173 | 173 | $maxSimilarity = 0; |
174 | - } |
|
175 | - elseif($maxSimilarity > 100) |
|
174 | + } elseif($maxSimilarity > 100) |
|
176 | 175 | { |
177 | 176 | $maxSimilarity = 100; |
178 | 177 | } |
@@ -75,8 +75,7 @@ |
||
75 | 75 | $html .= "<tr><td>Email</td><td>{$user->email}</td></tr>"; |
76 | 76 | $html .= "<tr><td>Groups</td><td>{$groupsForUser}</td></tr>"; |
77 | 77 | $html .= '</tbody></table>'; |
78 | - } |
|
79 | - else |
|
78 | + } else |
|
80 | 79 | { |
81 | 80 | $html = '<p>Not logged in.</p>'; |
82 | 81 | } |
@@ -40,16 +40,14 @@ |
||
40 | 40 | if (! $user) |
41 | 41 | { |
42 | 42 | CLI::write('User with identity: '. $identity .' not found.', 'red'); |
43 | - } |
|
44 | - else |
|
43 | + } else |
|
45 | 44 | { |
46 | 45 | $user->password = $password; |
47 | 46 | |
48 | 47 | if ($userModel->save($user)) |
49 | 48 | { |
50 | 49 | CLI::write('Password successfully set for user with identity: ' . $identity , 'green'); |
51 | - } |
|
52 | - else |
|
50 | + } else |
|
53 | 51 | { |
54 | 52 | CLI::write('Failed to set password for user with identity: ' . $identity , 'red'); |
55 | 53 | } |