Passed
Push — master ( 72aefd...fda4c0 )
by Maja
04:34
created
core/UserManagement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -276,9 +276,9 @@
 block discarded – undo
276 276
         $retval = [];
277 277
         $invitations = $this->databaseHandle->exec("SELECT cat_institution_id, country, name, invite_issuer_level, invite_dest_mail, invite_token 
278 278
                                         FROM invitations 
279
-                                        WHERE cat_institution_id " . ( $idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0");
279
+                                        WHERE cat_institution_id " . ($idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0");
280 280
         // SELECT -> resource, not boolean
281
-        $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation" ) . ".\n");
281
+        $this->loggerInstance->debug(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation") . ".\n");
282 282
         while ($invitationQuery = mysqli_fetch_object(/** @scrutinizer ignore-type */ $invitations)) {
283 283
             $retval[] = ["country" => $invitationQuery->country, "name" => $invitationQuery->name, "mail" => $invitationQuery->invite_dest_mail, "token" => $invitationQuery->invite_token];
284 284
         }
Please login to merge, or discard this patch.
devices/ms/WindowsCommon.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
         $logoCount = count($logosToPlace);
189 189
         if ($logoCount > 0) {
190 190
             $voffset = $freeTop;
191
-            $freeSpace = (int)round($this->background['freeHeight'] / ($logoCount + 1));
191
+            $freeSpace = (int) round($this->background['freeHeight'] / ($logoCount + 1));
192 192
             foreach ($logosToPlace as $logo) {
193 193
                 $voffset += $freeSpace;
194 194
                 $logoSize = $logo->getImageGeometry();
195
-                $hoffset = (int)round(($bgImageSize['width'] - $logoSize['width']) / 2);
195
+                $hoffset = (int) round(($bgImageSize['width'] - $logoSize['width']) / 2);
196 196
                 $bgImage->compositeImage($logo, $logo->getImageCompose(), $hoffset, $voffset);
197 197
                 $voffset += $logoSize['height'];
198 198
                 }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '"
233 233
 ';
234 234
         }
235
-        $fcontents .=  '
235
+        $fcontents .= '
236 236
 Caption "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage) . '"
237 237
 !define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage) . '"
238 238
 !define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '"
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 !define LOCALE "' . preg_replace('/\..*$/', '', CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['locale']) . '"
242 242
 ;--------------------------------
243 243
 !define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '"
244
-!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0] ) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '"
245
-!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0] ) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '"
244
+!define SUPPORT "' . ((isset($attr['support:email'][0]) && $attr['support:email'][0]) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->codePage)) . '"
245
+!define URL "' . ((isset($attr['support:url'][0]) && $attr['support:url'][0]) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->codePage)) . '"
246 246
     ';
247 247
 
248 248
 
@@ -256,11 +256,11 @@  discard block
 block discarded – undo
256 256
             $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '"
257 257
 ';
258 258
         }
259
-        if(!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) {
259
+        if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) {
260 260
             $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '"
261 261
 ';
262 262
         }
263
-        if(!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) {
263
+        if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) {
264 264
             $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '"
265 265
 ';
266 266
         }
Please login to merge, or discard this patch.
schema/1_1-2_0-script.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
 
96 96
 while ($oneAttrib = mysqli_fetch_object(/** @scrutinizer ignore-type */ $idpWideOptionsQuery)) {
97 97
     if (!isset($profiles[$oneAttrib->institution_id])) {
98
-        $idp = new \core\IdP((int)$oneAttrib->institution_id);
98
+        $idp = new \core\IdP((int) $oneAttrib->institution_id);
99 99
         $profiles[$oneAttrib->institution_id] = ['IdP' => $idp, 'Profiles' => $idp->listProfiles()];
100 100
         echo "Debug: IdP " . $idp->identifier . " has profiles ";
101 101
         foreach ($profiles[$oneAttrib->institution_id]['Profiles'] as $oneProfileObject) {
Please login to merge, or discard this patch.
web/diag/radius_tests.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 function disp_name($eap) {
29 29
     $displayName = \core\common\EAP::eapDisplayName($eap);
30
-    return $displayName['OUTER'] . ( $displayName['INNER'] != '' ? '-' . $displayName['INNER'] : '');
30
+    return $displayName['OUTER'] . ($displayName['INNER'] != '' ? '-' . $displayName['INNER'] : '');
31 31
 }
32 32
 
33 33
 if (!isset($_REQUEST['test_type']) || !$_REQUEST['test_type']) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $testsuite = new \core\diag\RADIUSTests($check_realm, $my_profile->getRealmCheckOuterUsername(), $my_profile->getEapMethodsinOrderOfPreference(1), $my_profile->getCollapsedAttributes()['eap:server_name'], $my_profile->getCollapsedAttributes()['eap:ca_file']);
51 51
 } else {
52 52
     $my_profile = NULL;
53
-    $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm);
53
+    $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm);
54 54
 }
55 55
 
56 56
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     // contains port number; needs to be redacted for filter_var to work
67 67
     // in any case, it's a printable string, so filter it initially
68 68
     
69
-    $filteredHost = filter_input(INPUT_GET,'src', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST,'src', FILTER_SANITIZE_STRING);
69
+    $filteredHost = filter_input(INPUT_GET, 'src', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'src', FILTER_SANITIZE_STRING);
70 70
     $hostonly1 = preg_replace('/:[0-9]*$/', "", $filteredHost);
71 71
     $hostonly2 = preg_replace('/^\[/', "", $hostonly1);
72 72
     $hostonly3 = preg_replace('/\]$/', "", $hostonly2);
@@ -295,12 +295,12 @@  discard block
 block discarded – undo
295 295
         $returnarray['time_millisec'] = sprintf("%d", $testsuite->UDP_reachability_result[$host]['time_millisec']);
296 296
 
297 297
         if (preg_match('/verify error:num=19/', implode($opensslbabble))) {
298
-            $printedres .= "<tr><td>"._("<strong>ERROR</strong>: the server presented a certificate which is from an unknown authority!") . $measure ."</td></tr>";
298
+            $printedres .= "<tr><td>" . _("<strong>ERROR</strong>: the server presented a certificate which is from an unknown authority!") . $measure . "</td></tr>";
299 299
             $my_ip_addrs[$key]["status"] = "FAILED";
300 300
             $goterror = 1;
301 301
         }
302 302
         if (preg_match('/verify return:1/', implode($opensslbabble))) {
303
-            $printedres .= "<tr><td>"._("Completed.") . $measure . "</td></tr>";
303
+            $printedres .= "<tr><td>" . _("Completed.") . $measure . "</td></tr>";
304 304
             $printedres .= "<tr><td></td><td><div class=\"more\">";
305 305
             $my_ip_addrs[$key]["status"] = "OK";
306 306
             $servercertRaw = implode("\n", $opensslbabble);
Please login to merge, or discard this patch.
web/lib/user/TextTemplates.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 namespace web\lib\user;
12 12
 
13
-require_once(ROOT."/config/_config.php");
13
+require_once(ROOT . "/config/_config.php");
14 14
 /**
15 15
  * these constants live in the global space just to ease their use - with class
16 16
  * prefix, the names simply get too long for comfort
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
         $this->templates[WELCOME_ABOARD_BACKTODOWNLOADS] = _("Back to downloads");
73 73
         $this->templates[EDUROAM_WELCOME_ADVERTISING] = sprintf(_("we would like to warmly welcome you among the several million users of %s! From now on, you will be able to use internet access resources on thousands of universities, research centres and other places all over the globe. All of this completely free of charge!"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
74 74
         $this->templates[HEADING_TOPLEVEL_GREET] = sprintf(_("Welcome to %s"), CONFIG['APPEARANCE']['productname']);
75
-        $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
75
+        $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
76 76
         $this->templates[FRONTPAGE_ROLLER_EASY] = sprintf(_("%s installation made easy:"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
77
-        $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = sprintf(_("Custom built for your %s"),$parent->nomenclature_inst);       
77
+        $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = sprintf(_("Custom built for your %s"), $parent->nomenclature_inst);       
78 78
         $this->templates[FRONTPAGE_BIGDOWNLOADBUTTON] = sprintf(_("Click here to download your %s installer"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
79 79
         $this->templates[PROFILE_SELECTION] = _("Select the user group");
80 80
         $this->templates[INSTITUTION_SELECTION] = _("select another");
Please login to merge, or discard this patch.
devices/ms/Device_Vista7.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@
 block discarded – undo
162 162
             $profileFileCont .= '
163 163
 </ServerSideCredential>
164 164
 <InnerAuthenticationMethod>
165
-<NonEAPAuthMethod>' .$innerMethod. '</NonEAPAuthMethod>
165
+<NonEAPAuthMethod>' .$innerMethod . '</NonEAPAuthMethod>
166 166
 </InnerAuthenticationMethod>
167 167
 <VendorSpecific>
168 168
 <SessionResumption>false</SessionResumption>
Please login to merge, or discard this patch.
core/EntityWithDBProperties.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -225,7 +225,7 @@
 block discarded – undo
225 225
         $handle = DBConnection::handle("INST");
226 226
         $blobQuery = $handle->exec("SELECT option_value from $table WHERE row = $row");
227 227
         // SELECT -> returns resource, not boolean
228
-        while ($returnedData =  /** @scrutinizer ignore-type */ mysqli_fetch_object($blobQuery)) {
228
+        while ($returnedData = /** @scrutinizer ignore-type */ mysqli_fetch_object($blobQuery)) {
229 229
             $blob = $returnedData->option_value;
230 230
         }
231 231
         if (!isset($blob)) {
Please login to merge, or discard this patch.
core/AbstractProfile.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -96,6 +96,12 @@
 block discarded – undo
96 96
      */
97 97
     protected $frontendHandle;
98 98
 
99
+    /**
100
+     * @param integer $idpIdentifier
101
+     * @param string $deviceId
102
+     * @param string $area
103
+     * @param string $lang
104
+     */
99 105
     protected function saveDownloadDetails($idpIdentifier, $profileId, $deviceId, $area, $lang, $eapType) {
100 106
         if (CONFIG['PATHS']['logdir']) {
101 107
             $file = fopen(CONFIG['PATHS']['logdir'] . "/download_details.log", "a");
Please login to merge, or discard this patch.
core/ProfileSilverbullet.php 2 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -56,6 +56,9 @@  discard block
 block discarded – undo
56 56
 
57 57
     const PRODUCTNAME = "Managed IdP";
58 58
 
59
+    /**
60
+     * @param integer $length
61
+     */
59 62
     public static function randomString(
60 63
     $length, $keyspace = '23456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
61 64
     ) {
@@ -238,6 +241,7 @@  discard block
 block discarded – undo
238 241
     /**
239 242
      * create a CSR
240 243
      * 
244
+     * @param resource $privateKey
241 245
      * @return 
242 246
      */
243 247
     private function generateCsr($privateKey) {
@@ -277,6 +281,7 @@  discard block
 block discarded – undo
277 281
      * take a CSR and sign it with our issuing CA's certificate
278 282
      * 
279 283
      * @param mixed $csr the CSR
284
+     * @param integer $expiryDays
280 285
      */
281 286
     private function signCsr($csr, $expiryDays) {
282 287
         switch (CONFIG_CONFASSISTANT['SILVERBULLET']['CA']['type']) {
Please login to merge, or discard this patch.
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.