Passed
Push — release_2_0 ( ad4f46...9cb9bf )
by Stefan
12:09
created
web/admin/overview_federation.php 1 patch
Spacing   +23 added lines, -23 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
 $deco = new \web\lib\admin\PageDecoration();
25 25
 $uiElements = new web\lib\admin\UIElements();
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             <?php echo $uiElements->infoblock($user->getAttributes(), "user", "User"); ?>
48 48
             <tr>
49 49
                 <td>
50
-                    <?php echo "" . _("Unique Identifier") ?>
50
+                    <?php echo ""._("Unique Identifier") ?>
51 51
                 </td>
52 52
                 <td>
53 53
                 </td>
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     $mgmt = new \core\UserManagement();
63 63
 
64 64
     if (!$user->isFederationAdmin()) {
65
-        echo "<p>" . sprintf(_("You are not a %s manager."), $uiElements->nomenclatureFed) . "</p>";
65
+        echo "<p>".sprintf(_("You are not a %s manager."), $uiElements->nomenclatureFed)."</p>";
66 66
         echo $deco->footer();
67 67
         exit(0);
68 68
     }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                 <!-- fed properties -->
80 80
                 <tr>
81 81
                     <td>
82
-                        <?php echo "" . _("Country") ?>
82
+                        <?php echo ""._("Country") ?>
83 83
                     </td>
84 84
                     <td>
85 85
                     </td>
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                     default:
161 161
                         throw new Exception("Error: unknown encryption status of invitation!?!");
162 162
                 }
163
-                echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter) . " " . $cryptText, _("Sent successfully."));
163
+                echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter)." ".$cryptText, _("Sent successfully."));
164 164
                 break;
165 165
             case "FAILURE":
166 166
                 echo $uiElements->boxError(_("No invitation email could be sent!"), _("Sending failure!"));
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                     default:
181 181
                         throw new Exception("Error: unknown encryption status of invitation!?!");
182 182
                 }
183
-                echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter) . " " . $cryptText, _("Partial success."));
183
+                echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter)." ".$cryptText, _("Partial success."));
184 184
                 break;
185 185
             case "INVALIDSYNTAX":
186 186
                 echo $uiElements->boxError(_("The invitation email address was malformed, no invitation was sent!"), _("The invitation email address was malformed, no invitation was sent!"));
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         echo "</table></div>";
192 192
     }
193 193
     if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == 'eduroam') {
194
-        $helptext = "<h3>" . sprintf(_("Need help? Refer to the <a href='%s'>%s manual</a>"), "https://wiki.geant.org/x/qJg7Bw", $uiElements->nomenclatureFed) . "</h3>";
194
+        $helptext = "<h3>".sprintf(_("Need help? Refer to the <a href='%s'>%s manual</a>"), "https://wiki.geant.org/x/qJg7Bw", $uiElements->nomenclatureFed)."</h3>";
195 195
     } else {
196 196
         $helptext = "";
197 197
     }
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             $pending_invites = $mgmt->listPendingInvitations();
206 206
 
207 207
             if (CONFIG['DB']['enforce-external-sync']) {
208
-                echo "<th>" . sprintf(_("%s Database Sync Status"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</th>";
208
+                echo "<th>".sprintf(_("%s Database Sync Status"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</th>";
209 209
             }
210 210
             ?>
211 211
             <th>
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         foreach ($feds as $onefed) {
221 221
             $thefed = new \core\Federation(strtoupper($onefed['value']));
222 222
             /// nomenclature for 'federation', federation name, nomenclature for 'inst'
223
-            echo "<tr><td colspan='8'><strong>" . sprintf(_("The following %s are in your %s %s:"), $uiElements->nomenclatureInst, $uiElements->nomenclatureFed, '<span style="color:green">' . $thefed->name . '</span>') . "</strong></td></tr>";
223
+            echo "<tr><td colspan='8'><strong>".sprintf(_("The following %s are in your %s %s:"), $uiElements->nomenclatureInst, $uiElements->nomenclatureFed, '<span style="color:green">'.$thefed->name.'</span>')."</strong></td></tr>";
224 224
 
225 225
             // extract only pending invitations for *this* fed
226 226
             $display_pendings = FALSE;
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                 // deployment status; need to dive into profiles for this
246 246
                 // show happy eyeballs if at least one profile is configured/showtime                    
247 247
                 echo "<td>";
248
-                echo ($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_CONFIGURED ? "C" : "" ) . " " . ($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_SHOWTIME ? "V" : "" );
248
+                echo ($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_CONFIGURED ? "C" : "")." ".($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_SHOWTIME ? "V" : "");
249 249
                 echo "</td>";
250 250
                 // name; and realm of silverbullet profiles if any
251 251
                 // instantiating all profiles is costly, so we only do this if
@@ -259,23 +259,23 @@  discard block
 block discarded – undo
259 259
                     }
260 260
                 }
261 261
                 echo "<td style='vertical-align:top;'>
262
-                         <input type='hidden' name='inst' value='" . $index . "'>" . $idp_instance->name . (empty($listOfSilverbulletRealms) ? "" : "<ul><li>" ) . implode("</li><li>",$listOfSilverbulletRealms) . (empty($listOfSilverbulletRealms) ? "" : "</li><ul>" ) . "
262
+                         <input type='hidden' name='inst' value='" . $index."'>".$idp_instance->name.(empty($listOfSilverbulletRealms) ? "" : "<ul><li>").implode("</li><li>", $listOfSilverbulletRealms).(empty($listOfSilverbulletRealms) ? "" : "</li><ul>")."
263 263
                       </td>";
264 264
                 // external DB sync, if configured as being necessary
265 265
                 if (CONFIG['DB']['enforce-external-sync']) {
266 266
                     echo "<td style='display: ruby;'>";
267 267
                     if ($readonly === FALSE) {
268
-                        echo "<form method='post' action='inc/manageDBLink.inc.php?inst_id=" . $idp_instance->identifier . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'>
269
-                                    <button type='submit'>" . _("Manage DB Link") . "</button></form>&nbsp;&nbsp;";
268
+                        echo "<form method='post' action='inc/manageDBLink.inc.php?inst_id=".$idp_instance->identifier."' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'>
269
+                                    <button type='submit'>" . _("Manage DB Link")."</button></form>&nbsp;&nbsp;";
270 270
                     }
271 271
                     switch ($idp_instance->getExternalDBSyncState()) {
272 272
                         case \core\IdP::EXTERNAL_DB_SYNCSTATE_NOTSUBJECTTOSYNCING:
273 273
                             break;
274 274
                         case \core\IdP::EXTERNAL_DB_SYNCSTATE_SYNCED:
275
-                            echo "<div class='acceptable'>" . _("Linked") . "</div>";
275
+                            echo "<div class='acceptable'>"._("Linked")."</div>";
276 276
                             break;
277 277
                         case \core\IdP::EXTERNAL_DB_SYNCSTATE_NOT_SYNCED:
278
-                            echo "<div class='notacceptable'>" . _("NOT linked") . "</div>";
278
+                            echo "<div class='notacceptable'>"._("NOT linked")."</div>";
279 279
 
280 280
 
281 281
                             break;
@@ -288,9 +288,9 @@  discard block
 block discarded – undo
288 288
                 echo "<td style='vertical-align: top;'>";
289 289
                 if ($readonly === FALSE) {
290 290
                     echo "<div style='white-space: nowrap;'>
291
-                                  <form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $index . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'>
291
+                                  <form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $index."' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'>
292 292
                                       <button type='submit'>" .
293
-                    _("Add/Remove Administrators") . "
293
+                    _("Add/Remove Administrators")."
294 294
                                       </button>
295 295
                                   </form>
296 296
                                 </div>";
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
                 echo "<tr>
304 304
                             <td colspan='2'>
305 305
                                <strong>" .
306
-                sprintf(_("Pending invitations in the %s:"), $uiElements->nomenclatureFed) . "
306
+                sprintf(_("Pending invitations in the %s:"), $uiElements->nomenclatureFed)."
307 307
                                </strong>
308 308
                             </td>
309 309
                          </tr>";
@@ -311,17 +311,17 @@  discard block
 block discarded – undo
311 311
                     if (strtoupper($oneinvite['country']) == strtoupper($thefed->tld)) {
312 312
                         echo "<tr>
313 313
                                     <td>" .
314
-                        $oneinvite['name'] . "
314
+                        $oneinvite['name']."
315 315
                                     </td>
316 316
                                     <td>" .
317
-                        $oneinvite['mail'] . "
317
+                        $oneinvite['mail']."
318 318
                                     </td>
319 319
                                     <td colspan=2>";
320 320
                         if ($readonly === FALSE) {
321 321
                             echo "<form method='post' action='overview_federation.php' accept-charset='UTF-8'>
322
-                                <input type='hidden' name='invitation_id' value='" . $oneinvite['token'] . "'/>
323
-                                <button class='delete' type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_DELETE . "'>" . _("Revoke Invitation") . "</button> "
324
-                              . sprintf(_("(expires %s)"),$oneinvite['expiry'])
322
+                                <input type='hidden' name='invitation_id' value='" . $oneinvite['token']."'/>
323
+                                <button class='delete' type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_DELETE."'>"._("Revoke Invitation")."</button> "
324
+                              . sprintf(_("(expires %s)"), $oneinvite['expiry'])
325 325
                               .     "</form>";
326 326
                         }
327 327
                         echo "      </td>
Please login to merge, or discard this patch.
core/IdP.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      * @return array<AbstractProfile> list of Profiles of this IdP
111 111
      */
112 112
     public function listProfiles(bool $activeOnly = FALSE) {
113
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "");
113
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "");
114 114
         $allProfiles = $this->databaseHandle->exec($query);
115 115
         $returnarray = [];
116 116
         // SELECT -> resource, not boolean
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $returnarray[] = $oneProfile;
121 121
         }
122 122
 
123
-        $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true));
123
+        $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true));
124 124
         return $returnarray;
125 125
     }
126 126
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
220 220
                     $theProfile = new ProfileSilverbullet($identifier, $this);
221 221
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
222
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
222
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']));
223 223
                     return $theProfile;
224 224
                 default:
225 225
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
      */
337 337
     public function getExternalDBId() {
338 338
         if (CONFIG_CONFASSISTANT['CONSORTIUM']['name'] == "eduroam" && isset(CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo']) && CONFIG_CONFASSISTANT['CONSORTIUM']['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
339
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
339
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
340 340
             // SELECT -> it's a resource, not a boolean
341 341
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
342 342
                 return FALSE;
Please login to merge, or discard this patch.