@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $base_uri = $this->guzzle->getConfig()['base_uri']; |
| 72 | 72 | |
| 73 | 73 | if (strlen($base_uri) > 0) { |
| 74 | - $url = $base_uri.'/account/new?forgot=true'; |
|
| 74 | + $url = $base_uri . '/account/new?forgot=true'; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $url; |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | public static function generateInt($min, $max) |
| 33 | 33 | { |
| 34 | 34 | if ($min >= $max) { |
| 35 | - throw new InvalidArgumentException('Invalid constraints - minimum ('.$min.') is above the maximum ('.$max.')'); |
|
| 35 | + throw new InvalidArgumentException('Invalid constraints - minimum (' . $min . ') is above the maximum (' . $max . ')'); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | if (function_exists('random_int')) { // use secure random numbers when available |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | { |
| 15 | 15 | public function getAvailabilityForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 16 | 16 | { |
| 17 | - $this->logger->info("Fetch user availability GET '/user/".$args['id']."/availability'"); |
|
| 17 | + $this->logger->info("Fetch user availability GET '/user/" . $args['id'] . "/availability'"); |
|
| 18 | 18 | |
| 19 | 19 | $u = UserQuery::create()->findPk($args['id']); |
| 20 | 20 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function postAvailability(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 35 | 35 | { |
| 36 | - $this->logger->info("Update user availability POST '/user/".$args['id']."/availability'"); |
|
| 36 | + $this->logger->info("Update user availability POST '/user/" . $args['id'] . "/availability'"); |
|
| 37 | 37 | |
| 38 | 38 | $u = UserQuery::create() |
| 39 | 39 | ->findPk($args['id']); |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | $a->setAvailable(false); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if (strlen($data['event'.$eventId.'comment']) > 0) { |
|
| 66 | - $a->setComment($data['event'.$eventId.'comment']); |
|
| 65 | + if (strlen($data['event' . $eventId . 'comment']) > 0) { |
|
| 66 | + $a->setComment($data['event' . $eventId . 'comment']); |
|
| 67 | 67 | } else { |
| 68 | 68 | $a->setComment(null); |
| 69 | 69 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | public function getAssignRolesForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 15 | 15 | { |
| 16 | - $this->logger->info("Fetch user GET '/user/".$args['id']."/roles'"); |
|
| 16 | + $this->logger->info("Fetch user GET '/user/" . $args['id'] . "/roles'"); |
|
| 17 | 17 | $r = RoleQuery::create()->find(); |
| 18 | 18 | $u = UserQuery::create()->findPK($args['id']); |
| 19 | 19 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function postUserAssignRoles(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 28 | 28 | { |
| 29 | - $this->logger->info("Create user people POST '/user/".$args['id']."/roles'"); |
|
| 29 | + $this->logger->info("Create user people POST '/user/" . $args['id'] . "/roles'"); |
|
| 30 | 30 | |
| 31 | 31 | $userId = filter_var($args['id'], FILTER_SANITIZE_NUMBER_INT); |
| 32 | 32 | $existingRoles = RoleQuery::create()->useUserRoleQuery()->filterByUserId($userId)->endUse()->find(); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | public function getRevokeCalendar(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 78 | 78 | { |
| 79 | - $this->logger->info("Fetch settings GET '/user/me/calendar/".$args['id']."/revoke'"); |
|
| 79 | + $this->logger->info("Fetch settings GET '/user/me/calendar/" . $args['id'] . "/revoke'"); |
|
| 80 | 80 | |
| 81 | 81 | $auth = $this->auth; |
| 82 | 82 | $u = $auth->currentUser(); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | public function getRenderedCalendar(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 103 | 103 | { |
| 104 | - $this->logger->info("Fetch calendar GET '/calendar/".$args['token'].'.'.$args['format']."'"); |
|
| 104 | + $this->logger->info("Fetch calendar GET '/calendar/" . $args['token'] . '.' . $args['format'] . "'"); |
|
| 105 | 105 | |
| 106 | 106 | $c = CalendarTokenQuery::create() |
| 107 | 107 | ->filterByToken($args['token']) |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | { |
| 119 | 119 | $getParameters = $request->getQueryParams(); |
| 120 | 120 | |
| 121 | - $this->logger->info("Fetch -LEGACY- calendar GET '/calendar.php?user=".$getParameters['user'].'&token='.$getParameters['token'].'&format='.$getParameters['format']."'"); |
|
| 121 | + $this->logger->info("Fetch -LEGACY- calendar GET '/calendar.php?user=" . $getParameters['user'] . '&token=' . $getParameters['token'] . '&format=' . $getParameters['format'] . "'"); |
|
| 122 | 122 | |
| 123 | 123 | $userId = filter_var($getParameters['user'], FILTER_VALIDATE_INT); |
| 124 | 124 | $token = $getParameters['token']; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | if (filter_var(trim($email), FILTER_VALIDATE_EMAIL)) { |
| 14 | 14 | $this->email = filter_var(trim($email), FILTER_SANITIZE_EMAIL); |
| 15 | 15 | } else { |
| 16 | - throw new InvalidArgumentException('Invalid email address: '.$email); |
|
| 16 | + throw new InvalidArgumentException('Invalid email address: ' . $email); |
|
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | |
@@ -42,12 +42,12 @@ |
||
| 42 | 42 | |
| 43 | 43 | $ret = ''; |
| 44 | 44 | |
| 45 | - $chars = 26 * 2 + 10; //26 (a-z) + 26 (A-Z) + 10 (0-9) |
|
| 45 | + $chars = 26 * 2 + 10; //26 (a-z) + 26 (A-Z) + 10 (0-9) |
|
| 46 | 46 | //a-z = 97-122 |
| 47 | 47 | //A-Z = 65-90 |
| 48 | 48 | //0-9 = 48-57 |
| 49 | 49 | |
| 50 | - srand(make_seed()); //Seed with microseconds |
|
| 50 | + srand(make_seed()); //Seed with microseconds |
|
| 51 | 51 | //if you don't need this, you can just use srand(time()); |
| 52 | 52 | |
| 53 | 53 | for ($i = 1; $i <= $length; $i++) { |
@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | function facebook() |
| 17 | 17 | { |
| 18 | 18 | $fb = new Facebook\Facebook([ |
| 19 | - 'app_id' => siteConfig()['auth']['facebook']['appId'], |
|
| 20 | - 'app_secret' => siteConfig()['auth']['facebook']['appSecret'], |
|
| 21 | - 'default_graph_version' => 'v2.2', |
|
| 22 | - ]); |
|
| 19 | + 'app_id' => siteConfig()['auth']['facebook']['appId'], |
|
| 20 | + 'app_secret' => siteConfig()['auth']['facebook']['appSecret'], |
|
| 21 | + 'default_graph_version' => 'v2.2', |
|
| 22 | + ]); |
|
| 23 | 23 | |
| 24 | 24 | return $fb; |
| 25 | 25 | } |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | $tokenMetadata = $oAuth2Client->debugToken($accessToken); |
| 67 | 67 | |
| 68 | 68 | // Validation (these will throw FacebookSDKException's when they fail) |
| 69 | - $tokenMetadata->validateAppId($config['auth']['facebook']['appId']); // Replace {app-id} with your app id |
|
| 70 | - // If you know the user ID this access token belongs to, you can validate it here |
|
| 71 | - //$tokenMetadata->validateUserId('123'); |
|
| 72 | - $tokenMetadata->validateExpiration(); |
|
| 69 | + $tokenMetadata->validateAppId($config['auth']['facebook']['appId']); // Replace {app-id} with your app id |
|
| 70 | + // If you know the user ID this access token belongs to, you can validate it here |
|
| 71 | + //$tokenMetadata->validateUserId('123'); |
|
| 72 | + $tokenMetadata->validateExpiration(); |
|
| 73 | 73 | |
| 74 | 74 | if (!$accessToken->isLongLived()) { |
| 75 | 75 | // Exchanges a short-lived access token for a long-lived one |
@@ -38,21 +38,21 @@ discard block |
||
| 38 | 38 | echo var_dump($accessToken); |
| 39 | 39 | } catch (Facebook\Exceptions\FacebookResponseException $e) { |
| 40 | 40 | // When Graph returns an error |
| 41 | - echo 'Graph returned an error: '.$e->getMessage(); |
|
| 41 | + echo 'Graph returned an error: ' . $e->getMessage(); |
|
| 42 | 42 | exit; |
| 43 | 43 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 44 | 44 | // When validation fails or other local issues |
| 45 | - echo 'Facebook SDK returned an error: '.$e->getMessage(); |
|
| 45 | + echo 'Facebook SDK returned an error: ' . $e->getMessage(); |
|
| 46 | 46 | exit; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | if (!isset($accessToken)) { |
| 50 | 50 | if ($helper->getError()) { |
| 51 | 51 | header('HTTP/1.0 401 Unauthorized'); |
| 52 | - echo 'Error: '.$helper->getError()."\n"; |
|
| 53 | - echo 'Error Code: '.$helper->getErrorCode()."\n"; |
|
| 54 | - echo 'Error Reason: '.$helper->getErrorReason()."\n"; |
|
| 55 | - echo 'Error Description: '.$helper->getErrorDescription()."\n"; |
|
| 52 | + echo 'Error: ' . $helper->getError() . "\n"; |
|
| 53 | + echo 'Error Code: ' . $helper->getErrorCode() . "\n"; |
|
| 54 | + echo 'Error Reason: ' . $helper->getErrorReason() . "\n"; |
|
| 55 | + echo 'Error Description: ' . $helper->getErrorDescription() . "\n"; |
|
| 56 | 56 | } else { |
| 57 | 57 | header('HTTP/1.0 400 Bad Request'); |
| 58 | 58 | echo 'Bad request'; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | try { |
| 77 | 77 | $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); |
| 78 | 78 | } catch (Facebook\Exceptions\FacebookSDKException $e) { |
| 79 | - echo '<p>Error getting long-lived access token: '.$helper->getMessage()."</p>\n\n"; |
|
| 79 | + echo '<p>Error getting long-lived access token: ' . $helper->getMessage() . "</p>\n\n"; |
|
| 80 | 80 | exit; |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | return false; |
| 122 | 122 | } |
| 123 | - $sendNotif = $fb->post('/'.$facebookUserId.'/notifications', ['href' => $url, 'template' => $message], $appAccessToken); |
|
| 123 | + $sendNotif = $fb->post('/' . $facebookUserId . '/notifications', ['href' => $url, 'template' => $message], $appAccessToken); |
|
| 124 | 124 | |
| 125 | 125 | if ($sendNotif->getHttpStatusCode() == 200) { |
| 126 | 126 | return true; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $statusMessage = 'Sent successfully'; |
| 54 | 54 | } else { |
| 55 | 55 | foreach ($sent as $errorMessage) { |
| 56 | - $statusMessage .= '<p>'.$errorMessage.'</p>'; |
|
| 56 | + $statusMessage .= '<p>' . $errorMessage . '</p>'; |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |