Passed
Push — release_2_0 ( 9d3bbc...a2785a )
by Stefan
09:21
created
core/IdP.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function listProfiles(bool $activeOnly = FALSE)
116 116
     {
117
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
117
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "");
118 118
         $allProfiles = $this->databaseHandle->exec($query);
119 119
         $returnarray = [];
120 120
         // SELECT -> resource, not boolean
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $returnarray[] = $oneProfile;
125 125
         }
126 126
 
127
-        $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true));
127
+        $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true));
128 128
         return $returnarray;
129 129
     }
130 130
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
230 230
                     $theProfile = new ProfileSilverbullet($identifier, $this);
231 231
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
232
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
232
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
233 233
                     return $theProfile;
234 234
                 default:
235 235
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
     public function getExternalDBId()
351 351
     {
352 352
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
353
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
353
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
354 354
             // SELECT -> it's a resource, not a boolean
355 355
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
356 356
                 return FALSE;
Please login to merge, or discard this patch.
web/admin/edit_idp_result.php 1 patch
Spacing   +22 added lines, -22 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();
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
 $myInstOriginal = $validator->IdP($_GET['inst_id'], $_SESSION['user']);
39 39
 $instId = $myInstOriginal->identifier;
40 40
 
41
-$hello = _("To whom it may concern,") . "\n\n";
42
-$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" .
43
-        _("Greetings, ") . "\n\n" .
41
+$hello = _("To whom it may concern,")."\n\n";
42
+$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".
43
+        _("Greetings, ")."\n\n".
44 44
         CONFIG['APPEARANCE']['productname_long'];
45 45
 
46 46
 switch ($_POST['submitbutton']) {
47 47
     case web\lib\common\FormElements::BUTTON_DELETE:
48 48
         $myInstOriginal->destroy();
49
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP " . $instId);
49
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP ".$instId);
50 50
         header("Location: overview_user.php");
51 51
         exit;
52 52
     case web\lib\common\FormElements::BUTTON_FLUSH_AND_RESTART:
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
         }
57 57
         // flush all IdP attributes and send user to creation wizard
58 58
         $myInstOriginal->flushAttributes();
59
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over" . $instId);
60
-        $text = $hello .
61
-                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" .
59
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over".$instId);
60
+        $text = $hello.
61
+                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".
62 62
                 $bye;
63 63
         $fed = new core\Federation($myInstOriginal->federation);
64 64
         foreach ($fed->listFederationAdmins() as $id) {
@@ -77,19 +77,19 @@  discard block
 block discarded – undo
77 77
             exit(0);
78 78
         }
79 79
         $inst_name = $myInstOriginal->name;
80
-        echo "<h1>" . sprintf(_("Submitted attributes for IdP '%s'"), $inst_name) . "</h1>";
80
+        echo "<h1>".sprintf(_("Submitted attributes for IdP '%s'"), $inst_name)."</h1>";
81 81
         echo "<table>";
82 82
         echo $optionParser->processSubmittedFields($myInstOriginal, $_POST, $_FILES);
83 83
         echo "</table>";
84 84
 // delete cached logo, if present
85
-        $dir = ROOT . '/web/downloads/logos/';
86
-        $globResult = glob($dir . $myInstOriginal->identifier . "_*.png");
85
+        $dir = ROOT.'/web/downloads/logos/';
86
+        $globResult = glob($dir.$myInstOriginal->identifier."_*.png");
87 87
         if ($globResult === FALSE) { // we should catch the improbable error condition
88 88
             $globResult = [];
89 89
         }
90 90
         array_map('unlink', $globResult);
91 91
         $loggerInstance->debug(4, "UNLINK from $dir\n");
92
-        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP " . $myInstOriginal->identifier . " - attributes changed");
92
+        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP ".$myInstOriginal->identifier." - attributes changed");
93 93
 
94 94
 // re-instantiate ourselves... profiles need fresh data
95 95
         $myInstReinstantiated = $validator->IdP($_GET['inst_id'], $_SESSION['user']);
@@ -98,10 +98,10 @@  discard block
 block discarded – undo
98 98
         if (count($significantChanges) > 0) {
99 99
             // send a notification/alert mail to someone we know is in charge
100 100
             /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
101
-            $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";
101
+            $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";
102 102
             if (isset($significantChanges[\core\IdP::INSTNAME_CHANGED])) {
103
-                $text .= sprintf(_("The %s has changed its name. The details are below:"), $ui->nomenclatureInst) . "\n\n";
104
-                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED] . "\n\n";
103
+                $text .= sprintf(_("The %s has changed its name. The details are below:"), $ui->nomenclatureInst)."\n\n";
104
+                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED]."\n\n";
105 105
             }
106 106
             $text .= $bye;
107 107
             // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
 
118 118
         if (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) && count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) {
119 119
             foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssidname) {
120
-                $ssids[] = $ssidname . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)") );
120
+                $ssids[] = $ssidname." ".(isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)"));
121 121
             }
122 122
         }
123 123
 
124 124
         foreach ($myInstReinstantiated->getAttributes("media:SSID_with_legacy") as $ssidname) {
125
-            $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES and WPA/TKIP)");
125
+            $ssids[] = $ssidname['value']." "._("(WPA2/AES and WPA/TKIP)");
126 126
         }
127 127
         foreach ($myInstReinstantiated->getAttributes("media:SSID") as $ssidname) {
128
-            $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES)");
128
+            $ssids[] = $ssidname['value']." "._("(WPA2/AES)");
129 129
         }
130 130
 
131 131
         echo "<table>";
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         if (count($ssids) > 0) {
134 134
             $printedlist = "";
135 135
             foreach ($ssids as $names) {
136
-                $printedlist = $printedlist . "$names ";
136
+                $printedlist = $printedlist."$names ";
137 137
             }
138 138
             echo $uiElements->boxOkay(sprintf(_("Your installers will configure the following SSIDs: <strong>%s</strong>"), $printedlist), _("SSIDs configured"));
139 139
         }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                 // did we get an email address? then, show the silverbullet jumpstart button
162 162
                 // otherwise, issue a smartass comment
163 163
                 if (count($myInstReinstantiated->getAttributes("support:email")) > 0) {
164
-                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME) . "</button></form>";
164
+                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>".sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME)."</button></form>";
165 165
                 } else {
166 166
                     echo "<table>";
167 167
                     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!"));
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
                 }
170 170
             }
171 171
             if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") {
172
-                echo "<br/><form method='post' action='edit_profile.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to RADIUS/EAP profile definition") . "</button></form>";
172
+                echo "<br/><form method='post' action='edit_profile.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to RADIUS/EAP profile definition")."</button></form>";
173 173
             }
174 174
         }
175
-        echo "<br/><form method='post' action='overview_idp.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to dashboard") . "</button></form>";
175
+        echo "<br/><form method='post' action='overview_idp.php?inst_id=$myInstReinstantiated->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to dashboard")."</button></form>";
176 176
         echo $deco->footer();
177 177
         break;
178 178
     default:
Please login to merge, or discard this patch.
web/diag/radius_tests.php 1 patch
Spacing   +10 added lines, -10 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
 $loggerInstance = new \core\common\Logging();
26 26
 $validator = new \web\lib\common\InputValidation();
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 function disp_name($eap)
46 46
 {
47 47
     $displayName = \core\common\EAP::eapDisplayName($eap);
48
-    return $displayName['OUTER'] . ( $displayName['INNER'] != '' ? '-' . $displayName['INNER'] : '');
48
+    return $displayName['OUTER'].($displayName['INNER'] != '' ? '-'.$displayName['INNER'] : '');
49 49
 }
50 50
 
51 51
 if (!isset($_REQUEST['test_type']) || !$_REQUEST['test_type']) {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     $testsuite = new \core\diag\RADIUSTests($check_realm, $my_profile->getRealmCheckOuterUsername(), $my_profile->getEapMethodsinOrderOfPreference(1), $my_profile->getCollapsedAttributes()['eap:server_name'], $my_profile->getCollapsedAttributes()['eap:ca_file']);
69 69
 } else {
70 70
     $my_profile = NULL;
71
-    $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm);
71
+    $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm);
72 72
 }
73 73
 
74 74
 
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
                             break;
159 159
                         case \core\common\Entity::L_REMARK:
160 160
                         case \core\common\Entity::L_WARN:
161
-                            $message = _("<strong>Test partially successful</strong>: authentication succeded.") . ' ' . $additional_message[$level];
161
+                            $message = _("<strong>Test partially successful</strong>: authentication succeded.").' '.$additional_message[$level];
162 162
                             break;
163 163
                         case \core\common\Entity::L_ERROR:
164
-                            $message = _("<strong>Test FAILED</strong>: authentication succeded.") . ' ' . $additional_message[$level];
164
+                            $message = _("<strong>Test FAILED</strong>: authentication succeded.").' '.$additional_message[$level];
165 165
                             break;
166 166
                     }
167 167
                     break;
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             case \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT:
213 213
                 $level = $returnarray['result'][$i]['level'];
214 214
                 if ($level > \core\common\Entity::L_OK) {
215
-                    $message = _("<strong>Test partially successful</strong>: a bidirectional RADIUS conversation with multiple round-trips was carried out, and ended in an Access-Reject as planned.") . ' ' . $additional_message[$level];
215
+                    $message = _("<strong>Test partially successful</strong>: a bidirectional RADIUS conversation with multiple round-trips was carried out, and ended in an Access-Reject as planned.").' '.$additional_message[$level];
216 216
                 } else {
217 217
                     $message = _("<strong>Test successful</strong>: a bidirectional RADIUS conversation with multiple round-trips was carried out, and ended in an Access-Reject as planned.");
218 218
                 }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                 $level = \core\common\Entity::L_ERROR;
236 236
                 break;
237 237
         }
238
-        $loggerInstance->debug(4, "SERVER=" . $returnarray['result'][$i]['server'] . "\n");
238
+        $loggerInstance->debug(4, "SERVER=".$returnarray['result'][$i]['server']."\n");
239 239
         $returnarray['result'][$i]['level'] = $level;
240 240
         $returnarray['result'][$i]['message'] = $message;
241 241
         break;
@@ -252,9 +252,9 @@  discard block
 block discarded – undo
252 252
         }
253 253
         // we tried to contact someone, and know how long that took
254 254
         $returnarray['time_millisec'] = sprintf("%d", $rfc6614suite->TLS_CA_checks_result[$host]['time_millisec']);
255
-        $timeDisplay = ' (' . sprintf(_("elapsed time: %d"), $rfc6614suite->TLS_CA_checks_result[$host]['time_millisec']) . '&nbsp;ms)';
255
+        $timeDisplay = ' ('.sprintf(_("elapsed time: %d"), $rfc6614suite->TLS_CA_checks_result[$host]['time_millisec']).'&nbsp;ms)';
256 256
         if (isset($rfc6614suite->TLS_CA_checks_result[$host]['cert_oddity']) && ($rfc6614suite->TLS_CA_checks_result[$host]['cert_oddity'] == \core\diag\RADIUSTests::CERTPROB_UNKNOWN_CA)) {
257
-            $returnarray['message'] = _("<strong>ERROR</strong>: the server presented a certificate which is from an unknown authority!") . $timeDisplay;
257
+            $returnarray['message'] = _("<strong>ERROR</strong>: the server presented a certificate which is from an unknown authority!").$timeDisplay;
258 258
             $returnarray['level'] = \core\common\Entity::L_ERROR;
259 259
             $returnarray['result'] = $testresult;
260 260
             break;
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         $returnarray['level'] = \core\common\Entity::L_OK;
265 265
         // override if the connection was with a mismatching server name
266 266
         if (isset($rfc6614suite->TLS_CA_checks_result[$host]['cert_oddity']) && ($rfc6614suite->TLS_CA_checks_result[$host]['cert_oddity'] == \core\diag\RADIUSTests::CERTPROB_DYN_SERVER_NAME_MISMATCH)) {
267
-            $returnarray['message'] = _("<strong>WARNING</strong>: the server name as discovered in the SRV record does not match any name in the server certificate!") . $timeDisplay;
267
+            $returnarray['message'] = _("<strong>WARNING</strong>: the server name as discovered in the SRV record does not match any name in the server certificate!").$timeDisplay;
268 268
             $returnarray['level'] = \core\common\Entity::L_WARN;
269 269
         }
270 270
         switch ($rfc6614suite->TLS_CA_checks_result[$host]['status']) {
Please login to merge, or discard this patch.
core/diag/RFC6614Tests.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
 use \Exception;
25 25
 
26
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
26
+require_once dirname(dirname(__DIR__))."/config/_config.php";
27 27
 
28 28
 /**
29 29
  * Test suite to verify that a given NAI realm has NAPTR records according to
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     private function checkServerName($host) {
145 145
         // it could match CN or sAN:DNS, we don't care which
146 146
         if (isset($this->TLS_CA_checks_result[$host]['certdata']['subject'])) {
147
-            $this->loggerInstance->debug(4,"Checking expected server name ".$this->expectedName." against Subject: ");
147
+            $this->loggerInstance->debug(4, "Checking expected server name ".$this->expectedName." against Subject: ");
148 148
             $this->loggerInstance->debug(4, $this->TLS_CA_checks_result[$host]['certdata']['subject']);
149 149
             // we are checking against accidental misconfig, not attacks, so loosely checking against end of string is appropriate
150 150
             if (preg_match("/CN=".$this->expectedName."/", $this->TLS_CA_checks_result[$host]['certdata']['subject']) === 1) {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             }
153 153
         }
154 154
         if (isset($this->TLS_CA_checks_result[$host]['certdata']['extensions']['subjectaltname'])) {
155
-            $this->loggerInstance->debug(4,"Checking expected server name ".$this->expectedName." against sANs: ");
155
+            $this->loggerInstance->debug(4, "Checking expected server name ".$this->expectedName." against sANs: ");
156 156
             $this->loggerInstance->debug(4, $this->TLS_CA_checks_result[$host]['certdata']['extensions']['subjectaltname']);
157 157
             $testNames = $this->TLS_CA_checks_result[$host]['certdata']['extensions']['subjectaltname'];
158 158
             if (!is_array($testNames)) {
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 }
165 165
             }
166 166
         }
167
-        $this->loggerInstance->debug(3,"Tried to check expected server name ".$this->expectedName." but neither CN nor sANs matched.");
167
+        $this->loggerInstance->debug(3, "Tried to check expected server name ".$this->expectedName." but neither CN nor sANs matched.");
168 168
         
169 169
         $this->TLS_CA_checks_result[$host]['cert_oddity'] = RADIUSTests::CERTPROB_DYN_SERVER_NAME_MISMATCH;
170 170
         return FALSE;
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['status'] = $cert['status'];
195 195
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['message'] = $this->TLS_certkeys[$cert['status']];
196 196
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['expected'] = $cert['expected'];
197
-                $add = ' -cert ' . ROOT . '/config/cli-certs/' . $cert['public'] . ' -key ' . ROOT . '/config/cli-certs/' . $cert['private'];
197
+                $add = ' -cert '.ROOT.'/config/cli-certs/'.$cert['public'].' -key '.ROOT.'/config/cli-certs/'.$cert['private'];
198 198
                 if (!isset($this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k])) {
199 199
                     $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k] = [];
200 200
                 }
@@ -238,11 +238,11 @@  discard block
 block discarded – undo
238 238
 // but code analysers want this more explicit, so here is this extra
239 239
 // call to escapeshellarg()
240 240
         $escapedHost = escapeshellarg($host);
241
-        $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " s_client -connect " . $escapedHost . " -tls1 -CApath " . ROOT . "/config/ca-certs/ $arg 2>&1\n");
241
+        $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." s_client -connect ".$escapedHost." -tls1 -CApath ".ROOT."/config/ca-certs/ $arg 2>&1\n");
242 242
         $time_start = microtime(true);
243 243
         $opensslbabble = [];
244 244
         $result = 999; // likely to become zero by openssl; don't want to initialise to zero, could cover up exec failures
245
-        exec(CONFIG['PATHS']['openssl'] . " s_client -connect " . $escapedHost . " -no_ssl3 -CApath " . ROOT . "/config/ca-certs/ $arg 2>&1", $opensslbabble, $result);
245
+        exec(CONFIG['PATHS']['openssl']." s_client -connect ".$escapedHost." -no_ssl3 -CApath ".ROOT."/config/ca-certs/ $arg 2>&1", $opensslbabble, $result);
246 246
         $time_stop = microtime(true);
247 247
         $testresults['time_millisec'] = floor(($time_stop - $time_start) * 1000);
248 248
         $testresults['returncode'] = $result;
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>';
@@ -426,8 +426,8 @@  discard block
 block discarded – undo
426 426
 <?php
427 427
 foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) {
428 428
     print "
429
-$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading);
430
-$(\"#live_src" . $hostindex . "_img\").show();
429
+$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading);
430
+$(\"#live_src" . $hostindex."_img\").show();
431 431
 $.ajax({
432 432
     url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm,
433 433
     type: 'POST',
@@ -457,15 +457,15 @@  discard block
 block discarded – undo
457 457
 <?php
458 458
 foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) {
459 459
     if ($testedProfile !== NULL) {
460
-        $extraarg = "profile_id: " . $testedProfile->identifier . ", ";
460
+        $extraarg = "profile_id: ".$testedProfile->identifier.", ";
461 461
     } else {
462 462
         $extraarg = "";
463 463
     }
464 464
     print "
465
-$(\"#src" . $hostindex . "_img\").attr('src',icon_loading);
465
+$(\"#src" . $hostindex."_img\").attr('src',icon_loading);
466 466
 $(\"#src$hostindex\").html('');
467 467
 running_ajax_stat++;
468
-$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex'  }, udp, 'json');
468
+$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex'  }, udp, 'json');
469 469
 
470 470
 ";
471 471
 }
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
     if ($check_realm === FALSE) {
493 493
         print "<p>$error_message</p>";
494 494
     } else {
495
-        print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n";
495
+        print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n";
496 496
         ?>
497 497
         <div id="debug_out" style="display: none"></div>
498 498
         <div id="tabs" style="min-width: 600px; max-width:800px">
@@ -509,12 +509,12 @@  discard block
 block discarded – undo
509 509
                     </legend>
510 510
                     <?php
511 511
                     // NAPTR existence check
512
-                    echo "<strong>" . _("DNS chekcs") . "</strong><div>";
512
+                    echo "<strong>"._("DNS chekcs")."</strong><div>";
513 513
                     $naptr = $rfc7585suite->relevantNAPTR();
514 514
                     if ($naptr != \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) {
515 515
                         echo "<table>";
516 516
                         // output in friendly words
517
-                        echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>";
517
+                        echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>";
518 518
                         switch ($naptr) {
519 519
                             case \core\diag\RFC7585Tests::RETVAL_NONAPTR:
520 520
                                 echo _("This realm has no NAPTR records.");
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 
530 530
                         // compliance checks for NAPTRs
531 531
                         if ($naptr > 0) {
532
-                            echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>";
532
+                            echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>";
533 533
                             $naptr_valid = $rfc7585suite->relevantNAPTRcompliance();
534 534
                             switch ($naptr_valid) {
535 535
                                 case \core\diag\RADIUSTests::RETVAL_OK:
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 
547 547
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) {
548 548
                             $srv = $rfc7585suite->relevantNAPTRsrvResolution();
549
-                            echo "<tr><td>" . _("Checking SRVs:") . "</td><td>";
549
+                            echo "<tr><td>"._("Checking SRVs:")."</td><td>";
550 550
                             switch ($srv) {
551 551
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
552 552
                                     echo _("This check was skipped.");
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
                         // IP addresses for the hosts
563 563
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) {
564 564
                             $hosts = $rfc7585suite->relevantNAPTRhostnameResolution();
565
-                            echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>";
565
+                            echo "<tr><td>"._("Checking IP address resolution:")."</td><td>";
566 566
                             switch ($srv) {
567 567
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
568 568
                                     echo _("This check was skipped.");
@@ -578,12 +578,12 @@  discard block
 block discarded – undo
578 578
 
579 579
                         echo "</table><br/><br/>";
580 580
                         if (count($testsuite->listerrors()) == 0) {
581
-                            echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!");
581
+                            echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!");
582 582
                         } else {
583
-                            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
+                            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.");
584 584
                             echo "<div class='notacceptable'><table>";
585 585
                             foreach ($testsuite->listerrors() as $details) {
586
-                                echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>";
586
+                                echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>";
587 587
                             }
588 588
                             echo "</table></div>";
589 589
                         }
@@ -599,26 +599,26 @@  discard block
 block discarded – undo
599 599
                  $("#dynamic_tests").show();
600 600
               ';
601 601
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
602
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
602
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
603 603
                             $expectedName = $addr['hostname'];
604 604
                             print "
605 605
                             running_ajax_dyn++;
606
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); 
606
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); 
607 607
                             running_ajax_dyn++;
608
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); 
608
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); 
609 609
                        ";
610 610
                         }
611 611
                         echo "}
612 612
               </script><hr>";
613 613
                     } else {
614
-                        echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
614
+                        echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>";
615 615
                     }
616
-                    echo "<strong>" . _("Static connectivity tests") . "</strong>
616
+                    echo "<strong>"._("Static connectivity tests")."</strong>
617 617
          <table><tr>
618 618
          <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>
619 619
          </tr></table>";
620 620
                     if ($naptr > 0) {
621
-                        echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong>
621
+                        echo "<hr><strong>"._("Dynamic connectivity tests")."</strong>
622 622
          <table><tr>
623 623
          <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>
624 624
          </tr></table>";
@@ -638,12 +638,12 @@  discard block
 block discarded – undo
638 638
                     print "<p>";
639 639
                     foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) {
640 640
                         print "<hr>";
641
-                        printf(_("Testing from: %s"), "<strong>" . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
641
+                        printf(_("Testing from: %s"), "<strong>".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name']."</strong>");
642 642
                         print "<table id='results$hostindex'  style='width:100%' class='udp_results'>
643 643
 <tr>
644
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td>
644
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td>
645 645
 <td id='src$hostindex' colspan=2>
646
-" . _("testing...") . "
646
+"._("testing...")."
647 647
 </td>
648 648
 </tr>
649 649
 </table>";
@@ -662,21 +662,21 @@  discard block
 block discarded – undo
662 662
 
663 663
                     <?php
664 664
                     echo "<div id='dynamic_tests'><fieldset class='option_container'>
665
-                <legend><strong>" . _("DYNAMIC connectivity tests") . "</strong></legend>";
665
+                <legend><strong>" . _("DYNAMIC connectivity tests")."</strong></legend>";
666 666
 
667 667
                     $resultstoprint = [];
668 668
                     if (count($rfc7585suite->NAPTR_hostname_records) > 0) {
669
-                        $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>';
670
-                        $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>";
669
+                        $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>';
670
+                        $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>";
671 671
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
672
-                            $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]);
673
-                            $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong>';
672
+                            $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]);
673
+                            $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong>';
674 674
                             $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>';
675 675
                             $resultstoprint[] = "<table id='caresults$hostindex'  style='width:100%'>
676 676
 <tr>
677
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca" . $hostindex . "_img'></td>
677
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca".$hostindex."_img'></td>
678 678
 <td id='srcca$hostindex'>
679
-" . _("testing...") . "
679
+"._("testing...")."
680 680
 </td>
681 681
 </tr>
682 682
 </table>";
@@ -684,12 +684,12 @@  discard block
 block discarded – undo
684 684
                         }
685 685
                         $clientstest = [];
686 686
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
687
-                            $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>';
687
+                            $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>';
688 688
                             $clientstest[] = "<span id='clientresults$hostindex$clinx'><table style='width:100%'>
689 689
 <tr>
690
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient" . $hostindex . "_img'></td>
690
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient".$hostindex."_img'></td>
691 691
 <td id='srcclient$hostindex'>
692
-" . _("testing...") . "
692
+"._("testing...")."
693 693
 </td>
694 694
 </tr>
695 695
 </table></span>";
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
                         }
698 698
                         echo '<div style="align:right;">';
699 699
                         echo join('', $resultstoprint);
700
-                        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
+                        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>';
701 701
                         print join('', $clientstest);
702 702
                         echo '</span>';
703 703
                         echo '</div>';
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
                 //     check if truncates/dies on Operator-Name
712 712
                 if ($my_profile !== NULL) {
713 713
                     echo "<div id='tabs-4'><fieldset class='option_container'>
714
-                <legend><strong>" . _("Live login test") . "</strong></legend>";
714
+                <legend><strong>" . _("Live login test")."</strong></legend>";
715 715
                     $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1);
716 716
                     if (count($prof_compl) > 0) {
717 717
                         $passwordReqired = FALSE;
@@ -724,34 +724,34 @@  discard block
 block discarded – undo
724 724
                                 $clientCertRequired = TRUE;
725 725
                             }
726 726
                         }
727
-                        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>
728
-                    <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>
729
-                    <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>
727
+                        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>
728
+                    <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>
729
+                    <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>
730 730
                     <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'>
731 731
                     <input type='hidden' name='test_type' value='udp_login'>
732
-                    <input type='hidden' name='lang' value='" . $gui->langObject->getLang() . "'>
733
-                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'>
732
+                    <input type='hidden' name='lang' value='" . $gui->langObject->getLang()."'>
733
+                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'>
734 734
                     <table id='live_tests'>";
735 735
 // if any password based EAP methods are available enable this section
736 736
                         if ($passwordReqired) {
737
-                            echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr>
738
-                        <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
739
-                            echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
740
-                            echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
737
+                            echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr>
738
+                        <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
739
+                            echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
740
+                            echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
741 741
                         }
742 742
                         // ask for cert + privkey if TLS-based method is active
743 743
                         if ($clientCertRequired) {
744
-                            echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr>
745
-                        <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
746
-                        <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
747
-                        <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
744
+                            echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr>
745
+                        <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
746
+                        <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
747
+                        <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
748 748
                         }
749
-                        echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>";
749
+                        echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>";
750 750
                         echo "<div id='live_login_results' style='display:none'>";
751 751
                         foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) {
752 752
                             print "<hr>";
753
-                            printf(_("Testing from: %s"), "<strong>" . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
754
-                            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>";
753
+                            printf(_("Testing from: %s"), "<strong>".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name']."</strong>");
754
+                            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>";
755 755
                             print "<div id='eap_test$hostindex' class='eap_test_results'></div>";
756 756
                         }
757 757
                         echo "</div>";
@@ -766,9 +766,9 @@  discard block
 block discarded – undo
766 766
             }
767 767
 
768 768
             if (isset($_POST['comefrom'])) {
769
-                $return = htmlspecialchars_decode($_POST['comefrom']) . "?inst_id=" . $my_inst->identifier;
769
+                $return = htmlspecialchars_decode($_POST['comefrom'])."?inst_id=".$my_inst->identifier;
770 770
                 echo "<form method='post' action='$return' accept-charset='UTF-8'>
771
-                    <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
+                    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst)."</button>"
772 772
                 . "</form>";
773 773
             }
774 774
             if ($check_realm !== FALSE) {
Please login to merge, or discard this patch.
core/diag/RADIUSTests.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 use \Exception;
37 37
 
38
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
38
+require_once dirname(dirname(__DIR__))."/config/_config.php";
39 39
 
40 40
 /**
41 41
  * Test suite to verify that an EAP setup is actually working as advertised in
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             }
169 169
         }
170 170
 
171
-        $this->loggerInstance->debug(4, "RADIUSTests is in opMode " . $this->opMode . ", parameters were: $realm, $outerUsernameForChecks, " . print_r($supportedEapTypes, true));
171
+        $this->loggerInstance->debug(4, "RADIUSTests is in opMode ".$this->opMode.", parameters were: $realm, $outerUsernameForChecks, ".print_r($supportedEapTypes, true));
172 172
         $this->loggerInstance->debug(4, print_r($expectedServerNames, true));
173 173
         $this->loggerInstance->debug(4, print_r($expectedCABundle, true));
174 174
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
                 $returnarray[] = RADIUSTests::CERTPROB_WILDCARD_IN_NAME;
259 259
                 continue; // otherwise we'd ALSO complain that it's not a real hostname
260 260
             }
261
-            if ($onename != "" && filter_var("foo@" . idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
261
+            if ($onename != "" && filter_var("foo@".idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
262 262
                 $returnarray[] = RADIUSTests::CERTPROB_NOT_A_HOSTNAME;
263 263
             }
264 264
         }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
         if (preg_match("/sha1/i", $intermediateCa['full_details']['signatureTypeSN'])) {
285 285
             $returnarray[] = RADIUSTests::CERTPROB_SHA1_SIGNATURE;
286 286
         }
287
-        $this->loggerInstance->debug(4, "CERT IS: " . print_r($intermediateCa, TRUE));
287
+        $this->loggerInstance->debug(4, "CERT IS: ".print_r($intermediateCa, TRUE));
288 288
         if ($intermediateCa['basicconstraints_set'] == 0) {
289 289
             $returnarray[] = RADIUSTests::CERTPROB_NO_BASICCONSTRAINTS;
290 290
         }
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
     {
334 334
         // for EAP-TLS to be a viable option, we need to pass a random client cert to make eapol_test happy
335 335
         // the following PEM data is one of the SENSE EAPLab client certs (not secret at all)
336
-        $clientcert = file_get_contents(dirname(__FILE__) . "/clientcert.p12");
336
+        $clientcert = file_get_contents(dirname(__FILE__)."/clientcert.p12");
337 337
         if ($clientcert === FALSE) {
338 338
             throw new Exception("A dummy client cert is part of the source distribution, but could not be loaded!");
339 339
         }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
         if ($this->opMode == self::RADIUS_TEST_OPERATION_MODE_THOROUGH) {
343 343
             return $this->udpLogin($probeindex, $this->supportedEapTypes[0]->getArrayRep(), $this->outerUsernameForChecks, 'eaplab', $opnameCheck, $frag, $clientcert);
344 344
         }
345
-        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@" . $this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
345
+        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@".$this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
346 346
     }
347 347
 
348 348
     /**
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
             return RADIUSTests::CERTPROB_NO_CDP_HTTP;
364 364
         }
365 365
         // first and second sub-match is the full URL... check it
366
-        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1] . $crlUrl[2]));
366
+        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1].$crlUrl[2]));
367 367
         if ($crlcontent === FALSE) {
368 368
             return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL;
369 369
         }
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 
378 378
         // $pem = chunk_split(base64_encode($crlcontent), 64, "\n");
379 379
         // inspired by https://stackoverflow.com/questions/2390604/how-to-pass-variables-as-stdin-into-command-line-from-php
380
-        $proc = CONFIG['PATHS']['openssl'] . " crl -inform der";
380
+        $proc = CONFIG['PATHS']['openssl']." crl -inform der";
381 381
         $descriptorspec = [
382 382
             0 => ["pipe", "r"],
383 383
             1 => ["pipe", "w"],
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         $origLength = strlen($hex);
417 417
         for ($i = 1; $i < $origLength; $i++) {
418 418
             if ($i % 2 == 1 && $i != strlen($hex)) {
419
-                $spaced .= $hex[$i] . " ";
419
+                $spaced .= $hex[$i]." ";
420 420
             } else {
421 421
                 $spaced .= $hex[$i];
422 422
             }
@@ -543,19 +543,19 @@  discard block
 block discarded – undo
543 543
         $eapText = \core\common\EAP::eapDisplayName($eaptype);
544 544
         $config = '
545 545
 network={
546
-  ssid="' . CONFIG['APPEARANCE']['productname'] . ' testing"
546
+  ssid="' . CONFIG['APPEARANCE']['productname'].' testing"
547 547
   key_mgmt=WPA-EAP
548 548
   proto=WPA2
549 549
   pairwise=CCMP
550 550
   group=CCMP
551 551
   ';
552 552
 // phase 1
553
-        $config .= 'eap=' . $eapText['OUTER'] . "\n";
553
+        $config .= 'eap='.$eapText['OUTER']."\n";
554 554
         $logConfig = $config;
555 555
 // phase 2 if applicable; all inner methods have passwords
556 556
         if (isset($eapText['INNER']) && $eapText['INNER'] != "") {
557
-            $config .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
558
-            $logConfig .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
557
+            $config .= '  phase2="auth='.$eapText['INNER']."\"\n";
558
+            $logConfig .= '  phase2="auth='.$eapText['INNER']."\"\n";
559 559
         }
560 560
 // all methods set a password, except EAP-TLS
561 561
         if ($eaptype != \core\common\EAP::EAPTYPE_TLS) {
@@ -571,11 +571,11 @@  discard block
 block discarded – undo
571 571
         }
572 572
 
573 573
 // inner identity
574
-        $config .= '  identity="' . $inner . "\"\n";
575
-        $logConfig .= '  identity="' . $inner . "\"\n";
574
+        $config .= '  identity="'.$inner."\"\n";
575
+        $logConfig .= '  identity="'.$inner."\"\n";
576 576
 // outer identity, may be equal
577
-        $config .= '  anonymous_identity="' . $outer . "\"\n";
578
-        $logConfig .= '  anonymous_identity="' . $outer . "\"\n";
577
+        $config .= '  anonymous_identity="'.$outer."\"\n";
578
+        $logConfig .= '  anonymous_identity="'.$outer."\"\n";
579 579
 // done
580 580
         $config .= "}";
581 581
         $logConfig .= "}";
@@ -638,13 +638,13 @@  discard block
 block discarded – undo
638 638
      */
639 639
     private function eapolTestConfig($probeindex, $opName, $frag)
640 640
     {
641
-        $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'] .
642
-                " -a " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'] .
643
-                " -s " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'] .
644
-                " -o serverchain.pem" .
645
-                " -c ./udp_login_test.conf" .
646
-                " -M 22:44:66:CA:20:" . sprintf("%02d", $probeindex) . " " .
647
-                " -t " . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout'] . " ";
641
+        $cmdline = CONFIG_DIAGNOSTICS['PATHS']['eapol_test'].
642
+                " -a ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['ip'].
643
+                " -s ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['secret'].
644
+                " -o serverchain.pem".
645
+                " -c ./udp_login_test.conf".
646
+                " -M 22:44:66:CA:20:".sprintf("%02d", $probeindex)." ".
647
+                " -t ".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$probeindex]['timeout']." ";
648 648
         if ($opName) {
649 649
             $cmdline .= '-N126:s:"1cat.eduroam.org" ';
650 650
         }
@@ -674,10 +674,10 @@  discard block
 block discarded – undo
674 674
      */
675 675
     private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs)
676 676
     {
677
-        if (!mkdir($tmpDir . "/root-ca-allcerts/", 0700, true)) {
677
+        if (!mkdir($tmpDir."/root-ca-allcerts/", 0700, true)) {
678 678
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-allcerts/\n");
679 679
         }
680
-        if (!mkdir($tmpDir . "/root-ca-eaponly/", 0700, true)) {
680
+        if (!mkdir($tmpDir."/root-ca-eaponly/", 0700, true)) {
681 681
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-eaponly/\n");
682 682
         }
683 683
 // make a copy of the EAP-received chain and add the configured intermediates, if any
@@ -691,15 +691,15 @@  discard block
 block discarded – undo
691 691
             }
692 692
             if ($decoded['ca'] == 1) {
693 693
                 if ($decoded['root'] == 1) { // save CAT roots to the root directory
694
-                    file_put_contents($tmpDir . "/root-ca-eaponly/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
695
-                    file_put_contents($tmpDir . "/root-ca-allcerts/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
694
+                    file_put_contents($tmpDir."/root-ca-eaponly/configuredroot".count($catRoots).".pem", $decoded['pem']);
695
+                    file_put_contents($tmpDir."/root-ca-allcerts/configuredroot".count($catRoots).".pem", $decoded['pem']);
696 696
                     $catRoots[] = $decoded['pem'];
697 697
                 } else { // save the intermediates to allcerts directory
698
-                    file_put_contents($tmpDir . "/root-ca-allcerts/cat-intermediate" . count($catIntermediates) . ".pem", $decoded['pem']);
698
+                    file_put_contents($tmpDir."/root-ca-allcerts/cat-intermediate".count($catIntermediates).".pem", $decoded['pem']);
699 699
                     $intermOdditiesCAT = array_merge($intermOdditiesCAT, $this->propertyCheckIntermediate($decoded));
700 700
                     if (isset($decoded['CRL']) && isset($decoded['CRL'][0])) {
701 701
                         $this->loggerInstance->debug(4, "got an intermediate CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
702
-                        file_put_contents($tmpDir . "/root-ca-allcerts/crl_cat" . count($catIntermediates) . ".pem", $decoded['CRL'][0]);
702
+                        file_put_contents($tmpDir."/root-ca-allcerts/crl_cat".count($catIntermediates).".pem", $decoded['CRL'][0]);
703 703
                     }
704 704
                     $catIntermediates[] = $decoded['pem'];
705 705
                 }
@@ -708,26 +708,26 @@  discard block
 block discarded – undo
708 708
         // save all intermediate certificates and CRLs to separate files in 
709 709
         // both root-ca directories
710 710
         foreach ($eapIntermediates as $index => $onePem) {
711
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediate$index.pem", $onePem);
712
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediate$index.pem", $onePem);
711
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediate$index.pem", $onePem);
712
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediate$index.pem", $onePem);
713 713
         }
714 714
         foreach ($eapIntermediateCRLs as $index => $onePem) {
715
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
716
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
715
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
716
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
717 717
         }
718 718
 
719 719
         $checkstring = "";
720 720
         if (isset($servercert['CRL']) && isset($servercert['CRL'][0])) {
721 721
             $this->loggerInstance->debug(4, "got a server CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
722 722
             $checkstring = "-crl_check_all";
723
-            file_put_contents($tmpDir . "/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
724
-            file_put_contents($tmpDir . "/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
723
+            file_put_contents($tmpDir."/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
724
+            file_put_contents($tmpDir."/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
725 725
         }
726 726
 
727 727
 
728 728
 // now c_rehash the root CA directory ...
729
-        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-eaponly/ > /dev/null");
730
-        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash'] . " $tmpDir/root-ca-allcerts/ > /dev/null");
729
+        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-eaponly/ > /dev/null");
730
+        system(CONFIG_DIAGNOSTICS['PATHS']['c_rehash']." $tmpDir/root-ca-allcerts/ > /dev/null");
731 731
         return $checkstring;
732 732
     }
733 733
 
@@ -760,12 +760,12 @@  discard block
 block discarded – undo
760 760
 // so test if there's something PEMy in the file at all
761 761
 // serverchain.pem is the output from eapol_test; incomingserver.pem is written by extractIncomingCertsfromEAP() if there was at least one server cert.
762 762
         if (filesize("$tmpDir/serverchain.pem") > 10 && filesize("$tmpDir/incomingserver.pem") > 10) {
763
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
764
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
765
-            $this->loggerInstance->debug(4, "Chain verify pass 1: " . print_r($verifyResultEaponly, TRUE) . "\n");
766
-            exec(CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
767
-            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
768
-            $this->loggerInstance->debug(4, "Chain verify pass 2: " . print_r($verifyResultAllcerts, TRUE) . "\n");
763
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
764
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
765
+            $this->loggerInstance->debug(4, "Chain verify pass 1: ".print_r($verifyResultEaponly, TRUE)."\n");
766
+            exec(CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
767
+            $this->loggerInstance->debug(4, CONFIG['PATHS']['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
768
+            $this->loggerInstance->debug(4, "Chain verify pass 2: ".print_r($verifyResultAllcerts, TRUE)."\n");
769 769
         }
770 770
 
771 771
 
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
         // we are UNHAPPY if no names match!
833 833
         $happiness = "UNHAPPY";
834 834
         foreach ($this->expectedServerNames as $expectedName) {
835
-            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: " . print_r($servercert['CN'], TRUE) . print_r($servercert['sAN_DNS'], TRUE));
835
+            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: ".print_r($servercert['CN'], TRUE).print_r($servercert['sAN_DNS'], TRUE));
836 836
             if (array_search($expectedName, $servercert['CN']) !== FALSE && array_search($expectedName, $servercert['sAN_DNS']) !== FALSE) {
837 837
                 $this->loggerInstance->debug(4, "Totally happy!");
838 838
                 $happiness = "TOTALLY";
@@ -877,11 +877,11 @@  discard block
 block discarded – undo
877 877
         $theconfigs = $this->wpaSupplicantConfig($eaptype, $finalInner, $finalOuter, $password);
878 878
         // the config intentionally does not include CA checking. We do this
879 879
         // ourselves after getting the chain with -o.
880
-        file_put_contents($tmpDir . "/udp_login_test.conf", $theconfigs[0]);
880
+        file_put_contents($tmpDir."/udp_login_test.conf", $theconfigs[0]);
881 881
 
882 882
         $cmdline = $this->eapolTestConfig($probeindex, $opnameCheck, $frag);
883 883
         $this->loggerInstance->debug(4, "Shallow reachability check cmdline: $cmdline\n");
884
-        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n" . $theconfigs[1] . "\n");
884
+        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n".$theconfigs[1]."\n");
885 885
         $time_start = microtime(true);
886 886
         $pflow = [];
887 887
         exec($cmdline, $pflow);
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
         if ($packetflow[count($packetflow) - 1] == 3 && $this->checkLineparse($packetflow_orig, self::LINEPARSE_CHECK_REJECTIGNORE)) {
926 926
             array_pop($packetflow);
927 927
         }
928
-        $this->loggerInstance->debug(5, "Packetflow: " . print_r($packetflow, TRUE));
928
+        $this->loggerInstance->debug(5, "Packetflow: ".print_r($packetflow, TRUE));
929 929
         $packetcount = array_count_values($packetflow);
930 930
         $testresults['packetcount'] = $packetcount;
931 931
         $testresults['packetflow'] = $packetflow;
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
     private function wasModernTlsNegotiated(&$testresults, $packetflow_orig)
968 968
     {
969 969
         $negotiatedTlsVersion = $this->checkLineparse($packetflow_orig, self::LINEPARSE_TLSVERSION);
970
-        $this->loggerInstance->debug(4,"TLS version found is: $negotiatedTlsVersion"."\n");
970
+        $this->loggerInstance->debug(4, "TLS version found is: $negotiatedTlsVersion"."\n");
971 971
         if ($negotiatedTlsVersion === FALSE) {
972 972
             $testresults['cert_oddities'][] = RADIUSTests::TLSPROB_UNKNOWN_TLS_VERSION;
973 973
         } elseif ($negotiatedTlsVersion != self::TLS_VERSION_1_2 && $negotiatedTlsVersion != self::TLS_VERSION_1_3) {
@@ -1027,7 +1027,7 @@  discard block
 block discarded – undo
1027 1027
 
1028 1028
         $x509 = new \core\common\X509();
1029 1029
 // $eap_certarray holds all certs received in EAP conversation
1030
-        $incomingData = file_get_contents($tmpDir . "/serverchain.pem");
1030
+        $incomingData = file_get_contents($tmpDir."/serverchain.pem");
1031 1031
         if ($incomingData !== FALSE && strlen($incomingData) > 0) {
1032 1032
             $eapCertArray = $x509->splitCertificate($incomingData);
1033 1033
         } else {
@@ -1057,10 +1057,10 @@  discard block
 block discarded – undo
1057 1057
                 case RADIUSTests::SERVER_CA_SELFSIGNED:
1058 1058
                     $servercert[] = $cert;
1059 1059
                     if (count($servercert) == 1) {
1060
-                        if (file_put_contents($tmpDir . "/incomingserver.pem", $certPem . "\n") === FALSE) {
1060
+                        if (file_put_contents($tmpDir."/incomingserver.pem", $certPem."\n") === FALSE) {
1061 1061
                             $this->loggerInstance->debug(4, "The (first) server certificate could not be written to $tmpDir/incomingserver.pem!\n");
1062 1062
                         }
1063
-                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: " . print_r($servercert[0], true));
1063
+                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: ".print_r($servercert[0], true));
1064 1064
                     } elseif (!in_array(RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS, $testresults['cert_oddities'])) {
1065 1065
                         $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS;
1066 1066
                     }
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
         chdir($tmpDir);
1142 1142
         $this->loggerInstance->debug(4, "temp dir: $tmpDir\n");
1143 1143
         if ($clientcertdata !== NULL) {
1144
-            file_put_contents($tmpDir . "/client.p12", $clientcertdata);
1144
+            file_put_contents($tmpDir."/client.p12", $clientcertdata);
1145 1145
         }
1146 1146
         $testresults = [];
1147 1147
         // initialise the sub-array for cleaner parsing
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
                     'issuer' => $this->printDN($certdata['issuer']),
1243 1243
                     'validFrom' => $this->printTm($certdata['validFrom_time_t']),
1244 1244
                     'validTo' => $this->printTm($certdata['validTo_time_t']),
1245
-                    'serialNumber' => $certdata['serialNumber'] . sprintf(" (0x%X)", $certdata['serialNumber']),
1245
+                    'serialNumber' => $certdata['serialNumber'].sprintf(" (0x%X)", $certdata['serialNumber']),
1246 1246
                     'sha1' => $certdata['sha1'],
1247 1247
                     'extensions' => $certdata['extensions']
1248 1248
                 ];
Please login to merge, or discard this patch.
devices/ms/Files/common.inc 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
 !define MUI_HEADERIMAGE_BITMAP "cat_150.bmp"
137 137
 !define MUI_COMPONENTSPAGE_SMALLDESC
138 138
 
139
-!define WELCOME_HEADER "<?php printf(WindowsCommon::sprint_nsi(_("Welcome to the %s installer")),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?>"
140
-!define FAREWELL_HEADER "<?php WindowsCommon::echo_nsi( _("Installation complete"))?>"
141
-!define FAREWELL_TEXT	"<?php WindowsCommon::echo_nsi( _("Network profiles have been installed."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi(  _("Your system is ready."))?>"
142
-!define FAREWELL_FAIL	"<?php WindowsCommon::echo_nsi( _("Network installation had errors."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi( _("Please contact \${SUPPORT}."))?>"
139
+!define WELCOME_HEADER "<?php printf(WindowsCommon::sprint_nsi(_("Welcome to the %s installer")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?>"
140
+!define FAREWELL_HEADER "<?php WindowsCommon::echo_nsi(_("Installation complete"))?>"
141
+!define FAREWELL_TEXT	"<?php WindowsCommon::echo_nsi(_("Network profiles have been installed."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi(_("Your system is ready."))?>"
142
+!define FAREWELL_FAIL	"<?php WindowsCommon::echo_nsi(_("Network installation had errors."))?>$\r$\n$\n <?php WindowsCommon::echo_nsi(_("Please contact \${SUPPORT}."))?>"
143 143
 ;--------------------------------
144 144
 ;Languages
145 145
 !insertmacro MUI_LANGUAGE "${LANG}"
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
 ;--------------------------------
148 148
 ; License file
149 149
 !ifdef LICENSE_FILE
150
-LicenseForceSelection checkbox "<?php WindowsCommon::echo_nsi( _("Accept"))?>"
150
+LicenseForceSelection checkbox "<?php WindowsCommon::echo_nsi(_("Accept"))?>"
151 151
 LicenseText "<?php WindowsCommon::echo_nsi(_("If you accept the conditions then select Accept and then click Install to continue."))?>"
152 152
 LicenseData ${LICENSE_FILE}
153 153
 !endif
154 154
 
155 155
 ;-----------------------------------
156 156
 
157
-MiscButtonText "" "" "" "<?php WindowsCommon::echo_nsi( _("Finish"))?>"
157
+MiscButtonText "" "" "" "<?php WindowsCommon::echo_nsi(_("Finish"))?>"
158 158
 ;----------------------------------
159 159
 ;  FUNCTIONS
160 160
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
 !macro install_ca_cert ca_file ca_fingerprint level
189 189
    !insertmacro debug_cat 2 "locating certificate  SHA=${ca_fingerprint} Level=${level}"
190
-   DetailPrint "<?php WindowsCommon::echo_nsi( _("searching for certificate"))?> ${ca_file}"
190
+   DetailPrint "<?php WindowsCommon::echo_nsi(_("searching for certificate"))?> ${ca_file}"
191 191
    File "${ca_file}"
192 192
    nsArray::Set Delete_files "${ca_file}"
193 193
    !insertmacro debug_cat 2 "Testing machine store root"
@@ -249,13 +249,13 @@  discard block
 block discarded – undo
249 249
    ${EndIf}
250 250
    !insertmacro debug_cat 2 "installing certificate $TEMP\${ca_file}"
251 251
    !insertmacro debug_cat 3 "Execute: certutil -addstore -user ${level} $TEMP\${ca_file}"
252
-   DetailPrint "<?php WindowsCommon::echo_nsi( _("installing certificate"))?> ${ca_file}"
252
+   DetailPrint "<?php WindowsCommon::echo_nsi(_("installing certificate"))?> ${ca_file}"
253 253
    nsExec::Exec '"certutil" -addstore -user ${level} "$TEMP"\${ca_file}'
254 254
    Pop $0
255 255
    !insertmacro debug_cat 3 "certutil returned $0"
256 256
    ${If} $0 != 0
257 257
      IfSilent +2
258
-     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi( _("could not install certificate"))?>  ${ca_file}"
258
+     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi(_("could not install certificate"))?>  ${ca_file}"
259 259
      !insertmacro debug_cat 1 "could not install certificate ${ca_file}"
260 260
    ${EndIf}
261 261
 no_install_${ca_file}:
@@ -462,26 +462,26 @@  discard block
 block discarded – undo
462 462
   pop $R0
463 463
   ${If} $tkip_count > 0
464 464
     ${If} $aes_count > 1
465
-      StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi( _("The non TKIP profiles are preferred. Always use them if you have a choice."))?>"
465
+      StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi(_("The non TKIP profiles are preferred. Always use them if you have a choice."))?>"
466 466
     ${Else}
467
-     StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi( _("The non TKIP profile is preferred. Always use it if you have a choice."))?>"
467
+     StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echo_nsi(_("The non TKIP profile is preferred. Always use it if you have a choice."))?>"
468 468
     ${EndIf}
469 469
   ${Else}
470 470
     StrCpy $R1 ""
471 471
   ${EndIf}
472 472
   ${If} $profile_count > 0
473
-    StrCpy $welcome_message "<?php WindowsCommon::echo_nsi( _("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
474
-<?php WindowsCommon::echo_nsi( _("The installer will create the following wireless profiles:"))?>$\r$\n\
473
+    StrCpy $welcome_message "<?php WindowsCommon::echo_nsi(_("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
474
+<?php WindowsCommon::echo_nsi(_("The installer will create the following wireless profiles:"))?>$\r$\n\
475 475
 $R0.\
476 476
 $R1$\r$\n$\n\
477
-<?php WindowsCommon::echo_nsi( _("More information and comments:"))?>$\r$\n\
477
+<?php WindowsCommon::echo_nsi(_("More information and comments:"))?>$\r$\n\
478 478
    EMAIL: ${SUPPORT}$\r$\n\
479 479
    WWW: ${URL}"
480 480
 ${Else}
481
-StrCpy $welcome_message "<?php WindowsCommon::echo_nsi( _("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
482
-<?php WindowsCommon::echo_nsi( _("The installer will create the wireless profile:"))?> $R0.\
481
+StrCpy $welcome_message "<?php WindowsCommon::echo_nsi(_("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
482
+<?php WindowsCommon::echo_nsi(_("The installer will create the wireless profile:"))?> $R0.\
483 483
 $R1$\r$\n$\n\
484
-<?php WindowsCommon::echo_nsi( _("More information and comments:"))?>$\r$\n\
484
+<?php WindowsCommon::echo_nsi(_("More information and comments:"))?>$\r$\n\
485 485
    EMAIL: ${SUPPORT}$\r$\n\
486 486
    WWW: ${URL}"
487 487
 ${EndIf}
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
   SendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0
508 508
 ;TRANSLATION
509 509
   nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 46u -130u -32u "$welcome_message\
510
-$\r$\n$\r$\n<?php WindowsCommon::echo_nsi( _("Installer created with software from the GEANT project."))?>"
510
+$\r$\n$\r$\n<?php WindowsCommon::echo_nsi(_("Installer created with software from the GEANT project."))?>"
511 511
   Pop $TEXT
512 512
 
513 513
   SetCtlColors $DIALOG "" 0xffffff
@@ -640,18 +640,18 @@  discard block
 block discarded – undo
640 640
     ${If} $wireless_result == 1
641 641
       !insertmacro debug_cat 1 "wlan_test.exe did not find wireless configuration service"
642 642
       IfSilent +2
643
-      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi( _("Windows wireless configuration service is not enabled. The installer cannot continue."))?>"
643
+      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi(_("Windows wireless configuration service is not enabled. The installer cannot continue."))?>"
644 644
       Call Cleanup
645 645
     ${EndIf}
646 646
     ${If} $wireless_result == 2
647 647
       IfSilent +2
648
-      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi( _("No wireless interfaces found. The installer cannot continue."))?>"
648
+      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echo_nsi(_("No wireless interfaces found. The installer cannot continue."))?>"
649 649
       Call Cleanup
650 650
     ${EndIf}
651 651
   ${Else}
652 652
     ${If} $wireless_result > 0
653 653
        IfSilent +3
654
-       MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi( _("No wireless interfaces found. Wireless access will not be configured. Would you like to continue and configure access on the wired interface?"))?>" IDYES wired_yes
654
+       MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi(_("No wireless interfaces found. Wireless access will not be configured. Would you like to continue and configure access on the wired interface?"))?>" IDYES wired_yes
655 655
        Call Cleanup
656 656
        wired_yes:
657 657
        Push 1
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
     ${If} $wired == 1
668 668
       ${If} $force_wired == 0
669 669
         IfSilent wired
670
-        MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi( _("Do you want to enable access on wired interfaces?"))?>" IDYES wired
670
+        MessageBox MB_YESNO "<?php WindowsCommon::echo_nsi(_("Do you want to enable access on wired interfaces?"))?>" IDYES wired
671 671
         Push 0
672 672
         Pop $wired
673 673
         wired:
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 ;================================
709 709
 
710 710
 Function ShowInstfiles
711
-  !insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi( _("Profiles installation"))?>" " "
711
+  !insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi(_("Profiles installation"))?>" " "
712 712
 FunctionEnd
713 713
 ;================================
714 714
 ;  Check if a wireless profile exist and put it on delete list
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 
728 728
 Function FindProfile
729 729
   Pop $R8
730
-  DetailPrint "<?php WindowsCommon::echo_nsi( _("Checking for profile \$R8"))?>"
730
+  DetailPrint "<?php WindowsCommon::echo_nsi(_("Checking for profile \$R8"))?>"
731 731
   !insertmacro debug_cat 2 "Checking for profile $R8"
732 732
   !insertmacro debug_cat 3 "Exec: $Netsh wlan show profiles $R8"
733 733
   nsExec::Exec  '"$Netsh" wlan show profiles "$R8"'
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
   !insertmacro debug_cat 4 "netsh returned $0"
736 736
   ${If} $0 == 0
737 737
     !insertmacro debug_cat 1 "found profile $R8"
738
-    DetailPrint "<?php WindowsCommon::echo_nsi( _("found profile \$R8"))?>"
738
+    DetailPrint "<?php WindowsCommon::echo_nsi(_("found profile \$R8"))?>"
739 739
     Push 0
740 740
   ${Else}
741 741
     !insertmacro debug_cat 1 "profile $R8 not found"
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
     ${If} $Symantec_installed  != 0
831 831
      !insertmacro debug_cat 3 "Symantec problem"
832 832
      IfSilent +2
833
-     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php printf(WindowsCommon::sprint_nsi(_("Please READ this message it is IMPORTANT.$\\r$\\nInstallation problems may be due to the fact that Symantec Endpoint Protection is installed on your machine.$\\r$\\nWhile this is a well-known bug of the Symantec product, about which the installer can not do anything, there is a workaround.$\\r$\\nWhen you close this window the installer will exit and an explorer window will be started (it could appear underneath already opened windows). In this window you should see a script named inst_cat. Start it by double-clicking, It will install the profiles. You will need to login to %s with your username and password.")),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) ?>"
833
+     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php printf(WindowsCommon::sprint_nsi(_("Please READ this message it is IMPORTANT.$\\r$\\nInstallation problems may be due to the fact that Symantec Endpoint Protection is installed on your machine.$\\r$\\nWhile this is a well-known bug of the Symantec product, about which the installer can not do anything, there is a workaround.$\\r$\\nWhen you close this window the installer will exit and an explorer window will be started (it could appear underneath already opened windows). In this window you should see a script named inst_cat. Start it by double-clicking, It will install the profiles. You will need to login to %s with your username and password.")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) ?>"
834 834
     Exec '"explorer" /select,"$EXEDIR\inst_cat.cmd"'
835 835
     Quit
836 836
 
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 Function PFXCertificateSelect
1122 1122
   !ifndef SILVERBULLET
1123 1123
 ;TRANSLATION
1124
-!insertmacro MUI_HEADER_TEXT "<?php printf(WindowsCommon::sprint_nsi(_("%s installer for")),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?> " "<?php WindowsCommon::echo_nsi(_("Install personal certificate"))?>"
1124
+!insertmacro MUI_HEADER_TEXT "<?php printf(WindowsCommon::sprint_nsi(_("%s installer for")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])?> " "<?php WindowsCommon::echo_nsi(_("Install personal certificate"))?>"
1125 1125
 ;TRANSLATION
1126 1126
     IfSilent +2
1127 1127
   MessageBox MB_OK "<?php WindowsCommon::echo_nsi(_("Preparing to install personal certificate."))?>$\r$\n<?php WindowsCommon::echo_nsi(_("Click OK to continue"))?> "
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
         $certPasswordLength = strlen($certPasswordLabel);
1138 1138
         $certUsernameLabel = WindowsCommon::sprint_nsi(_("Username:"));
1139 1139
         $certUsernameLength = strlen($certUsernameLabel);
1140
-        $labelLength = max($certPasswordLength,$certUsernameLength);
1140
+        $labelLength = max($certPasswordLength, $certUsernameLength);
1141 1141
   ?>
1142 1142
   ${NSD_CreateLabel} 0 0 100% 32u "<?php WindowsCommon::echo_nsi(_("Selected file: \$Cert_file"))?>"
1143 1143
   !else
@@ -1154,11 +1154,11 @@  discard block
 block discarded – undo
1154 1154
   !insertmacro debug_cat 3 "Vista level (Vista without Service pack): $VistaNoSP";
1155 1155
   ${If} $VistaNoSP == 0
1156 1156
     !ifdef PFX_USERNAME
1157
-       !define LABEL_LENGTH "<?php echo($labelLength*3.5)?>u"
1158
-       !define TEXT_START "<?php echo($labelLength*3.5 +5)?>u"
1157
+       !define LABEL_LENGTH "<?php echo($labelLength * 3.5)?>u"
1158
+       !define TEXT_START "<?php echo($labelLength * 3.5 + 5)?>u"
1159 1159
     !else
1160
-       !define LABEL_LENGTH "<?php echo($certPasswordLength*3.5)?>u"
1161
-       !define TEXT_START "<?php echo($certPasswordLength*3.5 +5)?>u"
1160
+       !define LABEL_LENGTH "<?php echo($certPasswordLength * 3.5)?>u"
1161
+       !define TEXT_START "<?php echo($certPasswordLength * 3.5 + 5)?>u"
1162 1162
     !endif
1163 1163
     ${NSD_CreateLabel} 0 35u ${LABEL_LENGTH} 12u "<?php echo $certPasswordLabel?>"
1164 1164
     ${NSD_CreatePassword} ${TEXT_START} 34.5u 120u 12u ""
@@ -1530,7 +1530,7 @@  discard block
 block discarded – undo
1530 1530
 Section "-start"
1531 1531
 SectionIn RO
1532 1532
 
1533
-!insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi( _("Installation"))?>" "<?php WindowsCommon::echo_nsi( _("Checking for existing wireless profiles"))?>"
1533
+!insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echo_nsi(_("Installation"))?>" "<?php WindowsCommon::echo_nsi(_("Checking for existing wireless profiles"))?>"
1534 1534
 !ifndef PWD
1535 1535
 !include "certs.nsh"
1536 1536
 !endif
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
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
       <key>PayloadDescription</key>
99 99
          <string>$tagline</string>
100 100
       <key>PayloadDisplayName</key>
101
-         <string>" . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . "</string>
101
+         <string>".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']."</string>
102 102
       <key>PayloadIdentifier</key>
103
-         <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
103
+         <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang</string>
104 104
       <key>PayloadOrganization</key>
105
-         <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>
105
+         <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>
106 106
       <key>PayloadType</key>
107 107
          <string>Configuration</string>
108 108
       <key>PayloadUUID</key>
109
-         <string>" . \core\common\Entity::uuid('', self::$iPhonePayloadPrefix . $this->massagedConsortium . $this->massagedCountry . $this->massagedInst . $this->massagedProfile) . "</string>
109
+         <string>" . \core\common\Entity::uuid('', self::$iPhonePayloadPrefix.$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile)."</string>
110 110
       <key>PayloadVersion</key>
111 111
          <integer>1</integer>";
112 112
         \core\common\Entity::outOfThePotatoes();
@@ -138,21 +138,21 @@  discard block
 block discarded – undo
138 138
     {
139 139
         \core\common\Entity::intoThePotatoes();
140 140
         if (isset($this->attributes['support:info_file'])) {
141
-            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;
141
+            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;
142 142
         }
143 143
         if ($this->attributes['internal:verify_userinput_suffix'][0] != 0) {
144 144
             if ($this->attributes['internal:hint_userinput_suffix'][0] != 0) {
145
-                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . sprintf(_("Important Notice: your username MUST end exactly with '...@%s' !"), $this->attributes['internal:realm'][0]) . MobileconfigSuperclass::BUFFER_CONSENT_POST;
145
+                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE.sprintf(_("Important Notice: your username MUST end exactly with '...@%s' !"), $this->attributes['internal:realm'][0]).MobileconfigSuperclass::BUFFER_CONSENT_POST;
146 146
                 \core\common\Entity::outOfThePotatoes();
147 147
                 return $retval;
148 148
             } else { 
149 149
             if (strlen($this->attributes['internal:realm'][0]) > 0) {
150 150
                 /// note space between variable and exclamation mark - makes sure users don't mistakenly think the exclamation mark is part of the required username!
151
-                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . sprintf(_("Important Notice: your username MUST contain an '@' and end with ...%s !"), $this->attributes['internal:realm'][0]) . MobileconfigSuperclass::BUFFER_CONSENT_POST;
151
+                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE.sprintf(_("Important Notice: your username MUST contain an '@' and end with ...%s !"), $this->attributes['internal:realm'][0]).MobileconfigSuperclass::BUFFER_CONSENT_POST;
152 152
                 \core\common\Entity::outOfThePotatoes();
153 153
                 return $retval;
154 154
             }
155
-            $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;
155
+            $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;
156 156
             \core\common\Entity::outOfThePotatoes();
157 157
             return $retval;
158 158
             }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         // also escape htmlspecialchars
178 178
         // not all names and profiles have a name, so be prepared
179 179
 
180
-        $this->loggerInstance->debug(5, "List of available attributes: " . var_export($this->attributes, TRUE));
180
+        $this->loggerInstance->debug(5, "List of available attributes: ".var_export($this->attributes, TRUE));
181 181
 
182 182
         $this->instName = $this->attributes['general:instname'][0] ?? _("Unnamed Organisation");
183 183
         $this->profileName = $this->attributes['profile:name'][0] ?? _("Unnamed Profile");
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
         file_put_contents('installer_profile', $outputXml);
221 221
 
222
-        $fileName = $this->installerBasename . '.mobileconfig';
222
+        $fileName = $this->installerBasename.'.mobileconfig';
223 223
 
224 224
         if (!$this->sign) {
225 225
             rename("installer_profile", $fileName);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             return $fileName;
228 228
         }
229 229
         // still here? Then we are signing.
230
-        $signing = system($this->sign . " installer_profile '$fileName' > /dev/null");
230
+        $signing = system($this->sign." installer_profile '$fileName' > /dev/null");
231 231
         if ($signing === FALSE) {
232 232
             $this->loggerInstance->debug(2, "Signing the mobileconfig installer $fileName FAILED!\n");
233 233
         }
@@ -246,19 +246,19 @@  discard block
 block discarded – undo
246 246
         \core\common\Entity::intoThePotatoes();
247 247
         $ssidCount = count($this->attributes['internal:SSID']);
248 248
         $certCount = count($this->attributes['internal:CAs'][0]);
249
-        $out = "<p>" . _("For best results, please use the built-in browser (Safari) to open the configuration file.") . "</p>";
249
+        $out = "<p>"._("For best results, please use the built-in browser (Safari) to open the configuration file.")."</p>";
250 250
         $out .= "<p>";
251 251
         $out .= _("The profile will install itself after you click (or tap) the button. You will be asked for confirmation/input at several points:");
252 252
         $out .= "<ul>";
253
-        $out .= "<li>" . _("to install the profile") . "</li>";
254
-        $out .= "<li>" . ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
253
+        $out .= "<li>"._("to install the profile")."</li>";
254
+        $out .= "<li>".ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
255 255
         if ($certCount > 1) {
256
-            $out .= " " . sprintf(_("(%d times)"), $certCount);
256
+            $out .= " ".sprintf(_("(%d times)"), $certCount);
257 257
         }
258 258
         $out .= "</li>";
259
-        $out .= "<li>" . _("to enter the username and password you have been given by your organisation");
259
+        $out .= "<li>"._("to enter the username and password you have been given by your organisation");
260 260
         if ($ssidCount > 1) {
261
-            $out .= " " . sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
261
+            $out .= " ".sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
262 262
         }
263 263
         $out .= "</li>";
264 264
         $out .= "</ul>";
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
         $retval .= "                <key>RoamingConsortiumOIs</key>
312 312
                 <array>";
313 313
 
314
-        $retval .= "<string>" . strtoupper($consortiumOi) . "</string>";
314
+        $retval .= "<string>".strtoupper($consortiumOi)."</string>";
315 315
 
316 316
         $retval .= "</array>";
317 317
         // this is an undocumented value found on the net. Does it do something useful?
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                   <dict>
353 353
                       <key>AcceptEAPTypes</key>
354 354
                          <array>
355
-                            <integer>" . $eapType['OUTER'] . "</integer>
355
+                            <integer>" . $eapType['OUTER']."</integer>
356 356
                          </array>
357 357
                       <key>EAPFASTProvisionPAC</key>
358 358
                             <true />
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 ";
366 366
         if ($realm !== NULL) {
367 367
             $retval .= "<key>OuterIdentity</key>
368
-                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8') . "</string>
368
+                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8')."</string>
369 369
 ";
370 370
         }
371 371
         $retval .= "<key>PayloadCertificateAnchorUUID</key>
@@ -389,11 +389,11 @@  discard block
 block discarded – undo
389 389
         $retval .= "
390 390
                          </array>";
391 391
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
392
-            $retval .= "<key>UserName</key><string>" . $this->clientCert["certObject"]->username . "</string>";
392
+            $retval .= "<key>UserName</key><string>".$this->clientCert["certObject"]->username."</string>";
393 393
         }
394 394
         $retval .= "
395 395
                       <key>TTLSInnerAuthentication</key>
396
-                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2") . "</string>
396
+                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2")."</string>
397 397
                    </dict>";
398 398
         return $retval;
399 399
     }
@@ -413,9 +413,9 @@  discard block
 block discarded – undo
413 413
             // characters are still reversed, invert on use!
414 414
             $buffer .= "<string>Manual</string>
415 415
                   <key>ProxyServer</key>
416
-                  <string>" . strrev($serverAndPort[1]) . "</string>
416
+                  <string>" . strrev($serverAndPort[1])."</string>
417 417
                   <key>ProxyServerPort</key>
418
-                  <integer>" . strrev($serverAndPort[0]) . "</integer>
418
+                  <integer>" . strrev($serverAndPort[0])."</integer>
419 419
                   <key>ProxyPACFallbackAllowed</key>
420 420
                   <false/>";
421 421
         } else {
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
                     throw new Exception("SSID must be a string!");
445 445
                 }
446 446
                 $escapedSSID = htmlspecialchars($toBeConfigured, ENT_XML1, 'UTF-8');
447
-                $payloadIdentifier = "wifi." . $this->serial;
447
+                $payloadIdentifier = "wifi.".$this->serial;
448 448
                 $payloadShortName = sprintf(_("SSID %s"), $escapedSSID);
449 449
                 $payloadName = sprintf(_("%s configuration for network name %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $escapedSSID);
450 450
                 $encryptionTypeString = "WPA";
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                 $payloadIdentifier = "hs20.$toBeConfigured";
475 475
                 $knownOiName = array_search($toBeConfigured, CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']);
476 476
                 if ($knownOiName === FALSE) { // a custom RCOI as set by the IdP admin; do not use the term "eduroam" in that one!
477
-                    $knownOiName = $this->instName . " "._("Roaming Partner");
477
+                    $knownOiName = $this->instName." "._("Roaming Partner");
478 478
                 }
479 479
                 $payloadShortName = $knownOiName;
480 480
                 $payloadName = _("Passpoint roaming configuration ($knownOiName)");
@@ -496,11 +496,11 @@  discard block
 block discarded – undo
496 496
                <key>PayloadDisplayName</key>
497 497
                   <string>$payloadShortName</string>
498 498
                <key>PayloadIdentifier</key>
499
-                  <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
499
+                  <string>".self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
500 500
                <key>PayloadOrganization</key>
501
-                  <string>" . $this->massagedConsortium . ".1x-config.org</string>
501
+                  <string>".$this->massagedConsortium.".1x-config.org</string>
502 502
                <key>PayloadType</key>
503
-                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi") . ".managed</string>";
503
+                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi").".managed</string>";
504 504
         $retval .= $this->proxySettings();
505 505
         $retval .= $setupModesString;
506 506
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
         }
513 513
         $retval .= "
514 514
                <key>PayloadUUID</key>
515
-                  <string>" . \core\common\Entity::uuid() . "</string>
515
+                  <string>" . \core\common\Entity::uuid()."</string>
516 516
                <key>PayloadVersion</key>
517 517
                   <integer>1</integer>
518 518
                   $wifiNetworkIdentification</dict>";
@@ -542,15 +542,15 @@  discard block
 block discarded – undo
542 542
 	<key>IsHotspot</key>
543 543
 	<false/>
544 544
 	<key>PayloadDescription</key>
545
-	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</string>
545
+	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</string>
546 546
 	<key>PayloadDisplayName</key>
547
-	<string>" . _("Disabled WiFi network") . "</string>
547
+	<string>" . _("Disabled WiFi network")."</string>
548 548
 	<key>PayloadIdentifier</key>
549
-	<string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
549
+	<string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
550 550
 	<key>PayloadType</key>
551 551
 	<string>com.apple.wifi.managed</string>
552 552
 	<key>PayloadUUID</key>
553
-	<string>" . \core\common\Entity::uuid() . "</string>
553
+	<string>".\core\common\Entity::uuid()."</string>
554 554
 	<key>PayloadVersion</key>
555 555
 	<real>1</real>";
556 556
         $retval .= $this->proxySettings();
@@ -629,12 +629,12 @@  discard block
 block discarded – undo
629 629
         $mimeBlob = base64_encode($binaryBlob);
630 630
         $mimeFormatted = chunk_split($mimeBlob, 52, "\r\n");
631 631
         $payloadUUID = \core\common\Entity::uuid('', $mimeBlob);
632
-        $retArray = ["block" => "<dict>" .
632
+        $retArray = ["block" => "<dict>".
633 633
             // we don't include the import password. It's displayed on screen, and should be input by the user.
634 634
             // <key>Password</key>
635 635
             //   <string>" . $this->clientCert['password'] . "</string>
636 636
             "<key>PayloadCertificateFileName</key>
637
-                     <string>" . $this->massagedConsortium . ".pfx</string>
637
+                     <string>" . $this->massagedConsortium.".pfx</string>
638 638
                   <key>PayloadContent</key>
639 639
                      <data>
640 640
 $mimeFormatted
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
                   <key>PayloadDescription</key>
643 643
                      <string>MIME Base-64 encoded PKCS#12 Client Certificate</string>
644 644
                   <key>PayloadDisplayName</key>
645
-                     <string>" . _("eduroam user certificate") . "</string>
645
+                     <string>"._("eduroam user certificate")."</string>
646 646
                   <key>PayloadIdentifier</key>
647 647
                      <string>com.apple.security.pkcs12.$payloadUUID</string>
648 648
                   <key>PayloadType</key>
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
                   <key>PayloadVersion</key>
653 653
                      <integer>1</integer>
654 654
                 </dict>",
655
-            "UUID" => $payloadUUID,];
655
+            "UUID" => $payloadUUID, ];
656 656
         \core\common\Entity::outOfThePotatoes();
657 657
         return $retArray;
658 658
     }
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
         }
672 672
         $expiryTime = new \DateTime($this->clientCert['certObject']->expiry);
673 673
         return "<key>RemovalDate</key>
674
-        <date>" . $expiryTime->format("Y-m-d") . "T" . $expiryTime->format("H:i:s") . "Z</date>";
674
+        <date>" . $expiryTime->format("Y-m-d")."T".$expiryTime->format("H:i:s")."Z</date>";
675 675
     }
676 676
 
677 677
     private $CAsAccountedFor = [];
@@ -695,27 +695,27 @@  discard block
 block discarded – undo
695 695
             $stream = "
696 696
             <dict>
697 697
                <key>PayloadCertificateFileName</key>
698
-               <string>" . $ca['uuid'] . ".der</string>
698
+               <string>" . $ca['uuid'].".der</string>
699 699
                <key>PayloadContent</key>
700 700
                <data>
701
-" . $trimmedPem . "</data>
701
+" . $trimmedPem."</data>
702 702
                <key>PayloadDescription</key>
703
-               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst) . "</string>
703
+               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst)."</string>
704 704
                <key>PayloadDisplayName</key>
705 705
                <string>" . 
706 706
                     /// example: "Identity Provider CA #1 (Root)"
707
-                    sprintf(_("%s CA #%d (%s)" ), 
707
+                    sprintf(_("%s CA #%d (%s)"), 
708 708
                             \core\common\Entity::$nomenclature_inst, 
709
-                            count($this->CAsAccountedFor)+1, 
710
-                            ($ca['root'] ? _("Root") : _("Intermediate"))) . 
709
+                            count($this->CAsAccountedFor) + 1, 
710
+                            ($ca['root'] ? _("Root") : _("Intermediate"))). 
711 711
               "</string>
712 712
                <key>PayloadIdentifier</key>
713
-               <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
713
+               <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
714 714
                <key>PayloadOrganization</key>
715
-               <string>" . $this->massagedConsortium . ".1x-config.org</string>
715
+               <string>".$this->massagedConsortium.".1x-config.org</string>
716 716
                <key>PayloadType</key>
717 717
                <string>com.apple.security.root</string>
718
-               <key>PayloadUUID</key><string>" . $ca['uuid'] . "</string>
718
+               <key>PayloadUUID</key><string>" . $ca['uuid']."</string>
719 719
                <key>PayloadVersion</key>
720 720
                <integer>1</integer>
721 721
             </dict>";
Please login to merge, or discard this patch.
web/admin/edit_profile.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 ?>
29 29
 <?php
30
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
31 31
 
32 32
 $deco = new \web\lib\admin\PageDecoration();
33 33
 $validator = new \web\lib\common\InputValidation();
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
     <?php
128 128
     echo $uiElements->instLevelInfoBoxes($my_inst);
129 129
 
130
-    echo "<form enctype='multipart/form-data' action='edit_profile_result.php?inst_id=$my_inst->identifier" . ($my_profile !== NULL ? "&amp;profile_id=" . $my_profile->identifier : "") . "' method='post' accept-charset='UTF-8'>
131
-                <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE'] . "'>";
130
+    echo "<form enctype='multipart/form-data' action='edit_profile_result.php?inst_id=$my_inst->identifier".($my_profile !== NULL ? "&amp;profile_id=".$my_profile->identifier : "")."' method='post' accept-charset='UTF-8'>
131
+                <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE']."'>";
132 132
     $optionDisplay = new \web\lib\admin\OptionDisplay($profile_options, "Profile");
133 133
     ?>
134 134
     <fieldset class="option_container">
@@ -137,19 +137,19 @@  discard block
 block discarded – undo
137 137
         </legend>
138 138
         <?php
139 139
         if ($wizardStyle) {
140
-            echo "<p>" . _("We will now define a profile for your user group(s).  You can add as many profiles as you like by choosing the appropriate button on the end of the page. After we are done, the wizard is finished and you will be taken to the main IdP administration page.") . "</p>";
140
+            echo "<p>"._("We will now define a profile for your user group(s).  You can add as many profiles as you like by choosing the appropriate button on the end of the page. After we are done, the wizard is finished and you will be taken to the main IdP administration page.")."</p>";
141 141
         }
142 142
         ?>
143 143
         <h3><?php echo _("Profile Name and RADIUS realm"); ?></h3>
144 144
         <?php
145 145
         if ($wizardStyle) {
146
-            echo "<p>" . _("First of all we need a name for the profile. This will be displayed to end users, so you may want to choose a descriptive name like 'Professors', 'Students of the Faculty of Bioscience', etc.") . "</p>";
147
-            echo "<p>" . _("Optionally, you can provide a longer descriptive text about who this profile is for. If you specify it, it will be displayed on the download page after the user has selected the profile name in the list.") . "</p>";
148
-            echo "<p>" . _("You can also tell us your RADIUS realm. ");
146
+            echo "<p>"._("First of all we need a name for the profile. This will be displayed to end users, so you may want to choose a descriptive name like 'Professors', 'Students of the Faculty of Bioscience', etc.")."</p>";
147
+            echo "<p>"._("Optionally, you can provide a longer descriptive text about who this profile is for. If you specify it, it will be displayed on the download page after the user has selected the profile name in the list.")."</p>";
148
+            echo "<p>"._("You can also tell us your RADIUS realm. ");
149 149
             if (CONFIG['FUNCTIONALITY_LOCATIONS']['DIAGNOSTICS'] !== NULL) {
150 150
                 printf(_("This is useful if you want to use the sanity check module later, which tests reachability of your realm in the %s infrastructure. "), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
151 151
             }
152
-            echo _("It is required to enter the realm name if you want to support anonymous outer identities (see below).") . "</p>";
152
+            echo _("It is required to enter the realm name if you want to support anonymous outer identities (see below).")."</p>";
153 153
         }
154 154
 
155 155
         echo $optionDisplay->prefilledOptionTable("profile");
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
 
204 204
         <?php
205 205
         if ($wizardStyle) {
206
-            echo "<p>" . sprintf(_("Some installers support a feature called 'Anonymous outer identity'. If you don't know what this is, please read <a href='%s'>this article</a>."), "https://confluence.terena.org/display/H2eduroam/eap-types") . "</p>";
207
-            echo "<p>" . _("On some platforms, the installers can suggest username endings and/or verify the user input to contain the realm suffix.") . "</p>";
208
-            echo "<p>" . _("The realm check feature needs to know an outer ID which actually gets a chance to authenticate. If your RADIUS server lets only select usernames pass, it is useful to supply the information which of those (outer ID) username we can use for testing.") . "</p>";
206
+            echo "<p>".sprintf(_("Some installers support a feature called 'Anonymous outer identity'. If you don't know what this is, please read <a href='%s'>this article</a>."), "https://confluence.terena.org/display/H2eduroam/eap-types")."</p>";
207
+            echo "<p>"._("On some platforms, the installers can suggest username endings and/or verify the user input to contain the realm suffix.")."</p>";
208
+            echo "<p>"._("The realm check feature needs to know an outer ID which actually gets a chance to authenticate. If your RADIUS server lets only select usernames pass, it is useful to supply the information which of those (outer ID) username we can use for testing.")."</p>";
209 209
         }
210 210
         ?>
211 211
         <p>
@@ -214,46 +214,46 @@  discard block
 block discarded – undo
214 214
             <!-- UI table to align elements-->
215 215
         <table style="margin-left: 25px; border-collapse: collapse;">
216 216
             <tr>
217
-                <th colspan="2" style="text-align: left;"><?php echo _("Outer Identity Handling");?></th>
217
+                <th colspan="2" style="text-align: left;"><?php echo _("Outer Identity Handling"); ?></th>
218 218
             </tr>
219 219
             <tr>
220 220
                 <!-- checkbox and input field for anonymity support, available only when realm is known-->
221 221
                 <td>
222
-                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
222
+                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
223 223
                         <?php echo _("Enable Anonymous Outer Identity:"); ?>
224 224
                     </span>
225 225
                 </td>
226 226
                 <td>
227
-                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='anon_support' onclick='
227
+                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "").($realm == "" ? " disabled" : ""); ?> name='anon_support' onclick='
228 228
                             if (this.form.elements["anon_support"].checked !== true) {
229 229
                                 this.form.elements["anon_local"].setAttribute("disabled", "disabled");
230 230
                             } else {
231 231
                                 this.form.elements["anon_local"].removeAttribute("disabled");
232 232
                             }
233 233
                             ;'/>
234
-                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : "" ); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
234
+                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : ""); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
235 235
                 </td>
236 236
             </tr>
237 237
             <tr>
238 238
                 <!-- checkbox and input field for check realm outer id, available only when realm is known-->
239 239
                 <td>
240
-                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
240
+                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
241 241
                         <?php echo _("Use special Outer Identity for realm checks:"); ?>
242 242
                     </span>
243 243
                 </td>
244 244
                 <td>
245
-                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='checkuser_support' onclick='
245
+                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "").($realm == "" ? " disabled" : ""); ?> name='checkuser_support' onclick='
246 246
                             if (this.form.elements["checkuser_support"].checked !== true) {
247 247
                                 this.form.elements["checkuser_local"].setAttribute("disabled", "disabled");
248 248
                             } else {
249 249
                                 this.form.elements["checkuser_local"].removeAttribute("disabled");
250 250
                             }
251 251
                             ;'/>
252
-                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : "" ); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
252
+                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : ""); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
253 253
                 </td>
254 254
             </tr>
255 255
             <tr>
256
-                <th colspan="2" style="border-top: 2px solid; text-align: left;"><?php echo _("Inner Identity (Username) Handling");?></th>
256
+                <th colspan="2" style="border-top: 2px solid; text-align: left;"><?php echo _("Inner Identity (Username) Handling"); ?></th>
257 257
             </tr>
258 258
             <tr>
259 259
                 <!-- checkbox for "verify-->
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                 </td>
265 265
                 <td>
266 266
                     <input type='checkbox' <?php
267
-                    echo ($verify != FALSE ? "checked" : "" );
267
+                    echo ($verify != FALSE ? "checked" : "");
268 268
                     ?> name='verify_support' onclick='
269 269
                             if (this.form.elements["verify_support"].checked !== true || this.form.elements["realm"].value.length == 0) {
270 270
                                 this.form.elements["hint_support"].setAttribute("disabled", "disabled");
@@ -276,12 +276,12 @@  discard block
 block discarded – undo
276 276
             </tr>
277 277
             <tr>
278 278
                 <td>
279
-                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
279
+                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
280 280
                         <?php echo _("Enforce exact realm in username"); ?>
281 281
                     </span>
282 282
                 </td>
283 283
                 <td>
284
-                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : "" ); ?> name='hint_support' <?php echo ( $hint != FALSE ? "checked" : "" ); ?> />
284
+                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : ""); ?> name='hint_support' <?php echo ($hint != FALSE ? "checked" : ""); ?> />
285 285
                 </td>
286 286
             </tr>
287 287
         </table>
@@ -291,20 +291,20 @@  discard block
 block discarded – undo
291 291
 
292 292
     <?php
293 293
     if ($wizardStyle) {
294
-        echo "<p>" . _("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).") . "</p>";
294
+        echo "<p>"._("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).")."</p>";
295 295
     }
296 296
     ?>
297 297
     <p>
298 298
 
299 299
         <?php
300
-        echo "<span id='redirect_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'><label for='redirect'>" . _("Redirect end users to own web page:") . "</label></span>
301
-                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked " ) . "onclick='
300
+        echo "<span id='redirect_label' style='".($realm == "" ? "color:#999999" : "")."'><label for='redirect'>"._("Redirect end users to own web page:")."</label></span>
301
+                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked ")."onclick='
302 302
                               if (this.form.elements[\"redirect\"].checked != true) {
303 303
                                 this.form.elements[\"redirect_target\"].setAttribute(\"disabled\", \"disabled\");
304 304
                               } else {
305 305
                                 this.form.elements[\"redirect_target\"].removeAttribute(\"disabled\");
306 306
                               };'/>
307
-                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled" ) . "/>";
307
+                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled")."/>";
308 308
         ?>
309 309
     </p>
310 310
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
     <legend><strong><?php echo _("Supported EAP types"); ?></strong></legend>
314 314
     <?php
315 315
     if ($wizardStyle) {
316
-        echo "<p>" . _("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.") . "</p>";
316
+        echo "<p>"._("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.")."</p>";
317 317
     }
318 318
     ?>
319 319
     <?php
@@ -327,9 +327,9 @@  discard block
 block discarded – undo
327 327
      * @return void
328 328
      */
329 329
     function priority(string $eapType, bool $isenabled, int $priority) {
330
-        echo "<td><select id='$eapType-priority' name='$eapType-priority' " . (!$isenabled ? "disabled='disabled'" : "") . ">";
330
+        echo "<td><select id='$eapType-priority' name='$eapType-priority' ".(!$isenabled ? "disabled='disabled'" : "").">";
331 331
         for ($a = 1; $a < 7; $a = $a + 1) {
332
-            echo "<option id='$eapType-$a' value='$a' " . ( $isenabled && $a == $priority ? "selected" : "" ) . ">$a</option>";
332
+            echo "<option id='$eapType-$a' value='$a' ".($isenabled && $a == $priority ? "selected" : "").">$a</option>";
333 333
         }
334 334
         echo "</select></td>";
335 335
     }
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      * @return void
346 346
      */
347 347
     function inherited_options($idpwideoptions, $eapType, $isVisible) {
348
-        echo "<td><div style='" . (!$isVisible ? "visibility:hidden" : "") . "' class='inheritedoptions' id='$eapType-inherited-global'>";
348
+        echo "<td><div style='".(!$isVisible ? "visibility:hidden" : "")."' class='inheritedoptions' id='$eapType-inherited-global'>";
349 349
 
350 350
         $eapoptions = [];
351 351
 
@@ -358,12 +358,12 @@  discard block
 block discarded – undo
358 358
         $eapoptionsNames = array_count_values($eapoptions);
359 359
 
360 360
         if (count($eapoptionsNames) > 0) {
361
-            echo "<strong>" . _("EAP options inherited from Global level:") . "</strong><br />";
361
+            echo "<strong>"._("EAP options inherited from Global level:")."</strong><br />";
362 362
             foreach ($eapoptionsNames as $optionname => $count) {
363 363
                 /// option count and enumeration
364 364
                 /// Example: "(3x) Server Name"
365 365
                 $uiElements = new web\lib\admin\UIElements();
366
-                printf(_("(%dx) %s") . "<br />", $count, $uiElements->displayName($optionname));
366
+                printf(_("(%dx) %s")."<br />", $count, $uiElements->displayName($optionname));
367 367
             }
368 368
         }
369 369
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
                         <?php
399 399
                         $D = [];
400 400
                         foreach ($prefill_methods as $prio => $value) {
401
-                            print '<li>' . $value->getPrintableRep() . "</li>\n";
401
+                            print '<li>'.$value->getPrintableRep()."</li>\n";
402 402
                             $D[$value->getPrintableRep()] = $prio;
403 403
                         }
404 404
                         ?>
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
                             }
425 425
                             $display = $a->getPrintableRep();
426 426
                             if (!isset($D[$a->getPrintableRep()])) {
427
-                                print '<li class="eap1">' . $a->getPrintableRep() . "</li>\n";
427
+                                print '<li class="eap1">'.$a->getPrintableRep()."</li>\n";
428 428
                             }
429 429
                         }
430 430
                         ?>
@@ -437,8 +437,8 @@  discard block
 block discarded – undo
437 437
     foreach ($methods as $a) {
438 438
         $display = $a->getPrintableRep();
439 439
         $v = isset($D[$display]) ? $D[$display] : '';
440
-        print '<input type="hidden" class="eapm" name="' . $display . '" id="EAP-' . $display . '" value="' . $display . '">';
441
-        print '<input type="hidden" class="eapmv" name="' . $display . '-priority" id="EAP-' . $display . '-priority" value="' . $v . '">';
440
+        print '<input type="hidden" class="eapm" name="'.$display.'" id="EAP-'.$display.'" value="'.$display.'">';
441
+        print '<input type="hidden" class="eapmv" name="'.$display.'-priority" id="EAP-'.$display.'-priority" value="'.$v.'">';
442 442
     }
443 443
     ?>
444 444
     <br style="clear:both;" />
@@ -458,11 +458,11 @@  discard block
 block discarded – undo
458 458
 foreach ($optionsAlreadySet as $optionNames) {
459 459
     if (preg_match("/^support:/", $optionNames)) {
460 460
         $has_support_options[$optionNames] = "SET";
461
-        $support_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
461
+        $support_text .= "<li><strong>".$uiElements->displayName($optionNames)."</strong></li>";
462 462
     }
463 463
     if (preg_match("/^media:/", $optionNames)) {
464 464
         $has_media_options[$$optionNames] = "SET";
465
-        $media_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
465
+        $media_text .= "<li><strong>".$uiElements->displayName($optionNames)."</strong></li>";
466 466
     }
467 467
 }
468 468
 $fields = [
@@ -471,22 +471,22 @@  discard block
 block discarded – undo
471 471
     "media" => _("Media Properties for this profile")];
472 472
 
473 473
 foreach ($fields as $name => $description) {
474
-    echo "<fieldset class='option_container' id='" . $name . "_override'>
474
+    echo "<fieldset class='option_container' id='".$name."_override'>
475 475
     <legend><strong>$description</strong></legend>
476 476
     <p>";
477 477
 
478
-    if (count(${"has_" . $name . "_options"}) > 0) {
479
-        printf(ngettext("The option %s is already defined IdP-wide. If you set it here on profile level, this setting will override the IdP-wide one.", "The options %s are already defined IdP-wide. If you set them here on profile level, these settings will override the IdP-wide ones.", count(${"has_" . $name . "_options"})), "<ul>" . ${$name . "_text"} . "</ul>");
478
+    if (count(${"has_".$name."_options"}) > 0) {
479
+        printf(ngettext("The option %s is already defined IdP-wide. If you set it here on profile level, this setting will override the IdP-wide one.", "The options %s are already defined IdP-wide. If you set them here on profile level, these settings will override the IdP-wide ones.", count(${"has_".$name."_options"})), "<ul>".${$name."_text"}."</ul>");
480 480
     }
481 481
 
482 482
     echo "</p>";
483 483
     echo $optionDisplay->prefilledOptionTable($name);
484
-    echo "<button type='button' class='newoption' onclick='getXML(\"$name\")'>" . _("Add new option") . "</button>";
484
+    echo "<button type='button' class='newoption' onclick='getXML(\"$name\")'>"._("Add new option")."</button>";
485 485
     echo "</fieldset>";
486 486
 }
487 487
 
488 488
 if ($wizardStyle) {
489
-    echo "<p>" . _("When you are sure that everything is correct, please click on 'Save data' and you will be taken to your IdP Dashboard page.") . "</p>";
489
+    echo "<p>"._("When you are sure that everything is correct, please click on 'Save data' and you will be taken to your IdP Dashboard page.")."</p>";
490 490
 }
491
-echo "<p><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>";
491
+echo "<p><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>";
492 492
 echo $deco->footer();
Please login to merge, or discard this patch.