Passed
Push — master ( 2fee66...2664da )
by Maja
13:32
created
core/ExternalEduroamDBData.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             return $this->counter;
132 132
         }
133 133
 
134
-        $cachedNumber = @file_get_contents(ROOT . "/var/tmp/cachedSPNumber.serialised");
134
+        $cachedNumber = @file_get_contents(ROOT."/var/tmp/cachedSPNumber.serialised");
135 135
         if ($cachedNumber !== FALSE) {
136 136
             $numberData = unserialize($cachedNumber);
137 137
             $now = new \DateTime();
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         } else { // data in cache is too old or doesn't exist. We really need to ask the database
145 145
             $list = $this->listAllServiceProviders();
146 146
             $this->counter = count($list);
147
-            file_put_contents(ROOT . "/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()]));
147
+            file_put_contents(ROOT."/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()]));
148 148
             return $this->counter;
149 149
         }
150 150
     }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $returnarray = [];
176 176
         $query = "SELECT id_institution AS id, country, inst_realm as realmlist, name AS collapsed_name, contact AS collapsed_contact, type FROM view_active_institution WHERE country = ?";
177 177
         if ($eduroamDbType !== NULL) {
178
-            $query .= " AND ( type = '" . ExternalEduroamDBData::TYPE_IDPSP . "' OR type = '" . $eduroamDbType . "')";
178
+            $query .= " AND ( type = '".ExternalEduroamDBData::TYPE_IDPSP."' OR type = '".$eduroamDbType."')";
179 179
         }
180 180
         $externals = $this->db->exec($query, "s", $tld);
181 181
         // was a SELECT query, so a resource and not a boolean
Please login to merge, or discard this patch.
web/user/faq.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     ],
46 46
     [
47 47
         'title' => sprintf(_("Is it safe to use %s installers?"), \config\Master::APPEARANCE['productname']),
48
-        'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Master::APPEARANCE['productname']) . ' ' . ( isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Master::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""),
48
+        'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Master::APPEARANCE['productname']).' '.(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Master::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""),
49 49
     ],
50 50
     [
51 51
         'title' => _("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"),
52
-        'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.") . " " . (isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name']) . " " : "") . sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>")
52
+        'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.")." ".(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name'])." " : "").sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>")
53 53
     ],
54 54
     [
55 55
         'title' => sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"), \config\ConfAssistant::CONSORTIUM['display_name']),
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 $consortium = \config\ConfAssistant::CONSORTIUM['display_name'];
69 69
 array_push($Faq,
70 70
         [
71
-            'id' => 'what_is_' . \config\ConfAssistant::CONSORTIUM['name'],
71
+            'id' => 'what_is_'.\config\ConfAssistant::CONSORTIUM['name'],
72 72
             'title' => sprintf(_("What is this %s thing anyway?"), $consortium),
73 73
             'text' => sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than %d hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> or <a href='http://monitor.eduroam.org/map_service_loc.php'>the %s location map</a> for more details."), $consortium, $consortium, $consortium, $SPs, $consortium, $consortium)
74 74
 ]);
Please login to merge, or discard this patch.
web/diag/diag.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 $admin = filter_input(INPUT_GET, 'admin', FILTER_VALIDATE_INT);
24 24
 $sp = filter_input(INPUT_GET, 'sp', FILTER_VALIDATE_INT);
25 25
 $givenRealm = filter_input(INPUT_GET, 'realm', FILTER_VALIDATE_STRING);
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             unset($q_el[$idx]);
36 36
             $q_r = preg_replace("/\?.*/", "", $_SERVER['REQUEST_URI']);
37 37
             if (count($q_el)) {
38
-                $q_r = $q_r . '?' . implode('&', $q_el);
38
+                $q_r = $q_r.'?'.implode('&', $q_el);
39 39
             }
40 40
             $_SERVER['REQUEST_URI'] = $q_r;
41 41
         }
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
     $auth->authenticate();
45 45
 }
46 46
 if (isset($_SESSION['admin_diag_auth'])) {
47
-   $admin =  1;
47
+   $admin = 1;
48 48
    unset($_SESSION['admin_diag_auth']);
49 49
 }
50 50
 $Gui = new \web\lib\user\Gui();
51 51
 $skinObject = new \web\lib\user\Skinjob($_REQUEST['skin'] ?? $_SESSION['skin'] ?? $fedskin[0] ?? \config\Master::APPEARANCE['skins'][0]);
52
-require "../skins/" . $skinObject->skin . "/diag/diag.php";
52
+require "../skins/".$skinObject->skin."/diag/diag.php";
53 53
 
54 54
 
Please login to merge, or discard this patch.
web/admin/edit_participant_result.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  */
22 22
 
23
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $loggerInstance = new \core\common\Logging();
@@ -33,15 +33,15 @@  discard block
 block discarded – undo
33 33
 $myInstOriginal = $validator->existingIdP($_GET['inst_id'], $_SESSION['user']);
34 34
 $instId = $myInstOriginal->identifier;
35 35
 
36
-$hello = _("To whom it may concern,") . "\n\n";
37
-$bye = _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.") . "\n\n" .
38
-        _("Greetings, ") . "\n\n" .
36
+$hello = _("To whom it may concern,")."\n\n";
37
+$bye = _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.")."\n\n".
38
+        _("Greetings, ")."\n\n".
39 39
         \config\Master::APPEARANCE['productname_long'];
40 40
 
41 41
 switch ($_POST['submitbutton']) {
42 42
     case web\lib\common\FormElements::BUTTON_DELETE:
43 43
         $myInstOriginal->destroy();
44
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP " . $instId);
44
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP ".$instId);
45 45
         header("Location: overview_user.php");
46 46
         exit;
47 47
     case web\lib\common\FormElements::BUTTON_FLUSH_AND_RESTART:
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
         }
52 52
         // flush all IdP attributes and send user to creation wizard
53 53
         $myInstOriginal->flushAttributes();
54
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over" . $instId);
55
-        $text = $hello .
56
-                sprintf(_("the %s %s / %s / (previously known as) '%s' has deleted all properties and is starting over freshly. This means that its not recognisable by its name any more, and it may assume a different name in the future. You will get another mail if and when the name change happens."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n" .
54
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over".$instId);
55
+        $text = $hello.
56
+                sprintf(_("the %s %s / %s / (previously known as) '%s' has deleted all properties and is starting over freshly. This means that its not recognisable by its name any more, and it may assume a different name in the future. You will get another mail if and when the name change happens."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n".
57 57
                 $bye;
58 58
         $fed = new core\Federation($myInstOriginal->federation);
59 59
         foreach ($fed->listFederationAdmins() as $id) {
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
             exit(0);
73 73
         }
74 74
         $inst_name = $myInstOriginal->name;
75
-        echo "<h1>" . sprintf(_("Submitted attributes for IdP '%s'"), $inst_name) . "</h1>";
75
+        echo "<h1>".sprintf(_("Submitted attributes for IdP '%s'"), $inst_name)."</h1>";
76 76
         echo "<table>";
77 77
         echo $optionParser->processSubmittedFields($myInstOriginal, $_POST, $_FILES);
78 78
         echo "</table>";
79 79
 // delete cached logo, if present
80
-        $dir = ROOT . '/web/downloads/logos/';
81
-        $globResult = glob($dir . $myInstOriginal->identifier . "_*.png");
80
+        $dir = ROOT.'/web/downloads/logos/';
81
+        $globResult = glob($dir.$myInstOriginal->identifier."_*.png");
82 82
         if ($globResult === FALSE) { // we should catch the improbable error condition
83 83
             $globResult = [];
84 84
         }
85 85
         array_map('unlink', $globResult);
86 86
         $loggerInstance->debug(4, "UNLINK from $dir\n");
87
-        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP " . $myInstOriginal->identifier . " - attributes changed");
87
+        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP ".$myInstOriginal->identifier." - attributes changed");
88 88
 
89 89
 // re-instantiate ourselves... profiles need fresh data
90 90
         $myInstReinstantiated = $validator->existingIdP($_GET['inst_id'], $_SESSION['user']);
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
         if (count($significantChanges) > 0) {
94 94
             // send a notification/alert mail to someone we know is in charge
95 95
             /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
96
-            $text = $hello . sprintf(_("significant changes were made to the %s %s / %s / (previously known as) '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n";
96
+            $text = $hello.sprintf(_("significant changes were made to the %s %s / %s / (previously known as) '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n";
97 97
             if (isset($significantChanges[\core\IdP::INSTNAME_CHANGED])) {
98
-                $text .= sprintf(_("The %s has changed its name. The details are below:"), $ui->nomenclatureInst) . "\n\n";
99
-                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED] . "\n\n";
98
+                $text .= sprintf(_("The %s has changed its name. The details are below:"), $ui->nomenclatureInst)."\n\n";
99
+                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED]."\n\n";
100 100
             }
101 101
             $text .= $bye;
102 102
             // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
 
113 113
         if (isset(\config\ConfAssistant::CONSORTIUM['ssid']) && count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0) {
114 114
             foreach (\config\ConfAssistant::CONSORTIUM['ssid'] as $ssidname) {
115
-                $ssids[] = $ssidname . " " . (isset(\config\ConfAssistant::CONSORTIUM['tkipsupport']) && \config\ConfAssistant::CONSORTIUM['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)") );
115
+                $ssids[] = $ssidname." ".(isset(\config\ConfAssistant::CONSORTIUM['tkipsupport']) && \config\ConfAssistant::CONSORTIUM['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)"));
116 116
             }
117 117
         }
118 118
 
119 119
         foreach ($myInstReinstantiated->getAttributes("media:SSID") as $ssidname) {
120
-            $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES)");
120
+            $ssids[] = $ssidname['value']." "._("(WPA2/AES)");
121 121
         }
122 122
 
123 123
         echo "<table>";
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         if (count($ssids) > 0) {
126 126
             $printedlist = "";
127 127
             foreach ($ssids as $names) {
128
-                $printedlist = $printedlist . "$names ";
128
+                $printedlist = $printedlist."$names ";
129 129
             }
130 130
             echo $uiElements->boxOkay(sprintf(_("Your installers will configure the following SSIDs: <strong>%s</strong>"), $printedlist), _("SSIDs configured"));
131 131
         }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
                 // did we get an email address? then, show the silverbullet jumpstart button
154 154
                 // otherwise, issue a smartass comment
155 155
                 if (count($myInstReinstantiated->getAttributes("support:email")) > 0) {
156
-                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME) . "</button></form>";
156
+                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>".sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME)."</button></form>";
157 157
                 } else {
158 158
                     echo "<table>";
159 159
                     echo $uiElements->boxError(sprintf(_("You did not submit an e-mail address. This is required for %s. Please go to the %s dashboard and edit your helpdesk settings to include a helpdesk e-mail address."), core\ProfileSilverbullet::PRODUCTNAME, $ui->nomenclatureInst), _("No support e-mail!"));
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
                 }
162 162
             }
163 163
             if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == "LOCAL") {
164
-                echo "<br/><form method='post' action='edit_profile.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to RADIUS/EAP profile definition") . "</button></form>";
164
+                echo "<br/><form method='post' action='edit_profile.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to RADIUS/EAP profile definition")."</button></form>";
165 165
             }
166 166
         }
167
-        echo "<br/><form method='post' action='overview_user.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to dashboard") . "</button></form>";
167
+        echo "<br/><form method='post' action='overview_user.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to dashboard")."</button></form>";
168 168
 
169 169
         break;
170 170
     default:
Please login to merge, or discard this patch.
core/diag/RADIUSTestsUI.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
          <table><tr>
291 291
          <td class='icon_td'>";
292 292
         $out[] = "<img src='".$this->stateIcons[$this->globalLevelStatic]."' id='main_static_ico' class='icon'></td><td id='main_static_result'>".
293
-                            $this->globalInfo[$this->globalLevelStatic].' '. _("See the appropriate tab for details.").'</td>
293
+                            $this->globalInfo[$this->globalLevelStatic].' '._("See the appropriate tab for details.").'</td>
294 294
          </tr></table>';
295 295
         if ($this->naptr > 0) {
296 296
             $out[] = "<hr><strong>"._("Dynamic connectivity tests")."</strong>
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 <td class='icon_td'><img src='".$this->stateIcons[$result->level]."' id='src".$hostindex."_img'></td>
324 324
 <td id='src$hostindex' colspan=2>
325 325
 ";
326
-            $out[] = '<strong>'.($result->server ? $result->server : _("Connected to undetermined server")).'</strong><br/>'.sprintf (_("elapsed time: %sms."), $result->time_millisec).'<p>'.$result->message.'</p>';
326
+            $out[] = '<strong>'.($result->server ? $result->server : _("Connected to undetermined server")).'</strong><br/>'.sprintf(_("elapsed time: %sms."), $result->time_millisec).'<p>'.$result->message.'</p>';
327 327
                     
328 328
             if ($result->level > \core\common\Entity::L_OK && property_exists($result, 'cert_oddities')) {
329 329
                 foreach ($result->cert_oddities as $oddities) {
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
             } else {
409 409
                 $certdesc = '<br>';
410 410
             }
411
-            $capathtest[] = '<div>'.($capath->message!='' ? $capath->message : _('Test failed')).'</div>'.$more;
411
+            $capathtest[] = '<div>'.($capath->message != '' ? $capath->message : _('Test failed')).'</div>'.$more;
412 412
             $capathtest[] = '</td>
413 413
 </tr>
414 414
 </table>';
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
                         $srefused = 0;
435 435
                         $cliinfo = '';
436 436
                         $cliinfo .= '<li>'._('Client certificate').' <b>'.$ca->clientcertinfo->from.
437
-                                    '</b>'.', '.$ca->clientcertinfo->message .
437
+                                    '</b>'.', '.$ca->clientcertinfo->message.
438 438
                                     '<br> (CA: '.$ca->clientcertinfo->issuer.')<ul>';
439 439
                         foreach ($ca->certificate as $certificate) {
440 440
                             if ($certificate->returncode == \core\diag\RADIUSTests::RETVAL_CONNECTION_REFUSED) {
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                 } else {
495 495
                     $cliinfo = _('Test failed');
496 496
                     $clientstest[] = "<table><tr><td class='icon_td' id='srcclient".$hostindex."_img'><img src='".
497
-                                    $this->stateIcons[\core\common\Entity::L_WARN]."'></td>" .
497
+                                    $this->stateIcons[\core\common\Entity::L_WARN]."'></td>".
498 498
                                     "<td id='srcclient$hostindex'>$cliinfo</td></tr></table>";
499 499
                 }
500 500
             } else {
Please login to merge, or discard this patch.
devices/apple_mobileconfig/MobileconfigSuperclass.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -179,15 +179,15 @@  discard block
 block discarded – undo
179 179
       <key>PayloadDescription</key>
180 180
          <string>$tagline</string>
181 181
       <key>PayloadDisplayName</key>
182
-         <string>" . \config\ConfAssistant::CONSORTIUM['display_name'] . "</string>
182
+         <string>".\config\ConfAssistant::CONSORTIUM['display_name']."</string>
183 183
       <key>PayloadIdentifier</key>
184
-         <string>" . self::IPHONE_PAYLOAD_PREFIX . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
184
+         <string>" . self::IPHONE_PAYLOAD_PREFIX.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
185 185
       <key>PayloadOrganization</key>
186
-         <string>" . htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['general:instname'][0]), ENT_XML1, 'UTF-8') . ( $this->attributes['internal:profile_count'][0] > 1 ? " (" . htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['profile:name'][0]), ENT_XML1, 'UTF-8') . ")" : "") . "</string>
186
+         <string>".htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['general:instname'][0]), ENT_XML1, 'UTF-8').($this->attributes['internal:profile_count'][0] > 1 ? " (".htmlspecialchars(iconv("UTF-8", "UTF-8//IGNORE", $this->attributes['profile:name'][0]), ENT_XML1, 'UTF-8').")" : "")."</string>
187 187
       <key>PayloadType</key>
188 188
          <string>Configuration</string>
189 189
       <key>PayloadUUID</key>
190
-         <string>" . \core\common\Entity::uuid('', self::IPHONE_PAYLOAD_PREFIX . $this->massagedConsortium . $this->massagedCountry . $this->massagedInst . $this->massagedProfile) . "</string>
190
+         <string>" . \core\common\Entity::uuid('', self::IPHONE_PAYLOAD_PREFIX.$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile)."</string>
191 191
       <key>PayloadVersion</key>
192 192
          <integer>1</integer>";
193 193
         \core\common\Entity::outOfThePotatoes();
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
     {
220 220
         \core\common\Entity::intoThePotatoes();
221 221
         if (isset($this->attributes['support:info_file'])) {
222
-            return MobileconfigSuperclass::BUFFER_CONSENT_PRE . htmlspecialchars(iconv("UTF-8", "UTF-8//TRANSLIT", $this->attributes['support:info_file'][0]), ENT_XML1, 'UTF-8') . MobileconfigSuperclass::BUFFER_CONSENT_POST;
222
+            return MobileconfigSuperclass::BUFFER_CONSENT_PRE.htmlspecialchars(iconv("UTF-8", "UTF-8//TRANSLIT", $this->attributes['support:info_file'][0]), ENT_XML1, 'UTF-8').MobileconfigSuperclass::BUFFER_CONSENT_POST;
223 223
         }
224 224
         if ($this->attributes['internal:verify_userinput_suffix'][0] != 0) {
225 225
             if (strlen($this->attributes['internal:realm'][0]) > 0) {
226 226
                 /// note space between variable and exclamation mark - makes sure users don't mistakenly think the exclamation mark is part of the required username!
227
-                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . sprintf(_("Important Notice: your username must end with @%s !"), $this->attributes['internal:realm'][0]) . MobileconfigSuperclass::BUFFER_CONSENT_POST;
227
+                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE.sprintf(_("Important Notice: your username must end with @%s !"), $this->attributes['internal:realm'][0]).MobileconfigSuperclass::BUFFER_CONSENT_POST;
228 228
                 \core\common\Entity::outOfThePotatoes();
229 229
                 return $retval;
230 230
             }
231
-            $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . _("Important Notice: your username MUST be in the form of xxx@yyy where the yyy is a common suffix identifying your Identity Provider. Please find out what to use there and enter the username in the correct format.") . MobileconfigSuperclass::BUFFER_CONSENT_POST;
231
+            $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE._("Important Notice: your username MUST be in the form of xxx@yyy where the yyy is a common suffix identifying your Identity Provider. Please find out what to use there and enter the username in the correct format.").MobileconfigSuperclass::BUFFER_CONSENT_POST;
232 232
             \core\common\Entity::outOfThePotatoes();
233 233
             return $retval;
234 234
         }
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         // also escape htmlspecialchars
252 252
         // not all names and profiles have a name, so be prepared
253 253
 
254
-        $this->loggerInstance->debug(5, "List of available attributes: " . var_export($this->attributes, TRUE));
254
+        $this->loggerInstance->debug(5, "List of available attributes: ".var_export($this->attributes, TRUE));
255 255
 
256 256
         $this->instName = $this->attributes['general:instname'][0] ?? _("Unnamed Organisation");
257 257
         $this->profileName = $this->attributes['profile:name'][0] ?? _("Unnamed Profile");
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 
294 294
         file_put_contents('installer_profile', $outputXml);
295 295
 
296
-        $fileName = $this->installerBasename . '.mobileconfig';
296
+        $fileName = $this->installerBasename.'.mobileconfig';
297 297
 
298 298
         if (!$this->sign) {
299 299
             rename("installer_profile", $fileName);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
             return $fileName;
302 302
         }
303 303
         // still here? Then we are signing.
304
-        $signing = system($this->sign . " installer_profile '$fileName' > /dev/null");
304
+        $signing = system($this->sign." installer_profile '$fileName' > /dev/null");
305 305
         if ($signing === FALSE) {
306 306
             $this->loggerInstance->debug(2, "Signing the mobileconfig installer $fileName FAILED!\n");
307 307
         }
@@ -320,19 +320,19 @@  discard block
 block discarded – undo
320 320
         \core\common\Entity::intoThePotatoes();
321 321
         $ssidCount = count($this->attributes['internal:SSID']);
322 322
         $certCount = count($this->attributes['internal:CAs'][0]);
323
-        $out = "<p>" . _("For best results, please use the built-in browser (Safari) to open the configuration file.") . "</p>";
323
+        $out = "<p>"._("For best results, please use the built-in browser (Safari) to open the configuration file.")."</p>";
324 324
         $out .= "<p>";
325 325
         $out .= _("The profile will install itself after you click (or tap) the button. You will be asked for confirmation/input at several points:");
326 326
         $out .= "<ul>";
327
-        $out .= "<li>" . _("to install the profile") . "</li>";
328
-        $out .= "<li>" . ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
327
+        $out .= "<li>"._("to install the profile")."</li>";
328
+        $out .= "<li>".ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
329 329
         if ($certCount > 1) {
330
-            $out .= " " . sprintf(_("(%d times)"), $certCount);
330
+            $out .= " ".sprintf(_("(%d times)"), $certCount);
331 331
         }
332 332
         $out .= "</li>";
333
-        $out .= "<li>" . _("to enter the username and password you have been given by your organisation");
333
+        $out .= "<li>"._("to enter the username and password you have been given by your organisation");
334 334
         if ($ssidCount > 1) {
335
-            $out .= " " . sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, \config\ConfAssistant::CONSORTIUM['display_name'], $ssidCount);
335
+            $out .= " ".sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, \config\ConfAssistant::CONSORTIUM['display_name'], $ssidCount);
336 336
         }
337 337
         $out .= "</li>";
338 338
         $out .= "</ul>";
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
                <key>ServiceProviderRoamingEnabled</key>
373 373
                <true/>
374 374
                <key>DisplayedOperatorName</key>
375
-               <string>" . \config\ConfAssistant::CONSORTIUM['display_name'] . " via Passpoint</string>";
375
+               <string>" . \config\ConfAssistant::CONSORTIUM['display_name']." via Passpoint</string>";
376 376
         // if we don't know the realm, omit the entire DomainName key
377 377
         if (isset($this->attributes['internal:realm'])) {
378 378
             $retval .= "<key>DomainName</key>
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
         $retval .= "                <key>RoamingConsortiumOIs</key>
385 385
                 <array>";
386 386
 
387
-        $retval .= "<string>" . strtoupper($consortiumOi) . "</string>";
387
+        $retval .= "<string>".strtoupper($consortiumOi)."</string>";
388 388
 
389 389
         $retval .= "</array>";
390 390
         // this is an undocumented value found on the net. Does it do something useful?
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
                   <dict>
422 422
                       <key>AcceptEAPTypes</key>
423 423
                          <array>
424
-                            <integer>" . $eapType['OUTER'] . "</integer>
424
+                            <integer>" . $eapType['OUTER']."</integer>
425 425
                          </array>
426 426
                       <key>EAPFASTProvisionPAC</key>
427 427
                             <true />
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 ";
435 435
         if ($realm !== NULL) {
436 436
             $retval .= "<key>OuterIdentity</key>
437
-                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8') . "</string>
437
+                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8')."</string>
438 438
 ";
439 439
         }
440 440
         $retval .= "<key>PayloadCertificateAnchorUUID</key>
@@ -458,11 +458,11 @@  discard block
 block discarded – undo
458 458
         $retval .= "
459 459
                          </array>";
460 460
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
461
-            $retval .= "<key>UserName</key><string>" . $this->clientCert["certObject"]->username . "</string>";
461
+            $retval .= "<key>UserName</key><string>".$this->clientCert["certObject"]->username."</string>";
462 462
         }
463 463
         $retval .= "
464 464
                       <key>TTLSInnerAuthentication</key>
465
-                         <string>" . ($eapType['INNER'] == \core\common\EAP::NE_PAP ? "PAP" : "MSCHAPv2") . "</string>
465
+                         <string>" . ($eapType['INNER'] == \core\common\EAP::NE_PAP ? "PAP" : "MSCHAPv2")."</string>
466 466
                    </dict>";
467 467
         return $retval;
468 468
     }
@@ -482,9 +482,9 @@  discard block
 block discarded – undo
482 482
             // characters are still reversed, invert on use!
483 483
             $buffer .= "<string>Manual</string>
484 484
                   <key>ProxyServer</key>
485
-                  <string>" . strrev($serverAndPort[1]) . "</string>
485
+                  <string>" . strrev($serverAndPort[1])."</string>
486 486
                   <key>ProxyServerPort</key>
487
-                  <integer>" . strrev($serverAndPort[0]) . "</integer>
487
+                  <integer>" . strrev($serverAndPort[0])."</integer>
488 488
                   <key>ProxyPACFallbackAllowed</key>
489 489
                   <false/>";
490 490
         } else {
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
                     throw new Exception("SSID must be a string!");
514 514
                 }
515 515
                 $escapedSSID = htmlspecialchars($toBeConfigured, ENT_XML1, 'UTF-8');
516
-                $payloadIdentifier = "wifi." . $this->serial;
516
+                $payloadIdentifier = "wifi.".$this->serial;
517 517
                 $payloadShortName = sprintf(_("SSID %s"), $escapedSSID);
518 518
                 $payloadName = sprintf(_("%s configuration for network name %s"), \config\ConfAssistant::CONSORTIUM['display_name'], $escapedSSID);
519 519
                 $encryptionTypeString = "WPA";
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
                 $payloadIdentifier = "hs20.$toBeConfigured";
544 544
                 $knownOiName = array_search($toBeConfigured, \config\ConfAssistant::CONSORTIUM['interworking-consortium-oi']);
545 545
                 if ($knownOiName === FALSE) { // a custom RCOI as set by the IdP admin; do not use the term "eduroam" in that one!
546
-                    $knownOiName = $this->instName . " "._("Roaming Partner");
546
+                    $knownOiName = $this->instName." "._("Roaming Partner");
547 547
                 }
548 548
                 $payloadShortName = $knownOiName;
549 549
                 $payloadName = _("Passpoint roaming configuration ($knownOiName)");
@@ -565,11 +565,11 @@  discard block
 block discarded – undo
565 565
                <key>PayloadDisplayName</key>
566 566
                   <string>$payloadShortName</string>
567 567
                <key>PayloadIdentifier</key>
568
-                  <string>" . self::IPHONE_PAYLOAD_PREFIX . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
568
+                  <string>".self::IPHONE_PAYLOAD_PREFIX.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
569 569
                <key>PayloadOrganization</key>
570
-                  <string>" . $this->massagedConsortium . ".1x-config.org</string>
570
+                  <string>".$this->massagedConsortium.".1x-config.org</string>
571 571
                <key>PayloadType</key>
572
-                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi") . ".managed</string>";
572
+                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi").".managed</string>";
573 573
         $retval .= $this->proxySettings();
574 574
         $retval .= $setupModesString;
575 575
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
         }
582 582
         $retval .= "
583 583
                <key>PayloadUUID</key>
584
-                  <string>" . \core\common\Entity::uuid() . "</string>
584
+                  <string>" . \core\common\Entity::uuid()."</string>
585 585
                <key>PayloadVersion</key>
586 586
                   <integer>1</integer>
587 587
                   $wifiNetworkIdentification</dict>";
@@ -611,15 +611,15 @@  discard block
 block discarded – undo
611 611
 	<key>IsHotspot</key>
612 612
 	<false/>
613 613
 	<key>PayloadDescription</key>
614
-	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), \config\ConfAssistant::CONSORTIUM['display_name']) . "</string>
614
+	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), \config\ConfAssistant::CONSORTIUM['display_name'])."</string>
615 615
 	<key>PayloadDisplayName</key>
616
-	<string>" . _("Disabled WiFi network") . "</string>
616
+	<string>" . _("Disabled WiFi network")."</string>
617 617
 	<key>PayloadIdentifier</key>
618
-	<string>" . self::IPHONE_PAYLOAD_PREFIX . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
618
+	<string>" . self::IPHONE_PAYLOAD_PREFIX.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
619 619
 	<key>PayloadType</key>
620 620
 	<string>com.apple.wifi.managed</string>
621 621
 	<key>PayloadUUID</key>
622
-	<string>" . \core\common\Entity::uuid() . "</string>
622
+	<string>".\core\common\Entity::uuid()."</string>
623 623
 	<key>PayloadVersion</key>
624 624
 	<real>1</real>";
625 625
         $retval .= $this->proxySettings();
@@ -698,12 +698,12 @@  discard block
 block discarded – undo
698 698
         $mimeBlob = base64_encode($binaryBlob);
699 699
         $mimeFormatted = chunk_split($mimeBlob, 52, "\r\n");
700 700
         $payloadUUID = \core\common\Entity::uuid('', $mimeBlob);
701
-        $retArray = ["block" => "<dict>" .
701
+        $retArray = ["block" => "<dict>".
702 702
             // we don't include the import password. It's displayed on screen, and should be input by the user.
703 703
             // <key>Password</key>
704 704
             //   <string>" . $this->clientCert['password'] . "</string>
705 705
             "<key>PayloadCertificateFileName</key>
706
-                     <string>" . $this->massagedConsortium . ".pfx</string>
706
+                     <string>" . $this->massagedConsortium.".pfx</string>
707 707
                   <key>PayloadContent</key>
708 708
                      <data>
709 709
 $mimeFormatted
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
                   <key>PayloadDescription</key>
712 712
                      <string>MIME Base-64 encoded PKCS#12 Client Certificate</string>
713 713
                   <key>PayloadDisplayName</key>
714
-                     <string>" . _("eduroam user certificate") . "</string>
714
+                     <string>"._("eduroam user certificate")."</string>
715 715
                   <key>PayloadIdentifier</key>
716 716
                      <string>com.apple.security.pkcs12.$payloadUUID</string>
717 717
                   <key>PayloadType</key>
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
                   <key>PayloadVersion</key>
722 722
                      <integer>1</integer>
723 723
                 </dict>",
724
-            "UUID" => $payloadUUID,];
724
+            "UUID" => $payloadUUID, ];
725 725
         \core\common\Entity::outOfThePotatoes();
726 726
         return $retArray;
727 727
     }
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
         }
740 740
         $expiryTime = new \DateTime($this->clientCert['certObject']->expiry);
741 741
         return "<key>RemovalDate</key>
742
-        <date>" . $expiryTime->format("Y-m-d") . "T" . $expiryTime->format("H:i:s") . "Z</date>";
742
+        <date>" . $expiryTime->format("Y-m-d")."T".$expiryTime->format("H:i:s")."Z</date>";
743 743
     }
744 744
 
745 745
     /**
@@ -761,27 +761,27 @@  discard block
 block discarded – undo
761 761
             $stream = "
762 762
             <dict>
763 763
                <key>PayloadCertificateFileName</key>
764
-               <string>" . $ca['uuid'] . ".der</string>
764
+               <string>" . $ca['uuid'].".der</string>
765 765
                <key>PayloadContent</key>
766 766
                <data>
767
-" . $trimmedPem . "</data>
767
+" . $trimmedPem."</data>
768 768
                <key>PayloadDescription</key>
769
-               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst) . "</string>
769
+               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst)."</string>
770 770
                <key>PayloadDisplayName</key>
771 771
                <string>" . 
772 772
                     /// example: "Identity Provider CA #1 (Root)"
773
-                    sprintf(_("%s CA #%d (%s)" ), 
773
+                    sprintf(_("%s CA #%d (%s)"), 
774 774
                             \core\common\Entity::$nomenclature_inst, 
775
-                            count($this->CAsAccountedFor)+1, 
776
-                            ($ca['root'] ? _("Root") : _("Intermediate"))) . 
775
+                            count($this->CAsAccountedFor) + 1, 
776
+                            ($ca['root'] ? _("Root") : _("Intermediate"))). 
777 777
               "</string>
778 778
                <key>PayloadIdentifier</key>
779
-               <string>" . self::IPHONE_PAYLOAD_PREFIX . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
779
+               <string>" . self::IPHONE_PAYLOAD_PREFIX.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
780 780
                <key>PayloadOrganization</key>
781
-               <string>" . $this->massagedConsortium . ".1x-config.org</string>
781
+               <string>".$this->massagedConsortium.".1x-config.org</string>
782 782
                <key>PayloadType</key>
783 783
                <string>com.apple.security.root</string>
784
-               <key>PayloadUUID</key><string>" . $ca['uuid'] . "</string>
784
+               <key>PayloadUUID</key><string>" . $ca['uuid']."</string>
785 785
                <key>PayloadVersion</key>
786 786
                <integer>1</integer>
787 787
             </dict>";
Please login to merge, or discard this patch.
devices/xml/DeviceXML.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
         $this->marshalObject($root, $eapIdp);
147 147
         $dom = dom_import_simplexml($root)->ownerDocument;
148 148
         //TODO schema validation makes sense so probably should be used
149
-        if ($dom->schemaValidate(ROOT . '/devices/xml/eap-metadata.xsd') === FALSE) {
149
+        if ($dom->schemaValidate(ROOT.'/devices/xml/eap-metadata.xsd') === FALSE) {
150 150
             throw new Exception("Schema validation failed for eap-metadata");
151 151
         }
152 152
         $dom->formatOutput = true;
153
-        file_put_contents($this->installerBasename . '.eap-config', $dom->saveXML());
154
-        return($this->installerBasename . '.eap-config');
153
+        file_put_contents($this->installerBasename.'.eap-config', $dom->saveXML());
154
+        return($this->installerBasename.'.eap-config');
155 155
     }
156 156
 
157 157
     private const ATTRIBUTENAMES = [
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             $this->loggerInstance->debug(4, "Missing class definition for $attrName\n");
178 178
             return([]);
179 179
         }
180
-        $className = "\devices\xml\\" . self::ATTRIBUTENAMES[$attrName];
180
+        $className = "\devices\xml\\".self::ATTRIBUTENAMES[$attrName];
181 181
         $objs = [];
182 182
         if ($this->langScope === 'global') {
183 183
             foreach ($attributeList['langs'] as $language => $value) {
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                 $displayname = new DisplayName();
216 216
                 if (isset($profileNameLangs)) {
217 217
                     $langOrC = isset($profileNameLangs[$language]) ? $profileNameLangs[$language] : $profileNameLangs['C'];
218
-                    $value .= ' - ' . $langOrC;
218
+                    $value .= ' - '.$langOrC;
219 219
                 }
220 220
                 $displayname->setValue($value);
221 221
                 $displayname->setAttributes(['lang' => $language]);
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
             $displayname = new DisplayName();
226 226
             $value = $attr['general:instname'][0];
227 227
             if ($attr['internal:profile_count'][0] > 1) {
228
-                $value .= ' - ' . $attr['profile:name'][0];
228
+                $value .= ' - '.$attr['profile:name'][0];
229 229
             }
230 230
             $displayname->setValue($value);
231 231
             $objs[] = $displayname;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         $attr = $this->attributes;
243 243
         if (isset($attr['general:logo_file'][0])) {
244 244
             $logoString = base64_encode($attr['general:logo_file'][0]);
245
-            $logoMime = 'image/' . $attr['internal:logo_file'][0]['mime'];
245
+            $logoMime = 'image/'.$attr['internal:logo_file'][0]['mime'];
246 246
             $providerlogo = new ProviderLogo();
247 247
             $providerlogo->setAttributes(['mime' => $logoMime, 'encoding' => 'base64']);
248 248
             $providerlogo->setValue($logoString);
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 
348 348
         if (isset($inner["METHOD"]) && $inner["METHOD"]) {
349 349
             $innerauthmethod = new InnerAuthenticationMethod();
350
-            $typeOfInner = "\devices\xml\\" . ($inner["EAP"] ? 'EAPMethod' : 'NonEAPAuthMethod');
350
+            $typeOfInner = "\devices\xml\\".($inner["EAP"] ? 'EAPMethod' : 'NonEAPAuthMethod');
351 351
             $eapmethod = new $typeOfInner();
352 352
             $eaptype = new Type();
353 353
             $eaptype->setValue(abs($inner['METHOD']));
Please login to merge, or discard this patch.
web/diag/action_realmcheck.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
22
+require_once dirname(dirname(__DIR__))."/config/_config.php";
23 23
 
24 24
 $loggerInstance = new \core\common\Logging();
25 25
 
@@ -65,13 +65,13 @@  discard block
 block discarded – undo
65 65
         $testsuite = new \core\diag\RADIUSTests($check_realm, $testedProfile->getRealmCheckOuterUsername(), $testedProfile->getEapMethodsinOrderOfPreference(1), $testedProfile->getCollapsedAttributes()['eap:server_name'], $testedProfile->getCollapsedAttributes()["eap:ca_file"]);
66 66
         $rfc7585suite = new \core\diag\RFC7585Tests($check_realm);
67 67
     } else {
68
-        $error_message = _("You asked for a realm check, but we don't know the realm for this profile!") . "</p>";
68
+        $error_message = _("You asked for a realm check, but we don't know the realm for this profile!")."</p>";
69 69
     }
70 70
 } else { // someone else's realm, and we don't know anything about it... only shallow checks
71 71
     $check_realm = $validator->realm($realm ?? $_SESSION['check_realm'] ?? "");
72 72
     if ($check_realm !== FALSE) {
73 73
         $_SESSION['check_realm'] = $check_realm;
74
-        $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm);
74
+        $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm);
75 75
         $rfc7585suite = new \core\diag\RFC7585Tests($check_realm);
76 76
     } else {
77 77
         $error_message = _("No valid realm name given, cannot execute any checks!");
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     var listofcas = "<?php echo _("You should update your list of accredited CAs") ?>";
120 120
     var getitfrom = "<?php echo _("Get it from here.") ?>";
121 121
     var listsource = "<?php echo \config\Diagnostics::RADIUSTESTS['accreditedCAsURL'] ?>";
122
-    var moretext = "<?php echo _("more") . "&raquo;" ?>";
122
+    var moretext = "<?php echo _("more")."&raquo;" ?>";
123 123
     var lesstext = "<?php echo "&laquo" ?>";
124 124
     var morealltext = "<?php echo _("Show detailed information for all tests") ?>";
125 125
     var unknownca_code = "<?php echo \core\diag\RADIUSTests::CERTPROB_UNKNOWN_CA ?>";
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                         }
257 257
                     }
258 258
                     cliinfo = cliinfo + '<li><table><tbody><tr><td class="icon_td"><img class="icon" src="' + icons[level] + '" style="width: 24px;"></td><td>' + state;
259
-                    cliinfo = cliinfo + ' <?php echo "(" . sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;") . ")"; ?>' + add + '</td></tr>';
259
+                    cliinfo = cliinfo + ' <?php echo "(".sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;").")"; ?>' + add + '</td></tr>';
260 260
                     cliinfo = cliinfo + '</tbody></table></ul></li>';
261 261
                     if (data.ca[key].certificate[c].finalerror === 1) {
262 262
                         cliinfo = cliinfo + '<li>' + restskipped + '</li>';
@@ -425,8 +425,8 @@  discard block
 block discarded – undo
425 425
 <?php
426 426
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
427 427
     print "
428
-$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading);
429
-$(\"#live_src" . $hostindex . "_img\").show();
428
+$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading);
429
+$(\"#live_src" . $hostindex."_img\").show();
430 430
 $.ajax({
431 431
     url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm,
432 432
     type: 'POST',
@@ -456,15 +456,15 @@  discard block
 block discarded – undo
456 456
 <?php
457 457
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
458 458
     if ($testedProfile !== NULL) {
459
-        $extraarg = "profile_id: " . $testedProfile->identifier . ", ";
459
+        $extraarg = "profile_id: ".$testedProfile->identifier.", ";
460 460
     } else {
461 461
         $extraarg = "";
462 462
     }
463 463
     print "
464
-$(\"#src" . $hostindex . "_img\").attr('src',icon_loading);
464
+$(\"#src" . $hostindex."_img\").attr('src',icon_loading);
465 465
 $(\"#src$hostindex\").html('');
466 466
 running_ajax_stat++;
467
-$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex'  }, udp, 'json');
467
+$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex'  }, udp, 'json');
468 468
 
469 469
 ";
470 470
 }
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
     if ($check_realm === FALSE) {
492 492
         print "<p>$error_message</p>";
493 493
     } else {
494
-        print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n";
494
+        print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n";
495 495
         ?>
496 496
         <div id="debug_out" style="display: none"></div>
497 497
         <div id="tabs" style="min-width: 600px; max-width:800px">
@@ -508,12 +508,12 @@  discard block
 block discarded – undo
508 508
                     </legend>
509 509
                     <?php
510 510
                     // NAPTR existence check
511
-                    echo "<strong>" . _("DNS chekcs") . "</strong><div>";
511
+                    echo "<strong>"._("DNS chekcs")."</strong><div>";
512 512
                     $naptr = $rfc7585suite->relevantNAPTR();
513 513
                     if ($naptr != \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) {
514 514
                         echo "<table>";
515 515
                         // output in friendly words
516
-                        echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>";
516
+                        echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>";
517 517
                         switch ($naptr) {
518 518
                             case \core\diag\RFC7585Tests::RETVAL_NONAPTR:
519 519
                                 echo _("This realm has no NAPTR records.");
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
 
529 529
                         // compliance checks for NAPTRs
530 530
                         if ($naptr > 0) {
531
-                            echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>";
531
+                            echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>";
532 532
                             $naptr_valid = $rfc7585suite->relevantNAPTRcompliance();
533 533
                             switch ($naptr_valid) {
534 534
                                 case \core\diag\RADIUSTests::RETVAL_OK:
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 
546 546
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) {
547 547
                             $srv = $rfc7585suite->relevantNAPTRsrvResolution();
548
-                            echo "<tr><td>" . _("Checking SRVs:") . "</td><td>";
548
+                            echo "<tr><td>"._("Checking SRVs:")."</td><td>";
549 549
                             switch ($srv) {
550 550
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
551 551
                                     echo _("This check was skipped.");
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
                         // IP addresses for the hosts
562 562
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) {
563 563
                             $hosts = $rfc7585suite->relevantNAPTRhostnameResolution();
564
-                            echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>";
564
+                            echo "<tr><td>"._("Checking IP address resolution:")."</td><td>";
565 565
                             switch ($srv) {
566 566
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
567 567
                                     echo _("This check was skipped.");
@@ -577,12 +577,12 @@  discard block
 block discarded – undo
577 577
 
578 578
                         echo "</table><br/><br/>";
579 579
                         if (count($testsuite->listerrors()) == 0) {
580
-                            echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!");
580
+                            echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!");
581 581
                         } else {
582
-                            echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("but there were DNS errors! Check them!") . " " . _("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below.");
582
+                            echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("but there were DNS errors! Check them!")." "._("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below.");
583 583
                             echo "<div class='notacceptable'><table>";
584 584
                             foreach ($testsuite->listerrors() as $details) {
585
-                                echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>";
585
+                                echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>";
586 586
                             }
587 587
                             echo "</table></div>";
588 588
                         }
@@ -598,26 +598,26 @@  discard block
 block discarded – undo
598 598
                  $("#dynamic_tests").show();
599 599
               ';
600 600
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
601
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
601
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
602 602
                             $expectedName = $addr['hostname'];
603 603
                             print "
604 604
                             running_ajax_dyn++;
605
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); 
605
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); 
606 606
                             running_ajax_dyn++;
607
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); 
607
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); 
608 608
                        ";
609 609
                         }
610 610
                         echo "}
611 611
               </script><hr>";
612 612
                     } else {
613
-                        echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
613
+                        echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>";
614 614
                     }
615
-                    echo "<strong>" . _("Static connectivity tests") . "</strong>
615
+                    echo "<strong>"._("Static connectivity tests")."</strong>
616 616
          <table><tr>
617 617
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_static_ico' class='icon'></td><td id='main_static_result' style='display:none'>&nbsp;</td>
618 618
          </tr></table>";
619 619
                     if ($naptr > 0) {
620
-                        echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong>
620
+                        echo "<hr><strong>"._("Dynamic connectivity tests")."</strong>
621 621
          <table><tr>
622 622
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_dynamic_ico' class='icon'></td><td id='main_dynamic_result' style='display:none'>&nbsp;</td>
623 623
          </tr></table>";
@@ -637,12 +637,12 @@  discard block
 block discarded – undo
637 637
                     print "<p>";
638 638
                     foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
639 639
                         print "<hr>";
640
-                        printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
640
+                        printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
641 641
                         print "<table id='results$hostindex'  style='width:100%' class='udp_results'>
642 642
 <tr>
643
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td>
643
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td>
644 644
 <td id='src$hostindex' colspan=2>
645
-" . _("testing...") . "
645
+"._("testing...")."
646 646
 </td>
647 647
 </tr>
648 648
 </table>";
@@ -661,21 +661,21 @@  discard block
 block discarded – undo
661 661
 
662 662
                     <?php
663 663
                     echo "<div id='dynamic_tests'><fieldset class='option_container'>
664
-                <legend><strong>" . _("DYNAMIC connectivity tests") . "</strong></legend>";
664
+                <legend><strong>" . _("DYNAMIC connectivity tests")."</strong></legend>";
665 665
 
666 666
                     $resultstoprint = [];
667 667
                     if (count($rfc7585suite->NAPTR_hostname_records) > 0) {
668
-                        $resultstoprint[] = '<div style="align:right; display: none;" id="dynamic_result_fail">' . _("Some errors were found during the tests, see below") . '</div><div style="align:right; display: none;" id="dynamic_result_pass">' . _("All tests passed, congratulations!") . '</div>';
669
-                        $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>";
668
+                        $resultstoprint[] = '<div style="align:right; display: none;" id="dynamic_result_fail">'._("Some errors were found during the tests, see below").'</div><div style="align:right; display: none;" id="dynamic_result_pass">'._("All tests passed, congratulations!").'</div>';
669
+                        $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>";
670 670
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
671
-                            $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]);
672
-                            $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong>';
671
+                            $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]);
672
+                            $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong>';
673 673
                             $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>';
674 674
                             $resultstoprint[] = "<table id='caresults$hostindex'  style='width:100%'>
675 675
 <tr>
676
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca" . $hostindex . "_img'></td>
676
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca".$hostindex."_img'></td>
677 677
 <td id='srcca$hostindex'>
678
-" . _("testing...") . "
678
+"._("testing...")."
679 679
 </td>
680 680
 </tr>
681 681
 </table>";
@@ -683,12 +683,12 @@  discard block
 block discarded – undo
683 683
                         }
684 684
                         $clientstest = [];
685 685
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
686
-                            $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>';
686
+                            $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>';
687 687
                             $clientstest[] = "<span id='clientresults$hostindex$clinx'><table style='width:100%'>
688 688
 <tr>
689
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient" . $hostindex . "_img'></td>
689
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient".$hostindex."_img'></td>
690 690
 <td id='srcclient$hostindex'>
691
-" . _("testing...") . "
691
+"._("testing...")."
692 692
 </td>
693 693
 </tr>
694 694
 </table></span>";
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
                         }
697 697
                         echo '<div style="align:right;">';
698 698
                         echo join('', $resultstoprint);
699
-                        echo '<span id="clientstest" style="display: none;"><p><hr><b>' . _('Checking if certificates from  CAs are accepted...') . '</b><p>' . _('A few client certificates will be tested to check if servers are resistant to some certificate problems.') . '<p>';
699
+                        echo '<span id="clientstest" style="display: none;"><p><hr><b>'._('Checking if certificates from  CAs are accepted...').'</b><p>'._('A few client certificates will be tested to check if servers are resistant to some certificate problems.').'<p>';
700 700
                         print join('', $clientstest);
701 701
                         echo '</span>';
702 702
                         echo '</div>';
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
                 //     check if truncates/dies on Operator-Name
711 711
                 if ($my_profile !== NULL) {
712 712
                     echo "<div id='tabs-4'><fieldset class='option_container'>
713
-                <legend><strong>" . _("Live login test") . "</strong></legend>";
713
+                <legend><strong>" . _("Live login test")."</strong></legend>";
714 714
                     $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1);
715 715
                     if (count($prof_compl) > 0) {
716 716
                         $passwordReqired = FALSE;
@@ -723,34 +723,34 @@  discard block
 block discarded – undo
723 723
                                 $clientCertRequired = TRUE;
724 724
                             }
725 725
                         }
726
-                        echo "<div id='disposable_credential_container'><p>" . _("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.") . "</p>
727
-                    <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.") . "</p>
728
-                    <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!") . "</p></div>
726
+                        echo "<div id='disposable_credential_container'><p>"._("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.")."</p>
727
+                    <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.")."</p>
728
+                    <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!")."</p></div>
729 729
                     <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'>
730 730
                     <input type='hidden' name='test_type' value='udp_login'>
731
-                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang() . "'>
732
-                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'>
731
+                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang()."'>
732
+                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'>
733 733
                     <table id='live_tests'>";
734 734
 // if any password based EAP methods are available enable this section
735 735
                         if ($passwordReqired) {
736
-                            echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr>
737
-                        <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
738
-                            echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
739
-                            echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
736
+                            echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr>
737
+                        <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
738
+                            echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
739
+                            echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
740 740
                         }
741 741
                         // ask for cert + privkey if TLS-based method is active
742 742
                         if ($clientCertRequired) {
743
-                            echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr>
744
-                        <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
745
-                        <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
746
-                        <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
743
+                            echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr>
744
+                        <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
745
+                        <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
746
+                        <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
747 747
                         }
748
-                        echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>";
748
+                        echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>";
749 749
                         echo "<div id='live_login_results' style='display:none'>";
750 750
                         foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
751 751
                             print "<hr>";
752
-                            printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
753
-                            print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src" . $hostindex . "_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>";
752
+                            printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
753
+                            print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src".$hostindex."_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>";
754 754
                             print "<div id='eap_test$hostindex' class='eap_test_results'></div>";
755 755
                         }
756 756
                         echo "</div>";
@@ -765,9 +765,9 @@  discard block
 block discarded – undo
765 765
             }
766 766
 
767 767
             if (isset($_POST['comefrom'])) {
768
-                $return = htmlspecialchars_decode($_POST['comefrom']) . ( $inst_id ? "?inst_id=" . $inst_id : "" );
768
+                $return = htmlspecialchars_decode($_POST['comefrom']).($inst_id ? "?inst_id=".$inst_id : "");
769 769
                 echo "<form method='post' action='$return' accept-charset='UTF-8'>
770
-                    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst) . "</button>"
770
+                    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst)."</button>"
771 771
                 . "</form>";
772 772
             }
773 773
             if ($check_realm !== FALSE) {
Please login to merge, or discard this patch.
web/diag/adminQuery.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  * License: see the web/copyright.inc.php file in the file structure or
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  */
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 $languageInstance = new \core\common\Language();
24 24
 $languageInstance->setTextDomain("diagnostics");
25 25
 $loggerInstance = new \core\common\Logging();
@@ -61,43 +61,43 @@  discard block
 block discarded – undo
61 61
     $select = "<div id='sp_abuse_problem'>
62 62
 <select style='margin-left: 0px;' id='select_sp_problem'>";
63 63
     foreach ($sp_problem as $pname => $pdesc) {
64
-        $select = $select . "<option value='$pname'>$pdesc</option>\n";
64
+        $select = $select."<option value='$pname'>$pdesc</option>\n";
65 65
     }
66
-    $select = $select . "</select></div>";
66
+    $select = $select."</select></div>";
67 67
     $res = "
68 68
 <input type='hidden' name='token' id='token' value=''>
69 69
 <input type='hidden' name='tests_result' id='tests_result' value=''>
70 70
 <table id='sp_questions'>
71 71
     <tr id='sp_problem_selector'>
72
-        <td>" . _("Select your problem") . "</td>
72
+        <td>" . _("Select your problem")."</td>
73 73
         <td>$select</td>
74 74
     </tr>
75 75
     <tr>
76
-        <td>" . _("What is the realm of the IdP in question?") . "</td>
76
+        <td>"._("What is the realm of the IdP in question?")."</td>
77 77
         <td>
78 78
                 <input type='text' name='admin_realm' id='admin_realm' value='$realmFromURL'>
79
-                <button class='diag_button' id='realm_in_db_admin' style='display: none;' accesskey='R' type='button'>" .
80
-                _("Check this realm") .
79
+                <button class='diag_button' id='realm_in_db_admin' style='display: none;' accesskey='R' type='button'>".
80
+                _("Check this realm").
81 81
                 "</button>
82 82
                 <div id='tests_info_area'></div>
83 83
         </td>
84 84
     </tr>
85 85
     <tr class='hidden_row'>
86
-        <td>" . _("What is the authentication timestamp of the user session in question?") . "</td>
86
+        <td>" . _("What is the authentication timestamp of the user session in question?")."</td>
87 87
         <td><input type='text' id='timestamp' name='timestamp'>
88 88
             <div id='datepicker'></div>
89 89
         </td>
90 90
     </tr>
91 91
     <tr class='hidden_row'>
92
-        <td>" . _("What is the MAC address of the user session in question?") . "</td>
92
+        <td>" . _("What is the MAC address of the user session in question?")."</td>
93 93
         <td><input type='text' id='mac' name='mac'></td>
94 94
     </tr>
95 95
     <tr class='hidden_row'>
96
-        <td>" . _("Additional comments") . "</td>
96
+        <td>" . _("Additional comments")."</td>
97 97
         <td><textarea id='freetext' name='freetext' cols='60' rows='5'></textarea></td>
98 98
     </tr>
99 99
     <tr class='hidden_row'>
100
-        <td>" . _("Please specify an email address on which the IdP can contact you") . "</td>
100
+        <td>" . _("Please specify an email address on which the IdP can contact you")."</td>
101 101
         <td><input type='text' id='email' name='email'></td>
102 102
     </tr>
103 103
     <tr>
@@ -105,82 +105,82 @@  discard block
 block discarded – undo
105 105
         <td></td>
106 106
     </tr>
107 107
     <tr class='hidden_row' id='send_query_to_idp'>
108
-        <td>" . _("Now you can send your query") . "</td>
109
-        <td><button type='submit' class='diag_button' id='submit_idp_query' name='go'>" . _("Send") . "</button></td>
108
+        <td>" . _("Now you can send your query")."</td>
109
+        <td><button type='submit' class='diag_button' id='submit_idp_query' name='go'>" . _("Send")."</button></td>
110 110
     </tr>
111 111
  </table>";
112
-    $res = $res . $javascript;
112
+    $res = $res.$javascript;
113 113
 }
114 114
 if ($queryType == 'idp') {
115 115
     $select = "<div id='idp_reported_problem' style='display:;'>
116 116
 <select style='margin-left:0px;' id='select_idp_problem'>";
117 117
     foreach ($idp_problem as $pname => $pdesc) {
118
-        $select = $select . "<option value='$pname'>$pdesc</option>\n";
118
+        $select = $select."<option value='$pname'>$pdesc</option>\n";
119 119
     }
120
-    $select = $select . "</select></div>";
120
+    $select = $select."</select></div>";
121 121
     $res = "
122 122
 <table id='idp_questions'>
123 123
     <tr>
124
-        <td>" . _("Select your problem") . "</td>
124
+        <td>" . _("Select your problem")."</td>
125 125
         <td>$select</td>
126 126
     </tr>
127 127
     <tr>
128
-        <td>" . _("Identify the SP by one of following means") . "</td>
128
+        <td>"._("Identify the SP by one of following means")."</td>
129 129
         <td></td>
130 130
     </tr>
131 131
     <tr id='by_opname'>
132
-        <td>" . _("SP Operator-Name attribute") . "</td>
132
+        <td>" . _("SP Operator-Name attribute")."</td>
133 133
         <td><input type='text' id='opname' name='opname' value=''></td>
134 134
     </tr>
135 135
     <tr id='spmanually'>
136
-        <td>" . _("Select the SP manually:") . "</td>
136
+        <td>" . _("Select the SP manually:")."</td>
137 137
         <td>
138 138
             <div id='select_asp_country'><a href='' id='asp_countries_list'>
139
-            <span id='opnameselect'>" . _("click to select country and organisation") . "</a></span>
139
+            <span id='opnameselect'>" . _("click to select country and organisation")."</a></span>
140 140
             </div>
141 141
             <div id='select_asp_area'></div>
142 142
         </td>
143 143
     </tr>
144 144
     <tr id='asp_desc' style='display: none;'>
145
-        <td>" . _("or") . ' ' . _("at least describe the SP location") . "</td>
145
+        <td>" . _("or").' '._("at least describe the SP location")."</td>
146 146
         <td><input type='text' id='asp_location' name='asp_location' value=''></td>
147 147
     </tr>
148 148
     <tr>
149
-        <td>" . _("What is the outer ID of the user session in question?") . "</td>
149
+        <td>" . _("What is the outer ID of the user session in question?")."</td>
150 150
         <td><input type='text' id='outer_id' name='outer_id' value=''></td>
151 151
     </tr>
152 152
     <tr>
153
-        <td>" . _("What is the authentication timestamp of the user session in question?") . "</td>
153
+        <td>" . _("What is the authentication timestamp of the user session in question?")."</td>
154 154
         <td>
155 155
             <input type='text' id='timestamp' name='timestamp'>
156 156
             <div id='datepicker'></div>
157 157
         </td>
158 158
     </tr>
159 159
     <tr>
160
-        <td>" . _("What is the MAC address of the user session in question?") . "</td>
160
+        <td>" . _("What is the MAC address of the user session in question?")."</td>
161 161
         <td><input type='text' id='mac' name='mac'></td>
162 162
     </tr>
163 163
     <tr>
164
-        <td>" . _("Additional comments about the problem") . "</td>
164
+        <td>" . _("Additional comments about the problem")."</td>
165 165
         <td><textarea id='freetext' name='freetext' cols='60' rows='5'></textarea></td>
166 166
     </tr>
167 167
     <tr>
168
-        <td>" . _("Do you have any contact details by which the user wishes to be contacted by the SP?") . "</td>
168
+        <td>" . _("Do you have any contact details by which the user wishes to be contacted by the SP?")."</td>
169 169
         <td><textarea id='c_details' name='c_details' cols='60' rows='5'></textarea></td>
170 170
     </tr>
171 171
     <tr>
172
-        <td>" . _("Please specify an email address on which the SP can contact you") . "</td>
172
+        <td>" . _("Please specify an email address on which the SP can contact you")."</td>
173 173
         <td><input type='text' id='email' name='email'></td>
174 174
     </tr>
175 175
     <tr class='hidden_row' id='send_query_to_sp'>
176
-        <td>" . _("Now you can send your query") . "</td>
177
-        <td><button type='submit' class='diag_button' id='submit_sp_query' name='go'>" . _("Send") . "</button></td>
176
+        <td>" . _("Now you can send your query")."</td>
177
+        <td><button type='submit' class='diag_button' id='submit_sp_query' name='go'>" . _("Send")."</button></td>
178 178
     </tr>
179 179
 </table>";
180
-    $res = $res . $javascript;
180
+    $res = $res.$javascript;
181 181
 }
182 182
 if ($queryType == 'idp_send' || $queryType == 'sp_send') {
183
-    include_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
183
+    include_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
184 184
     $cat = new \core\CAT();
185 185
     $returnArray = array();
186 186
     if (count((array) $o) > 0) {
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
             switch ($key) {
190 190
                 case 'realm':
191 191
                     $pos = strpos($value, '@');
192
-                    if ($pos !== FALSE ) {
193
-                        $value = substr($value, $pos+1);
192
+                    if ($pos !== FALSE) {
193
+                        $value = substr($value, $pos + 1);
194 194
                     }
195 195
                 case 'email':
196 196
                 case 'mac':
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
         $mail = \core\common\OutsideComm::mailHandle();
227 227
         $emails = ['[email protected]'];
228 228
         //$emails = explode(',', $returnArray['idpcontact']);
229
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System";
229
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System";
230 230
         foreach ($emails as $email) {
231 231
             $mail->addAddress($email);
232 232
         }
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
         } else {
237 237
             $link = 'http://';
238 238
         }
239
-        $link .= $_SERVER['SERVER_NAME'] . \core\CAT::getRootUrlPath() . '/diag/show_realmcheck.php?token=' . $returnArray['token'];
239
+        $link .= $_SERVER['SERVER_NAME'].\core\CAT::getRootUrlPath().'/diag/show_realmcheck.php?token='.$returnArray['token'];
240 240
         $returnArray['testurl'] = $link;
241 241
         $mail->Subject = _('Suspected a technical problem with the IdP');
242
-        $txt = _("We suspect a technical problem with the IdP handling the realm") . ' ' . 
243
-                $returnArray['realm'] . ".\n";
242
+        $txt = _("We suspect a technical problem with the IdP handling the realm").' '. 
243
+                $returnArray['realm'].".\n";
244 244
         $txt .= _("The CAT diagnostic test was run for this realm during reporting.\n");
245 245
         $txt .= _("The overall result was ");
246 246
         if ($returnArray['tests_result'] == 0) {
@@ -248,15 +248,15 @@  discard block
 block discarded – undo
248 248
         } else {
249 249
             $txt .= _("failure");
250 250
         }
251
-        $txt .= ".\n" . _("To see details go to ");
251
+        $txt .= ".\n"._("To see details go to ");
252 252
         $txt .= "$link\n\n";
253
-        $txt .= _("The reported problem details are as follows") . "\n";
254
-        $txt .= _("timestamp") . ": " . $returnArray['timestamp'] . "\n";
255
-        $txt .= _("client MAC address") . ": " . $returnArray['mac'] . "\n";
253
+        $txt .= _("The reported problem details are as follows")."\n";
254
+        $txt .= _("timestamp").": ".$returnArray['timestamp']."\n";
255
+        $txt .= _("client MAC address").": ".$returnArray['mac']."\n";
256 256
         if ($returnArray['freetext']) {
257
-            $txt .= _("additional comments") . ': ' . $returnArray['freetext'] . "\n";
257
+            $txt .= _("additional comments").': '.$returnArray['freetext']."\n";
258 258
         }
259
-        $txt .= "\n" . _("You can contact the incident reporter at") . ' ' . $returnArray['email'];
259
+        $txt .= "\n"._("You can contact the incident reporter at").' '.$returnArray['email'];
260 260
         
261 261
         $mail->Body = $txt;
262 262
         $sent = $mail->send();
Please login to merge, or discard this patch.