Test Setup Failed
Push — master ( defeb2...c0e551 )
by Tomasz
11:33
created
web/lib/admin/UIElements.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                 'display' => sprintf(_("Mint %s with CA on creation"), $this->nomenclatureIdP),
150 150
                 'help' => _("Set of default CAs to add to new IdPs on signup")],
151 151
             "fed:openroaming" => [
152
-                'display' => sprintf(_("OpenRoaming: Allow %s Opt-In"),$this->nomenclatureParticipant),
152
+                'display' => sprintf(_("OpenRoaming: Allow %s Opt-In"), $this->nomenclatureParticipant),
153 153
                 'help' => _("Allow IdP to set OpenRoaming support for its users.")],
154 154
             "fed:openroaming_customtarget" => ['display' => _("OpenRoaming: Custom NAPTR Target"), 'help' => "If you want your IdPs to use your own OpenRoaming → eduroam proxy then you can configure the hostname here; the realm check feature for IdPs will then warn them if the OpenRoaming destination server is not yours. This attribute does not need to be set, and the realm checks default to checking for the OpenRoaming → eduroam proxy operated by eduroam OT."],
155 155
             "fed:autoregister-synced" => [
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         ];
176 176
 
177 177
         if (!isset($displayNames[$input])) { // this is an error! throw an Exception
178
-            throw new \Exception("The translation of an option name was requested, but the option is not known to the system: " . htmlentities($input));
178
+            throw new \Exception("The translation of an option name was requested, but the option is not known to the system: ".htmlentities($input));
179 179
         }
180 180
         \core\common\Entity::outOfThePotatoes();
181 181
         // none of the strings have HTML in them, only translators can provide own text for it -> no threat, but complained about by the security review
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         foreach ($optionlist as $option) {
203 203
             $type = $optioninfo->optionType($option['name']);
204
-            if (preg_match('/^' . $class . '/', $option['name']) && $option['level'] == "$level") {
204
+            if (preg_match('/^'.$class.'/', $option['name']) && $option['level'] == "$level") {
205 205
                 // all non-multilang attribs get this assignment ...
206 206
                 $language = "";
207 207
                 $content = $option['value'];
@@ -219,19 +219,19 @@  discard block
 block discarded – undo
219 219
                         $locationMarkers[] = $coords;
220 220
                         break;
221 221
                     case "file":
222
-                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td>";
222
+                        $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td>";
223 223
                         switch ($option['name']) {
224 224
                             case "general:logo_file":
225 225
                             case "fed:logo_file":
226
-                                $retval .= $this->previewImageinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']);
226
+                                $retval .= $this->previewImageinHTML('ROWID-'.$option['level'].'-'.$option['row_id']);
227 227
                                 break;
228 228
                             case "eap:ca_file":
229 229
                             // fall-through intended: display both the same way
230 230
                             case "fed:minted_ca_file":
231
-                                $retval .= $this->previewCAinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']);
231
+                                $retval .= $this->previewCAinHTML('ROWID-'.$option['level'].'-'.$option['row_id']);
232 232
                                 break;
233 233
                             case "support:info_file":
234
-                                $retval .= $this->previewInfoFileinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']);
234
+                                $retval .= $this->previewInfoFileinHTML('ROWID-'.$option['level'].'-'.$option['row_id']);
235 235
                                 break;
236 236
                             default:
237 237
                         }
@@ -241,10 +241,10 @@  discard block
 block discarded – undo
241 241
                             // do not display the option at all; it gets auto-set by the ProfileSilverbullet constructor and doesn't have to be seen
242 242
                             break;
243 243
                         }
244
-                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>";
244
+                        $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>".($content == "on" ? _("on") : _("off"))."</strong></td></tr>";
245 245
                         break;
246 246
                     default:
247
-                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>";
247
+                        $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>$content</strong></td></tr>";
248 248
                 }
249 249
             }
250 250
         }
@@ -253,11 +253,11 @@  discard block
 block discarded – undo
253 253
             $locationCount = 0;
254 254
             foreach ($locationMarkers as $g) {
255 255
                 $locationCount++;
256
-                $marker .= '<marker name="' . $locationCount . '" lat="' . $g['lat'] . '" lng="' . $g['lon'] . '" />';
256
+                $marker .= '<marker name="'.$locationCount.'" lat="'.$g['lat'].'" lng="'.$g['lon'].'" />';
257 257
             }
258 258
             $marker .= '<\/markers>'; // some validator says this should be escaped
259 259
             $jMarker = json_encode($locationMarkers);
260
-            $retval .= '<tr><td><script>markers=\'' . $marker . '\'; jmarkers = \'' . $jMarker . '\';</script></td><td></td><td></td></tr>';
260
+            $retval .= '<tr><td><script>markers=\''.$marker.'\'; jmarkers = \''.$jMarker.'\';</script></td><td></td><td></td></tr>';
261 261
         }
262 262
         \core\common\Entity::outOfThePotatoes();
263 263
         return $retval;
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
         \core\common\Entity::intoThePotatoes();
274 274
         $idpoptions = $myInst->getAttributes();
275 275
         $retval = "<div class='infobox'>
276
-        <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant) . "</h2>
276
+        <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant)."</h2>
277 277
         <table>
278 278
             <tr>
279 279
                 <td>
280
-                    " . _("Country:") . "
280
+                    " . _("Country:")."
281 281
                 </td>
282 282
                 <td>
283 283
                 </td>
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
         $retval .= $myFed->name;
288 288
         $retval .= "</strong>
289 289
                 </td>
290
-            </tr>" . $this->infoblock($idpoptions, "general", "IdP") . "
290
+            </tr>" . $this->infoblock($idpoptions, "general", "IdP")."
291 291
         </table>
292 292
     </div>";
293 293
         $blocks = [["support", _("Global Helpdesk Details")]];        
@@ -296,9 +296,9 @@  discard block
 block discarded – undo
296 296
         }
297 297
         foreach ($blocks as $block) {
298 298
             $retval .= "<div class='infobox'>
299
-            <h2>" . $block[1] . "</h2>
299
+            <h2>" . $block[1]."</h2>
300 300
             <table>" .
301
-                    $this->infoblock($idpoptions, $block[0], "IdP") .
301
+                    $this->infoblock($idpoptions, $block[0], "IdP").
302 302
                     "</table>
303 303
         </div>";
304 304
         }
@@ -313,12 +313,12 @@  discard block
 block discarded – undo
313 313
      */
314 314
     private function displaySize(int $number) {
315 315
         if ($number > 1024 * 1024) {
316
-            return round($number / 1024 / 1024, 2) . " MiB";
316
+            return round($number / 1024 / 1024, 2)." MiB";
317 317
         }
318 318
         if ($number > 1024) {
319
-            return round($number / 1024, 2) . " KiB";
319
+            return round($number / 1024, 2)." KiB";
320 320
         }
321
-        return $number . " B";
321
+        return $number." B";
322 322
     }
323 323
 
324 324
     /**
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
         $caExpiryTrashhold = \config\ConfAssistant::CERT_WARNINGS['expiry_warning'];
374 374
         $rawResult = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE);
375 375
         if (is_bool($rawResult)) { // we didn't actually get a CA!
376
-            $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the certificate from the database!") . "</div>";
376
+            $retval = "<div class='ca-summary'>"._("There was an error while retrieving the certificate from the database!")."</div>";
377 377
             \core\common\Entity::outOfThePotatoes();
378 378
             return $retval;
379 379
         }
@@ -389,8 +389,8 @@  discard block
 block discarded – undo
389 389
 
390 390
         $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']);
391 391
         $details['name'] = preg_replace('/\//', "", $details['name']);
392
-        $certstatus = ( $details['root'] == 1 ? "R" : "I");
393
-        $certTooltip = ( $details['root'] == 1 ? _("Root CA") : _("Intermediate CA"));
392
+        $certstatus = ($details['root'] == 1 ? "R" : "I");
393
+        $certTooltip = ($details['root'] == 1 ? _("Root CA") : _("Intermediate CA"));
394 394
         $innerbgColor = "#0000ff";
395 395
         $leftBorderColor = "#00ff00";
396 396
         $message = "";
@@ -398,35 +398,35 @@  discard block
 block discarded – undo
398 398
             $leftBorderColor = "red";
399 399
             $message = _("This is a <strong>SERVER</strong> certificate!");
400 400
             if (\config\ConfAssistant::CERT_GUIDELINES !== '') {
401
-                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>". _("more info")."</a>";
401
+                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>"._("more info")."</a>";
402 402
             }
403 403
             $message .= "<br/>";
404
-            $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . $message . $details['name'] . "</div>";
404
+            $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>".$message.$details['name']."</div>";
405 405
             \core\common\Entity::outOfThePotatoes();
406 406
             return $retval;
407 407
         }
408 408
         $now = time();
409 409
         if ($now + \config\ConfAssistant::CERT_WARNINGS['expiry_critical'] > $details['full_details']['validTo_time_t']) {
410 410
             $leftBorderColor = "red";
411
-            $message = _("Certificate expired!") . "<br>";
412
-        } elseif($now + \config\ConfAssistant::CERT_WARNINGS['expiry_warning']  > $details['full_details']['validTo_time_t'] - $caExpiryTrashhold) {
411
+            $message = _("Certificate expired!")."<br>";
412
+        } elseif ($now + \config\ConfAssistant::CERT_WARNINGS['expiry_warning'] > $details['full_details']['validTo_time_t'] - $caExpiryTrashhold) {
413 413
             if ($leftBorderColor == "#00ff00") {
414 414
                 $leftBorderColor = "yellow";
415 415
             }
416
-            $message = _("Certificate close to expiry!") . "<br/>";            
416
+            $message = _("Certificate close to expiry!")."<br/>";            
417 417
         }
418 418
    
419 419
         if ($details['root'] == 1 && $details['basicconstraints_set'] == 0) {
420 420
             if ($leftBorderColor == "#00ff00") {
421 421
                 $leftBorderColor = "yellow";
422 422
             }
423
-            $message .= "<div style='max-width: 25em'><strong>" . _("Improper root certificate, required critical CA extension missing, will not reliably install!") . "</strong>";
423
+            $message .= "<div style='max-width: 25em'><strong>"._("Improper root certificate, required critical CA extension missing, will not reliably install!")."</strong>";
424 424
             if (\config\ConfAssistant::CERT_GUIDELINES !== '') {
425
-                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>". _("more info")."</a>";
425
+                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>"._("more info")."</a>";
426 426
             }
427 427
             $message .= "</div><br/>";
428 428
         }
429
-        $retval =  "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div title='$certTooltip' style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>" . $message . $details['name'] . "<br>" . $this->displayName('eap:ca_vailduntil') . " " . gmdate('Y-m-d H:i:s', $details['full_details']['validTo_time_t']) . " UTC</div>";
429
+        $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div title='$certTooltip' style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>".$message.$details['name']."<br>".$this->displayName('eap:ca_vailduntil')." ".gmdate('Y-m-d H:i:s', $details['full_details']['validTo_time_t'])." UTC</div>";
430 430
         \core\common\Entity::outOfThePotatoes();
431 431
         return $retval;
432 432
     }
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
      */
440 440
     public function previewImageinHTML($imageReference) {
441 441
         \core\common\Entity::intoThePotatoes();
442
-        $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=" . $imageReference . "' alt='" . _("Preview of logo file") . "'/>";
442
+        $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=".$imageReference."' alt='"._("Preview of logo file")."'/>";
443 443
         \core\common\Entity::outOfThePotatoes();
444 444
         return $retval;
445 445
     }
@@ -456,13 +456,13 @@  discard block
 block discarded – undo
456 456
         $ref = $validator->databaseReference($fileReference);
457 457
         $fileBlob = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE);
458 458
         if (is_bool($fileBlob)) { // we didn't actually get a file!
459
-            $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the file from the database!") . "</div>";
459
+            $retval = "<div class='ca-summary'>"._("There was an error while retrieving the file from the database!")."</div>";
460 460
             \core\common\Entity::outOfThePotatoes();
461 461
             return $retval;
462 462
         }
463 463
         $decodedFileBlob = base64_decode($fileBlob);
464 464
         $fileinfo = new \finfo();
465
-        $retval = "<div class='ca-summary'>" . _("File exists") . " (" . $fileinfo->buffer($decodedFileBlob, FILEINFO_MIME_TYPE) . ", " . $this->displaySize(strlen($decodedFileBlob)) . ")<br/><a href='inc/filepreview.php?id=$fileReference'>" . _("Preview") . "</a></div>";
465
+        $retval = "<div class='ca-summary'>"._("File exists")." (".$fileinfo->buffer($decodedFileBlob, FILEINFO_MIME_TYPE).", ".$this->displaySize(strlen($decodedFileBlob)).")<br/><a href='inc/filepreview.php?id=$fileReference'>"._("Preview")."</a></div>";
466 466
         \core\common\Entity::outOfThePotatoes();
467 467
         return $retval;
468 468
     }
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
             return "";
620 620
         }
621 621
 
622
-        $loggerInstance->debug(4, "Consortium logo is at: " . ROOT . "/web/resources/images/consortium_logo_large.png");
623
-        $logogd = imagecreatefrompng(ROOT . "/web/resources/images/consortium_logo_large.png");
622
+        $loggerInstance->debug(4, "Consortium logo is at: ".ROOT."/web/resources/images/consortium_logo_large.png");
623
+        $logogd = imagecreatefrompng(ROOT."/web/resources/images/consortium_logo_large.png");
624 624
         if ($logogd === FALSE) { // consortium logo is bogus; don't do anything
625 625
             return "";
626 626
         }
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
         imagecolorallocate($whiteimage, 255, 255, 255);
647 647
         // also make sure the initial placement is a multitude of 12; otherwise "two half" symbols might be affected
648 648
         $targetplacementx = (int) ($symbolsize * round(($sizeinput[0] / 2 - ($targetwidth - $symbolsize + 1) / 2) / $symbolsize));
649
-        $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1 ) / 2) / $symbolsize));
649
+        $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1) / 2) / $symbolsize));
650 650
         imagecopyresized($inputgd, $whiteimage, $targetplacementx - $symbolsize, $targetplacementy - $symbolsize, 0, 0, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize);
651 651
         imagecopyresized($inputgd, $logogd, $targetplacementx, $targetplacementy, 0, 0, $targetwidth, $targetheight, $sizelogo[0], $sizelogo[1]);
652 652
         ob_start();
@@ -696,9 +696,9 @@  discard block
 block discarded – undo
696 696
                 $message = "Your configuration appears to be fine.";
697 697
                 break;
698 698
             default:
699
-                throw new Exception("The result code level " . $test->test_result['global'] . " is not defined!");
699
+                throw new Exception("The result code level ".$test->test_result['global']." is not defined!");
700 700
         }
701
-        $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>" . $message . "<br>See below for details<br><hr>");
701
+        $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>".$message."<br>See below for details<br><hr>");
702 702
         foreach ($test->out as $testValue) {
703 703
             foreach ($testValue as $o) {
704 704
                 $out .= $this->boxFlexible($o['level'], $o['message']);
Please login to merge, or discard this patch.
web/admin/overview_federation.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     <?php
110 110
     foreach ($cat->printCountryList(1) as $country => $name) {
111 111
         $selected = '';
112
-        if ($country == strtoupper($fed_id) ) {
112
+        if ($country == strtoupper($fed_id)) {
113 113
             $selected = 'selected';
114 114
         }
115 115
     echo "<option value='$country' $selected>$name</option>\n";
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                 ?>
183 183
             </table>
184 184
         </div>
185
-        <?php if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') { ?>
185
+        <?php if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') { ?>
186 186
         <div class='infobox'>
187 187
             <h2>
188 188
                 <?php $tablecaption3 = sprintf(_("%s Statistics: %s"), $uiElements->nomenclatureFed, $thefed->name); echo $tablecaption3; ?>
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             ?>
324 324
         <tr>
325 325
             <th scope='col'><?php echo sprintf(_("%s Name"), $uiElements->nomenclatureParticipant); ?></th>
326
-            <?php if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') { ?>
326
+            <?php if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') { ?>
327 327
             <th scope='col'><?php echo _("Status") ?></th>
328 328
             <th scope='col'><?php echo $OpenRoamingSymbol ?></th>
329 329
             <th scope='col'><?php echo _("Cert"); ?></th>
@@ -346,8 +346,8 @@  discard block
 block discarded – undo
346 346
         <?php
347 347
             /// nomenclature for 'federation', federation name, nomenclature for 'inst'
348 348
             echo "<tbody class='fedlist'>";
349
-            echo "<tr><td colspan='1'><strong>". _("Quick search:")." </strong><input style='background:#eeeeee;' type='text' id='qsearch_".$fedId."'></td>";
350
-            if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
349
+            echo "<tr><td colspan='1'><strong>"._("Quick search:")." </strong><input style='background:#eeeeee;' type='text' id='qsearch_".$fedId."'></td>";
350
+            if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
351 351
                 echo "<td style='border-bottom-style: dotted;border-bottom-width: 1px;'><input type='checkbox' name='profilecheck' id='profile_ck_".$fedId."'></td>";
352 352
                 echo "<td style='border-bottom-style: dotted;border-bottom-width: 1px;'><input type='checkbox' name='orcheck' id='or_ck_".$fedId."'></td>";
353 353
                 echo "<td style='border-bottom-style: dotted;border-bottom-width: 1px;'><input type='checkbox' name='brokencert' id='brokencert_ck_".$fedId."'></td>";
@@ -465,18 +465,18 @@  discard block
 block discarded – undo
465 465
                          <input type='hidden' name='inst' value='" 
466 466
                        . $index."'>"
467 467
                        . "<span style='display:none' class='inst_name'>".$my_idp."</span>"
468
-                       . "<span>". $idp_instance->name."</span>"
468
+                       . "<span>".$idp_instance->name."</span>"
469 469
                        . " (<a href='overview_org.php?inst_id="
470 470
                        . $idp_instance->identifier."'>" 
471 471
                        . (in_array($index, $userIdps) ? _("manage") : _("view"))
472 472
                        . "</a>)"
473
-                       . (empty($listOfSilverbulletRealms) ? "" : "<ul><li>" ) 
473
+                       . (empty($listOfSilverbulletRealms) ? "" : "<ul><li>") 
474 474
                        . implode("</li><li>", $listOfSilverbulletRealms) 
475
-                       . (empty($listOfSilverbulletRealms) ? "" : "</li><ul>" )
475
+                       . (empty($listOfSilverbulletRealms) ? "" : "</li><ul>")
476 476
                        . "</td>";
477 477
                 // deployment status; need to dive into profiles for this
478 478
                 // show happy eyeballs if at least one profile is configured/showtime     
479
-                if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
479
+                if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
480 480
                     echo  "<td>$profileIcon</td>";
481 481
                     echo "<td style='text-align: center'>$orIcon</td>";
482 482
                     echo "<td>$certIcon</td>";
Please login to merge, or discard this patch.