GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 0332e4...c533d8 )
by Marcel
03:50 queued 01:24
created
app/sog/Dashboard/Authentication/LdapUserProvider.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
      *
65 65
      * @param string $user_dn The user DN for which to infer the rules
66 66
      * @param array $ownerships The owned groups for the user DN
67
-     * @return array The roles of the given user
67
+     * @return string[] The roles of the given user
68 68
      */
69 69
     private function getRoles($user_dn, $ownerships)
70 70
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 use Symfony\Component\Security\Core\User\UserInterface;
7 7
 use Symfony\Component\Security\Core\User\UserProviderInterface;
8 8
 use Zend\Ldap\Exception\LdapException;
9
-use Zend\Ldap\Ldap;
10 9
 
11 10
 /**
12 11
  * This class maps a requested user to its LDAP entry.
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,9 +54,9 @@
 block discarded – undo
54 54
             $roles = $this->getRoles($dn, $ownerships);
55 55
             return new LdapUser($username, null, $attributes, $roles, $memberships, $ownerships);
56 56
         } catch (LdapException $ex) {
57
-          throw new UsernameNotFoundException($ex->getMessage().'Der Login war nicht erfolgreich, bitte überprüfe deinen Benutzernamen und Passwort.');
58
-          $logger = $this->get('logger');
59
-          $logger->error(($ex->getMessage()));
57
+            throw new UsernameNotFoundException($ex->getMessage().'Der Login war nicht erfolgreich, bitte überprüfe deinen Benutzernamen und Passwort.');
58
+            $logger = $this->get('logger');
59
+            $logger->error(($ex->getMessage()));
60 60
         }
61 61
     }
62 62
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
             $roles = $this->getRoles($dn, $ownerships);
55 55
             return new LdapUser($username, null, $attributes, $roles, $memberships, $ownerships);
56 56
         } catch (LdapException $ex) {
57
-          throw new UsernameNotFoundException($ex->getMessage().'Der Login war nicht erfolgreich, bitte überprüfe deinen Benutzernamen und Passwort.');
57
+          throw new UsernameNotFoundException($ex->getMessage() . 'Der Login war nicht erfolgreich, bitte überprüfe deinen Benutzernamen und Passwort.');
58 58
           $logger = $this->get('logger');
59 59
           $logger->error(($ex->getMessage()));
60 60
         }
Please login to merge, or discard this patch.
app/sog/Dashboard/Authentication/LdapUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
         $this->attributes = $attributes;
56 56
         $this->roles = $roles;
57 57
         $this->memberships = $memberships;
58
-        $this->ownerships = array_map(function($group) {
58
+        $this->ownerships = array_map(function ($group) {
59 59
             return $group['ou'][0];
60 60
         }, $ownerships);
61 61
     }
Please login to merge, or discard this patch.
app/sog/Dashboard/LdapAdapter.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      * Retrieves all members for the given group CN
151 151
      *
152 152
      * @param string $group_ou The common name of the group for which we want to retrieve the members
153
-     * @param array $fields A list of fields we want to return from the search
153
+     * @param string[] $fields A list of fields we want to return from the search
154 154
      * @return bool|\Zend\Ldap\Collection
155 155
      * @throws LdapException
156 156
      */
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      * Retrieves all memberships for the given DN
220 220
      *
221 221
      * @param string $user_dn The DN for which to get the memberships
222
-     * @param array $fields A list of fields we want to return from the search
222
+     * @param string[] $fields A list of fields we want to return from the search
223 223
      * @param string $attribute The attribute which we use for filtering
224 224
      * @return bool|\Zend\Ldap\Collection
225 225
      * @throws LdapException
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -183,10 +183,11 @@
 block discarded – undo
183 183
             ['dn', 'uid', 'cn', 'displayName', $attribute],
184 184
             'dn'
185 185
         );
186
-        if ($results->count() > 0)
187
-            return $results->getFirst();
188
-        else
189
-            return false;
186
+        if ($results->count() > 0) {
187
+                    return $results->getFirst();
188
+        } else {
189
+                    return false;
190
+        }
190 191
     }
191 192
 
192 193
     /**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -352,17 +352,17 @@
 block discarded – undo
352 352
      */
353 353
     public function createGuest($name, $mail)
354 354
     {
355
-        $username = 'guest'.$this->generateUsername($name);
355
+        $username = 'guest' . $this->generateUsername($name);
356 356
         $dn = sprintf('uid=%s,ou=guests,ou=people,o=sog-de,dc=sog', $username);
357 357
         $info = [];
358 358
 
359 359
         // core data
360 360
         Attribute::setAttribute($info, 'dn', $dn);
361 361
         Attribute::setAttribute($info, 'uid', $username);
362
-        Attribute::setAttribute($info, 'cn', "Guest ".$name);
363
-        Attribute::setAttribute($info, 'displayName', "Guest ".$name);
364
-        Attribute::setAttribute($info, 'sn', "Guest ".$name);
365
-        Attribute::setAttribute($info, 'cn', "Guest ".$name);
362
+        Attribute::setAttribute($info, 'cn', "Guest " . $name);
363
+        Attribute::setAttribute($info, 'displayName', "Guest " . $name);
364
+        Attribute::setAttribute($info, 'sn', "Guest " . $name);
365
+        Attribute::setAttribute($info, 'cn', "Guest " . $name);
366 366
 
367 367
         // meta data
368 368
         Attribute::setAttribute($info, 'mail', $mail);
Please login to merge, or discard this patch.
public/index.php 1 patch
Braces   +31 added lines, -11 removed lines patch added patch discarded remove patch
@@ -65,7 +65,8 @@  discard block
 block discarded – undo
65 65
             $groupDN = sprintf('ou=%s,ou=groups,o=sog-de,dc=sog', $groupOU);
66 66
             $groupAttr = $app['ldap']->getEntry($groupDN, ['cn', 'owner']);
67 67
 
68
-            switch ($action) {
68
+            switch ($action)
69
+            {
69 70
                 case 'quit':
70 71
                     try {
71 72
                         if (in_array($userDN, $groupAttr['owner'])) {
@@ -112,15 +113,23 @@  discard block
 block discarded – undo
112 113
         $groupList = [];
113 114
         foreach ($groups as $g) {
114 115
             $roles = [];
115
-            if (isset($g['owner']) && in_array($userDN, $g['owner'])) $roles[] = 'owner';
116
-            if (isset($g['member']) && in_array($userDN, $g['member'])) $roles[] = 'member';
117
-            if (isset($g['pending']) && in_array($userDN, $g['pending'])) $roles[] = 'pending';
116
+            if (isset($g['owner']) && in_array($userDN, $g['owner'])) {
117
+                $roles[] = 'owner';
118
+            }
119
+            if (isset($g['member']) && in_array($userDN, $g['member'])) {
120
+                $roles[] = 'member';
121
+            }
122
+            if (isset($g['pending']) && in_array($userDN, $g['pending'])) {
123
+                $roles[] = 'pending';
124
+            }
118 125
 
119 126
             $owners = [];
120 127
             if (isset($g['owner'])) {
121 128
                 for ($j = 0; $j < count($g['owner']); $j++) {
122 129
                     $o = $app['ldap']->getEntry($g['owner'][$j], ['cn', 'mail']);
123
-                    if (isset($o)) $owners[] = $o;
130
+                    if (isset($o)) {
131
+                        $owners[] = $o;
132
+                    }
124 133
                 }
125 134
             }
126 135
 
@@ -155,7 +164,9 @@  discard block
 block discarded – undo
155 164
             return new \Symfony\Component\HttpFoundation\RedirectResponse('/members/Benutzerdaten');
156 165
         }
157 166
 
158
-        if (!isset($selGroup)) $selGroup = $ownedGroups[0]['ou'][0];
167
+        if (!isset($selGroup)) {
168
+            $selGroup = $ownedGroups[0]['ou'][0];
169
+        }
159 170
         $selGroupDN = sprintf('ou=%s,ou=groups,o=sog-de,dc=sog', $selGroup);
160 171
 
161 172
         $action = $request->request->get('manage-action');
@@ -178,7 +189,8 @@  discard block
 block discarded – undo
178 189
 
179 190
                 $groupAttr = $app['ldap']->getEntry($selGroupDN, ['owner']);
180 191
 
181
-                switch ($action) {
192
+                switch ($action)
193
+                {
182 194
                     case 'activate':
183 195
                         try {
184 196
                             $app['ldap']->activateMember($userID);
@@ -231,11 +243,19 @@  discard block
 block discarded – undo
231 243
         $memberList = [];
232 244
         foreach ($allUsers as $u) {
233 245
             $roles = [];
234
-            if (isset($groupAttr['owner']) && in_array($u['dn'], $groupAttr['owner'])) $roles[] = 'owner';
235
-            if (isset($groupAttr['member']) && in_array($u['dn'], $groupAttr['member'])) $roles[] = 'member';
236
-            if (isset($groupAttr['pending']) && in_array($u['dn'], $groupAttr['pending'])) $roles[] = 'pending';
246
+            if (isset($groupAttr['owner']) && in_array($u['dn'], $groupAttr['owner'])) {
247
+                $roles[] = 'owner';
248
+            }
249
+            if (isset($groupAttr['member']) && in_array($u['dn'], $groupAttr['member'])) {
250
+                $roles[] = 'member';
251
+            }
252
+            if (isset($groupAttr['pending']) && in_array($u['dn'], $groupAttr['pending'])) {
253
+                $roles[] = 'pending';
254
+            }
237 255
             // we handle inactive members like the other cases, the UI is just so similar
238
-            if (strstr($u['dn'], 'ou=inactive')) $roles[] = 'inactive';
256
+            if (strstr($u['dn'], 'ou=inactive')) {
257
+                $roles[] = 'inactive';
258
+            }
239 259
 
240 260
             $listentry = array(
241 261
                 'name' => $u['cn'][0],
Please login to merge, or discard this patch.
app/sog/Dashboard/GuestControllerProvider.php 1 patch
Braces   +8 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,7 +85,9 @@  discard block
 block discarded – undo
85 85
             $ownedGroups = $app['ldap']->getOwnedGroups($user->getAttributes()['dn'])->toArray();
86 86
 
87 87
             $selGroup = $request->request->get('ou');
88
-            if (!isset($selGroup)) $selGroup = $ownedGroups[0]['ou'][0];
88
+            if (!isset($selGroup)) {
89
+                $selGroup = $ownedGroups[0]['ou'][0];
90
+            }
89 91
             $selGroupDN = sprintf('ou=%s,ou=groups,o=sog-de,dc=sog', $selGroup);
90 92
 
91 93
             foreach ($ownedGroups as $og) {
@@ -151,9 +153,10 @@  discard block
 block discarded – undo
151 153
     private function retrieveGuestByMail($mail)
152 154
     {
153 155
         $info = $this->app['ldap']->getMemberByMail($mail, 'mail');
154
-        if (is_array($info))
155
-            return $info['dn'];
156
-        else
157
-            return false;
156
+        if (is_array($info)) {
157
+                    return $info['dn'];
158
+        } else {
159
+                    return false;
160
+        }
158 161
     }
159 162
 }
160 163
\ No newline at end of file
Please login to merge, or discard this patch.