@@ -327,8 +327,7 @@ |
||
327 | 327 | if (write_file($filename, $content)) |
328 | 328 | { |
329 | 329 | CLI::write(CLI::color(' Created: ', 'green') . $path); |
330 | - } |
|
331 | - else |
|
330 | + } else |
|
332 | 331 | { |
333 | 332 | CLI::error(" Error creating {$path}."); |
334 | 333 | } |
@@ -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 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | if (empty($rows)) |
24 | 24 | { |
25 | 25 | CLI::write( CLI::color("There are no groups.", 'yellow') ); |
26 | - } |
|
27 | - else |
|
26 | + } else |
|
28 | 27 | { |
29 | 28 | $thead = ['Group ID', 'Name', 'Description']; |
30 | 29 | CLI::table($rows, $thead); |
@@ -42,8 +42,7 @@ |
||
42 | 42 | CLI::write($message, 'red'); |
43 | 43 | } |
44 | 44 | } |
45 | - } |
|
46 | - catch (\Exception $e) |
|
45 | + } catch (\Exception $e) |
|
47 | 46 | { |
48 | 47 | $this->showError($e); |
49 | 48 | } |
@@ -46,8 +46,7 @@ |
||
46 | 46 | if ($userId = $users->insert($user)) |
47 | 47 | { |
48 | 48 | CLI::write(lang('Auth.registerCLI', [$row['username'], $userId]), 'green'); |
49 | - } |
|
50 | - else |
|
49 | + } else |
|
51 | 50 | { |
52 | 51 | foreach ($users->errors() as $message) |
53 | 52 | { |
@@ -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 | } |
@@ -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 | } |