@@ -22,35 +22,35 @@ discard block |
||
22 | 22 | // USER |
23 | 23 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
24 | 24 | |
25 | -$app->group('/user', function () { |
|
26 | - $this->get('s', UserController::class.':getAllUsers')->setName('users'); |
|
25 | +$app->group('/user', function() { |
|
26 | + $this->get('s', UserController::class . ':getAllUsers')->setName('users'); |
|
27 | 27 | |
28 | - $this->get('/{id}/widget-only', UserController::class.':getUserWidgetOnly')->setName('user-widget-only'); |
|
28 | + $this->get('/{id}/widget-only', UserController::class . ':getUserWidgetOnly')->setName('user-widget-only'); |
|
29 | 29 | |
30 | - $this->get('/new', UserController::class.':getNewUserForm')->setName('user-new'); |
|
31 | - $this->get('/{id}/edit', UserController::class.':getUserEditForm')->setName('user-edit'); |
|
32 | - $this->get('/{id}/password', UserController::class.':getUserPasswordForm')->setName('user-password'); |
|
30 | + $this->get('/new', UserController::class . ':getNewUserForm')->setName('user-new'); |
|
31 | + $this->get('/{id}/edit', UserController::class . ':getUserEditForm')->setName('user-edit'); |
|
32 | + $this->get('/{id}/password', UserController::class . ':getUserPasswordForm')->setName('user-password'); |
|
33 | 33 | |
34 | - $this->get('/me', UserController::class.':getCurrentUser')->setName('user-me'); |
|
35 | - $this->get('/{id}', UserController::class.':getUser')->setName('user'); |
|
34 | + $this->get('/me', UserController::class . ':getCurrentUser')->setName('user-me'); |
|
35 | + $this->get('/{id}', UserController::class . ':getUser')->setName('user'); |
|
36 | 36 | |
37 | - $this->post('[/{id}]', UserController::class.':postUser')->setName('user-post'); |
|
38 | - $this->post('/{id}/password', UserController::class.':postUserPasswordChange')->setName('user-password-post'); |
|
37 | + $this->post('[/{id}]', UserController::class . ':postUser')->setName('user-post'); |
|
38 | + $this->post('/{id}/password', UserController::class . ':postUserPasswordChange')->setName('user-password-post'); |
|
39 | 39 | |
40 | 40 | // roles |
41 | - $this->get('/{id}/roles', RoleController::class.':getAssignRolesForm')->setName('user-roles'); |
|
42 | - $this->post('/{id}/roles', RoleController::class.':postUserAssignRoles')->setName('user-assign-post'); |
|
41 | + $this->get('/{id}/roles', RoleController::class . ':getAssignRolesForm')->setName('user-roles'); |
|
42 | + $this->post('/{id}/roles', RoleController::class . ':postUserAssignRoles')->setName('user-assign-post'); |
|
43 | 43 | |
44 | 44 | // availability |
45 | - $this->get('/{id}/availability', AvailabilityController::class.':getAvailabilityForm')->setName('user-availability'); |
|
46 | - $this->post('/{id}/availability', AvailabilityController::class.':postAvailability')->setName('user-availability-post'); |
|
45 | + $this->get('/{id}/availability', AvailabilityController::class . ':getAvailabilityForm')->setName('user-availability'); |
|
46 | + $this->post('/{id}/availability', AvailabilityController::class . ':postAvailability')->setName('user-availability-post'); |
|
47 | 47 | |
48 | 48 | // calendar |
49 | - $this->group('/me/calendar', function () { |
|
50 | - $this->get('s', CalendarController::class.':getCalendarTokens')->setName('user-calendars'); |
|
51 | - $this->get('/new', CalendarController::class.':getNewCalendarForm')->setName('user-calendars'); |
|
52 | - $this->get('/{id}/revoke', CalendarController::class.':getRevokeCalendar')->setName('user-calendar-revoke'); |
|
53 | - $this->post('/new', CalendarController::class.':postNewCalendar')->setName('user-calendar-new-post'); |
|
49 | + $this->group('/me/calendar', function() { |
|
50 | + $this->get('s', CalendarController::class . ':getCalendarTokens')->setName('user-calendars'); |
|
51 | + $this->get('/new', CalendarController::class . ':getNewCalendarForm')->setName('user-calendars'); |
|
52 | + $this->get('/{id}/revoke', CalendarController::class . ':getRevokeCalendar')->setName('user-calendar-revoke'); |
|
53 | + $this->post('/new', CalendarController::class . ':postNewCalendar')->setName('user-calendar-new-post'); |
|
54 | 54 | }); |
55 | 55 | }); |
56 | 56 | |
@@ -58,103 +58,103 @@ discard block |
||
58 | 58 | // EVENT |
59 | 59 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
60 | 60 | |
61 | -$app->group('/event', function () { |
|
62 | - $this->get('s', EventController::class.':getAllEvents')->setName('events'); |
|
63 | - $this->get('s/type/{id}', EventController::class.':getAllEventsWithType')->setName('events-eventtype'); |
|
64 | - $this->get('s/subtype/{id}', EventController::class.':getAllEventsWithSubType')->setName('events-eventsubtype'); |
|
61 | +$app->group('/event', function() { |
|
62 | + $this->get('s', EventController::class . ':getAllEvents')->setName('events'); |
|
63 | + $this->get('s/type/{id}', EventController::class . ':getAllEventsWithType')->setName('events-eventtype'); |
|
64 | + $this->get('s/subtype/{id}', EventController::class . ':getAllEventsWithSubType')->setName('events-eventsubtype'); |
|
65 | 65 | |
66 | - $this->get('s/print/info', EventController::class.':getAllEventInfoToPrint')->setName('events-print-info'); |
|
66 | + $this->get('s/print/info', EventController::class . ':getAllEventInfoToPrint')->setName('events-print-info'); |
|
67 | 67 | |
68 | - $this->get('/new', EventController::class.':getNewEventForm')->setName('event-new'); |
|
69 | - $this->get('/{id}/edit', EventController::class.':getEventEditForm')->setName('event-edit'); |
|
70 | - $this->get('/{id}/copy', EventController::class.':getEventCopyForm')->setName('event-copy'); |
|
71 | - $this->get('/{id}/assign', EventController::class.':getEventAssignForm')->setName('event-assign'); |
|
68 | + $this->get('/new', EventController::class . ':getNewEventForm')->setName('event-new'); |
|
69 | + $this->get('/{id}/edit', EventController::class . ':getEventEditForm')->setName('event-edit'); |
|
70 | + $this->get('/{id}/copy', EventController::class . ':getEventCopyForm')->setName('event-copy'); |
|
71 | + $this->get('/{id}/assign', EventController::class . ':getEventAssignForm')->setName('event-assign'); |
|
72 | 72 | |
73 | - $this->get('/{id}', EventController::class.':getEvent')->setName('event'); |
|
73 | + $this->get('/{id}', EventController::class . ':getEvent')->setName('event'); |
|
74 | 74 | |
75 | - $this->post('[/{id}]', EventController::class.':postEvent')->setName('event-post'); |
|
76 | - $this->post('/{id}/assign', EventController::class.':postEventAssign')->setName('event-assign-post'); |
|
77 | - $this->post('/{id}/comment', EventController::class.':postEventComment')->setName('event-comment-post'); |
|
75 | + $this->post('[/{id}]', EventController::class . ':postEvent')->setName('event-post'); |
|
76 | + $this->post('/{id}/assign', EventController::class . ':postEventAssign')->setName('event-assign-post'); |
|
77 | + $this->post('/{id}/comment', EventController::class . ':postEventComment')->setName('event-comment-post'); |
|
78 | 78 | }); |
79 | 79 | |
80 | 80 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
81 | 81 | // RESOURCE |
82 | 82 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
83 | 83 | |
84 | -$app->group('/resource', function () { |
|
85 | - $this->get('s', ResourceController::class.':getAllResources')->setName('resources'); |
|
84 | +$app->group('/resource', function() { |
|
85 | + $this->get('s', ResourceController::class . ':getAllResources')->setName('resources'); |
|
86 | 86 | |
87 | - $this->get('[/new]', ResourceController::class.':getNewResourceForm')->setName('resource-new'); |
|
88 | - $this->get('/{id}/edit', ResourceController::class.':getResourceEditForm')->setName('resource-edit'); |
|
87 | + $this->get('[/new]', ResourceController::class . ':getNewResourceForm')->setName('resource-new'); |
|
88 | + $this->get('/{id}/edit', ResourceController::class . ':getResourceEditForm')->setName('resource-edit'); |
|
89 | 89 | |
90 | - $this->get('/{id}', ResourceController::class.':getResourceFile')->setName('resource'); |
|
90 | + $this->get('/{id}', ResourceController::class . ':getResourceFile')->setName('resource'); |
|
91 | 91 | |
92 | - $this->post('[/{id}]', ResourceController::class.':postResource')->setName('resource-post'); |
|
92 | + $this->post('[/{id}]', ResourceController::class . ':postResource')->setName('resource-post'); |
|
93 | 93 | }); |
94 | 94 | |
95 | 95 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
96 | 96 | // ROLES & GROUPS |
97 | 97 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
98 | 98 | |
99 | -$app->group('/group', function () { |
|
100 | - $this->get('/{id}', GroupController::class.':getGroup')->setName('group'); |
|
101 | - $this->get('/{id}/roles', GroupController::class.':getGroupRoles')->setName('group-roles'); |
|
99 | +$app->group('/group', function() { |
|
100 | + $this->get('/{id}', GroupController::class . ':getGroup')->setName('group'); |
|
101 | + $this->get('/{id}/roles', GroupController::class . ':getGroupRoles')->setName('group-roles'); |
|
102 | 102 | |
103 | - $this->get('/{id}/events', EventController::class.':getAllEventsToPrintForGroup')->setName('group-events-print'); |
|
103 | + $this->get('/{id}/events', EventController::class . ':getAllEventsToPrintForGroup')->setName('group-events-print'); |
|
104 | 104 | |
105 | - $this->post('[/{id}]', GroupController::class.':postGroup')->setName('group-post'); |
|
105 | + $this->post('[/{id}]', GroupController::class . ':postGroup')->setName('group-post'); |
|
106 | 106 | }); |
107 | 107 | |
108 | 108 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
109 | 109 | // AUTH |
110 | 110 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
111 | 111 | |
112 | -$app->get('/login', AuthController::class.':getLoginForm')->setName('login'); |
|
112 | +$app->get('/login', AuthController::class . ':getLoginForm')->setName('login'); |
|
113 | 113 | |
114 | -$app->get('/login/{provider}', AuthController::class.':getLoginAuth')->setName('login-auth'); |
|
115 | -$app->get('/login/{provider}/callback', AuthController::class.':getLoginCallback')->setName('login-callback'); |
|
116 | -$app->get('/signup', PendingUserController::class.':getSignUpForm')->setName('sign-up'); |
|
117 | -$app->get('/signup/cancel', PendingUserController::class.':getSignUpCancel')->setName('sign-up-cancel'); |
|
114 | +$app->get('/login/{provider}', AuthController::class . ':getLoginAuth')->setName('login-auth'); |
|
115 | +$app->get('/login/{provider}/callback', AuthController::class . ':getLoginCallback')->setName('login-callback'); |
|
116 | +$app->get('/signup', PendingUserController::class . ':getSignUpForm')->setName('sign-up'); |
|
117 | +$app->get('/signup/cancel', PendingUserController::class . ':getSignUpCancel')->setName('sign-up-cancel'); |
|
118 | 118 | |
119 | -$app->get('/logout', AuthController::class.':getLogout')->setName('logout'); |
|
119 | +$app->get('/logout', AuthController::class . ':getLogout')->setName('logout'); |
|
120 | 120 | |
121 | -$app->post('/login', AuthController::class.':postLogin')->setName('login-post'); |
|
122 | -$app->post('/signup', PendingUserController::class.':postSignUp')->setName('sign-up-post'); |
|
121 | +$app->post('/login', AuthController::class . ':postLogin')->setName('login-post'); |
|
122 | +$app->post('/signup', PendingUserController::class . ':postSignUp')->setName('sign-up-post'); |
|
123 | 123 | |
124 | 124 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
125 | 125 | // NOTIFICATIONS |
126 | 126 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
127 | 127 | |
128 | -$app->get('/notification/{id}[/{referrer}]', NotificationController::class.':getNotificationClick')->setName('notification'); |
|
128 | +$app->get('/notification/{id}[/{referrer}]', NotificationController::class . ':getNotificationClick')->setName('notification'); |
|
129 | 129 | |
130 | 130 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
131 | 131 | // CALENDAR |
132 | 132 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
133 | 133 | |
134 | -$app->get('/calendar/{token}.{format}', CalendarController::class.':getRenderedCalendar')->setName('user-calendar'); |
|
134 | +$app->get('/calendar/{token}.{format}', CalendarController::class . ':getRenderedCalendar')->setName('user-calendar'); |
|
135 | 135 | |
136 | 136 | // legacy |
137 | -$app->get('/calendar.php', CalendarController::class.':getLegacyRenderedCalendar')->setName('user-calendar'); |
|
137 | +$app->get('/calendar.php', CalendarController::class . ':getLegacyRenderedCalendar')->setName('user-calendar'); |
|
138 | 138 | |
139 | 139 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
140 | 140 | // OTHER |
141 | 141 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
142 | 142 | |
143 | -$app->get('/settings', function ($request, $response, $args) { |
|
143 | +$app->get('/settings', function($request, $response, $args) { |
|
144 | 144 | // Sample log message |
145 | 145 | $this->logger->info("Fetch settings GET '/settings'"); |
146 | 146 | |
147 | - $url = $this->router->pathFor('home').'old/settings.php'; |
|
147 | + $url = $this->router->pathFor('home') . 'old/settings.php'; |
|
148 | 148 | |
149 | 149 | return $response->withStatus(303)->withHeader('Location', $url); |
150 | 150 | //return $this->view->render($response, 'settings.twig', []); |
151 | 151 | })->setName('settings'); |
152 | 152 | |
153 | -$app->get('/token', function ($request, $response, $args) { |
|
153 | +$app->get('/token', function($request, $response, $args) { |
|
154 | 154 | return $response->getBody()->write(Crypt::generateToken(30)); |
155 | 155 | })->setName('token'); |
156 | 156 | |
157 | -$app->get('/', function ($request, $response, $args) { |
|
157 | +$app->get('/', function($request, $response, $args) { |
|
158 | 158 | // Sample log message |
159 | 159 | $this->logger->info("Fetch home GET '/'"); |
160 | 160 | |
@@ -174,19 +174,19 @@ discard block |
||
174 | 174 | // INSTALL |
175 | 175 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
176 | 176 | |
177 | -$app->group('/install', function () { |
|
178 | - $this->get('', InstallController::class.':getInstall')->setName('install'); |
|
177 | +$app->group('/install', function() { |
|
178 | + $this->get('', InstallController::class . ':getInstall')->setName('install'); |
|
179 | 179 | |
180 | - $this->get('/database', InstallController::class.':getInstallDatabase')->setName('install-database'); |
|
180 | + $this->get('/database', InstallController::class . ':getInstallDatabase')->setName('install-database'); |
|
181 | 181 | |
182 | - $this->get('/user', InstallController::class.':getFirstUserForm')->setName('install-user'); |
|
183 | - $this->post('/user', InstallController::class.':postFirstUserForm')->setName('install-user-post'); |
|
182 | + $this->get('/user', InstallController::class . ':getFirstUserForm')->setName('install-user'); |
|
183 | + $this->post('/user', InstallController::class . ':postFirstUserForm')->setName('install-user-post'); |
|
184 | 184 | }); |
185 | 185 | |
186 | 186 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
187 | 187 | // JOBS |
188 | 188 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
189 | 189 | |
190 | -$app->group('/job', function () { |
|
191 | - $this->get('/daily/{token}', JobController::class.':getDaily')->setName('job-daily'); |
|
190 | +$app->group('/job', function() { |
|
191 | + $this->get('/daily/{token}', JobController::class . ':getDaily')->setName('job-daily'); |
|
192 | 192 | }); |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | |
25 | 25 | $stage = 1; |
26 | 26 | |
27 | - $configPath = __DIR__.'/../../../config'; |
|
27 | + $configPath = __DIR__ . '/../../../config'; |
|
28 | 28 | if ( |
29 | - file_exists($configPath.'/auth.php') |
|
30 | - && file_exists($configPath.'/database.php') |
|
31 | - && file_exists($configPath.'/email.php') |
|
32 | - && file_exists($configPath.'/recording.php') |
|
29 | + file_exists($configPath . '/auth.php') |
|
30 | + && file_exists($configPath . '/database.php') |
|
31 | + && file_exists($configPath . '/email.php') |
|
32 | + && file_exists($configPath . '/recording.php') |
|
33 | 33 | ) { |
34 | 34 | $stage = 2; |
35 | 35 | } |
@@ -77,17 +77,17 @@ discard block |
||
77 | 77 | 'command' => 'sql:build', |
78 | 78 | '-vvv' => true, |
79 | 79 | '--overwrite' => true, |
80 | - '--config-dir' => __DIR__.'/../../../generated-conf', |
|
81 | - '--schema-dir' => __DIR__.'/../../../', |
|
82 | - '--output-dir' => __DIR__.'/../../../build/sql', |
|
80 | + '--config-dir' => __DIR__ . '/../../../generated-conf', |
|
81 | + '--schema-dir' => __DIR__ . '/../../../', |
|
82 | + '--output-dir' => __DIR__ . '/../../../build/sql', |
|
83 | 83 | ]); |
84 | 84 | $propelGenerator->run($input, $output); |
85 | 85 | |
86 | 86 | $input = new ArrayInput([ |
87 | 87 | 'command' => 'sql:insert', |
88 | 88 | '-vvv' => true, |
89 | - '--config-dir' => __DIR__.'/../../../generated-conf', |
|
90 | - '--sql-dir' => __DIR__.'/../../../build/sql', |
|
89 | + '--config-dir' => __DIR__ . '/../../../generated-conf', |
|
90 | + '--sql-dir' => __DIR__ . '/../../../build/sql', |
|
91 | 91 | ]); |
92 | 92 | $propelGenerator->run($input, $output); |
93 | 93 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $existingUserCount = UserQuery::create()->count(); |
100 | 100 | } catch (\Propel\Runtime\Exception\PropelException $e) { |
101 | 101 | if ($e->getPrevious()->getCode() === '42S02') { |
102 | - return $response->getBody()->write('Error installing database:'."\n".$outputString); |
|
102 | + return $response->getBody()->write('Error installing database:' . "\n" . $outputString); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | |
153 | 153 | return $this->view->render($response, 'login-credentials.twig', [ |
154 | 154 | 'username' => $user->getEmail(), |
155 | - 'message' => 'Your password is: '.$password.' Copy it somewhere safe as it will not be displayed again. You can change it once you\'ve logged in.', |
|
155 | + 'message' => 'Your password is: ' . $password . ' Copy it somewhere safe as it will not be displayed again. You can change it once you\'ve logged in.', |
|
156 | 156 | ]); |
157 | 157 | } |
158 | 158 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require __DIR__.'/../config/database.php'; |
|
3 | +require __DIR__ . '/../config/database.php'; |
|
4 | 4 | |
5 | 5 | return [ |
6 | 6 | 'propel' => [ |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | 'default' => [ |
10 | 10 | 'adapter' => 'mysql', |
11 | 11 | 'classname' => 'Propel\Runtime\Connection\ConnectionWrapper', |
12 | - 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], |
|
12 | + 'dsn' => 'mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'], |
|
13 | 13 | 'user' => $config['db']['user'], |
14 | 14 | 'password' => $config['db']['pass'], |
15 | 15 | 'attributes' => [], |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | if (!isAdmin()) { |
19 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
19 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
20 | 20 | exit; |
21 | 21 | } |
22 | 22 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $sql = "UPDATE eventGroups SET name = '$name', description = '$description' WHERE id = '$editid'"; |
43 | 43 | } |
44 | 44 | if (!mysqli_query(db(), $sql)) { |
45 | - exit('Error: '.mysqli_error(db())); |
|
45 | + exit('Error: ' . mysqli_error(db())); |
|
46 | 46 | } |
47 | 47 | } else { |
48 | 48 | $name = $_POST['seriesName']; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } else { |
57 | 57 | $sql = ("INSERT INTO eventGroups (name, description) VALUES ('$name', '$description')"); |
58 | 58 | if (!mysqli_query(db(), $sql)) { |
59 | - exit('Error: '.mysqli_error(db())); |
|
59 | + exit('Error: ' . mysqli_error(db())); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | // After we have inserted the data, we want to head back to the main users page |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | |
100 | 100 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
101 | 101 | $seriesId = $row['id']; |
102 | - echo "<span id='".$seriesId."' class='edit'><strong>".$row['name'].'</strong></span>'; |
|
103 | - echo " <a href='series.php?method=remove&series=".$seriesId."'><i class='fa fa-close'></i></a><br />"; |
|
104 | - echo "<p id='".$seriesId."' class='edit'>".$row['description'].'</p>'; |
|
102 | + echo "<span id='" . $seriesId . "' class='edit'><strong>" . $row['name'] . '</strong></span>'; |
|
103 | + echo " <a href='series.php?method=remove&series=" . $seriesId . "'><i class='fa fa-close'></i></a><br />"; |
|
104 | + echo "<p id='" . $seriesId . "' class='edit'>" . $row['description'] . '</p>'; |
|
105 | 105 | echo '<hr />'; |
106 | 106 | } ?> |
107 | 107 | </div><!-- /.box-body --> |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if (!empty($eventId)) { |
113 | 113 | // ensure user is logged in before allowing creation of swap |
114 | 114 | if (!(isset($_SESSION['is_logged_in']) || $_SESSION['db_is_logged_in'] == true)) { |
115 | - $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl().'/swap.php?event='.$eventId; |
|
115 | + $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl() . '/swap.php?event=' . $eventId; |
|
116 | 116 | header('Location: login.php'); |
117 | 117 | } |
118 | 118 | $createSwap = true; |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | <p> |
189 | 189 | <strong> |
190 | 190 | <s class="text-red"> |
191 | - <?php echo $swap->getOldUserRole()->getUser()->getFirstName().' '.$swap->getOldUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getOldUserRole()->getRole()->getName() ?>) |
|
191 | + <?php echo $swap->getOldUserRole()->getUser()->getFirstName() . ' ' . $swap->getOldUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getOldUserRole()->getRole()->getName() ?>) |
|
192 | 192 | </s> |
193 | 193 | → |
194 | 194 | <span class="text-green"> |
195 | - <?php echo $swap->getNewUserRole()->getUser()->getFirstName().' '.$swap->getNewUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getNewUserRole()->getRole()->getName() ?>) |
|
195 | + <?php echo $swap->getNewUserRole()->getUser()->getFirstName() . ' ' . $swap->getNewUserRole()->getUser()->getLastName() ?> (<?php echo $swap->getNewUserRole()->getRole()->getName() ?>) |
|
196 | 196 | </span> |
197 | 197 | </strong> |
198 | 198 | </p> |
@@ -227,16 +227,16 @@ discard block |
||
227 | 227 | <select name="newUserRole" class="form-control"> |
228 | 228 | <?php |
229 | 229 | if (roleCanSwapToOtherRoleInGroup($role->roleId)) { |
230 | - $whereAnd = 'r.groupId = '.groupIdWithRole($role->roleId).' AND r.allowRoleSwaps IS NOT FALSE'; |
|
230 | + $whereAnd = 'r.groupId = ' . groupIdWithRole($role->roleId) . ' AND r.allowRoleSwaps IS NOT FALSE'; |
|
231 | 231 | } else { |
232 | - $whereAnd = 'r.id = '.$role->roleId; |
|
232 | + $whereAnd = 'r.id = ' . $role->roleId; |
|
233 | 233 | } |
234 | - $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM users u INNER JOIN userRoles ur ON ur.userId = u.id INNER JOIN roles r ON r.id = ur.roleId WHERE u.id <> '.$role->userId.' AND '.$whereAnd.' ORDER BY lastName, firstName, r.name'; |
|
234 | + $sql = 'SELECT ur.id, u.firstName, u.lastName, r.name FROM users u INNER JOIN userRoles ur ON ur.userId = u.id INNER JOIN roles r ON r.id = ur.roleId WHERE u.id <> ' . $role->userId . ' AND ' . $whereAnd . ' ORDER BY lastName, firstName, r.name'; |
|
235 | 235 | $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
236 | 236 | |
237 | 237 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
238 | 238 | ?> |
239 | - <option value='<?php echo $row['id']; ?>'><?php echo $row['firstName'].' '.$row['lastName'].' ('.$row['name'].')'; ?></option> |
|
239 | + <option value='<?php echo $row['id']; ?>'><?php echo $row['firstName'] . ' ' . $row['lastName'] . ' (' . $row['name'] . ')'; ?></option> |
|
240 | 240 | <?php |
241 | 241 | } ?> |
242 | 242 | </select> |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | </div><!-- /.timeline-header --> |
224 | 224 | |
225 | 225 | <div class="timeline-body"> |
226 | - <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName().': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '('.$event->getBibleVerse().')' : '' ?></p> |
|
226 | + <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName() . ': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '(' . $event->getBibleVerse() . ')' : '' ?></p> |
|
227 | 227 | <p><strong>Location:</strong> <?php echo $event->getLocation()->getName(); ?></p> |
228 | 228 | |
229 | 229 | <?php if ($event->getComments()) { ?> |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | INNER JOIN groups g ON g.id = r.groupId |
284 | 284 | INNER JOIN users u ON u.id = ur.userId |
285 | 285 | INNER JOIN eventPeople ep ON ep.userRoleId = ur.id |
286 | - WHERE ep.eventId = '".$event->getId()."' |
|
286 | + WHERE ep.eventId = '".$event->getId() . "' |
|
287 | 287 | AND ep.removed = 0 |
288 | 288 | ORDER BY g.name, r.name"; |
289 | 289 | |
@@ -307,16 +307,16 @@ discard block |
||
307 | 307 | } else { |
308 | 308 | echo '</ul>'; |
309 | 309 | } |
310 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
310 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
311 | 311 | echo '<ul>'; |
312 | 312 | } |
313 | 313 | |
314 | 314 | echo '<li>'; |
315 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
315 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
316 | 316 | echo $viewPeople->name; |
317 | 317 | |
318 | 318 | if ($viewPeople->rolename != '') { |
319 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
319 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
320 | 320 | } else { |
321 | 321 | // If there is no skill, we don't need to mention this. |
322 | 322 | } |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | </div><!-- /.timeline-header --> |
399 | 399 | |
400 | 400 | <div class="timeline-body"> |
401 | - <p><strong><?php echo $event->eventGroup ? $event->eventGroup.': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '('.$event->bibleVerse.')' : '' ?></p> |
|
401 | + <p><strong><?php echo $event->eventGroup ? $event->eventGroup . ': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '(' . $event->bibleVerse . ')' : '' ?></p> |
|
402 | 402 | <p><strong>Location:</strong> <?php echo $event->eventLocation; ?></p> |
403 | 403 | |
404 | 404 | <?php if ($event->comment != '') { ?> |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | INNER JOIN groups g ON g.id = r.groupId |
460 | 460 | INNER JOIN users u ON u.id = ur.userId |
461 | 461 | INNER JOIN eventPeople ep ON ep.userRoleId = ur.id |
462 | - WHERE ep.eventId = '".$event->id."' |
|
462 | + WHERE ep.eventId = '".$event->id . "' |
|
463 | 463 | AND ep.removed = 0 |
464 | 464 | ORDER BY g.name, r.name"; |
465 | 465 | |
@@ -483,16 +483,16 @@ discard block |
||
483 | 483 | } else { |
484 | 484 | echo '</ul>'; |
485 | 485 | } |
486 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
486 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
487 | 487 | echo '<ul>'; |
488 | 488 | } |
489 | 489 | |
490 | 490 | echo '<li>'; |
491 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
491 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
492 | 492 | echo $viewPeople->name; |
493 | 493 | |
494 | 494 | if ($viewPeople->rolename != '') { |
495 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
495 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
496 | 496 | } else { |
497 | 497 | // If there is no skill, we don't need to mention this. |
498 | 498 | } |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | <img class="img-circle" src="<?php echo getProfileImageUrl($_SESSION['userid'], 'large') ?>" alt="User Avatar"> |
629 | 629 | </div> |
630 | 630 | <!-- /.widget-user-image --> |
631 | - <h3 class="widget-user-username"><?php echo $user->getFirstName().' '.$user->getLastName() ?></h3> |
|
631 | + <h3 class="widget-user-username"><?php echo $user->getFirstName() . ' ' . $user->getLastName() ?></h3> |
|
632 | 632 | <h5 class="widget-user-desc">Account created <?php echo $user->getCreated('M. Y') ?></h5> |
633 | 633 | </div> |
634 | 634 | <div class="box-footer no-padding"> |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | $userHasEmail = (strlen($user->getEmail()) > 3); |
653 | 653 | $emailRemindersEnabled = ($userHasEmail && true); // todo: add opt-out for email reminders |
654 | 654 | ?> |
655 | - Email Reminders <span class="pull-right badge bg-<?php echo $emailRemindersEnabled ? 'green' : 'red' ?>"><?php echo $emailRemindersEnabled ? siteSettings()->getDaysToAlert().' days before' : ($userHasEmail ? 'Disabled' : 'No email address') ?></span> |
|
655 | + Email Reminders <span class="pull-right badge bg-<?php echo $emailRemindersEnabled ? 'green' : 'red' ?>"><?php echo $emailRemindersEnabled ? siteSettings()->getDaysToAlert() . ' days before' : ($userHasEmail ? 'Disabled' : 'No email address') ?></span> |
|
656 | 656 | </a> |
657 | 657 | </li> |
658 | 658 | <li> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | if (!isAdmin()) { |
19 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
19 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
20 | 20 | exit; |
21 | 21 | } |
22 | 22 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | $sql = ("INSERT INTO eventSubTypes (name, description) VALUES ('$name', '$description')"); |
41 | 41 | if (!mysqli_query(db(), $sql)) { |
42 | - exit('Error: '.mysqli_error(db())); |
|
42 | + exit('Error: ' . mysqli_error(db())); |
|
43 | 43 | } |
44 | 44 | } else { |
45 | 45 | // Otherwise we are dealing with edits, not new stuff |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | $result = mysqli_query(db(), $sql) or exit(mysqli_error(db())); |
91 | 91 | |
92 | 92 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
93 | - echo '<input type="hidden" name="formindex[]" value="'.$row['id'].'" />'; |
|
94 | - echo "<input name='name[]' value='".$row['name']."' />"; |
|
93 | + echo '<input type="hidden" name="formindex[]" value="' . $row['id'] . '" />'; |
|
94 | + echo "<input name='name[]' value='" . $row['name'] . "' />"; |
|
95 | 95 | |
96 | - echo " <a href='subTypes.php?method=remove&subType=".$row['id']."'><i class='fa fa-times'></i></a><br />"; |
|
96 | + echo " <a href='subTypes.php?method=remove&subType=" . $row['id'] . "'><i class='fa fa-times'></i></a><br />"; |
|
97 | 97 | } ?> |
98 | 98 | </div><!-- /.box-body --> |
99 | 99 | <div class="box-footer"> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | exit; |
36 | 36 | } |
37 | 37 | if (!isAdmin()) { |
38 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
38 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
39 | 39 | exit; |
40 | 40 | } |
41 | 41 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | skin='$skin'"; |
168 | 168 | |
169 | 169 | if (!mysqli_query(db(), $sql)) { |
170 | - exit('Error: '.mysqli_error(db())); |
|
170 | + exit('Error: ' . mysqli_error(db())); |
|
171 | 171 | } |
172 | 172 | header('Location: settings.php'); |
173 | 173 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | <!-- Content Header (Page header) --> |
195 | 195 | <section class="content-header"> |
196 | 196 | <h1>Settings |
197 | - <?php echo '<small>v'.$row['version'].'</small>'; ?> |
|
197 | + <?php echo '<small>v' . $row['version'] . '</small>'; ?> |
|
198 | 198 | </h1> |
199 | 199 | <ol class="breadcrumb"> |
200 | 200 | <li><a href="<?php echo siteSettings()->getSiteUrl() ?>"><i class="fa fa-dashboard"></i> Home</a></li> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | exit; |
17 | 17 | } |
18 | 18 | if (!isAdmin()) { |
19 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
19 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
20 | 20 | exit; |
21 | 21 | } |
22 | 22 | |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | case 'approve': |
34 | 34 | $userId = approvePendingUser($id); |
35 | 35 | mailNewUser($userId); |
36 | - header('Location: addUser.php?action=edit&user='.$userId); |
|
36 | + header('Location: addUser.php?action=edit&user=' . $userId); |
|
37 | 37 | break; |
38 | 38 | case 'merge': |
39 | 39 | $existingUserId = $_POST['existingUser']; |
40 | 40 | $existingUserId = filter_var($existingUserId, FILTER_SANITIZE_NUMBER_INT); |
41 | 41 | mergePendingUserWithUserId($id, $existingUserId); |
42 | 42 | mailNewUser($existingUserId); |
43 | - header('Location: addUser.php?action=edit&user='.$existingUserId); |
|
43 | + header('Location: addUser.php?action=edit&user=' . $existingUserId); |
|
44 | 44 | break; |
45 | 45 | case 'decline': |
46 | 46 | declinePendingUser($id); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | <div class="box box-primary"> |
93 | 93 | <div class="box-header"> |
94 | 94 | <h2 class="box-title"> |
95 | - <?php echo $user->approved ? 'Approved' : ($user->declined ? 'Declined' : 'Pending') ?>: <?php echo $user->firstName.' '.$user->lastName ?> |
|
95 | + <?php echo $user->approved ? 'Approved' : ($user->declined ? 'Declined' : 'Pending') ?>: <?php echo $user->firstName . ' ' . $user->lastName ?> |
|
96 | 96 | </h2> |
97 | 97 | </div> |
98 | 98 | <div class="box-body"> |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | <?php |
134 | 134 | $users = allUsersNames(); |
135 | 135 | foreach ($users as $existingUser) { ?> |
136 | - <option value="<?php echo $existingUser->id?>" <?php echo($existingUser->firstName == $user->firstName) && ($existingUser->lastName == $user->lastName) ? "selected='selected'" : '' ?>><?php echo $existingUser->firstName.' '.$existingUser->lastName ?></option> |
|
136 | + <option value="<?php echo $existingUser->id?>" <?php echo($existingUser->firstName == $user->firstName) && ($existingUser->lastName == $user->lastName) ? "selected='selected'" : '' ?>><?php echo $existingUser->firstName . ' ' . $existingUser->lastName ?></option> |
|
137 | 137 | <?php } ?> |
138 | 138 | </select> |
139 | 139 | </div> |