@@ -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' => [], |
@@ -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 | $serviceContainer = \Propel\Runtime\Propel::getServiceContainer(); |
5 | 5 | $serviceContainer->checkVersion('2.0.0-dev'); |
6 | 6 | |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | $manager = new \Propel\Runtime\Connection\ConnectionManagerSingle(); |
9 | 9 | $manager->setConfiguration([ |
10 | 10 | 'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper', |
11 | - 'dsn' => 'mysql:host='.$config['db']['host'].';dbname='.$config['db']['dbname'], |
|
11 | + 'dsn' => 'mysql:host=' . $config['db']['host'] . ';dbname=' . $config['db']['dbname'], |
|
12 | 12 | 'user' => $config['db']['user'], |
13 | 13 | 'password' => $config['db']['pass'], |
14 | 14 | 'attributes' => [ |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | <!-- Menu toggle button --> |
297 | 297 | <a href="#" class="dropdown-toggle" data-toggle="dropdown"> |
298 | 298 | <i class="fa fa-bell-o"></i> |
299 | - <?php echo $unseen >= 1 ? '<span class="label label-warning">'.$unseen.'</span>' : '' ?> |
|
299 | + <?php echo $unseen >= 1 ? '<span class="label label-warning">' . $unseen . '</span>' : '' ?> |
|
300 | 300 | </a> |
301 | 301 | <ul class="dropdown-menu"> |
302 | 302 | <li class="header">You have <?php echo $unseen >= 1 ? $unseen : 'no' ?> new notifications</li> |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | <?php foreach ($notifications as $n): ?> |
307 | 307 | <li><!-- start notification --> |
308 | 308 | <a href="notification.php?click=notifications-panel&id=<?php echo $n->id ?>"> |
309 | - <i class="fa fa-users text-aqua"></i> <?php echo $n->seen ? $n->summary : '<strong>'.$n->summary.'</strong>' ?> |
|
309 | + <i class="fa fa-users text-aqua"></i> <?php echo $n->seen ? $n->summary : '<strong>' . $n->summary . '</strong>' ?> |
|
310 | 310 | <small><?php echo timeAgoInWords($n->timestamp) ?></small> |
311 | 311 | </a> |
312 | 312 | </li><!-- end notification --> |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | <!-- User Account Menu --> |
362 | 362 | <li class="dropdown user user-menu"> |
363 | 363 | <?php |
364 | - $sql = 'SELECT u.created FROM users u WHERE id = '.$_SESSION['userid']; |
|
364 | + $sql = 'SELECT u.created FROM users u WHERE id = ' . $_SESSION['userid']; |
|
365 | 365 | $stmt = mysqli_prepare(db(), $sql); |
366 | 366 | mysqli_stmt_bind_param($stmt, 'i', $_SESSION['userid']); |
367 | 367 | mysqli_stmt_execute($stmt) or die(mysqli_error(db())); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | mysqli_stmt_bind_param($stmt, 'ii', $eventId, $userRoleId); |
17 | 17 | |
18 | 18 | if (!mysqli_stmt_execute($stmt)) { |
19 | - die('Error: '.mysqli_error(db())); |
|
19 | + die('Error: ' . mysqli_error(db())); |
|
20 | 20 | } |
21 | 21 | mysqli_stmt_close($stmt); |
22 | 22 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | mysqli_stmt_bind_param($stmt, 'ii', $id, $userRoleId); |
36 | 36 | |
37 | 37 | if (!mysqli_stmt_execute($stmt)) { |
38 | - die('Error: '.mysqli_error(db())); |
|
38 | + die('Error: ' . mysqli_error(db())); |
|
39 | 39 | } |
40 | 40 | mysqli_stmt_close($stmt); |
41 | 41 | } |
@@ -185,40 +185,40 @@ discard block |
||
185 | 185 | |
186 | 186 | $verificationCode = verificationCodeForSwap($swapId); |
187 | 187 | |
188 | - $subject = 'Swap requested: '.$ob->newUserName.' - '.$ob->eventDate; |
|
189 | - $message = "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n". |
|
190 | - "Requested by:\t\t ".$ob->requestedBy."\r\n". |
|
191 | - "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n". |
|
192 | - "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n". |
|
193 | - "Accept:\t\t ".$ob->siteurl.'/swap.php?action='.'accept&swap='.$swapId.'&verify='.$verificationCode."\r\n "."\r\n". |
|
194 | - "Decline:\t\t ".$ob->siteurl.'/swap.php?action='.'decline&swap='.$swapId.'&verify='.$verificationCode."\r\n "."\r\n"; |
|
188 | + $subject = 'Swap requested: ' . $ob->newUserName . ' - ' . $ob->eventDate; |
|
189 | + $message = "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" . |
|
190 | + "Requested by:\t\t " . $ob->requestedBy . "\r\n" . |
|
191 | + "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" . |
|
192 | + "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n" . |
|
193 | + "Accept:\t\t " . $ob->siteurl . '/swap.php?action=' . 'accept&swap=' . $swapId . '&verify=' . $verificationCode . "\r\n " . "\r\n" . |
|
194 | + "Decline:\t\t " . $ob->siteurl . '/swap.php?action=' . 'decline&swap=' . $swapId . '&verify=' . $verificationCode . "\r\n " . "\r\n"; |
|
195 | 195 | |
196 | 196 | $from = $ob->siteadmin; |
197 | 197 | |
198 | - $linkToSwap = 'swap.php?swap='.$swapId; |
|
198 | + $linkToSwap = 'swap.php?swap=' . $swapId; |
|
199 | 199 | |
200 | 200 | $sessionUserId = $_SESSION['userid']; |
201 | 201 | |
202 | 202 | if ($sessionUserId == $ob->oldUserId) { // if old user requests swap |
203 | 203 | // notify new user |
204 | - $notificationMessage = $ob->oldUserFirstName.' requested a swap'; |
|
204 | + $notificationMessage = $ob->oldUserFirstName . ' requested a swap'; |
|
205 | 205 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
206 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
206 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
207 | 207 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
208 | 208 | } elseif ($sessionUserId == $ob->newUserId) { // if new user requests swap |
209 | 209 | // notify old user |
210 | - $notificationMessage = $ob->newUserFirstName.' requested a swap'; |
|
210 | + $notificationMessage = $ob->newUserFirstName . ' requested a swap'; |
|
211 | 211 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
212 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
212 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
213 | 213 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
214 | 214 | } else { // notify both users |
215 | 215 | $sessionUserFirstName = getFirstNameWithId($sessionUserId); |
216 | - $notificationMessageOldUser = $sessionUserFirstName.' requested a swap for '.$ob->newUserFirstName; |
|
217 | - $notificationMessageNewUser = $sessionUserFirstName.' requested a swap for '.$ob->oldUserFirstName; |
|
216 | + $notificationMessageOldUser = $sessionUserFirstName . ' requested a swap for ' . $ob->newUserFirstName; |
|
217 | + $notificationMessageNewUser = $sessionUserFirstName . ' requested a swap for ' . $ob->oldUserFirstName; |
|
218 | 218 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
219 | 219 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
220 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessageOldUser); |
|
221 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessageNewUser); |
|
220 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessageOldUser); |
|
221 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessageNewUser); |
|
222 | 222 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
223 | 223 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
224 | 224 | } |
@@ -251,60 +251,60 @@ discard block |
||
251 | 251 | |
252 | 252 | $verificationCode = verificationCodeForSwap($swapId); |
253 | 253 | |
254 | - $subject = 'Swap accepted: '.$ob->newUserName.' - '.$ob->eventDate; |
|
255 | - $message = "The following swap has been accepted\r\n\r\n". |
|
256 | - "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n". |
|
257 | - "Requested by:\t\t ".$ob->requestedBy."\r\n". |
|
258 | - "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n". |
|
259 | - "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n"; |
|
254 | + $subject = 'Swap accepted: ' . $ob->newUserName . ' - ' . $ob->eventDate; |
|
255 | + $message = "The following swap has been accepted\r\n\r\n" . |
|
256 | + "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" . |
|
257 | + "Requested by:\t\t " . $ob->requestedBy . "\r\n" . |
|
258 | + "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" . |
|
259 | + "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n"; |
|
260 | 260 | $from = $ob->siteadmin; |
261 | 261 | |
262 | - $linkToSwap = 'swap.php?swap='.$swapId; |
|
262 | + $linkToSwap = 'swap.php?swap=' . $swapId; |
|
263 | 263 | |
264 | 264 | $sessionUserId = $_SESSION['userid']; |
265 | 265 | |
266 | 266 | if ($sessionUserId == $ob->oldUserId) { // if old user accepted swap |
267 | 267 | // notify new user |
268 | - $notificationMessage = $ob->oldUserFirstName.' accepted a swap'; |
|
268 | + $notificationMessage = $ob->oldUserFirstName . ' accepted a swap'; |
|
269 | 269 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
270 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
270 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
271 | 271 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
272 | 272 | } elseif ($sessionUserId == $ob->newUserId) { // if new user accepted swap |
273 | 273 | // notify old user |
274 | - $notificationMessage = $ob->newUserFirstName.' accepted a swap'; |
|
274 | + $notificationMessage = $ob->newUserFirstName . ' accepted a swap'; |
|
275 | 275 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
276 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
276 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
277 | 277 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
278 | 278 | } elseif (isset($_GET['token'])) { // if accepted by email URL with token |
279 | 279 | // notify whoever requested swap |
280 | 280 | if ($ob->newUserId == $ob->requestedBy) { |
281 | - $notificationMessage = 'Swap accepted with '.$ob->oldUserFirstName; |
|
281 | + $notificationMessage = 'Swap accepted with ' . $ob->oldUserFirstName; |
|
282 | 282 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
283 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
283 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
284 | 284 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
285 | 285 | } elseif ($ob->oldUserId == $ob->requestedBy) { |
286 | - $notificationMessage = 'Swap accepted with '.$ob->newUserFirstName; |
|
286 | + $notificationMessage = 'Swap accepted with ' . $ob->newUserFirstName; |
|
287 | 287 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
288 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
288 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
289 | 289 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
290 | 290 | } else { // notify both |
291 | - $notificationMessageOldUser = 'Swap accepted with '.$ob->newUserFirstName; |
|
292 | - $notificationMessageNewUser = 'Swap accepted with '.$ob->oldUserFirstName; |
|
291 | + $notificationMessageOldUser = 'Swap accepted with ' . $ob->newUserFirstName; |
|
292 | + $notificationMessageNewUser = 'Swap accepted with ' . $ob->oldUserFirstName; |
|
293 | 293 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
294 | 294 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
295 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage); |
|
296 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage); |
|
295 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage); |
|
296 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage); |
|
297 | 297 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
298 | 298 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
299 | 299 | } |
300 | 300 | } else { // notify both users |
301 | 301 | $sessionUserFirstName = getFirstNameWithId($sessionUserId); |
302 | - $notificationMessageOldUser = $sessionUserFirstName.' accepted a swap for '.$ob->newUserFirstName; |
|
303 | - $notificationMessageNewUser = $sessionUserFirstName.' accepted a swap for '.$ob->oldUserFirstName; |
|
302 | + $notificationMessageOldUser = $sessionUserFirstName . ' accepted a swap for ' . $ob->newUserFirstName; |
|
303 | + $notificationMessageNewUser = $sessionUserFirstName . ' accepted a swap for ' . $ob->oldUserFirstName; |
|
304 | 304 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
305 | 305 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
306 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage); |
|
307 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage); |
|
306 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage); |
|
307 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage); |
|
308 | 308 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
309 | 309 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
310 | 310 | } |
@@ -336,39 +336,39 @@ discard block |
||
336 | 336 | |
337 | 337 | $verificationCode = verificationCodeForSwap($swapId); |
338 | 338 | |
339 | - $subject = 'Swap declined: '.$ob->newUserName.' - '.$ob->eventDate; |
|
340 | - $message = "The following swap has been declined\r\n\r\n". |
|
341 | - "Date:\t\t ".strftime($ob->time_format_long, strtotime($ob->eventDate))."\r\n". |
|
342 | - "Requested by:\t\t ".$ob->requestedBy."\r\n". |
|
343 | - "Swap from:\t\t ".$ob->oldUserName.' - '.$ob->oldRole."\r\n". |
|
344 | - "Swap to:\t\t ".$ob->newUserName.' - '.$ob->newRole."\r\n"; |
|
339 | + $subject = 'Swap declined: ' . $ob->newUserName . ' - ' . $ob->eventDate; |
|
340 | + $message = "The following swap has been declined\r\n\r\n" . |
|
341 | + "Date:\t\t " . strftime($ob->time_format_long, strtotime($ob->eventDate)) . "\r\n" . |
|
342 | + "Requested by:\t\t " . $ob->requestedBy . "\r\n" . |
|
343 | + "Swap from:\t\t " . $ob->oldUserName . ' - ' . $ob->oldRole . "\r\n" . |
|
344 | + "Swap to:\t\t " . $ob->newUserName . ' - ' . $ob->newRole . "\r\n"; |
|
345 | 345 | |
346 | 346 | $from = $ob->siteadmin; |
347 | 347 | |
348 | - $linkToSwap = 'swap.php?swap='.$swapId; |
|
348 | + $linkToSwap = 'swap.php?swap=' . $swapId; |
|
349 | 349 | |
350 | 350 | $sessionUserId = $_SESSION['userid']; |
351 | 351 | |
352 | 352 | if ($sessionUserId == $ob->oldUserId) { // if old user declines swap |
353 | 353 | // notify new user |
354 | - $notificationMessage = $ob->oldUserFirstName.' declined a swap'; |
|
354 | + $notificationMessage = $ob->oldUserFirstName . ' declined a swap'; |
|
355 | 355 | $notificationId = createNotificationForUser($ob->newUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
356 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
356 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
357 | 357 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
358 | 358 | } elseif ($sessionUserId == $ob->newUserId) { // if new user declines swap |
359 | 359 | // notify old user |
360 | - $notificationMessage = $ob->newUserFirstName.' declined a swap'; |
|
360 | + $notificationMessage = $ob->newUserFirstName . ' declined a swap'; |
|
361 | 361 | $notificationId = createNotificationForUser($ob->oldUserId, $notificationMessage, $message, 'swap', $linkToSwap); |
362 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationId, $notificationMessage); |
|
362 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationId, $notificationMessage); |
|
363 | 363 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
364 | 364 | } else { // notify both users |
365 | 365 | $sessionUserFirstName = getFirstNameWithId($sessionUserId); |
366 | - $notificationMessageOldUser = $sessionUserFirstName.' declined a swap for '.$ob->newUserFirstName; |
|
367 | - $notificationMessageNewUser = $sessionUserFirstName.' declined a swap for '.$ob->oldUserFirstName; |
|
366 | + $notificationMessageOldUser = $sessionUserFirstName . ' declined a swap for ' . $ob->newUserFirstName; |
|
367 | + $notificationMessageNewUser = $sessionUserFirstName . ' declined a swap for ' . $ob->oldUserFirstName; |
|
368 | 368 | $notificationIdOldUser = createNotificationForUser($ob->oldUserId, $notificationMessageOldUser, $message, 'swap', $linkToSwap); |
369 | 369 | $notificationIdNewUser = createNotificationForUser($ob->newUserId, $notificationMessageNewUser, $message, 'swap', $linkToSwap); |
370 | - createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id='.$notificationIdOldUser, $notificationMessage); |
|
371 | - createFacebookNotificationForUser($ob->newUserId, 'notification.php?id='.$notificationIdNewUser, $notificationMessage); |
|
370 | + createFacebookNotificationForUser($ob->oldUserId, 'notification.php?id=' . $notificationIdOldUser, $notificationMessage); |
|
371 | + createFacebookNotificationForUser($ob->newUserId, 'notification.php?id=' . $notificationIdNewUser, $notificationMessage); |
|
372 | 372 | sendMail(getEmailWithId($ob->newUserId), $subject, $message, $from); |
373 | 373 | sendMail(getEmailWithId($ob->oldUserId), $subject, $message, $from); |
374 | 374 | } |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | $stmt = mysqli_prepare(db(), $sql); |
544 | 544 | mysqli_stmt_bind_param($stmt, 'i', $seriesId); |
545 | 545 | if (!mysqli_stmt_execute($stmt)) { |
546 | - die('Error: '.mysqli_error(db())); |
|
546 | + die('Error: ' . mysqli_error(db())); |
|
547 | 547 | } |
548 | 548 | mysqli_stmt_close($stmt); |
549 | 549 | } |
@@ -555,14 +555,14 @@ discard block |
||
555 | 555 | mysqli_stmt_bind_param($stmt, 'ii', $bandId, $userRoleId); |
556 | 556 | |
557 | 557 | if (!mysqli_stmt_execute($stmt)) { |
558 | - die('Error: '.mysqli_error(db())); |
|
558 | + die('Error: ' . mysqli_error(db())); |
|
559 | 559 | } |
560 | 560 | mysqli_stmt_close($stmt); |
561 | 561 | } |
562 | 562 | |
563 | 563 | function getEventUrl($eventId) |
564 | 564 | { |
565 | - return 'event.php?id='.$eventId; |
|
565 | + return 'event.php?id=' . $eventId; |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | function getEventDetails($eventID, $separator, $type = 4, $apprev_description = true, $prefix = '') |
@@ -602,9 +602,9 @@ discard block |
||
602 | 602 | e.id = ? "; |
603 | 603 | |
604 | 604 | if ($type == 1) { |
605 | - $sql = $sql."AND ((g.id in (10,11)) OR (g.id=2 and u.firstname='Team')) "; |
|
605 | + $sql = $sql . "AND ((g.id in (10,11)) OR (g.id=2 and u.firstname='Team')) "; |
|
606 | 606 | } |
607 | - $sql = $sql.'ORDER BY e.id, g.id desc, role, firstname, lastname '; |
|
607 | + $sql = $sql . 'ORDER BY e.id, g.id desc, role, firstname, lastname '; |
|
608 | 608 | |
609 | 609 | $stmt = mysqli_prepare(db(), $sql); |
610 | 610 | mysqli_stmt_bind_param($stmt, 'i', $eventID); |
@@ -625,32 +625,32 @@ discard block |
||
625 | 625 | |
626 | 626 | $firstname = $row['firstname']; |
627 | 627 | if ($firstname != 'Team') { |
628 | - $firstname = ltrim(substr($firstname, 0, 1).'.', '.'); |
|
628 | + $firstname = ltrim(substr($firstname, 0, 1) . '.', '.'); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | $lastname = $row['lastname']; |
632 | 632 | |
633 | - $returnValue = $returnValue.$separator; |
|
633 | + $returnValue = $returnValue . $separator; |
|
634 | 634 | switch ($type) { |
635 | 635 | case 0: |
636 | 636 | //all persons of event |
637 | 637 | //break; -> no special handling, fallthrough to case 1 |
638 | 638 | case 1: |
639 | 639 | //only persons with groupID in 10,11,2 -> handled in sql query |
640 | - $returnValue = $returnValue.$prefix.ltrim($group.': '); |
|
641 | - $returnValue = $returnValue.trim($firstname.' '.$lastname); |
|
640 | + $returnValue = $returnValue . $prefix . ltrim($group . ': '); |
|
641 | + $returnValue = $returnValue . trim($firstname . ' ' . $lastname); |
|
642 | 642 | break; |
643 | 643 | case 2: |
644 | 644 | //only event date and event type |
645 | - $returnValue = $returnValue.strftime($time_format_normal, strtotime($eventDate)); |
|
646 | - $returnValue = $returnValue.$separator; |
|
647 | - $returnValue = $returnValue.$eventType; |
|
645 | + $returnValue = $returnValue . strftime($time_format_normal, strtotime($eventDate)); |
|
646 | + $returnValue = $returnValue . $separator; |
|
647 | + $returnValue = $returnValue . $eventType; |
|
648 | 648 | |
649 | 649 | return trim(substr($returnValue, strlen($separator) - 1)); //ends while loop |
650 | 650 | break; |
651 | 651 | case 4: |
652 | 652 | //only event type |
653 | - $returnValue = $returnValue.$eventType; |
|
653 | + $returnValue = $returnValue . $eventType; |
|
654 | 654 | |
655 | 655 | return trim(substr($returnValue, strlen($separator) - 1)); //ends while loop |
656 | 656 | break; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | |
37 | 37 | // create username and remove all whitespace |
38 | - $username = $firstNameLower.'.'.$lastNameLower; |
|
38 | + $username = $firstNameLower . '.' . $lastNameLower; |
|
39 | 39 | $username = preg_replace('/\s+/', '', $username); |
40 | 40 | |
41 | 41 | $sql = "INSERT INTO users (firstName, lastName, username, email, mobile, password, created, updated) |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | $id = mysqli_insert_id(db()); |
49 | 49 | |
50 | 50 | $notificationMessage = "Welcome to your new account on the rota system.\n |
51 | -If you have any issues, please get in touch with us [".siteSettings()->getAdminEmailAddress().'](mailto:'.siteSettings()->getAdminEmailAddress().").\n |
|
51 | +If you have any issues, please get in touch with us [".siteSettings()->getAdminEmailAddress() . '](mailto:' . siteSettings()->getAdminEmailAddress() . ").\n |
|
52 | 52 | ---\n |
53 | 53 | **Sync to digital calendar**\n |
54 | 54 | You may wish to link the rota to your digital calendar on your computer and phone. To do so, generate a [calendar token](calendarTokens.php) which will present you with your unique URL. Follow instructions from your digital calendar provider for exact details on how import an iCal feed, or get in touch and we may be able to help.\n"; |
55 | 55 | |
56 | - createNotificationForUser($id, 'Welcome '.$firstName, $notificationMessage, 'feature'); |
|
56 | + createNotificationForUser($id, 'Welcome ' . $firstName, $notificationMessage, 'feature'); |
|
57 | 57 | createNotificationForUser($id, 'Change your password', 'Please change your password to something unique and memorable.', 'account', 'editPassword.php'); |
58 | 58 | |
59 | 59 | return $id; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | "DELETE FROM users WHERE id = ?" |
98 | 98 | ]; |
99 | 99 | |
100 | - foreach($queries as $sql) { |
|
100 | + foreach ($queries as $sql) { |
|
101 | 101 | $stmt = mysqli_prepare(db(), $sql); |
102 | 102 | mysqli_stmt_bind_param($stmt, 'i', $id); |
103 | 103 | mysqli_stmt_execute($stmt) or die(mysqli_error(db())); |
@@ -123,10 +123,10 @@ discard block |
||
123 | 123 | function updatePermissions($id, $isAdmin, $isBandAdmin, $isEventEditor, $isOverviewRecipient) |
124 | 124 | { |
125 | 125 | $id = filter_var($id, FILTER_SANITIZE_NUMBER_INT); |
126 | - $isAdmin = (bool)$isAdmin; |
|
127 | - $isOverviewRecipient = (bool)$isOverviewRecipient; |
|
128 | - $isBandAdmin = (bool)$isBandAdmin; |
|
129 | - $isEventEditor = (bool)$isEventEditor; |
|
126 | + $isAdmin = (bool) $isAdmin; |
|
127 | + $isOverviewRecipient = (bool) $isOverviewRecipient; |
|
128 | + $isBandAdmin = (bool) $isBandAdmin; |
|
129 | + $isEventEditor = (bool) $isEventEditor; |
|
130 | 130 | |
131 | 131 | $sql = "UPDATE users |
132 | 132 | SET isAdmin = ?, |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $result = mysqli_stmt_get_result($stmt); |
151 | 151 | $ob = mysqli_fetch_object($result); |
152 | 152 | mysqli_stmt_close($stmt); |
153 | - $name = $ob->firstName.' '.$ob->lastName; |
|
153 | + $name = $ob->firstName . ' ' . $ob->lastName; |
|
154 | 154 | |
155 | 155 | return $name; |
156 | 156 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | mysqli_stmt_bind_param($stmt, 'ssi', $hashedPassword, $currentTimestamp, $userId); |
243 | 243 | mysqli_stmt_execute($stmt) or die(mysqli_error(db())); |
244 | 244 | mysqli_stmt_close($stmt); |
245 | - insertStatistics('user', __FILE__, 'password force changed for user '.getNameWithId($userId), null, $_SERVER['HTTP_USER_AGENT']); |
|
245 | + insertStatistics('user', __FILE__, 'password force changed for user ' . getNameWithId($userId), null, $_SERVER['HTTP_USER_AGENT']); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | function hashPassword($plainTextPassword) |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | if ($loginFailures < $numberOfAllowedAttempts) { |
289 | 289 | return true; |
290 | 290 | } else { |
291 | - insertStatistics('user', __FILE__, 'Login attempts exceeded for username: '.$username, $ipAddress, $_SERVER['HTTP_USER_AGENT']); |
|
291 | + insertStatistics('user', __FILE__, 'Login attempts exceeded for username: ' . $username, $ipAddress, $_SERVER['HTTP_USER_AGENT']); |
|
292 | 292 | |
293 | 293 | return false; |
294 | 294 | } |
@@ -376,11 +376,11 @@ discard block |
||
376 | 376 | $pendingId = mysqli_insert_id(db()); |
377 | 377 | mysqli_stmt_close($stmt); |
378 | 378 | |
379 | - $linkToApprove = 'pendingAccounts.php?id='.$pendingId; |
|
379 | + $linkToApprove = 'pendingAccounts.php?id=' . $pendingId; |
|
380 | 380 | |
381 | - $email = siteSettings()->getOwner().'<'.siteSettings()->getAdminEmailAddress().'>'; |
|
382 | - $subject = $firstName.' requested an account'; |
|
383 | - $message = $subject.' through '.$source.".\nApprove or decline: ".siteSettings()->getSiteUrl().'/'.$linkToApprove; |
|
381 | + $email = siteSettings()->getOwner() . '<' . siteSettings()->getAdminEmailAddress() . '>'; |
|
382 | + $subject = $firstName . ' requested an account'; |
|
383 | + $message = $subject . ' through ' . $source . ".\nApprove or decline: " . siteSettings()->getSiteUrl() . '/' . $linkToApprove; |
|
384 | 384 | |
385 | 385 | sendMail($email, $subject, $message, $email); |
386 | 386 | |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | addSocialAuthToUserWithId($userId, $pendingUser->socialId, $pendingUser->source); |
473 | 473 | updateUser($userId, $pendingUser->firstName, $pendingUser->lastName, $pendingUser->email, null); |
474 | 474 | |
475 | - createNotificationForUser($userId, 'Social Login added: '.$pendingUser->source, 'Your social media login details for '.$pendingUser->source.' have been added to your existing account', 'account'); |
|
475 | + createNotificationForUser($userId, 'Social Login added: ' . $pendingUser->source, 'Your social media login details for ' . $pendingUser->source . ' have been added to your existing account', 'account'); |
|
476 | 476 | createFacebookNotificationForUser($userId, 'login.php', 'Your account request has been approved. You can now login via Facebook.'); |
477 | 477 | |
478 | 478 | return true; |
@@ -587,25 +587,25 @@ discard block |
||
587 | 587 | if ($user->socialId) { |
588 | 588 | switch ($size) { |
589 | 589 | case 'small': // 50px x 50px |
590 | - return '//graph.facebook.com/'.$user->socialId.'/picture?type=square'; |
|
590 | + return '//graph.facebook.com/' . $user->socialId . '/picture?type=square'; |
|
591 | 591 | break; |
592 | 592 | case 'large': // 200px x 200px |
593 | - return '//graph.facebook.com/'.$user->socialId.'/picture?type=large'; |
|
593 | + return '//graph.facebook.com/' . $user->socialId . '/picture?type=large'; |
|
594 | 594 | break; |
595 | 595 | default: |
596 | - return '//graph.facebook.com/'.$user->socialId.'/picture'; |
|
596 | + return '//graph.facebook.com/' . $user->socialId . '/picture'; |
|
597 | 597 | break; |
598 | 598 | } |
599 | 599 | } else { |
600 | 600 | switch ($size) { |
601 | 601 | case 'small': // 50px x 50px |
602 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=50&d=mm'; |
|
602 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=50&d=mm'; |
|
603 | 603 | break; |
604 | 604 | case 'large': // 200px x 200px |
605 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=200&d=mm'; |
|
605 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=200&d=mm'; |
|
606 | 606 | break; |
607 | 607 | default: |
608 | - return '//www.gravatar.com/avatar/'.md5(strtolower(trim($user->email))).'?s=50&d=mm'; |
|
608 | + return '//www.gravatar.com/avatar/' . md5(strtolower(trim($user->email))) . '?s=50&d=mm'; |
|
609 | 609 | break; |
610 | 610 | } |
611 | 611 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $_SESSION['db_is_logged_in'] = true; |
22 | 22 | $_SESSION['isAdmin'] = $row['isAdmin']; // Set the admin status to be carried across this session |
23 | 23 | $_SESSION['userid'] = $row['id']; |
24 | - $_SESSION['name'] = $row['firstName'].' '.$row['lastName']; |
|
24 | + $_SESSION['name'] = $row['firstName'] . ' ' . $row['lastName']; |
|
25 | 25 | $_SESSION['isBandAdmin'] = $row['isBandAdmin']; // Set the band admin status to be carried across this session |
26 | 26 | $_SESSION['isEventEditor'] = $row['isEventEditor']; // Set the event editor status to be carried across this session |
27 | 27 | $_SESSION['onlyShowUserEvents'] = $users_start_with_myevents; // 1 if users_start_with_myevents is set in settings, can be changed by user during session |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | // admin section |
35 | 35 | if ($_SESSION['isAdmin'] == 1) { |
36 | - updateDatabase(); //check for db updates |
|
36 | + updateDatabase(); //check for db updates |
|
37 | 37 | //$_SESSION['onlyShowUserEvents'] = '0'; //show all events for admin, regardless what settings say |
38 | 38 | } |
39 | 39 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | $redirectFromSession = strip_tags($_SESSION['redirectUrl']); |
52 | 52 | unset($_SESSION['redirectUrl']); |
53 | 53 | // check is url is on same domain and prevents redirecting to logout page |
54 | - if (strncmp(strtolower(siteSettings()->getSiteUrl().'/'), strtolower($redirectFromSession), (strlen(siteSettings()->getSiteUrl()) + 1)) == 0 && strpos($redirectFromSession, 'logout.php') === false) { |
|
54 | + if (strncmp(strtolower(siteSettings()->getSiteUrl() . '/'), strtolower($redirectFromSession), (strlen(siteSettings()->getSiteUrl()) + 1)) == 0 && strpos($redirectFromSession, 'logout.php') === false) { |
|
55 | 55 | $redirectUrl = $redirectFromSession; |
56 | 56 | } |
57 | 57 | } |
58 | - header('Location: '.$redirectUrl); |
|
58 | + header('Location: ' . $redirectUrl); |
|
59 | 59 | exit; |
60 | 60 | } |
61 | 61 | } |
@@ -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 | |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | |
98 | 98 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
99 | 99 | $locationID = $row['id']; |
100 | - echo "<span id='".$locationID."' class='edit'>".$row['name'].'</span> '; |
|
101 | - echo " <a href='locations.php?locationremove=true&locationID=".$locationID."'><i class='fa fa-close'></i></a><br />"; |
|
100 | + echo "<span id='" . $locationID . "' class='edit'>" . $row['name'] . '</span> '; |
|
101 | + echo " <a href='locations.php?locationremove=true&locationID=" . $locationID . "'><i class='fa fa-close'></i></a><br />"; |
|
102 | 102 | } ?> |
103 | 103 | </div><!-- /.box-body --> |
104 | 104 | </div><!-- /.box --> |