Passed
Push — release_2_1 ( fbb5f6...18aa87 )
by Tomasz
11:00
created
core/AbstractProfile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
                     // for now (no OpenRoaming client certs available) only run server-side tests
332 332
                     foreach ($listOfIPs as $oneIP) {
333 333
                         $connectionResult = $connectionTests->cApathCheck($oneIP);
334
-                        if ($connectionResult != \core\diag\AbstractTest::RETVAL_OK || ( isset($connectionTests->TLS_CA_checks_result['cert_oddity']) && count($connectionTests->TLS_CA_checks_result['cert_oddity']) > 0)) {
334
+                        if ($connectionResult != \core\diag\AbstractTest::RETVAL_OK || (isset($connectionTests->TLS_CA_checks_result['cert_oddity']) && count($connectionTests->TLS_CA_checks_result['cert_oddity']) > 0)) {
335 335
                             $allHostsOkay = FALSE;
336 336
                         } else {
337 337
                             $oneHostOkay = TRUE;
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
         $profileStatus = self::CERT_STATUS_NONE;
946 946
         foreach ($rows as $row) {
947 947
             $encodedCert = $row[0];
948
-            $tm = $x509->processCertificate(base64_decode($encodedCert))['full_details']['validTo_time_t']- time();
948
+            $tm = $x509->processCertificate(base64_decode($encodedCert))['full_details']['validTo_time_t'] - time();
949 949
             if ($tm < \config\ConfAssistant::CERT_WARNINGS['expiry_critical']) {
950 950
                 $certStatus = self::CERT_STATUS_ERROR;
951 951
             } elseif ($tm < \config\ConfAssistant::CERT_WARNINGS['expiry_warning']) {
Please login to merge, or discard this patch.
web/admin/overview_org.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 <?php
29
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
29
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
30 30
 
31 31
 function displaySilverbulletPropertyWidget(&$theProfile, $readonly, &$uiElements) {
32 32
     ?>
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
                 <ul style='margin:1px'>
44 44
                     <?php
45 45
                     foreach ($completeness as $missing_attrib) {
46
-                        echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
46
+                        echo "<li>".$uiElements->displayName($missing_attrib)."</li>";
47 47
                     }
48 48
                     ?>
49 49
                 </ul>
50 50
             </div>
51 51
             <?php
52 52
         } else {
53
-            echo sprintf(_("You can create up to %d users."), $maxusers[0]['value']) . "<br/>" . sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $theProfile->realm);
53
+            echo sprintf(_("You can create up to %d users."), $maxusers[0]['value'])."<br/>".sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $theProfile->realm);
54 54
         }
55 55
         ?>
56 56
         <br/>
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         if ($readonly === FALSE) {
60 60
             ?>
61 61
             <form action='edit_silverbullet.php?inst_id=<?php echo $theProfile->institution; ?>&amp;profile_id=<?php echo $theProfile->identifier; ?>' method='POST'>
62
-                <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
62
+                <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
63 63
             </form>
64 64
             <?php
65 65
         }
@@ -95,21 +95,21 @@  discard block
 block discarded – undo
95 95
                 $has_overrides = TRUE;
96 96
             }
97 97
         }
98
-        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>";
98
+        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>";
99 99
         $typelist = $theProfile->getEapMethodsinOrderOfPreference();
100 100
         $allcomplete = TRUE;
101 101
         foreach ($typelist as $eaptype) {
102 102
             $buffer_eaptypediv .= $eaptype->getPrintableRep();
103 103
             $completeness = $theProfile->isEapTypeDefinitionComplete($eaptype);
104 104
             if ($completeness === true) {
105
-                $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>";
105
+                $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>";
106 106
             } else {
107 107
                 $buffer_eaptypediv .= " <div class='notacceptable'>";
108 108
                 $buffer_eaptypediv .= _("Information needed!");
109 109
                 if (is_array($completeness)) {
110 110
                     $buffer_eaptypediv .= "<ul style='margin:1px'>";
111 111
                     foreach ($completeness as $missing_attrib) {
112
-                        $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
112
+                        $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>";
113 113
                     }
114 114
                     $buffer_eaptypediv .= "</ul>";
115 115
                 }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             foreach ($attribs as $attrib) {
122 122
                 if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) {
123 123
                     $justOnce = TRUE;
124
-                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>";
124
+                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='"._("Options on EAP Method/Device level are in effect.")."'>";
125 125
                 }
126 126
             }
127 127
             $buffer_eaptypediv .= "<br/>";
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         if ($theProfile->isRedirected()) {
148 148
             $iconData = $uiElements->iconData('PROFILES_REDIRECTED');
149 149
             $iconData['text'] = _("Profile redirected");
150
-            $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
150
+            $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
151 151
             
152 152
         } 
153 153
         
@@ -155,15 +155,15 @@  discard block
 block discarded – undo
155 155
         switch ($certStatus) {
156 156
             case core\AbstractProfile::CERT_STATUS_OK:
157 157
                 $iconData = $uiElements->iconData('CERT_STATUS_OK');
158
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
158
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
159 159
                 break;
160 160
             case core\AbstractProfile::CERT_STATUS_WARN:
161 161
                 $iconData = $uiElements->iconData('CERT_STATUS_WARN');
162
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));                
162
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));                
163 163
                 break;
164 164
             case core\AbstractProfile::CERT_STATUS_ERROR:
165 165
                 $iconData = $uiElements->iconData('CERT_STATUS_ERROR');
166
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
166
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
167 167
                 break;            
168 168
         }
169 169
         $buffer_headline .= "</div>";
@@ -189,11 +189,11 @@  discard block
 block discarded – undo
189 189
                 if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") {
190 190
                     $diagUrl = "../diag/";
191 191
                 } else {
192
-                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/";
192
+                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/";
193 193
                 }
194 194
                 ?>
195
-                <form action='<?php echo $diagUrl . "action_realmcheck.php?inst_id=" . $theProfile->institution . "&profile_id=" . $theProfile->identifier ?>' method='post' accept-charset='UTF-8'>
196
-                    <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link . $_SERVER['SCRIPT_NAME']); ?>'/>
195
+                <form action='<?php echo $diagUrl."action_realmcheck.php?inst_id=".$theProfile->institution."&profile_id=".$theProfile->identifier ?>' method='post' accept-charset='UTF-8'>
196
+                    <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link.$_SERVER['SCRIPT_NAME']); ?>'/>
197 197
                     <button type='submit' name='profile_action' value='check' <?php echo ($has_realm ? "" : "disabled='disabled'"); ?> title='<?php echo _("The realm can only be checked if you configure the realm!"); ?>'>
198 198
                         <?php echo _("Check realm reachability"); ?>
199 199
                     </button>
@@ -235,9 +235,9 @@  discard block
 block discarded – undo
235 235
                 ?>
236 236
                 <div style='display: flex;'>
237 237
                     <?php
238
-                    $idpLevelUrl = $link . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $theProfile->institution;
239
-                    $displayurl = $idpLevelUrl . "&amp;profile=" . $theProfile->identifier;
240
-                    $QRurl = $idpLevelUrl . "&profile=" . $theProfile->identifier;
238
+                    $idpLevelUrl = $link.dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$theProfile->institution;
239
+                    $displayurl = $idpLevelUrl."&amp;profile=".$theProfile->identifier;
240
+                    $QRurl = $idpLevelUrl."&profile=".$theProfile->identifier;
241 241
                     $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([
242 242
                                 'outputType' => \chillerlan\QRCode\QRCode::OUTPUT_IMAGE_PNG,
243 243
                                 'eccLevel' => \chillerlan\QRCode\QRCode::ECC_H,
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
                     if (empty($rawQr)) {
250 250
                         throw new Exception("Something went seriously wrong during QR code generation!");
251 251
                     }
252
-                    $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
252
+                    $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
253 253
                     $size = getimagesize($uri);
254
-                    echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>";
254
+                    echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>";
255 255
 
256 256
                     //echo "<nobr>$displayurl</nobr></a>";
257 257
                     echo "<p>$displayurl</p></a>";
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
             <h2><?php
296 296
                 switch ($deploymentObject->consortium) {
297 297
                     case "eduroam":
298
-                        $displayname = config\ConfAssistant::CONSORTIUM['name'] . " " . core\DeploymentManaged::PRODUCTNAME;
298
+                        $displayname = config\ConfAssistant::CONSORTIUM['name']." ".core\DeploymentManaged::PRODUCTNAME;
299 299
                         break;
300 300
                     case "OpenRoaming":
301 301
                         $displayname = "OpenRoaming ANP";
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
                     default:
304 304
                         throw new Exception("We are supposed to operate on a roaming consortium we don't know.");
305 305
                 }
306
-                echo $displayname . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)";
306
+                echo $displayname." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)";
307 307
                 ?></h2>
308 308
             <table>
309 309
                 <caption><?php echo _("Deployment Details"); ?></caption>
@@ -317,13 +317,13 @@  discard block
 block discarded – undo
317 317
                     <td><strong><?php echo _("Your primary RADIUS server") ?></strong><br/>
318 318
                         <?php
319 319
                         if ($deploymentObject->host1_v4 !== NULL) {
320
-                            echo _("IPv4") . ": " . $deploymentObject->host1_v4;
320
+                            echo _("IPv4").": ".$deploymentObject->host1_v4;
321 321
                         }
322 322
                         if ($deploymentObject->host1_v4 !== NULL && $deploymentObject->host1_v6 !== NULL) {
323 323
                             echo "<br/>";
324 324
                         }
325 325
                         if ($deploymentObject->host1_v6 !== NULL) {
326
-                            echo _("IPv6") . ": " . $deploymentObject->host1_v6;
326
+                            echo _("IPv6").": ".$deploymentObject->host1_v6;
327 327
                         }
328 328
                         ?>
329 329
                     </td>
@@ -331,9 +331,9 @@  discard block
 block discarded – undo
331 331
                     <td><?php echo $deploymentObject->port1; ?></td>
332 332
                     <td>
333 333
                         <?php
334
-                        echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] .
335
-                        "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] .
336
-                        "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>";
334
+                        echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon'].
335
+                        "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text'].
336
+                        "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>";
337 337
                         ?>
338 338
                     </td>
339 339
                 </tr>
@@ -341,22 +341,22 @@  discard block
 block discarded – undo
341 341
                     <td><strong><?php echo _("Your backup RADIUS server") ?><br/></strong>
342 342
                         <?php
343 343
                         if ($deploymentObject->host2_v4 !== NULL) {
344
-                            echo _("IPv4") . ": " . $deploymentObject->host2_v4;
344
+                            echo _("IPv4").": ".$deploymentObject->host2_v4;
345 345
                         }
346 346
                         if ($deploymentObject->host2_v4 !== NULL && $deploymentObject->host2_v6 !== NULL) {
347 347
                             echo "<br/>";
348 348
                         }
349 349
                         if ($deploymentObject->host2_v6 !== NULL) {
350
-                            echo _("IPv6") . ": " . $deploymentObject->host2_v6;
350
+                            echo _("IPv6").": ".$deploymentObject->host2_v6;
351 351
                         }
352 352
                         ?></td>
353 353
                     <td><?php echo _("RADIUS port number: ") ?></td>
354 354
                     <td><?php echo $deploymentObject->port2; ?></td>
355 355
                     <td>
356 356
                         <?php
357
-                        echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
358
-                        "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] .
359
-                        "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>";
357
+                        echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
358
+                        "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text'].
359
+                        "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>";
360 360
                         ?>
361 361
                     </td>
362 362
                 </tr>
@@ -408,12 +408,12 @@  discard block
 block discarded – undo
408 408
                             if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) {
409 409
                                 echo '<br>';
410 410
                                 if ($res['FAILURE'] == 2) {
411
-                                    echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
411
+                                    echo ' <span style="color: red;">'._("Activation failure.").'</span>';
412 412
                                 } else {
413 413
                                     if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
414
-                                        echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>';
414
+                                        echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>';
415 415
                                     } else {
416
-                                        echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>';
416
+                                        echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>';
417 417
                                     }
418 418
                                 }
419 419
                             }
@@ -448,12 +448,12 @@  discard block
 block discarded – undo
448 448
                                 if ($res['FAILURE'] > 0) {
449 449
                                     echo '<br>';
450 450
                                     if ($res['FAILURE'] == 2) {
451
-                                        echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>';
451
+                                        echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>';
452 452
                                     } else {
453 453
                                         if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
454
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>';
454
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>';
455 455
                                         } else {
456
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>';
456
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>';
457 457
                                         }
458 458
                                     }
459 459
                                 }
@@ -474,24 +474,24 @@  discard block
 block discarded – undo
474 474
         </div>
475 475
         <div style='width:20px;'></div> <!-- QR code space, reserved -->
476 476
         <div style='display: table-cell; min-width:200px;'>
477
-            <?php $tablecaption = _("Hotspot Usage Statistics");?>
477
+            <?php $tablecaption = _("Hotspot Usage Statistics"); ?>
478 478
             <h1><?php echo $tablecaption; ?></h1>
479
-            <h2><?php echo _("5 most recent authentications");?></h2>
480
-            <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)");?></p>
479
+            <h2><?php echo _("5 most recent authentications"); ?></h2>
480
+            <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)"); ?></p>
481 481
             <table class='authrecord'>
482
-    <caption><?php echo $tablecaption;?></caption>
482
+    <caption><?php echo $tablecaption; ?></caption>
483 483
     <tr style='text-align: left;'>
484
-        <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th>
485
-        <th scope="col"><strong><?php echo _("Realm");?></strong></th>
486
-        <th scope="col"><strong><?php echo _("MAC Address");?></strong></th>
487
-        <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th>
488
-        <th scope="col"><strong><?php echo _("Result");?></strong></th>
489
-        <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th>
484
+        <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th>
485
+        <th scope="col"><strong><?php echo _("Realm"); ?></strong></th>
486
+        <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th>
487
+        <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th>
488
+        <th scope="col"><strong><?php echo _("Result"); ?></strong></th>
489
+        <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th>
490 490
     </tr>
491 491
     <?php
492
-    $userAuthData = $deploymentObject->retrieveStatistics(0,5);
492
+    $userAuthData = $deploymentObject->retrieveStatistics(0, 5);
493 493
     foreach ($userAuthData as $oneRecord) {
494
-        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>"
494
+        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>"
495 495
                 . "<td>".$oneRecord['activity_time']."</td>"
496 496
                 . "<td>".$oneRecord['realm']."</td>"
497 497
                 . "<td>".$oneRecord['mac']."</td>"
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
                         <div>
717 717
                             <input type="hidden" name="consortium" value="eduroam"/>
718 718
                             <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'>
719
-                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?>
719
+                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?>
720 720
                             </button>
721 721
                             <span style='color: red;'>
722 722
                             <?php if ($hasMail == 0) { 
Please login to merge, or discard this patch.