@@ -40,7 +40,7 @@ |
||
40 | 40 | $path = $this->option('destination'); |
41 | 41 | $path = reset($path); |
42 | 42 | // otherwise use the default path |
43 | - if (! $path) { |
|
43 | + if (!$path) { |
|
44 | 44 | $path = 'ui/preload.js'; |
45 | 45 | } |
46 | 46 | // fully calculated path is APPDIR/public/ui/preload.js |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | $graph = new \Microsoft\Graph\Graph(); |
42 | 42 | $graph->setAccessToken($accessToken); |
43 | 43 | $user = $graph->createRequest('GET', '/me') |
44 | - ->setReturnType(\Microsoft\Graph\Model\User::class) |
|
45 | - ->execute(); |
|
44 | + ->setReturnType(\Microsoft\Graph\Model\User::class) |
|
45 | + ->execute(); |
|
46 | 46 | |
47 | 47 | return $user->jsonSerialize(); |
48 | 48 | } |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | if (count($groups)) { |
174 | 174 | // remove the users existing database roles before assigning new ones |
175 | 175 | \DB::table('assigned_roles') |
176 | - ->where('entity_id', $user->id) |
|
177 | - ->where('entity_type', get_class($user)) |
|
178 | - ->delete(); |
|
176 | + ->where('entity_id', $user->id) |
|
177 | + ->where('entity_type', get_class($user)) |
|
178 | + ->delete(); |
|
179 | 179 | // TRY to add the user to each group they are assigned |
180 | 180 | try { |
181 | 181 | $user->assign($groups); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function scrubMicrosoftGraphUserData($userData) |
51 | 51 | { |
52 | 52 | // Fix any stupid crap with missing or null fields |
53 | - if (! isset($userData['mail']) || ! $userData['mail']) { |
|
53 | + if (!isset($userData['mail']) || !$userData['mail']) { |
|
54 | 54 | \Illuminate\Support\Facades\Log::debug('graph api did not contain mail field, using userPrincipalName instead '.json_encode($userData)); |
55 | 55 | $userData['mail'] = $userData['userPrincipalName']; |
56 | 56 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | // Try to find an existing user |
67 | 67 | $user = $userType::where($userIdField, $userData['id'])->first(); |
68 | 68 | // If we dont have an existing user |
69 | - if (! $user) { |
|
69 | + if (!$user) { |
|
70 | 70 | // Go create a new one with this data |
71 | 71 | $user = $this->createUserFromAzureData($userData); |
72 | 72 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | // TODO: rewrite this so that if the user doesnt exist we create them and get their groups from AAD |
112 | 112 | $user = $user_class::where('userPrincipalName', $upn)->first(); |
113 | - if (! $user) { |
|
113 | + if (!$user) { |
|
114 | 114 | throw new \Exception('No user found with user principal name '.$upn); |
115 | 115 | } |
116 | 116 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | public function loadClientCertFromWebserver() |
121 | 121 | { |
122 | 122 | // Make sure we got a client certificate from the web server |
123 | - if (! isset($_SERVER['SSL_CLIENT_CERT']) || ! $_SERVER['SSL_CLIENT_CERT']) { |
|
123 | + if (!isset($_SERVER['SSL_CLIENT_CERT']) || !$_SERVER['SSL_CLIENT_CERT']) { |
|
124 | 124 | throw new \Exception('TLS client certificate missing'); |
125 | 125 | } |
126 | 126 | // try to parse the certificate we got |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | public function getUserPrincipalNameFromClientCert($x509) |
136 | 136 | { |
137 | 137 | $names = $x509->getExtension('id-ce-subjectAltName'); |
138 | - if (! $names) { |
|
138 | + if (!$names) { |
|
139 | 139 | throw new \Exception('TLS client cert missing subject alternative names'); |
140 | 140 | } |
141 | 141 | // Search subject alt names for user principal name |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | } |
150 | 150 | } |
151 | 151 | } |
152 | - if (! $upn) { |
|
152 | + if (!$upn) { |
|
153 | 153 | throw new \Exception('Could not find user principal name in TLS client cert'); |
154 | 154 | } |
155 | 155 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | try { |
181 | 181 | $user->assign($groups); |
182 | 182 | } catch (\Exception $e) { |
183 | - \Illuminate\Support\Facades\Log::debug('unable to add user to groups ' . implode(',', $groups) . ' because' . $e->getMessage()); |
|
183 | + \Illuminate\Support\Facades\Log::debug('unable to add user to groups '.implode(',', $groups).' because'.$e->getMessage()); |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | } |