Passed
Push — master ( f851d9...c1d01f )
by Nils
05:04
created
sources/ldap.queries.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 ) {
81 81
     // Not allowed page
82 82
     $session->set('system-error_code', ERR_NOT_ALLOWED);
83
-    include $SETTINGS['cpassman_dir'] . '/error.php';
83
+    include $SETTINGS['cpassman_dir'].'/error.php';
84 84
     exit;
85 85
 }
86 86
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                     $openLdapExtra = new OpenLdapExtra();
155 155
                     break;
156 156
                 default:
157
-                    throw new Exception("Unsupported LDAP type: " . $SETTINGS['ldap_type']);
157
+                    throw new Exception("Unsupported LDAP type: ".$SETTINGS['ldap_type']);
158 158
             }
159 159
         } catch (Exception $e) {
160 160
             error_log('TEAMPASS Error - ldap - '.$e->getMessage());
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             // 2- Get user info from AD
172 172
             // We want to isolate attribute ldap_user_attribute or mostly samAccountName
173 173
             $userADInfos = $ldapConnection->query()
174
-                ->where((isset($SETTINGS['ldap_user_attribute']) ===true && empty($SETTINGS['ldap_user_attribute']) === false) ? $SETTINGS['ldap_user_attribute'] : 'samaccountname', '=', $post_username)
174
+                ->where((isset($SETTINGS['ldap_user_attribute']) === true && empty($SETTINGS['ldap_user_attribute']) === false) ? $SETTINGS['ldap_user_attribute'] : 'samaccountname', '=', $post_username)
175 175
                 ->firstOrFail();
176 176
 
177 177
             // Is user enabled? Only ActiveDirectory
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         } catch (\LdapRecord\Query\ObjectNotFoundException $e) {
193 193
             $error = $e->getDetailedError();
194 194
             if ($error) {
195
-                error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage(). " - ".$error->getDiagnosticMessage());
195
+                error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage()." - ".$error->getDiagnosticMessage());
196 196
             } else {
197 197
                 error_log('TEAMPASS Error - LDAP - Code: '.$e->getCode().' - Message: '.$e->getMessage());
198 198
             }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             // For OpenLDAP and others, we use attribute dn
214 214
             $userAuthAttempt = $ldapConnection->auth()->attempt(
215 215
                 $SETTINGS['ldap_type'] === 'ActiveDirectory' ?
216
-                    $userADInfos['userprincipalname'][0] :  // refering to https://ldaprecord.com/docs/core/v2/authentication#basic-authentication
216
+                    $userADInfos['userprincipalname'][0] : // refering to https://ldaprecord.com/docs/core/v2/authentication#basic-authentication
217 217
                     $userADInfos['dn'],
218 218
                 $post_password
219 219
             );
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
             }
232 232
         } catch (\LdapRecord\Query\ObjectNotFoundException $e) {
233 233
             $error = $e->getDetailedError();
234
-            error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage(). " - ".$error->getDiagnosticMessage());
234
+            error_log('TEAMPASS Error - LDAP - '.$error->getErrorCode()." - ".$error->getErrorMessage()." - ".$error->getDiagnosticMessage());
235 235
             // deepcode ignore ServerLeak: No important data is sent and is encrypted before being sent
236 236
             echo prepareExchangedData(
237 237
                 array(
Please login to merge, or discard this patch.