@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | public function getGroup(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 15 | 15 | { |
| 16 | - $this->logger->info("Fetch group GET '/group/".$args['id']."'"); |
|
| 16 | + $this->logger->info("Fetch group GET '/group/" . $args['id'] . "'"); |
|
| 17 | 17 | $events = EventQuery::create() |
| 18 | 18 | ->useEventPersonQuery() |
| 19 | 19 | ->useUserRoleQuery() |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | public function getGroupRoles(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 38 | 38 | { |
| 39 | - $this->logger->info("Fetch group roles GET '/group/".$args['id']."/roles'"); |
|
| 39 | + $this->logger->info("Fetch group roles GET '/group/" . $args['id'] . "/roles'"); |
|
| 40 | 40 | $events = EventQuery::create() |
| 41 | 41 | ->useEventPersonQuery() |
| 42 | 42 | ->useUserRoleQuery() |
@@ -58,14 +58,14 @@ discard block |
||
| 58 | 58 | ->findPk($args['id']); |
| 59 | 59 | |
| 60 | 60 | // temporary redirect |
| 61 | - return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home').'old/roles.php'); |
|
| 61 | + return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home') . 'old/roles.php'); |
|
| 62 | 62 | |
| 63 | 63 | return $this->view->render($response, 'group-roles.twig', ['events' => $events, 'group' => $group]); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | public function postGroup(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 67 | 67 | { |
| 68 | - $this->logger->info("Create/edit group POST '/group/".$args['id']."'"); |
|
| 68 | + $this->logger->info("Create/edit group POST '/group/" . $args['id'] . "'"); |
|
| 69 | 69 | |
| 70 | 70 | $group = new Group(); |
| 71 | 71 | |
@@ -20,35 +20,35 @@ discard block |
||
| 20 | 20 | // USER |
| 21 | 21 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 22 | 22 | |
| 23 | -$app->group('/user', function () { |
|
| 24 | - $this->get('s', UserController::class.':getAllUsers')->setName('users'); |
|
| 23 | +$app->group('/user', function() { |
|
| 24 | + $this->get('s', UserController::class . ':getAllUsers')->setName('users'); |
|
| 25 | 25 | |
| 26 | - $this->get('/{id}/widget-only', UserController::class.':getUserWidgetOnly')->setName('user-widget-only'); |
|
| 26 | + $this->get('/{id}/widget-only', UserController::class . ':getUserWidgetOnly')->setName('user-widget-only'); |
|
| 27 | 27 | |
| 28 | - $this->get('/new', UserController::class.':getNewUserForm')->setName('user-new'); |
|
| 29 | - $this->get('/{id}/edit', UserController::class.':getUserEditForm')->setName('user-edit'); |
|
| 30 | - $this->get('/{id}/password', UserController::class.':getUserPasswordForm')->setName('user-password'); |
|
| 28 | + $this->get('/new', UserController::class . ':getNewUserForm')->setName('user-new'); |
|
| 29 | + $this->get('/{id}/edit', UserController::class . ':getUserEditForm')->setName('user-edit'); |
|
| 30 | + $this->get('/{id}/password', UserController::class . ':getUserPasswordForm')->setName('user-password'); |
|
| 31 | 31 | |
| 32 | - $this->get('/me', UserController::class.':getCurrentUser')->setName('user-me'); |
|
| 33 | - $this->get('/{id}', UserController::class.':getUser')->setName('user'); |
|
| 32 | + $this->get('/me', UserController::class . ':getCurrentUser')->setName('user-me'); |
|
| 33 | + $this->get('/{id}', UserController::class . ':getUser')->setName('user'); |
|
| 34 | 34 | |
| 35 | - $this->post('[/{id}]', UserController::class.':postUser')->setName('user-post'); |
|
| 36 | - $this->post('/{id}/password', UserController::class.':postUserPasswordChange')->setName('user-password-post'); |
|
| 35 | + $this->post('[/{id}]', UserController::class . ':postUser')->setName('user-post'); |
|
| 36 | + $this->post('/{id}/password', UserController::class . ':postUserPasswordChange')->setName('user-password-post'); |
|
| 37 | 37 | |
| 38 | 38 | // roles |
| 39 | - $this->get('/{id}/roles', RoleController::class.':getAssignRolesForm')->setName('user-roles'); |
|
| 40 | - $this->post('/{id}/roles', RoleController::class.':postUserAssignRoles')->setName('user-assign-post'); |
|
| 39 | + $this->get('/{id}/roles', RoleController::class . ':getAssignRolesForm')->setName('user-roles'); |
|
| 40 | + $this->post('/{id}/roles', RoleController::class . ':postUserAssignRoles')->setName('user-assign-post'); |
|
| 41 | 41 | |
| 42 | 42 | // availability |
| 43 | - $this->get('/{id}/availability', AvailabilityController::class.':getAvailabilityForm')->setName('user-availability'); |
|
| 44 | - $this->post('/{id}/availability', AvailabilityController::class.':postAvailability')->setName('user-availability-post'); |
|
| 43 | + $this->get('/{id}/availability', AvailabilityController::class . ':getAvailabilityForm')->setName('user-availability'); |
|
| 44 | + $this->post('/{id}/availability', AvailabilityController::class . ':postAvailability')->setName('user-availability-post'); |
|
| 45 | 45 | |
| 46 | 46 | // calendar |
| 47 | - $this->group('/me/calendar', function () { |
|
| 48 | - $this->get('s', CalendarController::class.':getCalendarTokens')->setName('user-calendars'); |
|
| 49 | - $this->get('/new', CalendarController::class.':getNewCalendarForm')->setName('user-calendars'); |
|
| 50 | - $this->get('/{id}/revoke', CalendarController::class.':getRevokeCalendar')->setName('user-calendar-revoke'); |
|
| 51 | - $this->post('/new', CalendarController::class.':postNewCalendar')->setName('user-calendar-new-post'); |
|
| 47 | + $this->group('/me/calendar', function() { |
|
| 48 | + $this->get('s', CalendarController::class . ':getCalendarTokens')->setName('user-calendars'); |
|
| 49 | + $this->get('/new', CalendarController::class . ':getNewCalendarForm')->setName('user-calendars'); |
|
| 50 | + $this->get('/{id}/revoke', CalendarController::class . ':getRevokeCalendar')->setName('user-calendar-revoke'); |
|
| 51 | + $this->post('/new', CalendarController::class . ':postNewCalendar')->setName('user-calendar-new-post'); |
|
| 52 | 52 | }); |
| 53 | 53 | }); |
| 54 | 54 | |
@@ -56,100 +56,100 @@ discard block |
||
| 56 | 56 | // EVENT |
| 57 | 57 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 58 | 58 | |
| 59 | -$app->group('/event', function () { |
|
| 60 | - $this->get('s', EventController::class.':getAllEvents')->setName('events'); |
|
| 61 | - $this->get('s/type/{id}', EventController::class.':getAllEventsWithType')->setName('events-eventtype'); |
|
| 62 | - $this->get('s/subtype/{id}', EventController::class.':getAllEventsWithSubType')->setName('events-eventsubtype'); |
|
| 59 | +$app->group('/event', function() { |
|
| 60 | + $this->get('s', EventController::class . ':getAllEvents')->setName('events'); |
|
| 61 | + $this->get('s/type/{id}', EventController::class . ':getAllEventsWithType')->setName('events-eventtype'); |
|
| 62 | + $this->get('s/subtype/{id}', EventController::class . ':getAllEventsWithSubType')->setName('events-eventsubtype'); |
|
| 63 | 63 | |
| 64 | - $this->get('s/print/preachers', EventController::class.':getAllEventsToPrint')->setName('events-print'); |
|
| 64 | + $this->get('s/print/preachers', EventController::class . ':getAllEventsToPrint')->setName('events-print'); |
|
| 65 | 65 | |
| 66 | - $this->get('/new', EventController::class.':getNewEventForm')->setName('event-new'); |
|
| 67 | - $this->get('/{id}/edit', EventController::class.':getEventEditForm')->setName('event-edit'); |
|
| 68 | - $this->get('/{id}/copy', EventController::class.':getEventCopyForm')->setName('event-copy'); |
|
| 69 | - $this->get('/{id}/assign', EventController::class.':getEventAssignForm')->setName('event-assign'); |
|
| 66 | + $this->get('/new', EventController::class . ':getNewEventForm')->setName('event-new'); |
|
| 67 | + $this->get('/{id}/edit', EventController::class . ':getEventEditForm')->setName('event-edit'); |
|
| 68 | + $this->get('/{id}/copy', EventController::class . ':getEventCopyForm')->setName('event-copy'); |
|
| 69 | + $this->get('/{id}/assign', EventController::class . ':getEventAssignForm')->setName('event-assign'); |
|
| 70 | 70 | |
| 71 | - $this->get('/{id}', EventController::class.':getEvent')->setName('event'); |
|
| 71 | + $this->get('/{id}', EventController::class . ':getEvent')->setName('event'); |
|
| 72 | 72 | |
| 73 | - $this->post('[/{id}]', EventController::class.':postEvent')->setName('event-post'); |
|
| 74 | - $this->post('/{id}/assign', EventController::class.':postEventAssign')->setName('event-assign-post'); |
|
| 73 | + $this->post('[/{id}]', EventController::class . ':postEvent')->setName('event-post'); |
|
| 74 | + $this->post('/{id}/assign', EventController::class . ':postEventAssign')->setName('event-assign-post'); |
|
| 75 | 75 | }); |
| 76 | 76 | |
| 77 | 77 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 78 | 78 | // RESOURCE |
| 79 | 79 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 80 | 80 | |
| 81 | -$app->group('/resource', function () { |
|
| 82 | - $this->get('s', ResourceController::class.':getAllResources')->setName('resources'); |
|
| 81 | +$app->group('/resource', function() { |
|
| 82 | + $this->get('s', ResourceController::class . ':getAllResources')->setName('resources'); |
|
| 83 | 83 | |
| 84 | - $this->get('[/new]', ResourceController::class.':getNewResourceForm')->setName('resource-new'); |
|
| 85 | - $this->get('/{id}/edit', ResourceController::class.':getResourceEditForm')->setName('resource-edit'); |
|
| 84 | + $this->get('[/new]', ResourceController::class . ':getNewResourceForm')->setName('resource-new'); |
|
| 85 | + $this->get('/{id}/edit', ResourceController::class . ':getResourceEditForm')->setName('resource-edit'); |
|
| 86 | 86 | |
| 87 | - $this->get('/{id}', ResourceController::class.':getResourceFile')->setName('resource'); |
|
| 87 | + $this->get('/{id}', ResourceController::class . ':getResourceFile')->setName('resource'); |
|
| 88 | 88 | |
| 89 | - $this->post('[/{id}]', ResourceController::class.':postResource')->setName('resource-post'); |
|
| 89 | + $this->post('[/{id}]', ResourceController::class . ':postResource')->setName('resource-post'); |
|
| 90 | 90 | }); |
| 91 | 91 | |
| 92 | 92 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 93 | 93 | // ROLES & GROUPS |
| 94 | 94 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 95 | 95 | |
| 96 | -$app->group('/group', function () { |
|
| 97 | - $this->get('/{id}', GroupController::class.':getGroup')->setName('group'); |
|
| 98 | - $this->get('/{id}/roles', GroupController::class.':getGroupRoles')->setName('group-roles'); |
|
| 96 | +$app->group('/group', function() { |
|
| 97 | + $this->get('/{id}', GroupController::class . ':getGroup')->setName('group'); |
|
| 98 | + $this->get('/{id}/roles', GroupController::class . ':getGroupRoles')->setName('group-roles'); |
|
| 99 | 99 | |
| 100 | - $this->post('[/{id}]', GroupController::class.':postGroup')->setName('group-post'); |
|
| 100 | + $this->post('[/{id}]', GroupController::class . ':postGroup')->setName('group-post'); |
|
| 101 | 101 | }); |
| 102 | 102 | |
| 103 | 103 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 104 | 104 | // AUTH |
| 105 | 105 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 106 | 106 | |
| 107 | -$app->get('/login', AuthController::class.':getLoginForm')->setName('login'); |
|
| 107 | +$app->get('/login', AuthController::class . ':getLoginForm')->setName('login'); |
|
| 108 | 108 | |
| 109 | -$app->get('/login/{provider}', AuthController::class.':getLoginAuth')->setName('login-auth'); |
|
| 110 | -$app->get('/login/{provider}/callback', AuthController::class.':getLoginCallback')->setName('login-callback'); |
|
| 111 | -$app->get('/signup', PendingUserController::class.':getSignUpForm')->setName('sign-up'); |
|
| 112 | -$app->get('/signup/cancel', PendingUserController::class.':getSignUpCancel')->setName('sign-up-cancel'); |
|
| 109 | +$app->get('/login/{provider}', AuthController::class . ':getLoginAuth')->setName('login-auth'); |
|
| 110 | +$app->get('/login/{provider}/callback', AuthController::class . ':getLoginCallback')->setName('login-callback'); |
|
| 111 | +$app->get('/signup', PendingUserController::class . ':getSignUpForm')->setName('sign-up'); |
|
| 112 | +$app->get('/signup/cancel', PendingUserController::class . ':getSignUpCancel')->setName('sign-up-cancel'); |
|
| 113 | 113 | |
| 114 | -$app->get('/logout', AuthController::class.':getLogout')->setName('logout'); |
|
| 114 | +$app->get('/logout', AuthController::class . ':getLogout')->setName('logout'); |
|
| 115 | 115 | |
| 116 | -$app->post('/login', AuthController::class.':postLogin')->setName('login-post'); |
|
| 117 | -$app->post('/signup', PendingUserController::class.':postSignUp')->setName('sign-up-post'); |
|
| 116 | +$app->post('/login', AuthController::class . ':postLogin')->setName('login-post'); |
|
| 117 | +$app->post('/signup', PendingUserController::class . ':postSignUp')->setName('sign-up-post'); |
|
| 118 | 118 | |
| 119 | 119 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 120 | 120 | // NOTIFICATIONS |
| 121 | 121 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 122 | 122 | |
| 123 | -$app->get('/notification/{id}[/{referrer}]', NotificationController::class.':getNotificationClick')->setName('notification'); |
|
| 123 | +$app->get('/notification/{id}[/{referrer}]', NotificationController::class . ':getNotificationClick')->setName('notification'); |
|
| 124 | 124 | |
| 125 | 125 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 126 | 126 | // CALENDAR |
| 127 | 127 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 128 | 128 | |
| 129 | -$app->get('/calendar/{token}.{format}', CalendarController::class.':getRenderedCalendar')->setName('user-calendar'); |
|
| 129 | +$app->get('/calendar/{token}.{format}', CalendarController::class . ':getRenderedCalendar')->setName('user-calendar'); |
|
| 130 | 130 | |
| 131 | 131 | // legacy |
| 132 | -$app->get('/calendar.php', CalendarController::class.':getLegacyRenderedCalendar')->setName('user-calendar'); |
|
| 132 | +$app->get('/calendar.php', CalendarController::class . ':getLegacyRenderedCalendar')->setName('user-calendar'); |
|
| 133 | 133 | |
| 134 | 134 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 135 | 135 | // OTHER |
| 136 | 136 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 137 | 137 | |
| 138 | -$app->get('/settings', function ($request, $response, $args) { |
|
| 138 | +$app->get('/settings', function($request, $response, $args) { |
|
| 139 | 139 | // Sample log message |
| 140 | 140 | $this->logger->info("Fetch settings GET '/settings'"); |
| 141 | 141 | |
| 142 | - $url = $this->router->pathFor('home').'old/settings.php'; |
|
| 142 | + $url = $this->router->pathFor('home') . 'old/settings.php'; |
|
| 143 | 143 | |
| 144 | 144 | return $response->withStatus(303)->withHeader('Location', $url); |
| 145 | 145 | //return $this->view->render($response, 'settings.twig', []); |
| 146 | 146 | })->setName('settings'); |
| 147 | 147 | |
| 148 | -$app->get('/token', function ($request, $response, $args) { |
|
| 148 | +$app->get('/token', function($request, $response, $args) { |
|
| 149 | 149 | return $response->getBody()->write(Crypt::generateToken(30)); |
| 150 | 150 | })->setName('token'); |
| 151 | 151 | |
| 152 | -$app->get('/', function ($request, $response, $args) { |
|
| 152 | +$app->get('/', function($request, $response, $args) { |
|
| 153 | 153 | // Sample log message |
| 154 | 154 | $this->logger->info("Fetch home GET '/'"); |
| 155 | 155 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | if (!isAdmin()) { |
| 17 | - header('Location: error.php?no=100&page='.basename($_SERVER['SCRIPT_FILENAME'])); |
|
| 17 | + header('Location: error.php?no=100&page=' . basename($_SERVER['SCRIPT_FILENAME'])); |
|
| 18 | 18 | exit; |
| 19 | 19 | } |
| 20 | 20 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | if ($role && $assignTo) { |
| 35 | 35 | $sql = "UPDATE cr_roles r SET r.groupId = '$assignTo' WHERE r.id = '$role'"; |
| 36 | 36 | if (!mysqli_query(db(), $sql)) { |
| 37 | - die('Error: '.mysqli_error(db())); |
|
| 37 | + die('Error: ' . mysqli_error(db())); |
|
| 38 | 38 | } |
| 39 | 39 | header('Location: roles.php'); |
| 40 | 40 | exit; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $sql = "INSERT INTO cr_roles (name, description, rehersalId, groupId) |
| 71 | 71 | VALUES ('$newrole', '$newrole', $rehersal, $groupId)"; |
| 72 | 72 | if (!mysqli_query(db(), $sql)) { |
| 73 | - die('Error: '.mysqli_error(db())); |
|
| 73 | + die('Error: ' . mysqli_error(db())); |
|
| 74 | 74 | } |
| 75 | 75 | } else { |
| 76 | 76 | // Handle renaming of the roles |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | $i = 1; |
| 104 | 104 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
| 105 | 105 | if ($type == 'option') { |
| 106 | - $list = $list."<option value='".$row['id']."'>".$row['name'].'</option>'; |
|
| 106 | + $list = $list . "<option value='" . $row['id'] . "'>" . $row['name'] . '</option>'; |
|
| 107 | 107 | } elseif ($type == 'li') { |
| 108 | - $list = $list.'<li>'.$row['name'].'</li>'; |
|
| 108 | + $list = $list . '<li>' . $row['name'] . '</li>'; |
|
| 109 | 109 | } elseif ($type == 'li-a') { |
| 110 | - $list = $list."<li><a href='roles.php?role=".$roleId.'&assignto='.$row['id']."'>".$row['name'].'</a></li>'; |
|
| 110 | + $list = $list . "<li><a href='roles.php?role=" . $roleId . '&assignto=' . $row['id'] . "'>" . $row['name'] . '</a></li>'; |
|
| 111 | 111 | } |
| 112 | 112 | $i++; |
| 113 | 113 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | $group = $row['groupId']; |
| 174 | 174 | $down = $group + 1; |
| 175 | 175 | $up = $group - 1; |
| 176 | - echo '<div><strong>'.$groupname.'</strong><br />'; |
|
| 176 | + echo '<div><strong>' . $groupname . '</strong><br />'; |
|
| 177 | 177 | } |
| 178 | 178 | // Print text input box if a role exists for the group. |
| 179 | 179 | // Allows user to update role names and move roles between groups |