Passed
Push — master ( 9af84e...7cf688 )
by Tomasz
04:22
created
web/admin/inc/manageAdmins.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@
 block discarded – undo
159 159
 
160 160
         echo "</td>
161 161
               <td>
162
-                <form action='inc/manageAdmins.inc.php?inst_id=" . $my_inst->identifier . "' method='post' " . ( $oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "" ) . " accept-charset='UTF-8'>
162
+                <form action='inc/manageAdmins.inc.php?inst_id=" . $my_inst->identifier . "' method='post' " . ($oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "") . " accept-charset='UTF-8'>
163 163
                 <input type='hidden' name='admin_id' value='" . $oneowner['ID'] . "'></input>
164 164
                 <button type='submit' name='submitbutton' class='delete' value='" . web\lib\common\FormElements::BUTTON_DELETE . "'>" . _("Delete Administrator") . "</button>
165 165
                 </form>
Please login to merge, or discard this patch.
core/IdP.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@
 block discarded – undo
191 191
                 case "SILVERBULLET":
192 192
                     $theProfile = new ProfileSilverbullet($identifier, $this);
193 193
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
194
-                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier."." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
194
+                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
195 195
                     return $theProfile;
196 196
                 default:
197 197
                     throw new Exception("This type of profile is unknown and can not be added.");
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -155,12 +155,12 @@
 block discarded – undo
155 155
      * @return bool TRUE if this user is an admin with FED-level blessing
156 156
      */
157 157
     public function isPrimaryOwner($user) {
158
-       foreach ($this->listOwners() as $oneOwner) {
159
-           if ($oneOwner['ID'] == $user && $oneOwner['LEVEL'] == "FED") {
160
-               return TRUE;
161
-           }
162
-       }
163
-       return FALSE;
158
+        foreach ($this->listOwners() as $oneOwner) {
159
+            if ($oneOwner['ID'] == $user && $oneOwner['LEVEL'] == "FED") {
160
+                return TRUE;
161
+            }
162
+        }
163
+        return FALSE;
164 164
     }
165 165
     
166 166
     /**
Please login to merge, or discard this patch.
core/ProfileSilverbullet.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -175,11 +175,11 @@  discard block
 block discarded – undo
175 175
     public function invitationMailBody($invitationLink) {
176 176
         $text = _("Hello!");
177 177
         $text .= "\n\n";
178
-        $text .= sprintf(_("A new %s access credential has been created for you by your network administrator."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
178
+        $text .= sprintf(_("A new %s access credential has been created for you by your network administrator."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
179 179
         $text .= " ";
180 180
         $text .= sprintf(_("Please follow the following link with the device you want to enable for %s to get a custom %s installation program just for you. You can click on the link, copy and paste it into a browser or scan the attached QR code."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
181 181
         $text .= "\n\n$invitationLink\n\n"; // gets replaced with the token value by getBody()
182
-        $text .= sprintf(_("Please keep this email or bookmark this link for future use. After picking up your %s installation program, you can use the same link to get status information about your %s account."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
182
+        $text .= sprintf(_("Please keep this email or bookmark this link for future use. After picking up your %s installation program, you can use the same link to get status information about your %s account."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
183 183
         $text .= "\n\n";
184 184
         $text .= _("Regards,");
185 185
         $text .= "\n\n";
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
                 $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . CONFIG_CONFASSISTANT['CONSORTIUM']['name'] . "/OU=$federation/CN=$cn/emailAddress=$cn\n";
463 463
                 $logHandle->debug(4, "index.txt contents-to-be: $indexStatement");
464 464
                 if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) {
465
-                $logHandle->debug(1,"Unable to write openssl index.txt file for revocation handling!");
465
+                $logHandle->debug(1, "Unable to write openssl index.txt file for revocation handling!");
466 466
                 }
467 467
                 // index.txt.attr is dull but needs to exist
468 468
                 file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n");
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
         if ($invitationsResult->num_rows == 0) {
573 573
             $loggerInstance->debug(2, "Token  $tokenvalue not found in database or database query error!\n");
574 574
             return ["status" => self::SB_TOKENSTATUS_INVALID,
575
-                "cert_status" => [],];
575
+                "cert_status" => [], ];
576 576
         }
577 577
         // if not returned, we found the token in the DB
578 578
         $invitationRow = mysqli_fetch_object(/** @scrutinizer ignore-type */ $invitationsResult);
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
                 throw new Exception("Impossible: the string ends with '/admin' but it's not possible to cut six characters from the end?!");
743 743
             }
744 744
         }
745
-        $link .= '/accountstatus/accountstatus.php?token='.$token;
745
+        $link .= '/accountstatus/accountstatus.php?token=' . $token;
746 746
         return $link;
747 747
     }
748 748
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -254,7 +254,7 @@
 block discarded – undo
254 254
      * create a CSR
255 255
      * 
256 256
      * @param resource $privateKey the private key to create the CSR with
257
-     * @return array with the CSR and some meta info
257
+     * @return integer with the CSR and some meta info
258 258
      */
259 259
     private function generateCsr($privateKey) {
260 260
         // token leads us to the NRO, to set the OU property of the cert
Please login to merge, or discard this patch.
web/admin/overview_idp.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         <div class='infobox' style='text-align:center;'>
57 57
             <h2><?php echo sprintf(_("QR Code for %s download area"), $uiElements->nomenclature_inst); ?></h2>
58 58
             <?php
59
-            $displayurl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier;
59
+            $displayurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier;
60 60
             $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo(QRcode::png($displayurl, FALSE, QR_ECLEVEL_Q, QRCODE_PIXELS_PER_SYMBOL), QRCODE_PIXELS_PER_SYMBOL));
61 61
             $size = getimagesize($uri);
62 62
             echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>";
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 </td>
94 94
                 <td>
95 95
                     <form action='edit_idp_result.php?inst_id=<?php echo $my_inst->identifier; ?>' method='post' accept-charset='UTF-8'>
96
-                        <button class='delete' type='submit' name='submitbutton' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo ( CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL ? sprintf(_("After deleting the IdP, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclature_fed) . " " : "" ) . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclature_inst, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclature_inst); ?></button>
96
+                        <button class='delete' type='submit' name='submitbutton' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo (CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL ? sprintf(_("After deleting the IdP, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclature_fed) . " " : "") . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclature_inst, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclature_inst); ?></button>
97 97
                     </form>
98 98
 
99 99
                 </td>
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
                         if ($readonly === FALSE) {
182 182
                             ?>
183 183
                             <form action='edit_silverbullet.php?inst_id=<?php echo $my_inst->identifier; ?>&profile_id=<?php echo $profile_list->identifier; ?>' method='POST'>
184
-                                <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
184
+                                <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
185 185
                             </form>
186 186
                             <?php
187 187
                         }
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                     if (isset($URL['device-specific:redirect'])) {
316 316
                         $displayurl = $URL['device-specific:redirect'][0];
317 317
                     } else {
318
-                        $displayurl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier . "&amp;profile=" . $profile_list->identifier;
318
+                        $displayurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier . "&amp;profile=" . $profile_list->identifier;
319 319
                     }
320 320
                     echo "<a href='$displayurl' style='white-space: nowrap; text-align: center;'>";
321 321
                     $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo(QRcode::png($displayurl, FALSE, QR_ECLEVEL_Q, QRCODE_PIXELS_PER_SYMBOL), QRCODE_PIXELS_PER_SYMBOL));
Please login to merge, or discard this patch.
web/admin/overview_user.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
             $country[$key] = $row['country'];
99 99
             $name[$key] = $row['name'];
100 100
         }
101
-        echo "<tr><th>" . sprintf(_("%s Name"), $uiElements->nomenclature_inst) . "</th><th>" . sprintf(_("Other admins of this %s"), $uiElements->nomenclature_inst) . "</th><th>" . ( CONFIG['DB']['INST']['readonly'] === FALSE ? _("Administrator Management") : "") . "</th></tr>";
101
+        echo "<tr><th>" . sprintf(_("%s Name"), $uiElements->nomenclature_inst) . "</th><th>" . sprintf(_("Other admins of this %s"), $uiElements->nomenclature_inst) . "</th><th>" . (CONFIG['DB']['INST']['readonly'] === FALSE ? _("Administrator Management") : "") . "</th></tr>";
102 102
         foreach ($myFeds as $fed_id => $fed_name) {
103 103
             echo "<tr><td colspan='3'><strong>" . sprintf(_("%s %s: %s list"), $uiElements->nomenclature_fed, $fed_name, $uiElements->nomenclature_inst) . "</strong></td></tr>";
104 104
 
Please login to merge, or discard this patch.
web/admin/sanity_tests.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     'mailer',
29 29
 ];
30 30
 
31
-if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL" ) {
31
+if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") {
32 32
     $Tests[] = 'makensis';
33 33
     $Tests[] = 'makensis=>NSISmodules';
34 34
 }
Please login to merge, or discard this patch.
core/diag/Telepath.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@
 block discarded – undo
216 216
      * realm (and indirectly that of the links and statuses of involved proxies
217 217
      * and returns a judgment whether external Monitoring API tests are warranted
218 218
      * or not
219
-     * @return boolean TRUE if external tests have to be run
219
+     * @return boolean|null TRUE if external tests have to be run
220 220
      */
221 221
     private function CATInternalTests() {
222 222
         // we are expecting to get a REJECT from all runs, because that means the packet got through to the IdP.
Please login to merge, or discard this patch.
web/admin/112365365321.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                     <th>Device</th>
119 119
                     <th>Admin Downloads</th>
120 120
                     <th>User Downloads (classic)</th>
121
-                    <th>User Downloads (<?php echo \core\ProfileSilverbullet::PRODUCTNAME;?>)</th>
121
+                    <th>User Downloads (<?php echo \core\ProfileSilverbullet::PRODUCTNAME; ?>)</th>
122 122
                     <th>User Downloads (total)</th>
123 123
                 </tr>
124 124
                 <?php
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                     $admin_query = $dbHandle->exec("SELECT SUM(downloads_admin) AS admin, SUM(downloads_user) AS user, SUM(downloads_silverbullet) as silverbullet FROM downloads WHERE device_id = '$index'");
131 131
                     // SELECT -> mysqli_result, not boolean
132 132
                     while ($a = mysqli_fetch_object(/** @scrutinizer ignore-type */ $admin_query)) {
133
-                        echo "<td>" . $device_array['display'] . "</td><td>" . $a->admin . "</td><td>" . $a->user . "</td><td>" . $a->silverbullet . "</td><td>" . sprintf("%s",$a->user + $a->silverbullet) . "</td>";
133
+                        echo "<td>" . $device_array['display'] . "</td><td>" . $a->admin . "</td><td>" . $a->user . "</td><td>" . $a->silverbullet . "</td><td>" . sprintf("%s", $a->user + $a->silverbullet) . "</td>";
134 134
                         $gross_admin = $gross_admin + $a->admin;
135 135
                         $gross_user = $gross_user + $a->user;
136 136
                         $gross_silverbullet = $gross_silverbullet + $a->silverbullet;
Please login to merge, or discard this patch.
web/skins/classic/basic.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     public function listIdPs() {
142 142
         $instList = $this->orderIdentityProviders($this->country->tld);
143 143
         $out = '';
144
-        $out .= sprintf(_("Select your %s"), $this->nomenclature_inst );
144
+        $out .= sprintf(_("Select your %s"), $this->nomenclature_inst);
145 145
         $out .= '<select name="idp" onchange="submit_form(this)">';
146 146
         if (!empty($instList)) {
147 147
             if (!isset($this->idp)) {
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                 }
236 236
             }
237 237
             $out .= '>' . $disp . '</option>';
238
-            $deviceRedirects .= 'redirects[' . $iterator . '] = ' . ( $oneDevice['redirect'] ? 1 : 0 ) . ';';
238
+            $deviceRedirects .= 'redirects[' . $iterator . '] = ' . ($oneDevice['redirect'] ? 1 : 0) . ';';
239 239
             $iterator++;
240 240
         }
241 241
         $out .= '</select>';
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
         </script>
430 430
     </head>
431 431
     <body style="">
432
-        <?php print '<div id="motd">' . ( isset(CONFIG['APPEARANCE']['MOTD']) ? CONFIG['APPEARANCE']['MOTD'] : '&nbsp' ) . '</div>'; ?>
432
+        <?php print '<div id="motd">' . (isset(CONFIG['APPEARANCE']['MOTD']) ? CONFIG['APPEARANCE']['MOTD'] : '&nbsp') . '</div>'; ?>
433 433
         <form name="my_form" method="POST" action="<?php echo $_SERVER['SCRIPT_NAME'] ?>" accept-charset='UTF-8'>
434 434
             <img src="<?php echo $skinObject->findResourceUrl("IMAGES", "consortium_logo.png"); ?>" style="width: 20%; padding-right:20px; padding-top:0px; float:right" alt="logo" />
435 435
             <?php
Please login to merge, or discard this patch.