Passed
Push — master ( b32147...6275ed )
by Maja
06:20
created
web/admin/overview_user.php 1 patch
Spacing   +16 added lines, -16 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\Master::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\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
84 84
             $target = "https://wiki.geant.org/x/SSNwBg"; // 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->nomenclatureParticipant) . "</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->nomenclatureParticipant)."</h2>";
96 96
         $instlist = [];
97 97
         $my_idps = [];
98 98
         $myFeds = [];
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     <?php
137 137
     foreach ($myFeds as $fed_id => $fed_name) {
138 138
 /// nomenclature 'fed', fed name, nomenclature 'inst'
139
-        echo "<tr><td colspan='4'><strong>" . sprintf(_("%s %s: %s list"), $uiElements->nomenclatureFed, $fed_name, $uiElements->nomenclatureParticipant) . "</strong></td></tr>";
139
+        echo "<tr><td colspan='4'><strong>".sprintf(_("%s %s: %s list"), $uiElements->nomenclatureFed, $fed_name, $uiElements->nomenclatureParticipant)."</strong></td></tr>";
140 140
 
141 141
         $fedOrganisations = $my_idps[$fed_id];
142 142
         asort($fedOrganisations);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             $the_inst = $oneinst['object'];
146 146
 
147 147
             echo "<tr>"
148
-            . "<td>" . $oneinst['name'] . "</td>";
148
+            . "<td>".$oneinst['name']."</td>";
149 149
             echo "<td>";
150 150
             $admins = $the_inst->listOwners();
151 151
             $blessedUser = FALSE;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                     $coadmin = new \core\User($username['ID']);
155 155
                     $coadmin_name = $coadmin->getAttributes('user:realname');
156 156
                     if (count($coadmin_name) > 0) {
157
-                        echo $coadmin_name[0]['value'] . "<br/>";
157
+                        echo $coadmin_name[0]['value']."<br/>";
158 158
                         unset($admins[$number]);
159 159
                     }
160 160
                 } else { // don't list self
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             echo "</td><td>"; // danger zone 
201 201
             ?>
202 202
             <form action='edit_participant_result.php?inst_id=<?php echo $the_inst->identifier; ?>' method='post' accept-charset='UTF-8'>
203
-                <button class='delete' type='submit' name='submitbutton' value='<?php echo \web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo ( \config\ConfAssistant::CONSORTIUM['selfservice_registration'] === NULL ? sprintf(_("After deleting the %s, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclatureInst, $uiElements->nomenclatureFed) . " " : "" ) . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclatureParticipant, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclatureParticipant); ?></button>
203
+                <button class='delete' type='submit' name='submitbutton' value='<?php echo \web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo (\config\ConfAssistant::CONSORTIUM['selfservice_registration'] === NULL ? sprintf(_("After deleting the %s, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclatureInst, $uiElements->nomenclatureFed)." " : "").sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclatureParticipant, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclatureParticipant); ?></button>
204 204
             </form>
205 205
             <form action='edit_participant_result.php?inst_id=<?php echo $the_inst->identifier; ?>' method='post' accept-charset='UTF-8'>
206 206
                 <button class='delete' type='submit' name='submitbutton' value='<?php echo \web\lib\common\FormElements::BUTTON_FLUSH_AND_RESTART; ?>' onclick="return confirm('<?php echo sprintf(_("This action will delete all properties of the %s and start over the configuration from scratch. Do you really want to reset all settings of the %s %s?"), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureParticipant, $my_inst->name); ?>')"><?php echo sprintf(_("Reset all %s settings"), $uiElements->nomenclatureParticipant); ?></button>
@@ -211,18 +211,18 @@  discard block
 block discarded – undo
211 211
     }
212 212
     echo "</table>";
213 213
 } else {
214
-    echo "<h2>" . sprintf(_("You are not managing any %s."), $uiElements->nomenclatureInst) . "</h2>";
214
+    echo "<h2>".sprintf(_("You are not managing any %s."), $uiElements->nomenclatureInst)."</h2>";
215 215
 }
216 216
 if (\config\Master::DB['INST']['readonly'] === FALSE) {
217 217
     if (\config\ConfAssistant::CONSORTIUM['selfservice_registration'] === NULL) {
218
-        echo "<p>" . sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant) . "</p>";
218
+        echo "<p>".sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant)."</p>";
219 219
         echo "<hr/>
220 220
              <div style='white-space: nowrap;'>
221 221
                 <form action='action_enrollment.php' method='get' accept-charset='UTF-8'>" .
222
-        sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureParticipant) .
222
+        sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureParticipant).
223 223
         "        <input type='text' id='token' name='token'/>
224 224
                     <button type='submit'>" .
225
-        _("Go!") . "
225
+        _("Go!")."
226 226
                     </button>
227 227
                 </form>
228 228
              </div>";
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
             <div style='white-space: nowrap;'>
232 232
         <form action='action_enrollment.php' method='get'><button type='submit' accept-charset='UTF-8'>
233 233
                 <input type='hidden' id='token' name='token' value='SELF-REGISTER'/>" .
234
-        sprintf(_("New %s Registration"), $uiElements->nomenclatureParticipant) . "
234
+        sprintf(_("New %s Registration"), $uiElements->nomenclatureParticipant)."
235 235
             </button>
236 236
         </form>
237 237
         </div>";
Please login to merge, or discard this patch.
web/admin/edit_participant_result.php 1 patch
Spacing   +14 added lines, -14 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
 $loggerInstance = new \core\common\Logging();
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     $instId = $my_inst->identifier;
35 35
     // delete the IdP and send user to enrollment
36 36
     $my_inst->destroy();
37
-    $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP " . $instId);
37
+    $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP ".$instId);
38 38
     header("Location: overview_user.php");
39 39
     exit;
40 40
 }
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     }
51 51
     // flush all IdP attributes and send user to creation wizard
52 52
     $my_inst->flushAttributes();
53
-    $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over" . $instId);
53
+    $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over".$instId);
54 54
     header("Location: edit_participant.php?inst_id=$instId&wizard=true");
55 55
     exit;
56 56
 }
@@ -72,21 +72,21 @@  discard block
 block discarded – undo
72 72
 }
73 73
 
74 74
 $inst_name = $my_inst->name;
75
-echo "<h1>" . sprintf(_("Submitted attributes for IdP '%s'"), $inst_name) . "</h1>";
75
+echo "<h1>".sprintf(_("Submitted attributes for IdP '%s'"), $inst_name)."</h1>";
76 76
 echo "<table>";
77 77
 echo $optionParser->processSubmittedFields($my_inst, $_POST, $_FILES);
78 78
 echo "</table>";
79 79
 
80 80
 // delete cached logo, if present
81
-$dir = ROOT . '/web/downloads/logos/';
82
-$globResult = glob($dir . $my_inst->identifier . "_*.png");
81
+$dir = ROOT.'/web/downloads/logos/';
82
+$globResult = glob($dir.$my_inst->identifier."_*.png");
83 83
 if ($globResult === FALSE) { // we should catch the improbable error condition
84 84
     $globResult = [];
85 85
 }
86 86
 array_map('unlink', $globResult);
87 87
 $loggerInstance->debug(4, "UNLINK from $dir\n");
88 88
 
89
-$loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP " . $my_inst->identifier . " - attributes changed");
89
+$loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP ".$my_inst->identifier." - attributes changed");
90 90
 
91 91
 // re-instantiate ourselves... profiles need fresh data
92 92
 
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
 
99 99
 if (isset(\config\ConfAssistant::CONSORTIUM['ssid']) && count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0) {
100 100
     foreach (\config\ConfAssistant::CONSORTIUM['ssid'] as $ssidname) {
101
-        $ssids[] = $ssidname . " " . (isset(\config\ConfAssistant::CONSORTIUM['tkipsupport']) && \config\ConfAssistant::CONSORTIUM['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)") );
101
+        $ssids[] = $ssidname." ".(isset(\config\ConfAssistant::CONSORTIUM['tkipsupport']) && \config\ConfAssistant::CONSORTIUM['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)"));
102 102
     }
103 103
 }
104 104
 
105 105
 foreach ($my_inst->getAttributes("media:SSID_with_legacy") as $ssidname) {
106
-    $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES and WPA/TKIP)");
106
+    $ssids[] = $ssidname['value']." "._("(WPA2/AES and WPA/TKIP)");
107 107
 }
108 108
 foreach ($my_inst->getAttributes("media:SSID") as $ssidname) {
109
-    $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES)");
109
+    $ssids[] = $ssidname['value']." "._("(WPA2/AES)");
110 110
 }
111 111
 
112 112
 echo "<table>";
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 if (count($ssids) > 0) {
115 115
     $printedlist = "";
116 116
     foreach ($ssids as $names) {
117
-        $printedlist = $printedlist . "$names ";
117
+        $printedlist = $printedlist."$names ";
118 118
     }
119 119
     echo $uiElements->boxOkay(sprintf(_("Your installers will configure the following SSIDs: <strong>%s</strong>"), $printedlist), _("SSIDs configured"));
120 120
 }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         // did we get an email address? then, show the silverbullet jumpstart button
143 143
         // otherwise, issue a smartass comment
144 144
         if (count($my_inst->getAttributes("support:email")) > 0) {
145
-            echo "<form method='post' action='edit_silverbullet.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME) . "</button></form>";
145
+            echo "<form method='post' action='edit_silverbullet.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>".sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME)."</button></form>";
146 146
         } else {
147 147
             echo "<table>";
148 148
             echo $uiElements->boxError(sprintf(_("You did not submit an e-mail address. This is required for %s. Please go to the %s dashboard and edit your helpdesk settings to include a helpdesk e-mail address."), core\ProfileSilverbullet::PRODUCTNAME, $ui->nomenclatureInst), _("No support e-mail!"));
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
         }
151 151
     }
152 152
     if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == "LOCAL") {
153
-        echo "<br/><form method='post' action='edit_profile.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to RADIUS/EAP profile definition") . "</button></form>";
153
+        echo "<br/><form method='post' action='edit_profile.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to RADIUS/EAP profile definition")."</button></form>";
154 154
     }
155 155
 }
156
-echo "<br/><form method='post' action='overview_user.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to dashboard") . "</button></form>";
156
+echo "<br/><form method='post' action='overview_user.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to dashboard")."</button></form>";
157 157
 
158 158
 echo $deco->footer();
Please login to merge, or discard this patch.
core/UserAPI.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $this->installerPath = $cache['path'];
84 84
         if ($this->installerPath !== NULL && $token === NULL && $password === NULL) {
85 85
             $this->loggerInstance->debug(4, "Using cached installer for: $device\n");
86
-            $installerProperties['link'] = "API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=$profileId&device=$device&generatedfor=$generatedFor";
86
+            $installerProperties['link'] = "API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=$profileId&device=$device&generatedfor=$generatedFor";
87 87
             $installerProperties['mime'] = $cache['mime'];
88 88
         } else {
89 89
             $myInstaller = $this->generateNewInstaller($device, $profile, $generatedFor, $token, $password);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             $this->loggerInstance->debug(5, "generateNewInstaller() - Device setup done");
172 172
             $installer = $dev->writeInstaller();
173 173
             $this->loggerInstance->debug(5, "generateNewInstaller() - writeInstaller complete");
174
-            $iPath = $dev->FPATH . '/tmp/' . $installer;
174
+            $iPath = $dev->FPATH.'/tmp/'.$installer;
175 175
             if ($iPath && is_file($iPath)) {
176 176
                 if (isset($dev->options['mime'])) {
177 177
                     $out['mime'] = $dev->options['mime'];
@@ -179,17 +179,17 @@  discard block
 block discarded – undo
179 179
                     $info = new \finfo();
180 180
                     $out['mime'] = $info->file($iPath, FILEINFO_MIME_TYPE);
181 181
                 }
182
-                $this->installerPath = $dev->FPATH . '/' . $installer;
182
+                $this->installerPath = $dev->FPATH.'/'.$installer;
183 183
                 rename($iPath, $this->installerPath);
184 184
                 $integerEap = (new \core\common\EAP($dev->selectedEap))->getIntegerRep();
185 185
                 $profile->updateCache($device, $this->installerPath, $out['mime'], $integerEap);
186 186
                 if (\config\Master::DEBUG_LEVEL < 4) {
187
-                    \core\common\Entity::rrmdir($dev->FPATH . '/tmp');
187
+                    \core\common\Entity::rrmdir($dev->FPATH.'/tmp');
188 188
                 }
189
-                $this->loggerInstance->debug(4, "Generated installer: " . $this->installerPath . ": for: $device, EAP:" . $integerEap . "\n");
190
-                $out['link'] = "API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=" . $profile->identifier . "&device=$device&generatedfor=$generatedFor";
189
+                $this->loggerInstance->debug(4, "Generated installer: ".$this->installerPath.": for: $device, EAP:".$integerEap."\n");
190
+                $out['link'] = "API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=".$profile->identifier."&device=$device&generatedfor=$generatedFor";
191 191
             } else {
192
-                $this->loggerInstance->debug(2, "Installer generation failed for: " . $profile->identifier . ":$device:" . $this->languageInstance->getLang() . "\n");
192
+                $this->loggerInstance->debug(2, "Installer generation failed for: ".$profile->identifier.":$device:".$this->languageInstance->getLang()."\n");
193 193
                 $out['link'] = 0;
194 194
             }
195 195
         }
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
         $file = $this->installerPath;
303 303
         $filetype = $output['mime'];
304 304
         $this->loggerInstance->debug(4, "installer MIME type:$filetype\n");
305
-        header("Content-type: " . $filetype);
306
-        header('Content-Disposition: inline; filename="' . basename($file) . '"');
307
-        header('Content-Length: ' . filesize($file));
305
+        header("Content-type: ".$filetype);
306
+        header('Content-Disposition: inline; filename="'.basename($file).'"');
307
+        header('Content-Length: '.filesize($file));
308 308
         ob_clean();
309 309
         flush();
310 310
         readfile($file);
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
         $filetype = $info->buffer($inputImage, FILEINFO_MIME_TYPE);
326 326
         $offset = 60 * 60 * 24 * 30;
327 327
         // gmdate cannot fail here - time() is its default argument (and integer), and we are adding an integer to it
328
-        $expiresString = "Expires: " . /** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
328
+        $expiresString = "Expires: "./** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset)." GMT";
329 329
         $blob = $inputImage;
330 330
 
331 331
         if ($resize === TRUE) {
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
         $filetype = 'image/png'; // default, only one code path where it can become different
381 381
         list($width, $height, $resize) = $this->testForResize($widthIn, $heightIn);
382 382
         if ($resize) {
383
-            $logoFile = ROOT . '/web/downloads/logos/' . $identifier . '_' . $width . '_' . $height . '.png';
383
+            $logoFile = ROOT.'/web/downloads/logos/'.$identifier.'_'.$width.'_'.$height.'.png';
384 384
         }
385 385
         if (is_file($logoFile)) { // $logoFile could be an empty string but then we will get a FALSE
386 386
             $this->loggerInstance->debug(4, "Using cached logo $logoFile for: $identifier\n");
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
             if (!isset($device['match'])) {
474 474
                 continue;
475 475
             }
476
-            if (preg_match('/' . $device['match'] . '/', $browser)) {
476
+            if (preg_match('/'.$device['match'].'/', $browser)) {
477 477
                 return $this->returnDevice($devId, $device);
478 478
             }
479 479
         }
Please login to merge, or discard this patch.
core/Options.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -142,17 +142,17 @@  discard block
 block discarded – undo
142 142
         foreach (array_keys($this->typeDb) as $name) {
143 143
             if ($className === 0) {
144 144
                 $tempArray[] = $name;
145
-            } elseif (preg_match('/^' . $className . ':/', $name) > 0) {
145
+            } elseif (preg_match('/^'.$className.':/', $name) > 0) {
146 146
                 $tempArray[] = $name;
147 147
             }
148 148
         }
149 149
         $returnArray = $tempArray;
150 150
         // remove silverbullet-specific options if this deployment is not SB
151 151
         foreach ($tempArray as $key => $val) {
152
-            if (( \config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] != 'LOCAL') && (preg_match('/^fed:silverbullet/', $val) > 0)) {
152
+            if ((\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] != 'LOCAL') && (preg_match('/^fed:silverbullet/', $val) > 0)) {
153 153
                 unset($returnArray[$key]);
154 154
             }
155
-            if (( \config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] != 'LOCAL') && (preg_match('/^fed:minted_ca_file/', $val) > 0)) {
155
+            if ((\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] != 'LOCAL') && (preg_match('/^fed:minted_ca_file/', $val) > 0)) {
156 156
                 unset($returnArray[$key]);
157 157
             }
158 158
         }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         if (isset($this->typeDb[$optionname])) {
173 173
             return $this->typeDb[$optionname];
174 174
         }
175
-        throw new Exception("Metadata about an option was requested, but the option name does not exist in the system: " . htmlentities($optionname));
175
+        throw new Exception("Metadata about an option was requested, but the option name does not exist in the system: ".htmlentities($optionname));
176 176
     }
177 177
 
178 178
     /**
Please login to merge, or discard this patch.
core/common/Entity.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      */
109 109
     public function __construct() {
110 110
         $this->loggerInstance = new Logging();
111
-        $this->loggerInstance->debug(3, "--- BEGIN constructing class " . get_class($this) . " .\n");
111
+        $this->loggerInstance->debug(3, "--- BEGIN constructing class ".get_class($this)." .\n");
112 112
         $this->languageInstance = new Language();
113 113
         Entity::intoThePotatoes();
114 114
         // some config elements are displayable. We need some dummies to 
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
         $dummy_organisation2a = _("organization");
128 128
         $dummy_organisation3 = _("entity");
129 129
         // and do something useless with the strings so that there's no "unused" complaint
130
-        if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3 . $dummy_hotspot1 . $dummy_hotspot2 . $dummy_hotspot3 . $dummy_organisation1 . $dummy_organisation2 . $dummy_organisation2a . $dummy_organisation3) < 0) {
130
+        if (strlen($dummy_NRO.$dummy_inst1.$dummy_inst2.$dummy_inst3.$dummy_hotspot1.$dummy_hotspot2.$dummy_hotspot3.$dummy_organisation1.$dummy_organisation2.$dummy_organisation2a.$dummy_organisation3) < 0) {
131 131
             throw new Exception("Strings are usually not shorter than 0 characters. We've encountered a string blackhole.");
132 132
         }
133
-        $xyzVariableFed = \config\ConfAssistant::CONSORTIUM['nomenclature_federation'] . "";
134
-        $xyzVariableInst = \config\ConfAssistant::CONSORTIUM['nomenclature_institution'] . "";
135
-        $xyzVariableHotspot = \config\ConfAssistant::CONSORTIUM['nomenclature_hotspot'] . "";
136
-        $xyzVariableParticipant = \config\ConfAssistant::CONSORTIUM['nomenclature_participant'] . "";
133
+        $xyzVariableFed = \config\ConfAssistant::CONSORTIUM['nomenclature_federation']."";
134
+        $xyzVariableInst = \config\ConfAssistant::CONSORTIUM['nomenclature_institution']."";
135
+        $xyzVariableHotspot = \config\ConfAssistant::CONSORTIUM['nomenclature_hotspot']."";
136
+        $xyzVariableParticipant = \config\ConfAssistant::CONSORTIUM['nomenclature_participant']."";
137 137
         Entity::$nomenclature_fed = _($xyzVariableFed);
138 138
         Entity::$nomenclature_inst = _($xyzVariableInst);
139 139
         Entity::$nomenclature_hotspot = _($xyzVariableHotspot);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
      * Logs the end of lifetime of the entity to the debug log on level 5.
149 149
      */
150 150
     public function __destruct() {
151
-        (new Logging())->debug(5, "--- KILL Destructing class " . get_class($this) . " .\n");
151
+        (new Logging())->debug(5, "--- KILL Destructing class ".get_class($this)." .\n");
152 152
     }
153 153
 
154 154
     /**
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      */
180 180
     public static function createTemporaryDirectory($purpose = 'installer', $failIsFatal = 1) {
181 181
         $loggerInstance = new Logging();
182
-        $name = md5(time() . rand());
182
+        $name = md5(time().rand());
183 183
         $path = ROOT;
184 184
         switch ($purpose) {
185 185
             case 'silverbullet':
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
             default:
198 198
                 throw new Exception("unable to create temporary directory due to unknown purpose: $purpose\n");
199 199
         }
200
-        $tmpDir = $path . '/' . $name;
200
+        $tmpDir = $path.'/'.$name;
201 201
         $loggerInstance->debug(4, "temp dir: $purpose : $tmpDir\n");
202 202
         if (!mkdir($tmpDir, 0700, true)) {
203 203
             if ($failIsFatal) {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      * @return void
218 218
      */
219 219
     public static function rrmdir($dir) {
220
-        foreach (glob($dir . '/*') as $file) {
220
+        foreach (glob($dir.'/*') as $file) {
221 221
             if (is_dir($file)) {
222 222
                 Entity::rrmdir($file);
223 223
             } else {
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
         }
243 243
         // these substr() are guaranteed to yield actual string data, as the
244 244
         // base string is an MD5 hash - has sufficient length
245
-        $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8) . '-';
246
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4) . '-';
247
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4) . '-';
248
-        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4) . '-';
245
+        $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8).'-';
246
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4).'-';
247
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4).'-';
248
+        $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4).'-';
249 249
         $uuid .= /** @scrutinizer ignore-type */ substr($chars, 20, 12);
250
-        return $prefix . $uuid;
250
+        return $prefix.$uuid;
251 251
     }
252 252
 
253 253
     /**
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
         // if called from a class, guess based on the class name; 
293 293
         // otherwise, on the filename relative to ROOT
294 294
         $myName = $caller['class'] ?? substr($caller['file'], strlen(ROOT));
295
-        $loggerInstance->debug(1,$caller);
296
-        $loggerInstance->debug(1,"\nFOUND ".$myName."\n");
295
+        $loggerInstance->debug(1, $caller);
296
+        $loggerInstance->debug(1, "\nFOUND ".$myName."\n");
297 297
         if (preg_match("/diag/", $myName) == 1) {
298 298
             $ret = "diagnostics";
299 299
         } elseif (preg_match("/core/", $myName) == 1) {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         } else {
308 308
             $ret = "web_user";
309 309
         }
310
-        $loggerInstance->debug(1,"\nRETURNING ".$ret."\n");
310
+        $loggerInstance->debug(1, "\nRETURNING ".$ret."\n");
311 311
         return $ret;
312 312
     }
313 313
 
@@ -325,10 +325,10 @@  discard block
 block discarded – undo
325 325
         if ($catalogue === NULL) {
326 326
             $theCatalogue = Entity::determineOwnCatalogue();
327 327
             textdomain($theCatalogue);
328
-            bindtextdomain($theCatalogue, ROOT . "/translation/");
328
+            bindtextdomain($theCatalogue, ROOT."/translation/");
329 329
         } else {
330 330
             textdomain($catalogue);
331
-            bindtextdomain($catalogue, ROOT . "/translation/");
331
+            bindtextdomain($catalogue, ROOT."/translation/");
332 332
         }
333 333
     }
334 334
 
Please login to merge, or discard this patch.
config/_config.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
  */
22 22
 
23 23
 require_once "autoloader.php";
24
-require_once __DIR__ . "/../packageRoot.php";
24
+require_once __DIR__."/../packageRoot.php";
25 25
 
26 26
 // enable Composer autoloader, if exists
27
-if (file_exists(__DIR__ . "/../vendor/autoload.php") !== FALSE) {
28
-    include_once __DIR__ . "/../vendor/autoload.php";
27
+if (file_exists(__DIR__."/../vendor/autoload.php") !== FALSE) {
28
+    include_once __DIR__."/../vendor/autoload.php";
29 29
 }
30 30
 
31
-if (!file_exists(ROOT . "/config/Master.php")) {
31
+if (!file_exists(ROOT."/config/Master.php")) {
32 32
     echo "Master configuration file not found. You need to configure the product! At least config/Master.php is required!";
33 33
     throw new Exception("Master config file not found!");
34 34
 }
@@ -36,14 +36,14 @@  discard block
 block discarded – undo
36 36
 /* load sub-configs if we are dealing with those in this installation */
37 37
 
38 38
 if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == 'LOCAL' || \config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == 'LOCAL') {
39
-    if (!file_exists(ROOT . "/config/ConfAssistant.php")) {
39
+    if (!file_exists(ROOT."/config/ConfAssistant.php")) {
40 40
         echo "ConfAssistant configuration file not found. You need to configure the product!";
41 41
         throw new Exception("ConfAssistant config file not found!");
42 42
     }
43 43
 }
44 44
 
45 45
 if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == 'LOCAL') {
46
-    if (!file_exists(ROOT . "/config/Diagnostics.php")) {
46
+    if (!file_exists(ROOT."/config/Diagnostics.php")) {
47 47
         echo "Diagnostics configuration file not found. You need to configure the product!";
48 48
         throw new Exception("Diagnostics config file not found!");
49 49
     }
Please login to merge, or discard this patch.
core/IdP.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
         $this->name = $this->languageInstance->getLocalisedValue($this->getAttributes('general:instname'));
114 114
         $eligibility = $this->eligibility();
115 115
         if (in_array(IdP::ELIGIBILITY_IDP, $eligibility) && in_array(IdP::ELIGIBILITY_SP, $eligibility)) {
116
-            $eligType = IdP::TYPE_IDPSP . "";
116
+            $eligType = IdP::TYPE_IDPSP."";
117 117
             $this->type = $eligType;
118 118
         } elseif (in_array(IdP::ELIGIBILITY_IDP, $eligibility)) {
119
-            $eligType = IdP::TYPE_IDP . "";
119
+            $eligType = IdP::TYPE_IDP."";
120 120
         } else {
121
-            $eligType = IdP::TYPE_SP . "";
121
+            $eligType = IdP::TYPE_SP."";
122 122
         }
123 123
         $this->type = $eligType;
124 124
         $this->loggerInstance->debug(3, "--- END Constructing new IdP object ... ---\n");
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      * @return \core\AbstractProfile[] list of Profiles of this IdP
132 132
      */
133 133
     public function listProfiles(bool $activeOnly = FALSE) {
134
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
134
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "");
135 135
         $allProfiles = $this->databaseHandle->exec($query);
136 136
         $returnarray = [];
137 137
         // SELECT -> resource, not boolean
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             $returnarray[] = $oneProfile;
142 142
         }
143 143
 
144
-        $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true));
144
+        $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true));
145 145
         return $returnarray;
146 146
     }
147 147
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      * @return \core\AbstractDeployment[] list of deployments of this IdP
153 153
      */
154 154
     public function listDeployments(bool $activeOnly = FALSE) {
155
-        $query = "SELECT deployment_id FROM deployment WHERE inst_id = $this->identifier" . ($activeOnly ? " AND status = " . AbstractDeployment::ACTIVE : "");
155
+        $query = "SELECT deployment_id FROM deployment WHERE inst_id = $this->identifier".($activeOnly ? " AND status = ".AbstractDeployment::ACTIVE : "");
156 156
         $allDeployments = $this->databaseHandle->exec($query);
157 157
         $returnarray = [];
158 158
         // SELECT -> resource, not boolean
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             $returnarray[] = new DeploymentManaged($this, $deploymentQuery->deployment_id);
161 161
         }
162 162
 
163
-        $this->loggerInstance->debug(4, "listDeployments: " . print_r($returnarray, true));
163
+        $this->loggerInstance->debug(4, "listDeployments: ".print_r($returnarray, true));
164 164
         return $returnarray;
165 165
     }
166 166
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
295 295
                     $theProfile = new ProfileSilverbullet($identifier, $this);
296 296
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
297
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(\config\ConfAssistant::SILVERBULLET['realm_suffix']));
297
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(\config\ConfAssistant::SILVERBULLET['realm_suffix']));
298 298
                     return $theProfile;
299 299
                 default:
300 300
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
      */
431 431
     public function getExternalDBId() {
432 432
         if (\config\ConfAssistant::CONSORTIUM['name'] == "eduroam" && isset(\config\ConfAssistant::CONSORTIUM['deployment-voodoo']) && \config\ConfAssistant::CONSORTIUM['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
433
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
433
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
434 434
             // SELECT -> it's a resource, not a boolean
435 435
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
436 436
                 return FALSE;
Please login to merge, or discard this patch.
web/user/faq.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     ],
46 46
     [
47 47
         'title' => sprintf(_("Is it safe to use %s installers?"), \config\Master::APPEARANCE['productname']),
48
-        'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Master::APPEARANCE['productname']) . ' ' . ( isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Master::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""),
48
+        'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Master::APPEARANCE['productname']).' '.(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Master::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""),
49 49
     ],
50 50
     [
51 51
         'title' => _("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"),
52
-        'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.") . " " . (isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name']) . " " : "") . sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>")
52
+        'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.")." ".(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name'])." " : "").sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>")
53 53
     ],
54 54
     [
55 55
         'title' => sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"), \config\ConfAssistant::CONSORTIUM['display_name']),
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 $consortium = \config\ConfAssistant::CONSORTIUM['display_name'];
69 69
 array_push($Faq,
70 70
         [
71
-            'id' => 'what_is_' . \config\ConfAssistant::CONSORTIUM['name'],
71
+            'id' => 'what_is_'.\config\ConfAssistant::CONSORTIUM['name'],
72 72
             'title' => sprintf(_("What is this %s thing anyway?"), $consortium),
73 73
             'text' => sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than %d hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> or <a href='http://monitor.eduroam.org/map_service_loc.php'>the %s location map</a> for more details."), $consortium, $consortium, $consortium, count($SPs), $consortium, $consortium)
74 74
 ]);
Please login to merge, or discard this patch.
core/ExternalEduroamDBData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
135 135
         $returnarray = [];
136 136
         $query = "SELECT id_institution AS id, country, inst_realm as realmlist, name AS collapsed_name, contact AS collapsed_contact, type FROM view_active_institution WHERE country = ?";
137 137
         if ($eduroamDbType !== NULL) {
138
-            $query .= " AND ( type = '" . ExternalEduroamDBData::TYPE_IDPSP . "' OR type = '" . $eduroamDbType . "')";
138
+            $query .= " AND ( type = '".ExternalEduroamDBData::TYPE_IDPSP."' OR type = '".$eduroamDbType."')";
139 139
         }
140 140
         $externals = $this->db->exec($query, "s", $tld);
141 141
         // was a SELECT query, so a resource and not a boolean
Please login to merge, or discard this patch.