Passed
Push — release_2_0 ( f2471a...804114 )
by Stefan
07:43
created
core/ProfileSilverbullet.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
 // realm is automatically calculated, then stored in DB
92 92
 
93
-        $this->realm = "opaquehash@$myInst->identifier-$this->identifier." . strtolower($myInst->federation) . CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix'];
93
+        $this->realm = "opaquehash@$myInst->identifier-$this->identifier.".strtolower($myInst->federation).CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix'];
94 94
         $localValueIfAny = "";
95 95
 
96 96
 // but there's some common internal attributes populated directly
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 
108 108
         // and we need to populate eap:server_name and eap:ca_file with the NRO-specific EAP information
109 109
         $silverbulletAttributes = [
110
-            "eap:server_name" => "auth." . strtolower($myFed->tld) . CONFIG_CONFASSISTANT['SILVERBULLET']['server_suffix'],
110
+            "eap:server_name" => "auth.".strtolower($myFed->tld).CONFIG_CONFASSISTANT['SILVERBULLET']['server_suffix'],
111 111
         ];
112 112
         $temp = array_merge($this->addInternalAttributes($internalAttributes), $this->addInternalAttributes($silverbulletAttributes));
113 113
         $x509 = new \core\common\X509();
114
-        $caHandle = fopen(dirname(__FILE__) . "/../config/SilverbulletServerCerts/" . strtoupper($myFed->tld) . "/root.pem", "r");
114
+        $caHandle = fopen(dirname(__FILE__)."/../config/SilverbulletServerCerts/".strtoupper($myFed->tld)."/root.pem", "r");
115 115
         if ($caHandle !== FALSE) {
116 116
             $cAFile = fread($caHandle, 16000000);
117 117
             foreach ($x509->splitCertificate($cAFile) as $oneCa) {
@@ -132,26 +132,26 @@  discard block
 block discarded – undo
132 132
         $this->loggerInstance->debug(3, "--- END Constructing new Profile object ... ---\n");
133 133
 
134 134
         $this->termsAndConditions = "<h2>Product Definition</h2>
135
-        <p>" . \core\ProfileSilverbullet::PRODUCTNAME . " outsources the technical setup of " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . " " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " functions to the " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . " Operations Team. The system includes</p>
135
+        <p>" . \core\ProfileSilverbullet::PRODUCTNAME." outsources the technical setup of ".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']." ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." functions to the ".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']." Operations Team. The system includes</p>
136 136
             <ul>
137 137
                 <li>a web-based user management interface where user accounts and access credentials can be created and revoked (there is a limit to the number of active users)</li>
138 138
                 <li>a technical infrastructure ('CA') which issues and revokes credentials</li>
139
-                <li>a technical infrastructure ('RADIUS') which verifies access credentials and subsequently grants access to " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . "</li>           
139
+                <li>a technical infrastructure ('RADIUS') which verifies access credentials and subsequently grants access to " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']."</li>           
140 140
             </ul>
141 141
         <h2>User Account Liability</h2>
142
-        <p>As an " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . " " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " administrator using this system, you are authorized to create user accounts according to your local " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " policy. You are fully responsible for the accounts you issue and are the data controller for all user information you deposit in this system; the system is a data processor.</p>";
142
+        <p>As an " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']." ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." administrator using this system, you are authorized to create user accounts according to your local ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." policy. You are fully responsible for the accounts you issue and are the data controller for all user information you deposit in this system; the system is a data processor.</p>";
143 143
         $this->termsAndConditions .= "<p>Your responsibilities include that you</p>
144 144
         <ul>
145
-            <li>only issue accounts to members of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . ", as defined by your local policy.</li>
145
+            <li>only issue accounts to members of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'].", as defined by your local policy.</li>
146 146
             <li>must make sure that all accounts that you issue can be linked by you to actual human end users</li>
147
-            <li>have to immediately revoke accounts of users when they leave or otherwise stop being a member of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . "</li>
147
+            <li>have to immediately revoke accounts of users when they leave or otherwise stop being a member of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']."</li>
148 148
             <li>will act upon notifications about possible network abuse by your users and will appropriately sanction them</li>
149 149
         </ul>
150 150
         <p>";
151
-        $this->termsAndConditions .= "Failure to comply with these requirements may make your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation'] . " act on your behalf, which you authorise, and will ultimately lead to the deletion of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " (and all the users you create inside) in this system.";
151
+        $this->termsAndConditions .= "Failure to comply with these requirements may make your ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']." act on your behalf, which you authorise, and will ultimately lead to the deletion of your ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." (and all the users you create inside) in this system.";
152 152
         $this->termsAndConditions .= "</p>
153 153
         <h2>Privacy</h2>
154
-        <p>With " . \core\ProfileSilverbullet::PRODUCTNAME . ", we are necessarily storing personally identifiable information about the end users you create. While the actual human is only identifiable with your help, we consider all the user data as relevant in terms of privacy jurisdiction. Please note that</p>
154
+        <p>With " . \core\ProfileSilverbullet::PRODUCTNAME.", we are necessarily storing personally identifiable information about the end users you create. While the actual human is only identifiable with your help, we consider all the user data as relevant in terms of privacy jurisdiction. Please note that</p>
155 155
         <ul>
156 156
             <li>You are the only one who needs to be able to make a link to the human behind the usernames you create. The usernames you create in the system have to be rich enough to allow you to make that identification step. Also consider situations when you are unavailable or leave the organisation and someone else needs to perform the matching to an individual.</li>
157 157
             <li>The identifiers we create in the credentials are not linked to the usernames you add to the system; they are randomly generated pseudonyms.</li>
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         if (empty($certNames)) {
255 255
             return [];
256 256
         }
257
-        $namesCondensed = "'" . implode("' OR username = '", $certNames) . "'";
257
+        $namesCondensed = "'".implode("' OR username = '", $certNames)."'";
258 258
         $serverHandles = DBConnection::handle("RADIUS");
259 259
         $returnarray = [];
260 260
         foreach ($serverHandles as $oneDbServer) {
Please login to merge, or discard this patch.
core/DeviceConfig.php 2 patches
Indentation   -2 removed lines patch added patch discarded remove patch
@@ -106,7 +106,6 @@  discard block
 block discarded – undo
106 106
      * ["my.server.name"] => "my.server.name"
107 107
      * ["foo.bar.de", "baz.bar.ge"] => "e"
108 108
      * ["server1.example.com", "server2.example.com", "serverN.example.com"] => ".example.com"
109
-
110 109
      * @return string
111 110
      */
112 111
     public function longestNameSuffix() {
@@ -340,7 +339,6 @@  discard block
 block discarded – undo
340 339
      * 
341 340
      * @param string $format only "der" and "pem" are currently allowed
342 341
      * @return array an array of arrays or empty array on error
343
-
344 342
      */
345 343
     final protected function saveCertificateFiles($format) {
346 344
         switch ($format) {
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     protected function setSupportedEapMethods($eapArray) {
85 85
         $this->supportedEapMethods = $eapArray;
86
-        $this->loggerInstance->debug(4, "This device (" . __CLASS__ . ") supports the following EAP methods: ");
86
+        $this->loggerInstance->debug(4, "This device (".__CLASS__.") supports the following EAP methods: ");
87 87
         $this->loggerInstance->debug(4, $this->supportedEapMethods);
88 88
     }
89 89
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
                     break 2;
134 134
                 }
135 135
             }
136
-            $longestSuffix = $candidate . $longestSuffix;
136
+            $longestSuffix = $candidate.$longestSuffix;
137 137
         }
138 138
         return $longestSuffix;
139 139
     }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             throw new Exception("No EAP type available.");
170 170
         }
171 171
         $this->attributes = $this->getProfileAttributes($profile);
172
-        $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id);
172
+        $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id);
173 173
 
174 174
 
175 175
         // if we are instantiating a Silverbullet profile AND have been given
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
         // create temporary directory, its full path will be saved in $this->FPATH;
194 194
         $tempDir = $this->createTemporaryDirectory($purpose);
195 195
         $this->FPATH = $tempDir['dir'];
196
-        mkdir($tempDir['dir'] . '/tmp');
197
-        chdir($tempDir['dir'] . '/tmp');
196
+        mkdir($tempDir['dir'].'/tmp');
197
+        chdir($tempDir['dir'].'/tmp');
198 198
         $caList = [];
199 199
         $x509 = new \core\common\X509();
200 200
         if (isset($this->attributes['eap:ca_file'])) {
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         $this->support_url_substitute = sprintf(_("your local %s support page"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
231 231
 
232 232
         if ($this->signer && $this->options['sign']) {
233
-            $this->sign = ROOT . '/signer/' . $this->signer;
233
+            $this->sign = ROOT.'/signer/'.$this->signer;
234 234
         }
235 235
         $this->installerBasename = $this->getInstallerBasename();
236 236
         common\Entity::outOfThePotatoes();
@@ -286,10 +286,10 @@  discard block
 block discarded – undo
286 286
      * @return string|boolean the filename as found, with path, or FALSE if it does not exist
287 287
      */
288 288
     protected function findSourceFile($file) {
289
-        if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) {
290
-            return $this->module_path . '/Files/' . $this->device_id . '/' . $file;
291
-        } elseif (is_file($this->module_path . '/Files/' . $file)) {
292
-            return $this->module_path . '/Files/' . $file;
289
+        if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) {
290
+            return $this->module_path.'/Files/'.$this->device_id.'/'.$file;
291
+        } elseif (is_file($this->module_path.'/Files/'.$file)) {
292
+            return $this->module_path.'/Files/'.$file;
293 293
         } else {
294 294
             $this->loggerInstance->debug(2, "requested file $file does not exist\n");
295 295
             return FALSE;
@@ -410,17 +410,17 @@  discard block
 block discarded – undo
410 410
      */
411 411
     private function getInstallerBasename() {
412 412
 
413
-        $baseName = $this->customTranslit(CONFIG_CONFASSISTANT['CONSORTIUM']['name']) . "-" . $this->getDeviceId();
413
+        $baseName = $this->customTranslit(CONFIG_CONFASSISTANT['CONSORTIUM']['name'])."-".$this->getDeviceId();
414 414
         if (isset($this->attributes['profile:customsuffix'][1])) {
415 415
             // this string will end up as a filename on a filesystem, so always
416 416
             // take a latin-based language variant if available
417 417
             // and then scrub non-ASCII just in case
418
-            return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]);
418
+            return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]);
419 419
         }
420 420
         // Okay, no custom suffix. 
421 421
         // Use the configured inst name and apply shortening heuristics
422 422
         $lang_pointer = CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1;
423
-        $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes['general:instname'][$lang_pointer] . "\n");
423
+        $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes['general:instname'][$lang_pointer]."\n");
424 424
         $inst = $this->customTranslit($this->attributes['general:instname'][$lang_pointer]);
425 425
         $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n");
426 426
         $Inst_a = explode('_', $inst);
@@ -435,10 +435,10 @@  discard block
 block discarded – undo
435 435
             if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) {
436 436
                 $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]);
437 437
                 $prof = preg_replace('/_+$/', '', $profTemp);
438
-                return $baseName . $inst . '-' . $prof;
438
+                return $baseName.$inst.'-'.$prof;
439 439
             }
440 440
         }
441
-        return $baseName . $inst;
441
+        return $baseName.$inst;
442 442
     }
443 443
 
444 444
     /**
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
                 $ext = 'unsupported';
552 552
             }
553 553
             $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n");
554
-            $fileName = 'logo-' . $type . $iterator . '.' . $ext;
554
+            $fileName = 'logo-'.$type.$iterator.'.'.$ext;
555 555
             $fileHandle = fopen($fileName, "w");
556 556
             if (!$fileHandle) {
557 557
                 $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n");
@@ -577,13 +577,13 @@  discard block
 block discarded – undo
577 577
         $mime = $finfo->buffer($blob);
578 578
         $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported';
579 579
         $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n");
580
-        $fileHandle = fopen('local-info.' . $ext, "w");
580
+        $fileHandle = fopen('local-info.'.$ext, "w");
581 581
         if ($fileHandle === FALSE) {
582 582
             throw new Exception("problem opening the file");
583 583
         }
584 584
         fwrite($fileHandle, $blob);
585 585
         fclose($fileHandle);
586
-        return(['name' => 'local-info.' . $ext, 'mime' => $ext]);
586
+        return(['name' => 'local-info.'.$ext, 'mime' => $ext]);
587 587
     }
588 588
 
589 589
     /**
@@ -634,9 +634,9 @@  discard block
 block discarded – undo
634 634
     protected function determineOuterIdString() {
635 635
         $outerId = NULL;
636 636
         if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) {
637
-            $outerId = "@" . $this->attributes['internal:realm'][0];
637
+            $outerId = "@".$this->attributes['internal:realm'][0];
638 638
             if (isset($this->attributes['internal:anon_local_value'])) {
639
-                $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId;
639
+                $outerId = $this->attributes['internal:anon_local_value'][0].$outerId;
640 640
             }
641 641
         }
642 642
         return $outerId;
Please login to merge, or discard this patch.
web/admin/overview_user.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 namespace core;
23 23
 
24
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
24
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
25 25
 
26 26
 $instMgmt = new \core\UserManagement();
27 27
 $deco = new \web\lib\admin\PageDecoration();
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 <?php echo $uiElements->infoblock($user->getAttributes(), "user", "User"); ?>
52 52
             <tr>
53 53
                 <td>
54
-<?php echo "" . _("Unique Identifier") ?>
54
+<?php echo ""._("Unique Identifier") ?>
55 55
                 </td>
56 56
                 <td>
57 57
                 </td>
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
     <div>
65 65
         <?php
66 66
         if (CONFIG['DB']['USER']['readonly'] === FALSE) {
67
-            echo "<a href='edit_user.php'><button>" . _("Edit User Details") . "</button></a>";
67
+            echo "<a href='edit_user.php'><button>"._("Edit User Details")."</button></a>";
68 68
         }
69 69
 
70 70
         if ($user->isFederationAdmin()) {
71
-            echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . sprintf(_('Click here for %s management tasks'), $uiElements->nomenclatureFed) . "</button></form>";
71
+            echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>".sprintf(_('Click here for %s management tasks'), $uiElements->nomenclatureFed)."</button></form>";
72 72
         }
73 73
         if ($user->isSuperadmin()) {
74
-            echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . _('Click here to access the superadmin page') . "</button></form>";
74
+            echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>"._('Click here to access the superadmin page')."</button></form>";
75 75
         }
76 76
         ?>
77 77
     </div>
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
84 84
             $target = "https://wiki.geant.org/x/6Zg7Bw"; // Managed IdP manual
85 85
         }
86
-        $helptext = "<h3 style='display:inline;'>" . sprintf(_("(Need help? Refer to the <a href='%s'>%s administrator manual</a>)"), $target, $uiElements->nomenclatureInst) . "</h3>";
86
+        $helptext = "<h3 style='display:inline;'>".sprintf(_("(Need help? Refer to the <a href='%s'>%s administrator manual</a>)"), $target, $uiElements->nomenclatureInst)."</h3>";
87 87
     } else {
88 88
         $helptext = "";
89 89
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         // we need to run the Federation constructor
93 93
         $cat = new \core\CAT;
94 94
         /// first parameter: number of Identity Providers; second param is the literal configured term for 'Identity Provider' (you may or may not be able to add a plural suffix for your locale)
95
-        echo "<h2>" . sprintf(ngettext("You are managing the following <span style='display:none'>%d </span>%s:", "You are managing the following <strong>%d</strong> %s:", sizeof($hasInst)), sizeof($hasInst), $uiElements->nomenclatureInst) . "</h2>";
95
+        echo "<h2>".sprintf(ngettext("You are managing the following <span style='display:none'>%d </span>%s:", "You are managing the following <strong>%d</strong> %s:", sizeof($hasInst)), sizeof($hasInst), $uiElements->nomenclatureInst)."</h2>";
96 96
         $instlist = [];
97 97
         $my_idps = [];
98 98
         $myFeds = [];
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
             $country[$key] = $row['country'];
115 115
             $name[$key] = $row['name'];
116 116
         }
117
-        echo "<tr><th>" . sprintf(_("%s Name"), $uiElements->nomenclatureInst) . "</th><th>" . sprintf(_("Other admins of this %s"), $uiElements->nomenclatureInst) . "</th><th>" . ( CONFIG['DB']['INST']['readonly'] === FALSE ? _("Administrator Management") : "") . "</th></tr>";
117
+        echo "<tr><th>".sprintf(_("%s Name"), $uiElements->nomenclatureInst)."</th><th>".sprintf(_("Other admins of this %s"), $uiElements->nomenclatureInst)."</th><th>".(CONFIG['DB']['INST']['readonly'] === FALSE ? _("Administrator Management") : "")."</th></tr>";
118 118
         foreach ($myFeds as $fed_id => $fed_name) {
119 119
             /// nomenclature 'fed', fed name, nomenclature 'inst'
120
-            echo "<tr><td colspan='3'><strong>" . sprintf(_("%s %s: %s list"), $uiElements->nomenclatureFed, $fed_name, $uiElements->nomenclatureInst) . "</strong></td></tr>";
120
+            echo "<tr><td colspan='3'><strong>".sprintf(_("%s %s: %s list"), $uiElements->nomenclatureFed, $fed_name, $uiElements->nomenclatureInst)."</strong></td></tr>";
121 121
 
122 122
             $fed_idps = $my_idps[$fed_id];
123 123
             asort($fed_idps);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                 $oneinst = $instlist[$index];
126 126
                 $the_inst = $oneinst['object'];
127 127
 
128
-                echo "<tr><td><a href='overview_idp.php?inst_id=$the_inst->identifier'>" . $oneinst['name'] . "</a></td><td>";
128
+                echo "<tr><td><a href='overview_idp.php?inst_id=$the_inst->identifier'>".$oneinst['name']."</a></td><td>";
129 129
                 echo "<input type='hidden' name='inst' value='$the_inst->identifier'>";
130 130
                 $admins = $the_inst->listOwners();
131 131
                 $blessedUser = FALSE;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                         $coadmin = new \core\User($username['ID']);
135 135
                         $coadmin_name = $coadmin->getAttributes('user:realname');
136 136
                         if (count($coadmin_name) > 0) {
137
-                            echo $coadmin_name[0]['value'] . "<br/>";
137
+                            echo $coadmin_name[0]['value']."<br/>";
138 138
                             unset($admins[$number]);
139 139
                         }
140 140
                     } else { // don't list self
@@ -146,29 +146,29 @@  discard block
 block discarded – undo
146 146
                 }
147 147
                 $otherAdminCount = count($admins); // only the unnamed remain
148 148
                 if ($otherAdminCount > 0) {
149
-                    echo sprintf(ngettext("%d other user", "%d other users", $otherAdminCount),$otherAdminCount);
149
+                    echo sprintf(ngettext("%d other user", "%d other users", $otherAdminCount), $otherAdminCount);
150 150
                 }
151 151
                 echo "</td><td>";
152 152
                 if ($blessedUser && CONFIG['DB']['INST']['readonly'] === FALSE) {
153
-                    echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $the_inst->identifier . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>" . _("Add/Remove Administrators") . "</button></form></div>";
153
+                    echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=".$the_inst->identifier."' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>"._("Add/Remove Administrators")."</button></form></div>";
154 154
                 }
155 155
                 echo "</td></tr>";
156 156
             }
157 157
         }
158 158
         echo "</table>";
159 159
     } else {
160
-        echo "<h2>" . sprintf(_("You are not managing any %s."), $uiElements->nomenclatureInst) . "</h2>";
160
+        echo "<h2>".sprintf(_("You are not managing any %s."), $uiElements->nomenclatureInst)."</h2>";
161 161
     }
162 162
     if (CONFIG['DB']['INST']['readonly'] === FALSE) {
163 163
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL) {
164
-            echo "<p>" . sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureInst) . "</p>";
164
+            echo "<p>".sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureInst)."</p>";
165 165
             echo "<hr/>
166 166
              <div style='white-space: nowrap;'>
167 167
                 <form action='action_enrollment.php' method='get' accept-charset='UTF-8'>" .
168
-            sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureInst) .
168
+            sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureInst).
169 169
             "        <input type='text' id='token' name='token'/>
170 170
                     <button type='submit'>" .
171
-            _("Go!") . "
171
+            _("Go!")."
172 172
                     </button>
173 173
                 </form>
174 174
              </div>";
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             <div style='white-space: nowrap;'>
178 178
         <form action='action_enrollment.php' method='get'><button type='submit' accept-charset='UTF-8'>
179 179
                 <input type='hidden' id='token' name='token' value='SELF-REGISTER'/>" .
180
-            sprintf(_("New %s Registration"), $uiElements->nomenclatureInst) . "
180
+            sprintf(_("New %s Registration"), $uiElements->nomenclatureInst)."
181 181
             </button>
182 182
         </form>
183 183
         </div>";
Please login to merge, or discard this patch.
web/admin/edit_silverbullet.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 /*
21 21
  * Class autoloader invocation, should be included prior to any other code at the entry points to the application
22 22
  */
23
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
24
-require_once dirname(dirname(dirname(__FILE__))) . "/core/phpqrcode.php";
23
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
24
+require_once dirname(dirname(dirname(__FILE__)))."/core/phpqrcode.php";
25 25
 const QRCODE_PIXELS_PER_SYMBOL = 12;
26 26
 
27 27
 $auth = new \web\lib\admin\Authentication();
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     $fed = new \core\Federation($inst->federation);
56 56
     $allowSb = $fed->getAttributes("fed:silverbullet");
57 57
     if (count($allowSb) == 0) {
58
-        throw new Exception("We were told to create a new SB profile, but this " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation'] . " does not allow SB at all!");
58
+        throw new Exception("We were told to create a new SB profile, but this ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']." does not allow SB at all!");
59 59
     }
60 60
     // okay, new SB profiles are allowed. 
61 61
     // but is there a support:email attribute on inst level?
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     // Create one.
67 67
     $newProfile = $inst->newProfile(core\AbstractProfile::PROFILETYPE_SILVERBULLET);
68 68
     // and modify the REQUEST_URI to add the new profile ID
69
-    $_SERVER['REQUEST_URI'] = $_SERVER['REQUEST_URI'] . "&profile_id=" . $newProfile->identifier;
69
+    $_SERVER['REQUEST_URI'] = $_SERVER['REQUEST_URI']."&profile_id=".$newProfile->identifier;
70 70
     $_GET['profile_id'] = $newProfile->identifier;
71 71
     $profile = $newProfile;
72 72
 } else {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 if (isset($_POST['command'])) {
92 92
     switch ($_POST['command']) {
93 93
         case \web\lib\common\FormElements::BUTTON_CLOSE:
94
-            header("Location: overview_idp.php?inst_id=" . $inst->identifier);
94
+            header("Location: overview_idp.php?inst_id=".$inst->identifier);
95 95
             break;
96 96
         case \web\lib\common\FormElements::BUTTON_TERMSOFUSE:
97 97
             if (isset($_POST['agreement']) && $_POST['agreement'] == 'true') {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                         break;
135 135
                     }
136 136
                     $properName = $validator->User($elements[0]);
137
-                    $properDate = new DateTime($elements[1] . " 00:00:00");
137
+                    $properDate = new DateTime($elements[1]." 00:00:00");
138 138
                     $numberOfActivations = $elements[2] ?? 5;
139 139
                     $number = $validator->integer($numberOfActivations);
140 140
                     if ($number === FALSE) { // invalid input received, default to sane
@@ -237,18 +237,18 @@  discard block
 block discarded – undo
237 237
                     // warn and ask for confirmation unless already confirmed
238 238
                     if (!isset($_POST['insecureconfirm']) || $_POST['insecureconfirm'] != "CONFIRM") {
239 239
                         echo $deco->pageheader(_("Insecure mail domain!"), "ADMIN-IDP-USERS");
240
-                        echo "<p>" . sprintf(_("The mail domain of the mail address <strong>%s</strong> is not secure: some or all of the mail servers are not accepting encrypted connections (no consistent support for STARTTLS)."), $properEmail) . "</p>";
241
-                        echo "<p>" . _("The invitation would need to be sent in cleartext across the internet, and can possibly be read and abused by anyone in transit.") . "</p>";
242
-                        echo "<p>" . _("Do you want the system to send this mail anyway?") . "</p>";
240
+                        echo "<p>".sprintf(_("The mail domain of the mail address <strong>%s</strong> is not secure: some or all of the mail servers are not accepting encrypted connections (no consistent support for STARTTLS)."), $properEmail)."</p>";
241
+                        echo "<p>"._("The invitation would need to be sent in cleartext across the internet, and can possibly be read and abused by anyone in transit.")."</p>";
242
+                        echo "<p>"._("Do you want the system to send this mail anyway?")."</p>";
243 243
                         echo $formtext;
244
-                        echo "<button type='submit' class='delete'>" . _("DO NOT SEND") . "</button>";
244
+                        echo "<button type='submit' class='delete'>"._("DO NOT SEND")."</button>";
245 245
                         echo "</form>";
246 246
                         echo $formtext;
247
-                        echo "<input type='hidden' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT . "'</>";
247
+                        echo "<input type='hidden' name='command' value='".\web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT."'</>";
248 248
                         echo "<input type='hidden' name='address' value='$properEmail'</>";
249
-                        echo "<input type='hidden' name='token' value='" . $invitationObject->invitationTokenString . "'</>";
249
+                        echo "<input type='hidden' name='token' value='".$invitationObject->invitationTokenString."'</>";
250 250
                         echo "<input type='hidden' name='insecureconfirm' value='CONFIRM'/>";
251
-                        echo "<button type='submit'>" . _("Send anyway.") . "</button>";
251
+                        echo "<button type='submit'>"._("Send anyway.")."</button>";
252 252
                         echo "</form>";
253 253
                         echo $deco->footer();
254 254
                         exit;
@@ -358,19 +358,19 @@  discard block
 block discarded – undo
358 358
         case "NOSTIPULATION":
359 359
             break;
360 360
         case "EMAIL-SENT":
361
-            echo $boundaryPre . $uiElements->boxOkay(_("The e-mail was sent successfully."), _("E-mail OK."), FALSE) . $boundaryPost;
361
+            echo $boundaryPre.$uiElements->boxOkay(_("The e-mail was sent successfully."), _("E-mail OK."), FALSE).$boundaryPost;
362 362
             break;
363 363
         case "EMAIL-NOTSENT":
364
-            echo $boundaryPre . $uiElements->boxError(_("The e-mail was NOT sent."), _("E-mail not OK."), FALSE) . $boundaryPost;
364
+            echo $boundaryPre.$uiElements->boxError(_("The e-mail was NOT sent."), _("E-mail not OK."), FALSE).$boundaryPost;
365 365
             break;
366 366
         case "SMS-SENT":
367
-            echo $boundaryPre . $uiElements->boxOkay(_("The SMS was sent successfully."), _("SMS OK."), FALSE) . $boundaryPost;
367
+            echo $boundaryPre.$uiElements->boxOkay(_("The SMS was sent successfully."), _("SMS OK."), FALSE).$boundaryPost;
368 368
             break;
369 369
         case "SMS-NOTSENT":
370
-            echo $boundaryPre . $uiElements->boxOkay(_("The SMS was NOT sent."), _("SMS not OK."), FALSE) . $boundaryPost;
370
+            echo $boundaryPre.$uiElements->boxOkay(_("The SMS was NOT sent."), _("SMS not OK."), FALSE).$boundaryPost;
371 371
             break;
372 372
         case "SMS-FRAGMENT":
373
-            echo $boundaryPre . $uiElements->boxWarning(_("Only a fragment of the SMS was sent. You should re-send it."), _("SMS Fragment."), FALSE) . $boundaryPost;
373
+            echo $boundaryPre.$uiElements->boxWarning(_("Only a fragment of the SMS was sent. You should re-send it."), _("SMS Fragment."), FALSE).$boundaryPost;
374 374
             break;
375 375
     }
376 376
     ?>
@@ -383,17 +383,17 @@  discard block
 block discarded – undo
383 383
             <?php
384 384
             $bufferCurrentUsers = "<table class='sb-user-table' style='max-width:1920px;'>
385 385
                 <tr class='sb-title-row'>
386
-                    <td>" . _("User") . "</td>
387
-                    <td>" . _("Token/Certificate details") . "</td>
388
-                    <td>" . _("User/Token Expiry") . "</td>
389
-                    <td>" . _("Actions") . "</td>
386
+                    <td>" . _("User")."</td>
387
+                    <td>" . _("Token/Certificate details")."</td>
388
+                    <td>" . _("User/Token Expiry")."</td>
389
+                    <td>" . _("Actions")."</td>
390 390
                 </tr>";
391 391
             $bufferPreviousUsers = "<table class='sb-user-table' style='max-width:1920px;'>
392 392
                 <tr class='sb-title-row'>
393
-                    <td>" . _("User") . "</td>
394
-                    <td>" . _("Certificate details") . "</td>
395
-                    <td>" . _("User Expiry") . "</td>
396
-                    <td>" . _("Actions") . "</td>
393
+                    <td>" . _("User")."</td>
394
+                    <td>" . _("Certificate details")."</td>
395
+                    <td>" . _("User Expiry")."</td>
396
+                    <td>" . _("Actions")."</td>
397 397
                 </tr>";
398 398
 
399 399
             natsort($allUsers);
@@ -449,23 +449,23 @@  discard block
 block discarded – undo
449 449
                     $display = empty(devices\Devices::listDevices()[$oneCert->device]['display']) ? $oneCert->device : devices\Devices::listDevices()[$oneCert->device]['display'];
450 450
 
451 451
                     $bufferText = "<div class='sb-certificate-summary ca-summary' $style>
452
-                                    <div class='sb-certificate-details'>" . _("Device:") . " " . $display .
453
-                            "<br>" . _("Serial Number:") . "&nbsp;" . dechex($oneCert->serial) .
454
-                            "<br>" . _("CN:") . "&nbsp;" . explode('@', $oneCert->username)[0] . "@…" .
455
-                            "<br>" . _("Expiry:") . "&nbsp;" . $oneCert->expiry .
456
-                            "<br>" . _("Issued:") . "&nbsp;" . $oneCert->issued .
457
-                            "</div>" .
452
+                                    <div class='sb-certificate-details'>"._("Device:")." ".$display.
453
+                            "<br>"._("Serial Number:")."&nbsp;".dechex($oneCert->serial).
454
+                            "<br>"._("CN:")."&nbsp;".explode('@', $oneCert->username)[0]."@…".
455
+                            "<br>"._("Expiry:")."&nbsp;".$oneCert->expiry.
456
+                            "<br>"._("Issued:")."&nbsp;".$oneCert->issued.
457
+                            "</div>".
458 458
                             "<div style='text-align:right;padding-top: 5px; $buttonStyle'>";
459 459
 
460 460
                     if ($buttonText == "") {
461 461
                         $bufferText .= $formtext
462
-                                . "<input type='hidden' name='certSerial' value='" . $oneCert->serial . "'/>"
463
-                                . "<input type='hidden' name='certAlgo' value='" . $oneCert->ca_type . "'/>"
462
+                                . "<input type='hidden' name='certSerial' value='".$oneCert->serial."'/>"
463
+                                . "<input type='hidden' name='certAlgo' value='".$oneCert->ca_type."'/>"
464 464
                                 . "<button type='submit' "
465 465
                                 . "name='command' "
466
-                                . "value='" . \web\lib\common\FormElements::BUTTON_REVOKECREDENTIAL . "' "
466
+                                . "value='".\web\lib\common\FormElements::BUTTON_REVOKECREDENTIAL."' "
467 467
                                 . "class='delete' "
468
-                                . "onclick='return confirm(\"" . sprintf(_("The device in question will stop functioning with %s. The revocation cannot be undone. Are you sure you want to do this?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "\")'>"
468
+                                . "onclick='return confirm(\"".sprintf(_("The device in question will stop functioning with %s. The revocation cannot be undone. Are you sure you want to do this?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."\")'>"
469 469
                                 . _("Revoke")
470 470
                                 . "</button>"
471 471
                                 . "</form>";
@@ -490,13 +490,13 @@  discard block
 block discarded – undo
490 490
                 }
491 491
                 // wrap the revoked and expired certs in a div that is hidden by default
492 492
                 if ($textRevokedCerts !== "") {
493
-                    $textRevokedCerts = "<span style='text-decoration: underline;' id='$oneUserId-revoked-heading' onclick='document.getElementById(\"$oneUserId-revoked-certs\").style.display = \"block\"; document.getElementById(\"$oneUserId-revoked-heading\").style.display = \"none\";'>" . sprintf(ngettext("(show %d revoked certificate)", "(show %d revoked certificates)", $countRevoked), $countRevoked) . "</span><div id='$oneUserId-revoked-certs' style='display:none;'>" . $textRevokedCerts . "</div>";
493
+                    $textRevokedCerts = "<span style='text-decoration: underline;' id='$oneUserId-revoked-heading' onclick='document.getElementById(\"$oneUserId-revoked-certs\").style.display = \"block\"; document.getElementById(\"$oneUserId-revoked-heading\").style.display = \"none\";'>".sprintf(ngettext("(show %d revoked certificate)", "(show %d revoked certificates)", $countRevoked), $countRevoked)."</span><div id='$oneUserId-revoked-certs' style='display:none;'>".$textRevokedCerts."</div>";
494 494
                 }
495 495
                 if ($textExpiredCerts !== "") {
496
-                    $textExpiredCerts = "<span style='text-decoration: underline;' id='$oneUserId-expired-heading' onclick='document.getElementById(\"$oneUserId-expired-certs\").style.display = \"block\"; document.getElementById(\"$oneUserId-expired-heading\").style.display = \"none\";'>" . sprintf(ngettext("(show %d expired certificate)", "(show %d expired certificates)", $countExpired), $countExpired) . "</span><div id='$oneUserId-expired-certs' style='display:none;'>" . $textExpiredCerts . "</div>";
496
+                    $textExpiredCerts = "<span style='text-decoration: underline;' id='$oneUserId-expired-heading' onclick='document.getElementById(\"$oneUserId-expired-certs\").style.display = \"block\"; document.getElementById(\"$oneUserId-expired-heading\").style.display = \"none\";'>".sprintf(ngettext("(show %d expired certificate)", "(show %d expired certificates)", $countExpired), $countExpired)."</span><div id='$oneUserId-expired-certs' style='display:none;'>".$textExpiredCerts."</div>";
497 497
                 }
498 498
                 // and push out the HTML
499
-                ${$outputBuffer} .= $textActiveCerts . "<br/>" . $textExpiredCerts . " " . $textRevokedCerts . "</td>";
499
+                ${$outputBuffer} .= $textActiveCerts."<br/>".$textExpiredCerts." ".$textRevokedCerts."</td>";
500 500
                 $tokenHtmlBuffer = "";
501 501
                 $hasOnePendingInvite = FALSE;
502 502
                 foreach ($tokensWithoutCerts as $invitationObject) {
@@ -507,38 +507,38 @@  discard block
 block discarded – undo
507 507
                             $tokenHtmlBuffer .= "<tr class='sb-certificate-row'><td></td>";
508 508
                             $jsEncodedBody = str_replace('\n', '%0D%0A', str_replace('"', '', json_encode($invitationObject->invitationMailBody())));
509 509
                             $tokenHtmlBuffer .= "<td>";
510
-                            $tokenHtmlBuffer .= sprintf(_("The invitation token %s is ready for sending! Choose how to send it:"), "<input type='text' readonly='readonly' style='background-color:lightgrey;' size='60' value='" . $invitationObject->link() . "' name='token' class='identifiedtokenarea-" . $invitationObject->identifier . "'>(…)<br/>");
510
+                            $tokenHtmlBuffer .= sprintf(_("The invitation token %s is ready for sending! Choose how to send it:"), "<input type='text' readonly='readonly' style='background-color:lightgrey;' size='60' value='".$invitationObject->link()."' name='token' class='identifiedtokenarea-".$invitationObject->identifier."'>(…)<br/>");
511 511
                             $tokenHtmlBuffer .= "<table>
512
-                                    <tr><td style='vertical-align:bottom;'>" . _("E-Mail:") . "</td><td>
512
+                                    <tr><td style='vertical-align:bottom;'>" . _("E-Mail:")."</td><td>
513 513
                                     $formtext
514
-                                <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/>
514
+                                <input type='hidden' value='".$invitationObject->invitationTokenString."' name='token'><br/>
515 515
                                 <input type='text' name='address' id='address-$invitationObject->identifier'/>
516
-                                <button type='button' onclick='window.location=\"mailto:\"+document.getElementById(\"address-$invitationObject->identifier\").value+\"?subject=" . $invitationObject->invitationMailSubject() . "&amp;body=$jsEncodedBody\"; return false;'>" . _("Local mail client") . "</button>
517
-                                <button type='submit' name='command' onclick='document.getElementById(\"spin\").style.display =\"block\"' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT . "'>" . _("Send with CAT") . "</button>
516
+                                <button type='button' onclick='window.location=\"mailto:\"+document.getElementById(\"address-$invitationObject->identifier\").value+\"?subject=".$invitationObject->invitationMailSubject()."&amp;body=$jsEncodedBody\"; return false;'>"._("Local mail client")."</button>
517
+                                <button type='submit' name='command' onclick='document.getElementById(\"spin\").style.display =\"block\"' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT."'>"._("Send with CAT")."</button>
518 518
                                     </form>
519 519
                                     </td></tr>
520
-                                    <tr><td style='vertical-align:bottom;'>" . _("SMS:") . "</td><td>
520
+                                    <tr><td style='vertical-align:bottom;'>" . _("SMS:")."</td><td>
521 521
                                     $formtext
522
-                                    <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/>
522
+                                    <input type='hidden' value='".$invitationObject->invitationTokenString."' name='token'><br/>
523 523
                                     <input type='text' name='smsnumber' />
524
-				<button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONSMS . "'>" . _("Send in SMS...") . "</button>
524
+				<button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONSMS."'>"._("Send in SMS...")."</button>
525 525
                                     </form>
526 526
 				</td></tr>
527
-                                    <tr><td style='vertical-align:bottom;'>" . _("Manual:") . "</td><td>
528
-				<button type='button' class='clipboardButton' onclick='clipboardCopy(" . $invitationObject->identifier . ");'>" . _("Copy to Clipboard") . "</button>
527
+                                    <tr><td style='vertical-align:bottom;'>" . _("Manual:")."</td><td>
528
+				<button type='button' class='clipboardButton' onclick='clipboardCopy(" . $invitationObject->identifier.");'>"._("Copy to Clipboard")."</button>
529 529
                                     <form style='display:inline-block;' method='post' action='inc/displayQRcode.inc.php' onsubmit='popupQRWindow(this); return false;' accept-charset='UTF-8'>
530
-                                    <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/>
531
-                                      <button type='submit'>" . _("Display QR code") . "</button>
530
+                                    <input type='hidden' value='" . $invitationObject->invitationTokenString."' name='token'><br/>
531
+                                      <button type='submit'>" . _("Display QR code")."</button>
532 532
                                   </form>
533 533
                                         </td></tr>
534 534
                                         
535 535
                                 </table>
536 536
                                 </td>";
537
-                            $tokenHtmlBuffer .= "<td>" . _("Expiry Date:") . " " . $invitationObject->expiry . " UTC<br>" . _("Activations remaining:") . " " . sprintf(_("%d of %d"), $invitationObject->activationsRemaining, $invitationObject->activationsTotal) . "</td>";
537
+                            $tokenHtmlBuffer .= "<td>"._("Expiry Date:")." ".$invitationObject->expiry." UTC<br>"._("Activations remaining:")." ".sprintf(_("%d of %d"), $invitationObject->activationsRemaining, $invitationObject->activationsTotal)."</td>";
538 538
                             $tokenHtmlBuffer .= "<td>"
539 539
                                     . $formtext
540
-                                    . "<input type='hidden' name='invitationtoken' value='" . $invitationObject->invitationTokenString . "'/>"
541
-                                    . "<button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_REVOKEINVITATION . "' class='delete'>" . _("Revoke") . "</button></form>"
540
+                                    . "<input type='hidden' name='invitationtoken' value='".$invitationObject->invitationTokenString."'/>"
541
+                                    . "<button type='submit' name='command' value='".\web\lib\common\FormElements::BUTTON_REVOKEINVITATION."' class='delete'>"._("Revoke")."</button></form>"
542 542
                                     . "</td></tr>";
543 543
                             break;
544 544
                         case core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED:
@@ -554,10 +554,10 @@  discard block
 block discarded – undo
554 554
                 }
555 555
                 ${$outputBuffer} .= "<td>$formtext
556 556
                     <div class='sb-date-container' style='min-width: 200px;'>
557
-                        <span><input type='text' maxlength='19' class='sb-date-picker' name='userexpiry' value='" . $profile->getUserExpiryDate($oneUserId) . "'>&nbsp;(UTC)</span>
557
+                        <span><input type='text' maxlength='19' class='sb-date-picker' name='userexpiry' value='".$profile->getUserExpiryDate($oneUserId)."'>&nbsp;(UTC)</span>
558 558
                     </div>
559 559
                     <input type='hidden' name='userid' value='$oneUserId'/>
560
-                    <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_CHANGEUSEREXPIRY . "'>" . _("Update") . "</button>
560
+                    <button type='submit' name='command' value='".\web\lib\common\FormElements::BUTTON_CHANGEUSEREXPIRY."'>"._("Update")."</button>
561 561
                     </form>
562 562
                 </td>
563 563
                 <td>
@@ -565,33 +565,33 @@  discard block
 block discarded – undo
565 565
 
566 566
                 if ($hasOnePendingInvite || count($validCerts) > 0) {
567 567
                     $deletionText = sprintf(_("All of the currently active devices will stop functioning with %s. This cannot be undone. While the user can be re-activated later, they will then need to be re-provisioned with new invitation tokens. Are you sure you want to do this?"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
568
-                    ${$outputBuffer} .= $formtext . "
568
+                    ${$outputBuffer} .= $formtext."
569 569
                                     <input type='hidden' name='userid' value='$oneUserId'/>
570 570
                                     <button type='submit' "
571 571
                             . "name='command' "
572
-                            . "value='" . \web\lib\common\FormElements::BUTTON_DEACTIVATEUSER . "' "
572
+                            . "value='".\web\lib\common\FormElements::BUTTON_DEACTIVATEUSER."' "
573 573
                             . "class='delete' "
574
-                            . ( count($validCerts) > 0 ? "onclick='return confirm(\"" . $deletionText . "\")' " : "" )
574
+                            . (count($validCerts) > 0 ? "onclick='return confirm(\"".$deletionText."\")' " : "")
575 575
                             . ">"
576 576
                             . _("Deactivate User")
577 577
                             . "</button>
578 578
                                 </form>";
579 579
                 }
580
-                ${$outputBuffer} .= "<form method='post' action='inc/userStats.inc.php?inst_id=" . $profile->institution . "&amp;profile_id=" . $profile->identifier . "&amp;user_id=$oneUserId' onsubmit='popupStatsWindow(this); return false;' accept-charset='UTF-8'>
581
-                    <button type='submit'>" . _("Show Authentication Records") . "</button>
580
+                ${$outputBuffer} .= "<form method='post' action='inc/userStats.inc.php?inst_id=".$profile->institution."&amp;profile_id=".$profile->identifier."&amp;user_id=$oneUserId' onsubmit='popupStatsWindow(this); return false;' accept-charset='UTF-8'>
581
+                    <button type='submit'>"._("Show Authentication Records")."</button>
582 582
                 </form>";
583 583
                 if (new DateTime() < new DateTime($expiryDate)) { // current user, allow sending new token
584
-                    ${$outputBuffer} .= $formtext . "
584
+                    ${$outputBuffer} .= $formtext."
585 585
                     <input type='hidden' name='userid' value='$oneUserId'/>
586
-                    <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_NEWINVITATION . "'>" . _("New Invitation") . "</button>
587
-                    <label>" . _("Activations:") . "
586
+                    <button type='submit' name='command' value='".\web\lib\common\FormElements::BUTTON_NEWINVITATION."'>"._("New Invitation")."</button>
587
+                    <label>" . _("Activations:")."
588 588
                         <input type='text' name='invitationsquantity' value='5' maxlength='3' style='width: 30px;'/>
589 589
                     </label>
590 590
                     </form>";
591 591
                 } elseif (count($profile->getUserAuthRecords($oneUserId)) == 0) { // previous user; if there are NO authentication records, allow full deletion - otherwise, need to keep user trace for abuse handling
592
-                    ${$outputBuffer} .= $formtext . "
592
+                    ${$outputBuffer} .= $formtext."
593 593
                     <input type='hidden' name='userid' value='$oneUserId'/>
594
-                    <button type='submit' class='delete' name='command' value='" . \web\lib\common\FormElements::BUTTON_DELETE . "'>" . _("Delete User") . "</button>
594
+                    <button type='submit' class='delete' name='command' value='".\web\lib\common\FormElements::BUTTON_DELETE."'>"._("Delete User")."</button>
595 595
                     </form>";
596 596
                 }
597 597
                 ${$outputBuffer} .= "</div>
@@ -623,13 +623,13 @@  discard block
 block discarded – undo
623 623
                                     . ' If all accounts shown as active above are indeed still valid, please check the box below and push "Save".'
624 624
                                     . ' If any of the accounts are stale, please deactivate them by pushing the corresponding button before doing this.'), CONFIG_CONFASSISTANT['SILVERBULLET']['gracetime'] ?? core\ProfileSilverbullet::SB_ACKNOWLEDGEMENT_REQUIRED_DAYS);
625 625
 
626
-                    echo $formtext . "<div style='padding-bottom: 20px;'>"
626
+                    echo $formtext."<div style='padding-bottom: 20px;'>"
627 627
                     . "
628 628
                     <p>$acknowledgeText</p>
629 629
                     <input type='checkbox' name='acknowledge' value='true'>
630
-                    <label>" . sprintf(_("I have verified that all configured users are still eligible for %s."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</label>
630
+                    <label>".sprintf(_("I have verified that all configured users are still eligible for %s."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</label>
631 631
                 </div>
632
-                <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_ACKUSERELIGIBILITY . "'>" . _("Save") . "</button></form>";
632
+                <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_ACKUSERELIGIBILITY."'>"._("Save")."</button></form>";
633 633
                 }
634 634
                 ?>
635 635
             </div>
Please login to merge, or discard this patch.
core/SilverbulletCertificate.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     public function annotate($annotation) {
145 145
         $encoded = json_encode($annotation);
146 146
         $this->annotation = $encoded;
147
-        $this->databaseHandle->exec("UPDATE silverbullet_certificate SET extrainfo = ? WHERE serial_number = ?", "si", $encoded, $this->serial );
147
+        $this->databaseHandle->exec("UPDATE silverbullet_certificate SET extrainfo = ? WHERE serial_number = ?", "si", $encoded, $this->serial);
148 148
     }
149 149
     /**
150 150
      * we don't use caching in SB, so this function does nothing
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         $invitationObject = new SilverbulletInvitation($token);
171 171
         $profile = new ProfileSilverbullet($invitationObject->profile);
172 172
         $inst = new IdP($profile->institution);
173
-        $loggerInstance->debug(5, "tokenStatus: done, got " . $invitationObject->invitationTokenStatus . ", " . $invitationObject->profile . ", " . $invitationObject->userId . ", " . $invitationObject->expiry . ", " . $invitationObject->invitationTokenString . "\n");
173
+        $loggerInstance->debug(5, "tokenStatus: done, got ".$invitationObject->invitationTokenStatus.", ".$invitationObject->profile.", ".$invitationObject->userId.", ".$invitationObject->expiry.", ".$invitationObject->invitationTokenString."\n");
174 174
         if ($invitationObject->invitationTokenStatus != SilverbulletInvitation::SB_TOKENSTATUS_VALID && $invitationObject->invitationTokenStatus != SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED) {
175 175
             throw new Exception("Attempt to generate a SilverBullet installer with an invalid/redeemed/expired token. The user should never have gotten that far!");
176 176
         }
@@ -183,12 +183,12 @@  discard block
 block discarded – undo
183 183
             throw new Exception("Despite a valid token, the corresponding user was not found in database or database query error!");
184 184
         }
185 185
         $expiryObject = mysqli_fetch_object(/** @scrutinizer ignore-type */ $userrow);
186
-        $loggerInstance->debug(5, "EXP: " . $expiryObject->expiry . "\n");
186
+        $loggerInstance->debug(5, "EXP: ".$expiryObject->expiry."\n");
187 187
         $expiryDateObject = date_create_from_format("Y-m-d H:i:s", $expiryObject->expiry);
188 188
         if ($expiryDateObject === FALSE) {
189 189
             throw new Exception("The expiry date we got from the DB is bogus!");
190 190
         }
191
-        $loggerInstance->debug(5, $expiryDateObject->format("Y-m-d H:i:s") . "\n");
191
+        $loggerInstance->debug(5, $expiryDateObject->format("Y-m-d H:i:s")."\n");
192 192
         // date_create with no parameters can't fail, i.e. is never FALSE
193 193
         $validity = date_diff(/** @scrutinizer ignore-type */ date_create(), $expiryDateObject);
194 194
         $expiryDays = $validity->days + 1;
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         $certString = "";
238 238
         openssl_x509_export($cert, $certString);
239 239
         $parsedCert = $x509->processCertificate($certString);
240
-        $loggerInstance->debug(5, "CERTINFO: " . print_r($parsedCert['full_details'], true));
240
+        $loggerInstance->debug(5, "CERTINFO: ".print_r($parsedCert['full_details'], true));
241 241
         $realExpiryDate = date_create_from_format("U", $parsedCert['full_details']['validTo_time_t'])->format("Y-m-d H:i:s");
242 242
 
243 243
         // store new cert info in DB
@@ -295,26 +295,26 @@  discard block
 block discarded – undo
295 295
                 $cat = new CAT();
296 296
                 $tempdirArray = $cat->createTemporaryDirectory("test");
297 297
                 $tempdir = $tempdirArray['dir'];
298
-                $nowIndexTxt = (new \DateTime())->format("ymdHis") . "Z";
299
-                $expiryIndexTxt = $originalExpiry->format("ymdHis") . "Z";
298
+                $nowIndexTxt = (new \DateTime())->format("ymdHis")."Z";
299
+                $expiryIndexTxt = $originalExpiry->format("ymdHis")."Z";
300 300
                 $serialHex = strtoupper(dechex($this->serial));
301 301
                 if (strlen($serialHex) % 2 == 1) {
302
-                    $serialHex = "0" . $serialHex;
302
+                    $serialHex = "0".$serialHex;
303 303
                 }
304 304
 
305
-                $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . CONFIG_CONFASSISTANT['CONSORTIUM']['name'] . "/OU=$federation/CN=$this->username\n";
305
+                $indexStatement = "$certstatus\t$expiryIndexTxt\t".($certstatus == "R" ? "$nowIndexTxt,unspecified" : "")."\t$serialHex\tunknown\t/O=".CONFIG_CONFASSISTANT['CONSORTIUM']['name']."/OU=$federation/CN=$this->username\n";
306 306
                 $logHandle->debug(4, "index.txt contents-to-be: $indexStatement");
307
-                if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) {
307
+                if (!file_put_contents($tempdir."/index.txt", $indexStatement)) {
308 308
                     $logHandle->debug(1, "Unable to write openssl index.txt file for revocation handling!");
309 309
                 }
310 310
                 // index.txt.attr is dull but needs to exist
311
-                file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n");
311
+                file_put_contents($tempdir."/index.txt.attr", "unique_subject = yes\n");
312 312
                 // call "openssl ocsp" to manufacture our own OCSP statement
313 313
                 // adding "-rmd sha1" to the following command-line makes the
314 314
                 // choice of signature algorithm for the response explicit
315 315
                 // but it's only available from openssl-1.1.0 (which we do not
316 316
                 // want to require just for that one thing).
317
-                $execCmd = CONFIG['PATHS']['openssl'] . " ocsp -issuer " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rsigner " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rkey " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".key -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der";
317
+                $execCmd = CONFIG['PATHS']['openssl']." ocsp -issuer ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rsigner ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rkey ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".key -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der";
318 318
                 $logHandle->debug(2, "Calling openssl ocsp with following cmdline: $execCmd\n");
319 319
                 $output = [];
320 320
                 $return = 999;
@@ -322,11 +322,11 @@  discard block
 block discarded – undo
322 322
                 if ($return !== 0) {
323 323
                     throw new Exception("Non-zero return value from openssl ocsp!");
324 324
                 }
325
-                $ocsp = file_get_contents($tempdir . "/$serialHex.response.der");
325
+                $ocsp = file_get_contents($tempdir."/$serialHex.response.der");
326 326
                 // remove the temp dir!
327
-                unlink($tempdir . "/$serialHex.response.der");
328
-                unlink($tempdir . "/index.txt.attr");
329
-                unlink($tempdir . "/index.txt");
327
+                unlink($tempdir."/$serialHex.response.der");
328
+                unlink($tempdir."/index.txt.attr");
329
+                unlink($tempdir."/index.txt");
330 330
                 rmdir($tempdir);
331 331
                 break;
332 332
             default:
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
         $username = "";
381 381
         while ($usernameIsUnique === FALSE) {
382 382
             $usernameLocalPart = common\Entity::randomString(64 - 1 - strlen($realm), "0123456789abcdefghijklmnopqrstuvwxyz");
383
-            $username = $usernameLocalPart . "@" . $realm;
383
+            $username = $usernameLocalPart."@".$realm;
384 384
             $uniquenessQuery = $databaseHandle->exec("SELECT cn from silverbullet_certificate WHERE cn = ?", "s", $username);
385 385
             // SELECT -> resource, not boolean
386 386
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $uniquenessQuery) == 0) {
@@ -432,10 +432,10 @@  discard block
 block discarded – undo
432 432
         $databaseHandle = DBConnection::handle("INST");
433 433
         switch (CONFIG_CONFASSISTANT['SILVERBULLET']['CA']['type']) {
434 434
             case "embedded":
435
-                $rootCaPem = file_get_contents(ROOT . "/config/SilverbulletClientCerts/rootca-$certtype.pem");
436
-                $issuingCaPem = file_get_contents(ROOT . "/config/SilverbulletClientCerts/real-$certtype.pem");
435
+                $rootCaPem = file_get_contents(ROOT."/config/SilverbulletClientCerts/rootca-$certtype.pem");
436
+                $issuingCaPem = file_get_contents(ROOT."/config/SilverbulletClientCerts/real-$certtype.pem");
437 437
                 $issuingCa = openssl_x509_read($issuingCaPem);
438
-                $issuingCaKey = openssl_pkey_get_private("file://" . ROOT . "/config/SilverbulletClientCerts/real-$certtype.key");
438
+                $issuingCaKey = openssl_pkey_get_private("file://".ROOT."/config/SilverbulletClientCerts/real-$certtype.key");
439 439
                 $nonDupSerialFound = FALSE;
440 440
                 do {
441 441
                     $serial = random_int(1000000000, PHP_INT_MAX);
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                         throw new Exception("Unknown cert type!");
458 458
                 }
459 459
                 return [
460
-                    "CERT" => openssl_csr_sign($csr, $issuingCa, $issuingCaKey, $expiryDays, ['digest_alg' => $alg, 'config' => dirname(__DIR__) . "/config/SilverbulletClientCerts/openssl-$certtype.cnf"], $serial),
460
+                    "CERT" => openssl_csr_sign($csr, $issuingCa, $issuingCaKey, $expiryDays, ['digest_alg' => $alg, 'config' => dirname(__DIR__)."/config/SilverbulletClientCerts/openssl-$certtype.cnf"], $serial),
461 461
                     "SERIAL" => $serial,
462 462
                     "ISSUER" => $issuingCaPem,
463 463
                     "ROOT" => $rootCaPem,
Please login to merge, or discard this patch.
devices/ms/WindowsCommon.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
         $this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n");
108 108
         ob_start();
109
-        $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n");
109
+        $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n");
110 110
         $source = $this->findSourceFile($source_name);
111 111
 
112 112
         if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         }
115 115
         $output = ob_get_clean();
116 116
         if ($encoding) {
117
-            $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output);
117
+            $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output);
118 118
             if ($outputClean) {
119 119
                 $output = $outputClean;
120 120
             }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             $encoding = 0;
159 159
         }
160 160
         if ($encoding) {
161
-            $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $source_string);
161
+            $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $source_string);
162 162
         } else {
163 163
             $output_c = $source_string;
164 164
         }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         if (isset($this->LANGS[$this->languageInstance->getLang()])) {
238 238
             $language = $this->LANGS[$this->languageInstance->getLang()];
239 239
             $this->lang = $language['nsis'];
240
-            $this->codePage = 'cp' . $language['cp'];
240
+            $this->codePage = 'cp'.$language['cp'];
241 241
         } else {
242 242
             $this->lang = 'English';
243 243
             $this->codePage = 'cp1252';
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
         $out .= sprintf(_("%s installer will be in the form of an EXE file. It will configure %s on your device, by creating wireless network profiles.<p>When you click the download button, the installer will be saved by your browser. Copy it to the machine you want to configure and execute."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
260 260
         $out .= "<p>";
261 261
         if ($ssidCount > $configCount) {
262
-            $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList)) . " ";
263
-            $out .= '<strong>' . join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)) . '</strong>';
262
+            $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList))." ";
263
+            $out .= '<strong>'.join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)).'</strong>';
264 264
             $out .= "<p>";
265 265
         }
266 266
 // TODO - change this below
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
             $out .= _("When you are connecting to the network for the first time, Windows will pop up a login box, where you should enter your user name and password. This information will be saved so that you will reconnect to the network automatically each time you are in the range.");
277 277
             if ($ssidCount > 1) {
278 278
                 $out .= "<p>";
279
-                $out .= _("You will be required to enter the same credentials for each of the configured networks:") . " ";
280
-                $out .= '<strong>' . join('</strong>, <strong>', array_keys($ssids)) . '</strong>';
279
+                $out .= _("You will be required to enter the same credentials for each of the configured networks:")." ";
280
+                $out .= '<strong>'.join('</strong>, <strong>', array_keys($ssids)).'</strong>';
281 281
             }
282 282
         }
283 283
         return $out;
@@ -379,13 +379,13 @@  discard block
 block discarded – undo
379 379
      */
380 380
     protected function signInstaller()
381 381
     {
382
-        $fileName = $this->installerBasename . '.exe';
382
+        $fileName = $this->installerBasename.'.exe';
383 383
         if (!$this->sign) {
384 384
             rename("installer.exe", $fileName);
385 385
             return $fileName;
386 386
         }
387 387
         // are actually signing
388
-        $outputFromSigning = system($this->sign . " installer.exe '$fileName' > /dev/null");
388
+        $outputFromSigning = system($this->sign." installer.exe '$fileName' > /dev/null");
389 389
         if ($outputFromSigning === FALSE) {
390 390
             $this->loggerInstance->debug(2, "Signing the WindowsCommon installer $fileName FAILED!\n");
391 391
         }
@@ -400,15 +400,15 @@  discard block
 block discarded – undo
400 400
     protected function compileNSIS()
401 401
     {
402 402
         if (CONFIG_CONFASSISTANT['NSIS_VERSION'] >= 3) {
403
-            $makensis = CONFIG_CONFASSISTANT['PATHS']['makensis'] . " -INPUTCHARSET UTF8";
403
+            $makensis = CONFIG_CONFASSISTANT['PATHS']['makensis']." -INPUTCHARSET UTF8";
404 404
         } else {
405 405
             $makensis = CONFIG_CONFASSISTANT['PATHS']['makensis'];
406 406
         }
407 407
         $lcAll = getenv("LC_ALL");
408 408
         putenv("LC_ALL=en_US.UTF-8");
409
-        $command = $makensis . ' -V4 cat.NSI > nsis.log 2>&1';
409
+        $command = $makensis.' -V4 cat.NSI > nsis.log 2>&1';
410 410
         system($command);
411
-        putenv("LC_ALL=" . $lcAll);
411
+        putenv("LC_ALL=".$lcAll);
412 412
         $this->loggerInstance->debug(4, "compileNSIS:$command\n");
413 413
     }
414 414
 
@@ -425,10 +425,10 @@  discard block
 block discarded – undo
425 425
             'email' => 'SUPPORT',
426 426
             'url' => 'URL',
427 427
         ];
428
-        $s = "support_" . $type . "_substitute";
428
+        $s = "support_".$type."_substitute";
429 429
         $substitute = $this->translateString($this->$s, $this->codePage);
430
-        $returnValue = !empty($attr['support:' . $type][0]) ? $attr['support:' . $type][0] : $substitute;
431
-        return '!define ' . $supportString[$type] . ' "' . $returnValue . '"' . "\n";
430
+        $returnValue = !empty($attr['support:'.$type][0]) ? $attr['support:'.$type][0] : $substitute;
431
+        return '!define '.$supportString[$type].' "'.$returnValue.'"'."\n";
432 432
     }
433 433
 
434 434
     /**
@@ -439,20 +439,20 @@  discard block
 block discarded – undo
439 439
      */
440 440
     protected function writeNsisDefines($attr)
441 441
     {
442
-        $fcontents = "\n" . '!define NSIS_MAJOR_VERSION ' . CONFIG_CONFASSISTANT['NSIS_VERSION'];
442
+        $fcontents = "\n".'!define NSIS_MAJOR_VERSION '.CONFIG_CONFASSISTANT['NSIS_VERSION'];
443 443
         if ($attr['internal:profile_count'][0] > 1) {
444
-            $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '"
444
+            $fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage).'"
445 445
 ';
446 446
         }
447 447
         $fcontents .= '
448
-Caption "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage) . '"
449
-!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage) . '"
450
-!define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '"
448
+Caption "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage).'"
449
+!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage).'"
450
+!define VERSION "' . \core\CAT::VERSION_MAJOR.'.'.\core\CAT::VERSION_MINOR.'"
451 451
 !define INSTALLER_NAME "installer.exe"
452
-!define LANG "' . $this->lang . '"
453
-!define LOCALE "' . preg_replace('/\..*$/', '', CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['locale']) . '"
452
+!define LANG "' . $this->lang.'"
453
+!define LOCALE "' . preg_replace('/\..*$/', '', CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['locale']).'"
454 454
 ;--------------------------------
455
-!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '"
455
+!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage).'"
456 456
 ';
457 457
         $fcontents .= $this->getSupport($attr, 'email');
458 458
         $fcontents .= $this->getSupport($attr, 'url');
@@ -460,18 +460,18 @@  discard block
 block discarded – undo
460 460
             $fcontents .= '!define WIRED
461 461
         ';
462 462
         }
463
-        $fcontents .= '!define PROVIDERID "urn:UUID:' . $this->deviceUUID . '"
463
+        $fcontents .= '!define PROVIDERID "urn:UUID:'.$this->deviceUUID.'"
464 464
 ';
465 465
         if (!empty($attr['internal:realm'][0])) {
466
-            $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '"
466
+            $fcontents .= '!define REALM "'.$attr['internal:realm'][0].'"
467 467
 ';
468 468
         }
469 469
         if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) {
470
-            $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '"
470
+            $fcontents .= '!define HINT_USER_INPUT "'.$attr['internal:hint_userinput_suffix'][0].'"
471 471
 ';
472 472
         }
473 473
         if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) {
474
-            $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '"
474
+            $fcontents .= '!define VERIFY_USER_REALM_INPUT "'.$attr['internal:verify_userinput_suffix'][0].'"
475 475
 ';
476 476
         }
477 477
         $fcontents .= $this->msInfoFile($attr);
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
             $out .= '!define EXTERNAL_INFO "';
493 493
 //  $this->loggerInstance->debug(4,"Info file type ".$attr['support:info_file'][0]['mime']."\n");
494 494
             if ($attr['internal:info_file'][0]['mime'] == 'rtf') {
495
-                $out = '!define LICENSE_FILE "' . $attr['internal:info_file'][0]['name'];
495
+                $out = '!define LICENSE_FILE "'.$attr['internal:info_file'][0]['name'];
496 496
             } elseif ($attr['internal:info_file'][0]['mime'] == 'txt') {
497 497
                 $infoFile = file_get_contents($attr['internal:info_file'][0]['name']);
498 498
                 if ($infoFile === FALSE) {
@@ -501,14 +501,14 @@  discard block
 block discarded – undo
501 501
                 if (CONFIG_CONFASSISTANT['NSIS_VERSION'] >= 3) {
502 502
                     $infoFileConverted = $infoFile;
503 503
                 } else {
504
-                    $infoFileConverted = iconv('UTF-8', $this->codePage . '//TRANSLIT', $infoFile);
504
+                    $infoFileConverted = iconv('UTF-8', $this->codePage.'//TRANSLIT', $infoFile);
505 505
                 }
506 506
                 if ($infoFileConverted !== FALSE && strlen($infoFileConverted) > 0) {
507 507
                     file_put_contents('info_f.txt', $infoFileConverted);
508 508
                     $out = '!define LICENSE_FILE " info_f.txt';
509 509
                 }
510 510
             } else {
511
-                $out = '!define EXTERNAL_INFO "' . $attr['internal:info_file'][0]['name'];
511
+                $out = '!define EXTERNAL_INFO "'.$attr['internal:info_file'][0]['name'];
512 512
             }
513 513
 
514 514
             $out .= "\"\n";
Please login to merge, or discard this patch.
web/admin/edit_idp.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 $auth = new \web\lib\admin\Authentication();
25 25
 $deco = new \web\lib\admin\PageDecoration();
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
         </table>
95 95
     </div>
96 96
     <?php
97
-    echo "<form enctype='multipart/form-data' action='edit_idp_result.php?inst_id=$my_inst->identifier" . ($wizardStyle ? "&wizard=true" : "") . "' method='post' accept-charset='UTF-8'>
98
-              <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE'] . "'>";
97
+    echo "<form enctype='multipart/form-data' action='edit_idp_result.php?inst_id=$my_inst->identifier".($wizardStyle ? "&wizard=true" : "")."' method='post' accept-charset='UTF-8'>
98
+              <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE']."'>";
99 99
 
100 100
     if ($wizardStyle) {
101
-        echo "<p>" .
102
-        sprintf(_("Hello, newcomer. The %s is new to us. This wizard will ask you several questions about it, so that we can generate beautiful profiles for you in the end. All of the information below is optional, but it is important to fill out as many fields as possible for the benefit of your end users."), $uiElements->nomenclatureInst) . "</p>";
101
+        echo "<p>".
102
+        sprintf(_("Hello, newcomer. The %s is new to us. This wizard will ask you several questions about it, so that we can generate beautiful profiles for you in the end. All of the information below is optional, but it is important to fill out as many fields as possible for the benefit of your end users."), $uiElements->nomenclatureInst)."</p>";
103 103
     }
104 104
     $optionDisplay = new web\lib\admin\OptionDisplay($idpoptions, "IdP");
105 105
     ?>
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
         <legend><strong><?php echo _("General Information"); ?></strong></legend>
108 108
         <?php
109 109
         if ($wizardStyle) {
110
-            echo "<p>" .
111
-            _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:") . "</p>
110
+            echo "<p>".
111
+            _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:")."</p>
112 112
                       <ul>
113
-                         <li>" . _("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).") . "</li>
114
-                         <li>" . sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."),$uiElements->nomenclatureInst) . "</li>";
113
+                         <li>" . _("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).")."</li>
114
+                         <li>" . sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."), $uiElements->nomenclatureInst)."</li>";
115 115
             echo "</ul>";
116 116
         }
117 117
         echo $optionDisplay->prefilledOptionTable("general");
@@ -125,30 +125,30 @@  discard block
 block discarded – undo
125 125
         <legend><strong><?php echo _("Media Properties"); ?></strong></legend>
126 126
         <?php
127 127
         if ($wizardStyle) {
128
-            echo "<p>" .
129
-            sprintf(_("In this section, you define on which media %s should be configured on user devices."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</p>
128
+            echo "<p>".
129
+            sprintf(_("In this section, you define on which media %s should be configured on user devices."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</p>
130 130
           <ul>";
131 131
             echo "<li>";
132
-            echo "<strong>" . ( count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:")) . " </strong>";
132
+            echo "<strong>".(count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:"))." </strong>";
133 133
             if (count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) {
134 134
                 $ssidlist = "";
135 135
                 foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssid) {
136
-                    $ssidlist .= ", '<strong>" . $ssid . "</strong>'";
136
+                    $ssidlist .= ", '<strong>".$ssid."</strong>'";
137 137
                 }
138 138
                 $ssidlist = substr($ssidlist, 2);
139 139
                 echo sprintf(ngettext("We will always configure this SSID for WPA2/AES: %s.", "We will always configure these SSIDs for WPA2/AES: %s.", count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'])), $ssidlist);
140 140
                 if (CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) {
141
-                    echo " " . _("They will also be configured for WPA/TKIP if the device supports multiple encryption types.");
141
+                    echo " "._("They will also be configured for WPA/TKIP if the device supports multiple encryption types.");
142 142
                 }
143
-                echo "<br/>" . sprintf(_("It is also possible to define custom additional SSIDs with the options '%s' and '%s' below."), $uiElements->displayName("media:SSID"), $uiElements->displayName("media:SSID_with_legacy"));
143
+                echo "<br/>".sprintf(_("It is also possible to define custom additional SSIDs with the options '%s' and '%s' below."), $uiElements->displayName("media:SSID"), $uiElements->displayName("media:SSID_with_legacy"));
144 144
             } else {
145 145
                 echo _("Please configure which SSIDs should be configured in the installers.");
146 146
             }
147
-            echo " " . _("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible.");
147
+            echo " "._("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible.");
148 148
             echo "</li>";
149 149
 
150 150
             echo "<li>";
151
-            echo "<strong>" . ( count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:")) . " </strong>";
151
+            echo "<strong>".(count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:"))." </strong>";
152 152
             if (count(CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']) > 0) {
153 153
                 $consortiumlist = "";
154 154
                 foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi'] as $displayName => $oi) {
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
                 $consortiumlistFinal = substr($consortiumlist, 2);
158 158
                 echo sprintf(ngettext("We will always configure this Consortium OI: %s.", "We will always configure these Consortium OIs: %s.", count(CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi'])), $consortiumlistFinal);
159 159
 
160
-                echo "<br/>" . sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $uiElements->displayName("media:consortium_OI"));
160
+                echo "<br/>".sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $uiElements->displayName("media:consortium_OI"));
161 161
             } else {
162 162
                 echo _("Please configure which Consortium OIs should be configured in the installers.");
163 163
             }
164 164
             echo "</li>";
165
-            echo "<li><strong>" . _("Support for wired IEEE 802.1X:") . " </strong>"
166
-            . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail).") .
165
+            echo "<li><strong>"._("Support for wired IEEE 802.1X:")." </strong>"
166
+            . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail).").
167 167
             "</li>";
168
-            echo "<li><strong>" . _("Removal of bootstrap/onboarding SSIDs:") . " </strong>"
168
+            echo "<li><strong>"._("Removal of bootstrap/onboarding SSIDs:")." </strong>"
169 169
             . _("If you use a captive portal to distribute configurations, you may want to unconfigure/disable that SSID after the bootstrap process. With this option, the SSID will either be removed, or be defined as 'Only connect manually'.")
170 170
             . "</li>";
171 171
             echo "</ul>";
@@ -181,16 +181,16 @@  discard block
 block discarded – undo
181 181
             echo "<p>"._("This section can be used to upload specific Terms of Use for your users and to display details of how your users can reach your local helpdesk.")."</p>";
182 182
             
183 183
             if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") {
184
-                echo "<p>" .
184
+                echo "<p>".
185 185
                         
186
-                sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."),$uiElements->nomenclatureInst)  . "</p>" .
187
-                "<p>" .
188
-                _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.") . "</p>";
186
+                sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."), $uiElements->nomenclatureInst)."</p>".
187
+                "<p>".
188
+                _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.")."</p>";
189 189
                 if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
190
-                echo "<p>" . sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), core\ProfileSilverbullet::PRODUCTNAME) ." " . _("This is the contact point for your end users' level 1 support.") . "</p>";
190
+                echo "<p>".sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), core\ProfileSilverbullet::PRODUCTNAME)." "._("This is the contact point for your end users' level 1 support.")."</p>";
191 191
                 }
192 192
             } elseif (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
193
-                echo "<p>". _("Providing at least a local support e-mail contact is required.")." "._("This is the contact point for your end users' level 1 support.")."</p>";
193
+                echo "<p>"._("Providing at least a local support e-mail contact is required.")." "._("This is the contact point for your end users' level 1 support.")."</p>";
194 194
             }
195 195
             
196 196
         }
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
         <button type='button' class='newoption' onclick='getXML("support")'><?php echo _("Add new option"); ?></button></fieldset>
201 201
     <?php
202 202
     if ($wizardStyle) {
203
-        echo "<p>" . sprintf(_("When you are sure that everything is correct, please click on %sContinue ...%s"), "<button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CONTINUE . "'>", "</button>") . "</p></form>";
203
+        echo "<p>".sprintf(_("When you are sure that everything is correct, please click on %sContinue ...%s"), "<button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CONTINUE."'>", "</button>")."</p></form>";
204 204
     } else {
205
-        echo "<div><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></div></form>";
205
+        echo "<div><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></div></form>";
206 206
     }
207 207
     echo $deco->footer();
Please login to merge, or discard this patch.
devices/apple_mobileconfig/MobileconfigSuperclass.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -701,7 +701,7 @@
 block discarded – undo
701 701
                             \core\common\Entity::$nomenclature_inst, 
702 702
                             count($this->CAsAccountedFor)+1, 
703 703
                             ($ca['root'] ? _("Root") : _("Intermediate"))) . 
704
-              "</string>
704
+                "</string>
705 705
                <key>PayloadIdentifier</key>
706 706
                <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
707 707
                <key>PayloadOrganization</key>
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 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,16 +138,16 @@  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 (strlen($this->attributes['internal:realm'][0]) > 0) {
145 145
                 /// note space between variable and exclamation mark - makes sure users don't mistakenly think the exclamation mark is part of the required username!
146
-                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE . sprintf(_("Important Notice: your username must end with @%s !"), $this->attributes['internal:realm'][0]) . MobileconfigSuperclass::BUFFER_CONSENT_POST;
146
+                $retval = MobileconfigSuperclass::BUFFER_CONSENT_PRE.sprintf(_("Important Notice: your username must end with @%s !"), $this->attributes['internal:realm'][0]).MobileconfigSuperclass::BUFFER_CONSENT_POST;
147 147
                 \core\common\Entity::outOfThePotatoes();
148 148
                 return $retval;
149 149
             }
150
-            $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;
150
+            $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;
151 151
             \core\common\Entity::outOfThePotatoes();
152 152
             return $retval;
153 153
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         // also escape htmlspecialchars
172 172
         // not all names and profiles have a name, so be prepared
173 173
 
174
-        $this->loggerInstance->debug(5, "List of available attributes: " . var_export($this->attributes, TRUE));
174
+        $this->loggerInstance->debug(5, "List of available attributes: ".var_export($this->attributes, TRUE));
175 175
 
176 176
         $this->instName = $this->attributes['general:instname'][0] ?? _("Unnamed Organisation");
177 177
         $this->profileName = $this->attributes['profile:name'][0] ?? _("Unnamed Profile");
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
         file_put_contents('installer_profile', $outputXml);
215 215
 
216
-        $fileName = $this->installerBasename . '.mobileconfig';
216
+        $fileName = $this->installerBasename.'.mobileconfig';
217 217
 
218 218
         if (!$this->sign) {
219 219
             rename("installer_profile", $fileName);
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             return $fileName;
222 222
         }
223 223
         // still here? Then we are signing.
224
-        $signing = system($this->sign . " installer_profile '$fileName' > /dev/null");
224
+        $signing = system($this->sign." installer_profile '$fileName' > /dev/null");
225 225
         if ($signing === FALSE) {
226 226
             $this->loggerInstance->debug(2, "Signing the mobileconfig installer $fileName FAILED!\n");
227 227
         }
@@ -240,19 +240,19 @@  discard block
 block discarded – undo
240 240
         \core\common\Entity::intoThePotatoes();
241 241
         $ssidCount = count($this->attributes['internal:SSID']);
242 242
         $certCount = count($this->attributes['internal:CAs'][0]);
243
-        $out = "<p>" . _("For best results, please use the built-in browser (Safari) to open the configuration file.") . "</p>";
243
+        $out = "<p>"._("For best results, please use the built-in browser (Safari) to open the configuration file.")."</p>";
244 244
         $out .= "<p>";
245 245
         $out .= _("The profile will install itself after you click (or tap) the button. You will be asked for confirmation/input at several points:");
246 246
         $out .= "<ul>";
247
-        $out .= "<li>" . _("to install the profile") . "</li>";
248
-        $out .= "<li>" . ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
247
+        $out .= "<li>"._("to install the profile")."</li>";
248
+        $out .= "<li>".ngettext("to accept the server certificate authority", "to accept the server certificate authorities", $certCount);
249 249
         if ($certCount > 1) {
250
-            $out .= " " . sprintf(_("(%d times)"), $certCount);
250
+            $out .= " ".sprintf(_("(%d times)"), $certCount);
251 251
         }
252 252
         $out .= "</li>";
253
-        $out .= "<li>" . _("to enter the username and password you have been given by your organisation");
253
+        $out .= "<li>"._("to enter the username and password you have been given by your organisation");
254 254
         if ($ssidCount > 1) {
255
-            $out .= " " . sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
255
+            $out .= " ".sprintf(_("(%d times each, because %s is installed for %d SSIDs)"), $ssidCount, CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $ssidCount);
256 256
         }
257 257
         $out .= "</li>";
258 258
         $out .= "</ul>";
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         $retval .= "                <key>RoamingConsortiumOIs</key>
306 306
                 <array>";
307 307
 
308
-        $retval .= "<string>" . strtoupper($consortiumOi) . "</string>";
308
+        $retval .= "<string>".strtoupper($consortiumOi)."</string>";
309 309
 
310 310
         $retval .= "</array>";
311 311
         // this is an undocumented value found on the net. Does it do something useful?
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                   <dict>
347 347
                       <key>AcceptEAPTypes</key>
348 348
                          <array>
349
-                            <integer>" . $eapType['OUTER'] . "</integer>
349
+                            <integer>" . $eapType['OUTER']."</integer>
350 350
                          </array>
351 351
                       <key>EAPFASTProvisionPAC</key>
352 352
                             <true />
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 ";
360 360
         if ($realm !== NULL) {
361 361
             $retval .= "<key>OuterIdentity</key>
362
-                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8') . "</string>
362
+                                    <string>" . htmlspecialchars($realm, ENT_XML1, 'UTF-8')."</string>
363 363
 ";
364 364
         }
365 365
         $retval .= "<key>PayloadCertificateAnchorUUID</key>
@@ -383,11 +383,11 @@  discard block
 block discarded – undo
383 383
         $retval .= "
384 384
                          </array>";
385 385
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
386
-            $retval .= "<key>UserName</key><string>" . $this->clientCert["certObject"]->username . "</string>";
386
+            $retval .= "<key>UserName</key><string>".$this->clientCert["certObject"]->username."</string>";
387 387
         }
388 388
         $retval .= "
389 389
                       <key>TTLSInnerAuthentication</key>
390
-                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2") . "</string>
390
+                         <string>" . ($eapType['INNER'] == \core\common\EAP::NONE ? "PAP" : "MSCHAPv2")."</string>
391 391
                    </dict>";
392 392
         return $retval;
393 393
     }
@@ -407,9 +407,9 @@  discard block
 block discarded – undo
407 407
             // characters are still reversed, invert on use!
408 408
             $buffer .= "<string>Manual</string>
409 409
                   <key>ProxyServer</key>
410
-                  <string>" . strrev($serverAndPort[1]) . "</string>
410
+                  <string>" . strrev($serverAndPort[1])."</string>
411 411
                   <key>ProxyServerPort</key>
412
-                  <integer>" . strrev($serverAndPort[0]) . "</integer>
412
+                  <integer>" . strrev($serverAndPort[0])."</integer>
413 413
                   <key>ProxyPACFallbackAllowed</key>
414 414
                   <false/>";
415 415
         } else {
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                     throw new Exception("SSID must be a string!");
439 439
                 }
440 440
                 $escapedSSID = htmlspecialchars($toBeConfigured, ENT_XML1, 'UTF-8');
441
-                $payloadIdentifier = "wifi." . $this->serial;
441
+                $payloadIdentifier = "wifi.".$this->serial;
442 442
                 $payloadShortName = sprintf(_("SSID %s"), $escapedSSID);
443 443
                 $payloadName = sprintf(_("%s configuration for network name %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $escapedSSID);
444 444
                 $encryptionTypeString = "WPA";
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
                 $payloadIdentifier = "hs20.$toBeConfigured";
469 469
                 $knownOiName = array_search($toBeConfigured, CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']);
470 470
                 if ($knownOiName === FALSE) { // a custom RCOI as set by the IdP admin; do not use the term "eduroam" in that one!
471
-                    $knownOiName = $this->instName . " "._("Roaming Partner");
471
+                    $knownOiName = $this->instName." "._("Roaming Partner");
472 472
                 }
473 473
                 $payloadShortName = $knownOiName;
474 474
                 $payloadName = _("Passpoint roaming configuration ($knownOiName)");
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
                <key>PayloadDisplayName</key>
491 491
                   <string>$payloadShortName</string>
492 492
                <key>PayloadIdentifier</key>
493
-                  <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
493
+                  <string>".self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.$payloadIdentifier</string>
494 494
                <key>PayloadOrganization</key>
495
-                  <string>" . $this->massagedConsortium . ".1x-config.org</string>
495
+                  <string>".$this->massagedConsortium.".1x-config.org</string>
496 496
                <key>PayloadType</key>
497
-                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi") . ".managed</string>";
497
+                  <string>com.apple." . ($blocktype == MobileconfigSuperclass::NETWORK_BLOCK_TYPE_WIRED ? "firstactiveethernet" : "wifi").".managed</string>";
498 498
         $retval .= $this->proxySettings();
499 499
         $retval .= $setupModesString;
500 500
         if ($eapType['INNER'] == \core\common\EAP::NE_SILVERBULLET) {
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
         }
507 507
         $retval .= "
508 508
                <key>PayloadUUID</key>
509
-                  <string>" . \core\common\Entity::uuid() . "</string>
509
+                  <string>" . \core\common\Entity::uuid()."</string>
510 510
                <key>PayloadVersion</key>
511 511
                   <integer>1</integer>
512 512
                   $wifiNetworkIdentification</dict>";
@@ -536,15 +536,15 @@  discard block
 block discarded – undo
536 536
 	<key>IsHotspot</key>
537 537
 	<false/>
538 538
 	<key>PayloadDescription</key>
539
-	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</string>
539
+	<string>" . sprintf(_("This SSID should not be used after bootstrapping %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</string>
540 540
 	<key>PayloadDisplayName</key>
541
-	<string>" . _("Disabled WiFi network") . "</string>
541
+	<string>" . _("Disabled WiFi network")."</string>
542 542
 	<key>PayloadIdentifier</key>
543
-	<string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
543
+	<string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.$this->lang.wifi.disabled.$this->removeSerial</string>
544 544
 	<key>PayloadType</key>
545 545
 	<string>com.apple.wifi.managed</string>
546 546
 	<key>PayloadUUID</key>
547
-	<string>" . \core\common\Entity::uuid() . "</string>
547
+	<string>".\core\common\Entity::uuid()."</string>
548 548
 	<key>PayloadVersion</key>
549 549
 	<real>1</real>";
550 550
         $retval .= $this->proxySettings();
@@ -623,12 +623,12 @@  discard block
 block discarded – undo
623 623
         $mimeBlob = base64_encode($binaryBlob);
624 624
         $mimeFormatted = chunk_split($mimeBlob, 52, "\r\n");
625 625
         $payloadUUID = \core\common\Entity::uuid('', $mimeBlob);
626
-        $retArray = ["block" => "<dict>" .
626
+        $retArray = ["block" => "<dict>".
627 627
             // we don't include the import password. It's displayed on screen, and should be input by the user.
628 628
             // <key>Password</key>
629 629
             //   <string>" . $this->clientCert['password'] . "</string>
630 630
             "<key>PayloadCertificateFileName</key>
631
-                     <string>" . $this->massagedConsortium . ".pfx</string>
631
+                     <string>" . $this->massagedConsortium.".pfx</string>
632 632
                   <key>PayloadContent</key>
633 633
                      <data>
634 634
 $mimeFormatted
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
                   <key>PayloadDescription</key>
637 637
                      <string>MIME Base-64 encoded PKCS#12 Client Certificate</string>
638 638
                   <key>PayloadDisplayName</key>
639
-                     <string>" . _("eduroam user certificate") . "</string>
639
+                     <string>"._("eduroam user certificate")."</string>
640 640
                   <key>PayloadIdentifier</key>
641 641
                      <string>com.apple.security.pkcs12.$payloadUUID</string>
642 642
                   <key>PayloadType</key>
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
                   <key>PayloadVersion</key>
647 647
                      <integer>1</integer>
648 648
                 </dict>",
649
-            "UUID" => $payloadUUID,];
649
+            "UUID" => $payloadUUID, ];
650 650
         \core\common\Entity::outOfThePotatoes();
651 651
         return $retArray;
652 652
     }
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         }
666 666
         $expiryTime = new \DateTime($this->clientCert['certObject']->expiry);
667 667
         return "<key>RemovalDate</key>
668
-        <date>" . $expiryTime->format("Y-m-d") . "T" . $expiryTime->format("H:i:s") . "Z</date>";
668
+        <date>" . $expiryTime->format("Y-m-d")."T".$expiryTime->format("H:i:s")."Z</date>";
669 669
     }
670 670
 
671 671
     private $CAsAccountedFor = [];
@@ -689,27 +689,27 @@  discard block
 block discarded – undo
689 689
             $stream = "
690 690
             <dict>
691 691
                <key>PayloadCertificateFileName</key>
692
-               <string>" . $ca['uuid'] . ".der</string>
692
+               <string>" . $ca['uuid'].".der</string>
693 693
                <key>PayloadContent</key>
694 694
                <data>
695
-" . $trimmedPem . "</data>
695
+" . $trimmedPem."</data>
696 696
                <key>PayloadDescription</key>
697
-               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst) . "</string>
697
+               <string>" . sprintf(_("The %s Certification Authority"), \core\common\Entity::$nomenclature_inst)."</string>
698 698
                <key>PayloadDisplayName</key>
699 699
                <string>" . 
700 700
                     /// example: "Identity Provider CA #1 (Root)"
701
-                    sprintf(_("%s CA #%d (%s)" ), 
701
+                    sprintf(_("%s CA #%d (%s)"), 
702 702
                             \core\common\Entity::$nomenclature_inst, 
703
-                            count($this->CAsAccountedFor)+1, 
704
-                            ($ca['root'] ? _("Root") : _("Intermediate"))) . 
703
+                            count($this->CAsAccountedFor) + 1, 
704
+                            ($ca['root'] ? _("Root") : _("Intermediate"))). 
705 705
               "</string>
706 706
                <key>PayloadIdentifier</key>
707
-               <string>" . self::$iPhonePayloadPrefix . ".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
707
+               <string>" . self::$iPhonePayloadPrefix.".$this->massagedConsortium.$this->massagedCountry.$this->massagedInst.$this->massagedProfile.credential.$this->caSerial</string>
708 708
                <key>PayloadOrganization</key>
709
-               <string>" . $this->massagedConsortium . ".1x-config.org</string>
709
+               <string>".$this->massagedConsortium.".1x-config.org</string>
710 710
                <key>PayloadType</key>
711 711
                <string>com.apple.security.root</string>
712
-               <key>PayloadUUID</key><string>" . $ca['uuid'] . "</string>
712
+               <key>PayloadUUID</key><string>" . $ca['uuid']."</string>
713 713
                <key>PayloadVersion</key>
714 714
                <integer>1</integer>
715 715
             </dict>";
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,25 +599,25 @@  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
                             print "
604 604
                             running_ajax_dyn++;
605
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, error: eee, success: capath, dataType: 'json'}); 
605
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, error: eee, success: capath, dataType: 'json'}); 
606 606
                             running_ajax_dyn++;
607
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); 
607
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); 
608 608
                        ";
609 609
                         }
610 610
                         echo "}
611 611
               </script><hr>";
612 612
                     } else {
613
-                        echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
613
+                        echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>";
614 614
                     }
615
-                    echo "<strong>" . _("Static connectivity tests") . "</strong>
615
+                    echo "<strong>"._("Static connectivity tests")."</strong>
616 616
          <table><tr>
617 617
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_static_ico' class='icon'></td><td id='main_static_result' style='display:none'>&nbsp;</td>
618 618
          </tr></table>";
619 619
                     if ($naptr > 0) {
620
-                        echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong>
620
+                        echo "<hr><strong>"._("Dynamic connectivity tests")."</strong>
621 621
          <table><tr>
622 622
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_dynamic_ico' class='icon'></td><td id='main_dynamic_result' style='display:none'>&nbsp;</td>
623 623
          </tr></table>";
@@ -637,12 +637,12 @@  discard block
 block discarded – undo
637 637
                     print "<p>";
638 638
                     foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) {
639 639
                         print "<hr>";
640
-                        printf(_("Testing from: %s"), "<strong>" . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
640
+                        printf(_("Testing from: %s"), "<strong>".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name']."</strong>");
641 641
                         print "<table id='results$hostindex'  style='width:100%' class='udp_results'>
642 642
 <tr>
643
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td>
643
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td>
644 644
 <td id='src$hostindex' colspan=2>
645
-" . _("testing...") . "
645
+"._("testing...")."
646 646
 </td>
647 647
 </tr>
648 648
 </table>";
@@ -661,21 +661,21 @@  discard block
 block discarded – undo
661 661
 
662 662
                     <?php
663 663
                     echo "<div id='dynamic_tests'><fieldset class='option_container'>
664
-                <legend><strong>" . _("DYNAMIC connectivity tests") . "</strong></legend>";
664
+                <legend><strong>" . _("DYNAMIC connectivity tests")."</strong></legend>";
665 665
 
666 666
                     $resultstoprint = [];
667 667
                     if (count($rfc7585suite->NAPTR_hostname_records) > 0) {
668
-                        $resultstoprint[] = '<table style="align:right; display: none;" id="dynamic_result_fail">' . _("Some errors were found during the tests, see below") . '</table><table style="align:right; display: none;" id="dynamic_result_pass">' . _("All tests passed, congratulations!") . '</table>';
669
-                        $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>";
668
+                        $resultstoprint[] = '<table style="align:right; display: none;" id="dynamic_result_fail">'._("Some errors were found during the tests, see below").'</table><table style="align:right; display: none;" id="dynamic_result_pass">'._("All tests passed, congratulations!").'</table>';
669
+                        $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>";
670 670
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
671
-                            $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]);
672
-                            $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong>';
671
+                            $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]);
672
+                            $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong>';
673 673
                             $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>';
674 674
                             $resultstoprint[] = "<table id='caresults$hostindex'  style='width:100%'>
675 675
 <tr>
676
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca" . $hostindex . "_img'></td>
676
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca".$hostindex."_img'></td>
677 677
 <td id='srcca$hostindex'>
678
-" . _("testing...") . "
678
+"._("testing...")."
679 679
 </td>
680 680
 </tr>
681 681
 </table>";
@@ -683,12 +683,12 @@  discard block
 block discarded – undo
683 683
                         }
684 684
                         $clientstest = [];
685 685
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
686
-                            $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>';
686
+                            $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>';
687 687
                             $clientstest[] = "<span id='clientresults$hostindex$clinx'><table style='width:100%'>
688 688
 <tr>
689
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient" . $hostindex . "_img'></td>
689
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient".$hostindex."_img'></td>
690 690
 <td id='srcclient$hostindex'>
691
-" . _("testing...") . "
691
+"._("testing...")."
692 692
 </td>
693 693
 </tr>
694 694
 </table></span>";
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
                         }
697 697
                         echo '<div style="align:right;">';
698 698
                         echo join('', $resultstoprint);
699
-                        echo '<span id="clientstest" style="display: none;"><p><hr><b>' . _('Checking if certificates from  CAs are accepted...') . '</b><p>' . _('A few client certificates will be tested to check if servers are resistant to some certificate problems.') . '<p>';
699
+                        echo '<span id="clientstest" style="display: none;"><p><hr><b>'._('Checking if certificates from  CAs are accepted...').'</b><p>'._('A few client certificates will be tested to check if servers are resistant to some certificate problems.').'<p>';
700 700
                         print join('', $clientstest);
701 701
                         echo '</span>';
702 702
                         echo '</div>';
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
                 //     check if truncates/dies on Operator-Name
711 711
                 if ($my_profile !== NULL) {
712 712
                     echo "<div id='tabs-4'><fieldset class='option_container'>
713
-                <legend><strong>" . _("Live login test") . "</strong></legend>";
713
+                <legend><strong>" . _("Live login test")."</strong></legend>";
714 714
                     $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1);
715 715
                     if (count($prof_compl) > 0) {
716 716
                         $passwordReqired = FALSE;
@@ -723,34 +723,34 @@  discard block
 block discarded – undo
723 723
                                 $clientCertRequired = TRUE;
724 724
                             }
725 725
                         }
726
-                        echo "<div id='disposable_credential_container'><p>" . _("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.") . "</p>
727
-                    <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.") . "</p>
728
-                    <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!") . "</p></div>
726
+                        echo "<div id='disposable_credential_container'><p>"._("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.")."</p>
727
+                    <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.")."</p>
728
+                    <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!")."</p></div>
729 729
                     <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'>
730 730
                     <input type='hidden' name='test_type' value='udp_login'>
731
-                    <input type='hidden' name='lang' value='" . $gui->langObject->getLang() . "'>
732
-                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'>
731
+                    <input type='hidden' name='lang' value='" . $gui->langObject->getLang()."'>
732
+                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'>
733 733
                     <table id='live_tests'>";
734 734
 // if any password based EAP methods are available enable this section
735 735
                         if ($passwordReqired) {
736
-                            echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr>
737
-                        <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
738
-                            echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
739
-                            echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
736
+                            echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr>
737
+                        <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
738
+                            echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
739
+                            echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
740 740
                         }
741 741
                         // ask for cert + privkey if TLS-based method is active
742 742
                         if ($clientCertRequired) {
743
-                            echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr>
744
-                        <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
745
-                        <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
746
-                        <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
743
+                            echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr>
744
+                        <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
745
+                        <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
746
+                        <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
747 747
                         }
748
-                        echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>";
748
+                        echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>";
749 749
                         echo "<div id='live_login_results' style='display:none'>";
750 750
                         foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) {
751 751
                             print "<hr>";
752
-                            printf(_("Testing from: %s"), "<strong>" . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
753
-                            print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src" . $hostindex . "_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>";
752
+                            printf(_("Testing from: %s"), "<strong>".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name']."</strong>");
753
+                            print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src".$hostindex."_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>";
754 754
                             print "<div id='eap_test$hostindex' class='eap_test_results'></div>";
755 755
                         }
756 756
                         echo "</div>";
@@ -765,9 +765,9 @@  discard block
 block discarded – undo
765 765
             }
766 766
 
767 767
             if (isset($_POST['comefrom'])) {
768
-                $return = htmlspecialchars_decode($_POST['comefrom']) . "?inst_id=" . $my_inst->identifier;
768
+                $return = htmlspecialchars_decode($_POST['comefrom'])."?inst_id=".$my_inst->identifier;
769 769
                 echo "<form method='post' action='$return' accept-charset='UTF-8'>
770
-                    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst) . "</button>"
770
+                    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst)."</button>"
771 771
                 . "</form>";
772 772
             }
773 773
             if ($check_realm !== FALSE) {
Please login to merge, or discard this patch.