@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $path = $this->router->pathFor('login-callback', ['provider' => $this->getAuthProviderSlug()]); |
| 45 | 45 | |
| 46 | - $url = $this->baseUrl.$path; |
|
| 46 | + $url = $this->baseUrl . $path; |
|
| 47 | 47 | |
| 48 | 48 | return $helper->getLoginUrl($url, $this->permissions); |
| 49 | 49 | } |
@@ -56,12 +56,12 @@ discard block |
||
| 56 | 56 | $accessToken = $helper->getAccessToken(); |
| 57 | 57 | } catch (FacebookResponseException $e) { |
| 58 | 58 | // When Graph returns an error |
| 59 | - echo 'Graph returned an error: '.$e->getMessage(); |
|
| 59 | + echo 'Graph returned an error: ' . $e->getMessage(); |
|
| 60 | 60 | |
| 61 | 61 | return false; |
| 62 | 62 | } catch (FacebookSDKException $e) { |
| 63 | 63 | // When validation fails or other local issues |
| 64 | - echo 'Facebook SDK returned an error: '.$e->getMessage(); |
|
| 64 | + echo 'Facebook SDK returned an error: ' . $e->getMessage(); |
|
| 65 | 65 | |
| 66 | 66 | return false; |
| 67 | 67 | } |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | if (!isset($accessToken)) { |
| 70 | 70 | if ($helper->getError()) { |
| 71 | 71 | header('HTTP/1.0 401 Unauthorized'); |
| 72 | - echo 'Error: '.$helper->getError()."\n"; |
|
| 73 | - echo 'Error Code: '.$helper->getErrorCode()."\n"; |
|
| 74 | - echo 'Error Reason: '.$helper->getErrorReason()."\n"; |
|
| 75 | - echo 'Error Description: '.$helper->getErrorDescription()."\n"; |
|
| 72 | + echo 'Error: ' . $helper->getError() . "\n"; |
|
| 73 | + echo 'Error Code: ' . $helper->getErrorCode() . "\n"; |
|
| 74 | + echo 'Error Reason: ' . $helper->getErrorReason() . "\n"; |
|
| 75 | + echo 'Error Description: ' . $helper->getErrorDescription() . "\n"; |
|
| 76 | 76 | } else { |
| 77 | 77 | header('HTTP/1.0 400 Bad Request'); |
| 78 | 78 | echo 'Bad request'; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | try { |
| 99 | 99 | $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
| 100 | 100 | } catch (FacebookSDKException $e) { |
| 101 | - echo '<p>Error getting long-lived access token: '.$helper->getMessage()."</p>\n\n"; |
|
| 101 | + echo '<p>Error getting long-lived access token: ' . $helper->getMessage() . "</p>\n\n"; |
|
| 102 | 102 | |
| 103 | 103 | return false; |
| 104 | 104 | } |
@@ -122,10 +122,10 @@ discard block |
||
| 122 | 122 | // Returns a `Facebook\FacebookResponse` object |
| 123 | 123 | $response = $this->facebook->get('/me?fields=id,name,email', $accessToken); |
| 124 | 124 | } catch (Facebook\Exceptions\FacebookResponseException $e) { |
| 125 | - echo 'Graph returned an error: '.$e->getMessage(); |
|
| 125 | + echo 'Graph returned an error: ' . $e->getMessage(); |
|
| 126 | 126 | exit; |
| 127 | 127 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 128 | - echo 'Facebook SDK returned an error: '.$e->getMessage(); |
|
| 128 | + echo 'Facebook SDK returned an error: ' . $e->getMessage(); |
|
| 129 | 129 | exit; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $container = $app->getContainer(); |
| 20 | 20 | |
| 21 | 21 | // TWIG view renderer |
| 22 | -$container['view'] = function ($c) { |
|
| 22 | +$container['view'] = function($c) { |
|
| 23 | 23 | $settings = $c->get('settings')['renderer']; |
| 24 | 24 | $view = new Twig($settings['template_path'], [ |
| 25 | 25 | 'cache' => false, // or 'path/to/cache' |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $env = $view->getEnvironment(); |
| 42 | 42 | $env->addGlobal('site', new Site()); |
| 43 | 43 | $env->addGlobal('currenturl', $c->get('request')->getUri()); |
| 44 | - $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath().'/'.$c->get('request')->getUri()->getPath()); |
|
| 44 | + $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath() . '/' . $c->get('request')->getUri()->getPath()); |
|
| 45 | 45 | |
| 46 | 46 | if (isset($_SESSION['userId'])) { |
| 47 | 47 | $u = UserQuery::create()->findPk($_SESSION['userId']); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | 56 | // monolog |
| 57 | -$container['logger'] = function ($c) { |
|
| 57 | +$container['logger'] = function($c) { |
|
| 58 | 58 | $settings = $c->get('settings')['logger']; |
| 59 | 59 | $logger = new Monolog\Logger($settings['name']); |
| 60 | 60 | $logger->pushProcessor(new Monolog\Processor\UidProcessor()); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | return $logger; |
| 64 | 64 | }; |
| 65 | 65 | |
| 66 | -$container['auth'] = function ($c) { |
|
| 66 | +$container['auth'] = function($c) { |
|
| 67 | 67 | $authConfig = getConfig()['auth']; |
| 68 | 68 | |
| 69 | 69 | // full domain e.g. https://example.com |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | break; |
| 82 | 82 | |
| 83 | 83 | case 'onebody': |
| 84 | - $url = $authConfig['onebody']['url'].'/'; |
|
| 84 | + $url = $authConfig['onebody']['url'] . '/'; |
|
| 85 | 85 | $email = new EmailAddress($authConfig['onebody']['email']); |
| 86 | 86 | $apiKey = $authConfig['onebody']['apiKey']; |
| 87 | 87 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | FROM cr_eventTypes et |
| 112 | 112 | WHERE id IN (SELECT e.type |
| 113 | 113 | FROM cr_events e |
| 114 | - WHERE '.$whereTwoMonth.' |
|
| 114 | + WHERE '.$whereTwoMonth . ' |
|
| 115 | 115 | AND e.removed = 0) |
| 116 | 116 | ORDER BY name'; |
| 117 | 117 | $result = mysqli_query(db(), $filter_sql) or die(mysqli_error(db())); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | <tr> |
| 133 | 133 | <td ><strong>Event</strong></td> |
| 134 | 134 | <?php |
| 135 | - $sql = 'SELECT * FROM cr_groups g ORDER BY '.$group_sorting_name; |
|
| 135 | + $sql = 'SELECT * FROM cr_groups g ORDER BY ' . $group_sorting_name; |
|
| 136 | 136 | $result = mysqli_query(db(), $sql) or die(mysqli_error(db())); |
| 137 | 137 | |
| 138 | 138 | while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | if ($filter == '') { |
| 164 | 164 | $sql .= ' |
| 165 | - AND '.$whereTwoMonth.' |
|
| 165 | + AND '.$whereTwoMonth . ' |
|
| 166 | 166 | ORDER BY |
| 167 | 167 | e.date'; |
| 168 | 168 | } elseif ($filter == 'all') { |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | } elseif ($filter != '') { |
| 173 | 173 | $sql .= " |
| 174 | 174 | AND e.type = '$filter' |
| 175 | - AND ".$whereTwoMonth.' |
|
| 175 | + AND " . $whereTwoMonth . ' |
|
| 176 | 176 | ORDER BY |
| 177 | 177 | e.date'; |
| 178 | 178 | } |
@@ -186,31 +186,31 @@ discard block |
||
| 186 | 186 | echo '<tr>'; |
| 187 | 187 | echo '<td >'; |
| 188 | 188 | setlocale(LC_TIME, $lang_locale); //de_DE |
| 189 | - echo '<a href="event.php?id='.$row['id'].'">'; |
|
| 189 | + echo '<a href="event.php?id=' . $row['id'] . '">'; |
|
| 190 | 190 | echo strftime($time_format_short, strtotime($row['sundayDate'])); // %a, <strong>%e. %b</strong>, KW%V |
| 191 | 191 | echo '</a>'; |
| 192 | 192 | |
| 193 | 193 | //$row['sundayDate'] |
| 194 | 194 | if (!empty($row['eventType'])) { |
| 195 | - echo '<br /><em> '.$row['eventType'].'</em>'; |
|
| 195 | + echo '<br /><em> ' . $row['eventType'] . '</em>'; |
|
| 196 | 196 | } |
| 197 | 197 | if (!empty($row['eventSubType'])) { |
| 198 | - echo ' - <em>'.$row['eventSubType'].'</em>'; |
|
| 198 | + echo ' - <em>' . $row['eventSubType'] . '</em>'; |
|
| 199 | 199 | } |
| 200 | 200 | if (!empty($row['eventLocation'])) { |
| 201 | - echo '<br /><em> '.$row['eventLocation'].'</em>'; |
|
| 201 | + echo '<br /><em> ' . $row['eventLocation'] . '</em>'; |
|
| 202 | 202 | } |
| 203 | 203 | if (!empty($row['name'])) { |
| 204 | - echo '<br /><em> '.$row['name'].'</em>'; |
|
| 204 | + echo '<br /><em> ' . $row['name'] . '</em>'; |
|
| 205 | 205 | } |
| 206 | 206 | if (!empty($row['eventGroup'])) { |
| 207 | - echo '<br /><strong> '.$row['eventGroup'].'</strong>'; |
|
| 207 | + echo '<br /><strong> ' . $row['eventGroup'] . '</strong>'; |
|
| 208 | 208 | } |
| 209 | 209 | if (!empty($row['sermonTitle'])) { |
| 210 | - echo ': '.$row['sermonTitle']; |
|
| 210 | + echo ': ' . $row['sermonTitle']; |
|
| 211 | 211 | } |
| 212 | 212 | if (!empty($row['bibleVerse'])) { |
| 213 | - echo ' <em>('.$row['bibleVerse'].')</em>'; |
|
| 213 | + echo ' <em>(' . $row['bibleVerse'] . ')</em>'; |
|
| 214 | 214 | } |
| 215 | 215 | echo '</td>'; |
| 216 | 216 | |
@@ -242,16 +242,16 @@ discard block |
||
| 242 | 242 | if ($previousName == '') { |
| 243 | 243 | // new name |
| 244 | 244 | echo ($viewPeople['userId'] == $sessionUserId) ? '<strong class="me">' : ''; |
| 245 | - echo $name.' <em>('.$viewPeople['role']; |
|
| 245 | + echo $name . ' <em>(' . $viewPeople['role']; |
|
| 246 | 246 | } elseif ($previousName != $name) { |
| 247 | 247 | echo ')</em>'; |
| 248 | 248 | echo ($viewPeople['userId'] != $sessionUserId) ? '</strong>' : ''; |
| 249 | 249 | echo '<br />'; // line break from previous name |
| 250 | 250 | // new name |
| 251 | 251 | echo ($viewPeople['userId'] == $sessionUserId) ? '<strong class="me">' : ''; |
| 252 | - echo $name.' <em>('.$viewPeople['role']; |
|
| 252 | + echo $name . ' <em>(' . $viewPeople['role']; |
|
| 253 | 253 | } else { |
| 254 | - echo ', '.$viewPeople['role']; |
|
| 254 | + echo ', ' . $viewPeople['role']; |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | $peopleInEvent = true; |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | if (!empty($_GET['id'])) { |
| 4 | - header('Location: ../event/'.(int) $_GET['id']); |
|
| 4 | + header('Location: ../event/' . (int) $_GET['id']); |
|
| 5 | 5 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | <br> |
| 47 | 47 | The following error has occurred |
| 48 | 48 | <?php |
| 49 | -echo " on page '".$page."':<br><br>"; |
|
| 49 | +echo " on page '" . $page . "':<br><br>"; |
|
| 50 | 50 | echo '<strong>'; |
| 51 | 51 | |
| 52 | 52 | switch ($no) { |
@@ -87,23 +87,23 @@ |
||
| 87 | 87 | WHERE |
| 88 | 88 | date >= CURDATE() |
| 89 | 89 | AND date_format( date , "%y-%m-%d" ) |
| 90 | - <= date_format( DATE_ADD(now(), INTERVAL '.$daysAlert.' DAY ) , "%y-%m-%d" )'; |
|
| 90 | + <= date_format( DATE_ADD(now(), INTERVAL '.$daysAlert . ' DAY ) , "%y-%m-%d" )'; |
|
| 91 | 91 | $resultEvents = mysqli_query(db(), $sqlEvents) or die(mysqli_error(db())); |
| 92 | 92 | $i = 0; |
| 93 | 93 | while ($rowEvents = mysqli_fetch_array($resultEvents, MYSQLI_ASSOC)) { |
| 94 | 94 | $usersNotified = notifyEveryoneForEvent($rowEvents['id']); |
| 95 | 95 | if (count($usersNotified) > 0) { |
| 96 | - $out = $out.'Automatic notifications sent to users ('.implode(', ', $usersNotified).') for event '.$rowEvents['id'].' on '.$rowEvents['date'].".<br>\r\n"; |
|
| 96 | + $out = $out . 'Automatic notifications sent to users (' . implode(', ', $usersNotified) . ') for event ' . $rowEvents['id'] . ' on ' . $rowEvents['date'] . ".<br>\r\n"; |
|
| 97 | 97 | } else { |
| 98 | - $out = $out.'No notifications sent for event '.$rowEvents['id'].' on '.$rowEvents['date'].".<br>\r\n"; |
|
| 98 | + $out = $out . 'No notifications sent for event ' . $rowEvents['id'] . ' on ' . $rowEvents['date'] . ".<br>\r\n"; |
|
| 99 | 99 | } |
| 100 | 100 | $i = $i + 1; |
| 101 | 101 | } |
| 102 | 102 | if ($i == 0) { |
| 103 | - $out = $out.'No events found to automatically notify for.'; |
|
| 103 | + $out = $out . 'No events found to automatically notify for.'; |
|
| 104 | 104 | } |
| 105 | 105 | } else { |
| 106 | - $out = $out.'Automatic notifications are disabled.'; |
|
| 106 | + $out = $out . 'Automatic notifications are disabled.'; |
|
| 107 | 107 | } ?> |
| 108 | 108 | <html> |
| 109 | 109 | <body> |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | namespace TechWilk\Rota; |
| 4 | 4 | |
| 5 | 5 | if (!empty($_GET['id'])) { |
| 6 | - header('Location: ../user/'.(int) $_GET['id'].'/password'); |
|
| 6 | + header('Location: ../user/' . (int) $_GET['id'] . '/password'); |
|
| 7 | 7 | exit; |
| 8 | 8 | } |
| 9 | 9 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | public function getLoginAuth(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 80 | 80 | { |
| 81 | - $this->logger->info("Login auth GET '/login/".$args['provider']."'"); |
|
| 81 | + $this->logger->info("Login auth GET '/login/" . $args['provider'] . "'"); |
|
| 82 | 82 | |
| 83 | 83 | // login |
| 84 | 84 | $authUrl = $this->auth->getCallbackUrl(); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | public function getLoginCallback(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 90 | 90 | { |
| 91 | - $this->logger->info("Login auth GET '/login/".$args['provider']."/callback'"); |
|
| 91 | + $this->logger->info("Login auth GET '/login/" . $args['provider'] . "/callback'"); |
|
| 92 | 92 | |
| 93 | 93 | // login |
| 94 | 94 | try { |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public function getResourceEditForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 63 | 63 | { |
| 64 | - $this->logger->info("Fetch resource GET '/resource/".$args['id']."/edit'"); |
|
| 64 | + $this->logger->info("Fetch resource GET '/resource/" . $args['id'] . "/edit'"); |
|
| 65 | 65 | $d = DocumentQuery::create()->findPK($args['id']); |
| 66 | 66 | |
| 67 | 67 | if (!is_null($d)) { |
@@ -73,15 +73,15 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | public function getResourceFile(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 75 | 75 | { |
| 76 | - $this->logger->info("Fetch resource GET '/resource/".$args['id']."'"); |
|
| 76 | + $this->logger->info("Fetch resource GET '/resource/" . $args['id'] . "'"); |
|
| 77 | 77 | $resource = DocumentQuery::create()->findPk($args['id']); |
| 78 | - $directory = __DIR__.'/../../../documents/'; |
|
| 78 | + $directory = __DIR__ . '/../../../documents/'; |
|
| 79 | 79 | |
| 80 | 80 | if (!is_null($resource)) { |
| 81 | - if (file_exists($directory.$resource->getUrl())) { |
|
| 82 | - $file = $directory.$resource->getUrl(); |
|
| 83 | - } elseif (file_exists($directory.$resource->getId())) { |
|
| 84 | - $file = $directory.$resource->getId(); |
|
| 81 | + if (file_exists($directory . $resource->getUrl())) { |
|
| 82 | + $file = $directory . $resource->getUrl(); |
|
| 83 | + } elseif (file_exists($directory . $resource->getId())) { |
|
| 84 | + $file = $directory . $resource->getId(); |
|
| 85 | 85 | } else { |
| 86 | 86 | return $this->view->render($response, 'error.twig'); |
| 87 | 87 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ->withHeader('Content-Type', 'application/download') |
| 96 | 96 | ->withHeader('Content-Description', 'File Transfer') |
| 97 | 97 | ->withHeader('Content-Transfer-Encoding', 'binary') |
| 98 | - ->withHeader('Content-Disposition', 'attachment; filename="'.$resource->getUrl().'"') |
|
| 98 | + ->withHeader('Content-Disposition', 'attachment; filename="' . $resource->getUrl() . '"') |
|
| 99 | 99 | ->withHeader('Expires', '0') |
| 100 | 100 | ->withHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0') |
| 101 | 101 | ->withHeader('Pragma', 'public') |