@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function scrubMicrosoftGraphUserData($userData) |
| 50 | 50 | { |
| 51 | 51 | // Fix any stupid crap with missing or null fields |
| 52 | - if (! isset($userData['mail']) || ! $userData['mail']) { |
|
| 52 | + if (!isset($userData['mail']) || !$userData['mail']) { |
|
| 53 | 53 | $userData['mail'] = $userData['userPrincipalName']; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | // Try to find an existing user |
| 65 | 65 | $user = $userType::where($userIdField, $userData['id'])->first(); |
| 66 | 66 | // If we dont have an existing user |
| 67 | - if (! $user) { |
|
| 67 | + if (!$user) { |
|
| 68 | 68 | // Go create a new one with this data |
| 69 | 69 | $user = $this->createUserFromAzureData($userData); |
| 70 | 70 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | // TODO: rewrite this so that if the user doesnt exist we create them and get their groups from AAD |
| 106 | 106 | $user = $user_class::where('userPrincipalName', $upn)->first(); |
| 107 | - if (! $user) { |
|
| 107 | + if (!$user) { |
|
| 108 | 108 | throw new \Exception('No user found with user principal name '.$upn); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | public function loadClientCertFromWebserver() |
| 115 | 115 | { |
| 116 | 116 | // Make sure we got a client certificate from the web server |
| 117 | - if (! isset($_SERVER['SSL_CLIENT_CERT']) || ! $_SERVER['SSL_CLIENT_CERT']) { |
|
| 117 | + if (!isset($_SERVER['SSL_CLIENT_CERT']) || !$_SERVER['SSL_CLIENT_CERT']) { |
|
| 118 | 118 | throw new \Exception('TLS client certificate missing'); |
| 119 | 119 | } |
| 120 | 120 | // try to parse the certificate we got |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | public function getUserPrincipalNameFromClientCert($x509) |
| 130 | 130 | { |
| 131 | 131 | $names = $x509->getExtension('id-ce-subjectAltName'); |
| 132 | - if (! $names) { |
|
| 132 | + if (!$names) { |
|
| 133 | 133 | throw new \Exception('TLS client cert missing subject alternative names'); |
| 134 | 134 | } |
| 135 | 135 | // Search subject alt names for user principal name |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | - if (! $upn) { |
|
| 146 | + if (!$upn) { |
|
| 147 | 147 | throw new \Exception('Could not find user principal name in TLS client cert'); |
| 148 | 148 | } |
| 149 | 149 | |