Test Setup Failed
Push — master ( e97efd...ef17d7 )
by Tomasz
11:34
created
core/UserManagement.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                 } else {
161 161
                     $this->databaseHandle->exec("INSERT INTO ownership (user_id, institution_id, blesslevel, orig_mail) VALUES(?, ?, ?, ?)", "siss", $owner, $catId, $level, $destMail);
162 162
                 }
163
-                common\Logging::writeAudit_s((string) $owner, "OWN", "IdP " . $invitationDetails['cat_institution_id'] . " - added user as owner");
163
+                common\Logging::writeAudit_s((string) $owner, "OWN", "IdP ".$invitationDetails['cat_institution_id']." - added user as owner");
164 164
                 common\Entity::outOfThePotatoes();
165 165
                 return new IdP($invitationDetails['cat_institution_id']);
166 166
             }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                 $idp = new IdP($fed->newIdP('TOKEN', $invitationDetails['invite_fortype'], $owner, $invitationDetails['invite_issuer_level'], $invitationDetails['invite_dest_mail'], $bestnameguess));
175 175
                 $idp->addAttribute("general:instname", 'C', $bestnameguess);
176 176
             }
177
-            common\Logging::writeAudit_s($owner, "NEW", "IdP " . $idp->identifier . " - created from invitation");
177
+            common\Logging::writeAudit_s($owner, "NEW", "IdP ".$idp->identifier." - created from invitation");
178 178
 
179 179
             // in case we have more admins in the queue which were invited to 
180 180
             // administer the same inst but haven't redeemed their invitations 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                              WHERE invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0 AND name = ? AND country = ? AND ( cat_institution_id IS NULL OR external_db_uniquehandle IS NULL ) ", "ss", $invitationDetails['name'], $invitationDetails['country']);
189 189
             // SELECT -> resource, no boolean
190 190
             while ($pendingDetail = mysqli_fetch_object(/** @scrutinizer ignore-type */ $otherPending)) {
191
-                $this->databaseHandle->exec("UPDATE invitations SET cat_institution_id = " . $idp->identifier . " WHERE id = " . $pendingDetail->id);
191
+                $this->databaseHandle->exec("UPDATE invitations SET cat_institution_id = ".$idp->identifier." WHERE id = ".$pendingDetail->id);
192 192
             }
193 193
             common\Entity::outOfThePotatoes();
194 194
             return $idp;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             'invite_dest_mail' => $_SESSION['auth_email'],
214 214
         ];
215 215
         $idp = $this->newIdPFromExternal($extId, $fed, $invitationDetails, $owner, $externalinfo);
216
-        common\Logging::writeAudit_s($owner, "NEW", "IdP " . $idp->identifier . " - created from auto-registration of $extId");
216
+        common\Logging::writeAudit_s($owner, "NEW", "IdP ".$idp->identifier." - created from auto-registration of $extId");
217 217
         return $idp;
218 218
     }
219 219
     
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
                 $extinfo = $cat->getExternalDBEntityDetails($externalId, $ROid);
310 310
                 $extCountry = $extinfo['country'];
311 311
                 $extType = $extinfo['type'];
312
-                if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') {
312
+                if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') {
313 313
                     $extType = \core\IdP::TYPE_SP;
314 314
                 }
315 315
                 $this->databaseHandle->exec("INSERT INTO invitations (invite_fortype, invite_issuer_level, invite_dest_mail, invite_token,name,country, external_db_uniquehandle) VALUES(?, ?, ?, ?, ?, ?, ?)", "sssssss", $extType, $level, $oneDest, $token, $instIdentifier, $extCountry, $externalId);
@@ -338,9 +338,9 @@  discard block
 block discarded – undo
338 338
         $retval = [];
339 339
         $invitations = $this->databaseHandle->exec("SELECT cat_institution_id, country, name, invite_issuer_level, invite_dest_mail, invite_token , TIMESTAMPADD(DAY, 1, invite_created) as expiry
340 340
                                         FROM invitations 
341
-                                        WHERE cat_institution_id " . ( $idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL") . " AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0");
341
+                                        WHERE cat_institution_id " . ($idpIdentifier != 0 ? "= $idpIdentifier" : "IS NULL")." AND invite_created >= TIMESTAMPADD(DAY, -1, NOW()) AND used = 0");
342 342
         // SELECT -> resource, not boolean
343
-        common\Logging::debug_s(4, "Retrieving pending invitations for " . ($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation" ) . ".\n");
343
+        common\Logging::debug_s(4, "Retrieving pending invitations for ".($idpIdentifier != 0 ? "IdP $idpIdentifier" : "IdPs awaiting initial creation").".\n");
344 344
         while ($invitationQuery = mysqli_fetch_object(/** @scrutinizer ignore-type */ $invitations)) {
345 345
             $retval[] = ["country" => $invitationQuery->country, "name" => $invitationQuery->name, "mail" => $invitationQuery->invite_dest_mail, "token" => $invitationQuery->invite_token, "expiry" => $invitationQuery->expiry];
346 346
         }
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
         // these require no further checking
413 413
         foreach ($extInstListTmp as $country => $extInstCountryList) {
414 414
             $len = count($extInstCountryList);
415
-            for($i = 0; $i < $len; ++$i) {
415
+            for ($i = 0; $i < $len; ++$i) {
416 416
                 $extInst = $extInstCountryList[$i];
417 417
                 if ($extInst['inst_id'] != NULL && in_array($extInst['inst_id'], $this->currentInstitutions['existing'])) {
418 418
                     unset($extInstList[$country][$i]);
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
             $names = $disectedNames['joint'];
504 504
             $realms = ExternalEduroamDBData::dissectCollapsedInstitutionRealms($extInst['realm']);
505 505
             $foundMatch = $this->checkForSimilarInstitutions($names, $realms);
506
-            common\Logging::debug_s(4, $foundMatch, "checkForSimilarInstitutions returned: ","\n");
506
+            common\Logging::debug_s(4, $foundMatch, "checkForSimilarInstitutions returned: ", "\n");
507 507
             if ($foundMatch == 0) {
508 508
                 $this->currentInstitutions['new'][] = [$extInst['external_db_id'], $disectedNames['perlang'], $country];
509 509
             }
Please login to merge, or discard this patch.
web/admin/inc/sendinvite.inc.php 2 patches
Switch Indentation   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -98,103 +98,103 @@
 block discarded – undo
98 98
 }
99 99
 
100 100
 switch ($operationMode) {
101
-    case OPERATION_MODE_EDIT:
102
-        $idp = $validator->existingIdP($_GET['inst_id']);
103
-        // editing IdPs is done from within the popup. When we're done, send the 
104
-        // user back to the popup (append the result of the operation later)
105
-        $redirectDestination = "manageAdmins.inc.php?inst_id=" . $idp->identifier . "&";
106
-        if (count($validAddresses) == 0) {
107
-            header("Location: $redirectDestination" . "invitation=INVALIDSYNTAX");
108
-            exit(1);
109
-        }
110
-        // is the user primary admin of this IdP?
111
-        $is_owner = $idp->isPrimaryOwner($_SESSION['user']);
112
-        // check if he is (also) federation admin for the federation this IdP is in. His invitations have more blessing then.
113
-        $fedadmin = $userObject->isFederationAdmin($idp->federation);
114
-        // check if he is either one, if not, complain
115
-        if (!$is_owner && !$fedadmin) {
116
-            echo "<p>" . sprintf(_("Something's wrong... you are a %s admin, but not for the %s the requested %s belongs to!"), $uiElements->nomenclatureFed, $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant) . "</p>";
117
-            exit(1);
118
-        }
101
+        case OPERATION_MODE_EDIT:
102
+            $idp = $validator->existingIdP($_GET['inst_id']);
103
+            // editing IdPs is done from within the popup. When we're done, send the 
104
+            // user back to the popup (append the result of the operation later)
105
+            $redirectDestination = "manageAdmins.inc.php?inst_id=" . $idp->identifier . "&";
106
+            if (count($validAddresses) == 0) {
107
+                header("Location: $redirectDestination" . "invitation=INVALIDSYNTAX");
108
+                exit(1);
109
+            }
110
+            // is the user primary admin of this IdP?
111
+            $is_owner = $idp->isPrimaryOwner($_SESSION['user']);
112
+            // check if he is (also) federation admin for the federation this IdP is in. His invitations have more blessing then.
113
+            $fedadmin = $userObject->isFederationAdmin($idp->federation);
114
+            // check if he is either one, if not, complain
115
+            if (!$is_owner && !$fedadmin) {
116
+                echo "<p>" . sprintf(_("Something's wrong... you are a %s admin, but not for the %s the requested %s belongs to!"), $uiElements->nomenclatureFed, $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant) . "</p>";
117
+                exit(1);
118
+            }
119 119
 
120
-        $prettyprintname = $idp->name;
121
-        $newtokens = $mgmt->createTokens($fedadmin, $validAddresses, $idp);
122
-        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP " . $idp->identifier . " - Token created for " . implode(",", $validAddresses));
123
-        $introtext = "CO-ADMIN";
124
-        $participant_type = $idp->type;
125
-        break;
126
-    case OPERATION_MODE_NEWUNLINKED:
127
-        $redirectDestination = "../overview_federation.php?";
128
-        if (count($validAddresses) == 0) {
129
-            header("Location: $redirectDestination"."invitation=INVALIDSYNTAX");
130
-            exit(1);
131
-        }
132
-        // run an input check and conversion of the raw inputs... just in case
133
-        $newinstname = $validator->string($_POST['name']);
134
-        $newcountry = $validator->string($_POST['country']);
135
-        $participant_type = $validator->partType($_POST['participant_type']);
136
-        $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($newcountry);
137
-        if ($new_idp_authorized_fedadmin !== TRUE) {
138
-            throw new Exception("Something's wrong... you want to create a new " . $uiElements->nomenclatureParticipant . ", but are not a " . $uiElements->nomenclatureFed . " admin for the " . $uiElements->nomenclatureFed . " it should be in!");
139
-        }
140
-        $federation = $validator->existingFederation($newcountry);
141
-        $prettyprintname = $newinstname;
142
-        $introtext = "NEW-FED";
143
-        // send the user back to his federation overview page, append the result of the operation later
144
-        // do the token creation magic
145
-        $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $newinstname, 0, $newcountry, $participant_type);
146
-        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "ORG FUTURE  - Token created for $participant_type " . implode(",", $validAddresses));
147
-        break;
148
-    case OPERATION_MODE_NEWFROMDB:
149
-        $redirectDestination = "../overview_federation.php?";
150
-        if (count($validAddresses) == 0) {
151
-            header("Location: $redirectDestination"."invitation=INVALIDSYNTAX");
152
-            exit(1);
153
-        }
154
-        // a real external DB entry was submitted and all the required parameters are there
155
-        $externals = $validator->string($_POST['externals']);
156
-        [$fedId, $newexternalid] = explode('-', $externals, 2);
157
-        $extinfo = $catInstance->getExternalDBEntityDetails($newexternalid, strtoupper($fedId).'01');
158
-        $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($extinfo['country']);
159
-        if ($new_idp_authorized_fedadmin !== TRUE) {
160
-            throw new Exception("Something's wrong... you want to create a new " . $uiElements->nomenclatureParticipant . ", but are not a " . $uiElements->nomenclatureFed . " admin for the " . $uiElements->nomenclatureFed . " it should be in!");
161
-        }
162
-        $federation = $validator->existingFederation($extinfo['country']);
163
-        $newcountry = $extinfo['country'];
164
-        // see if the inst name is defined in the currently set language; if not, pick its English name; if N/A, pick the last in the list
165
-        $prettyprintname = "";
166
-        foreach ($extinfo['names'] as $lang => $name) {
167
-            if ($lang == $languageInstance->getLang()) {
168
-                $prettyprintname = $name;
120
+            $prettyprintname = $idp->name;
121
+            $newtokens = $mgmt->createTokens($fedadmin, $validAddresses, $idp);
122
+            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP " . $idp->identifier . " - Token created for " . implode(",", $validAddresses));
123
+            $introtext = "CO-ADMIN";
124
+            $participant_type = $idp->type;
125
+            break;
126
+        case OPERATION_MODE_NEWUNLINKED:
127
+            $redirectDestination = "../overview_federation.php?";
128
+            if (count($validAddresses) == 0) {
129
+                header("Location: $redirectDestination"."invitation=INVALIDSYNTAX");
130
+                exit(1);
169 131
             }
170
-        }
171
-        if ($prettyprintname == "" && isset($extinfo['names']['en'])) {
172
-            $prettyprintname = $extinfo['names']['en'];
173
-        }
174
-        if ($prettyprintname == "") {
175
-            foreach ($extinfo['names'] as $name) {
176
-                $prettyprintname = $name;
132
+            // run an input check and conversion of the raw inputs... just in case
133
+            $newinstname = $validator->string($_POST['name']);
134
+            $newcountry = $validator->string($_POST['country']);
135
+            $participant_type = $validator->partType($_POST['participant_type']);
136
+            $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($newcountry);
137
+            if ($new_idp_authorized_fedadmin !== TRUE) {
138
+                throw new Exception("Something's wrong... you want to create a new " . $uiElements->nomenclatureParticipant . ", but are not a " . $uiElements->nomenclatureFed . " admin for the " . $uiElements->nomenclatureFed . " it should be in!");
177 139
             }
178
-        }
179
-        if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') {
180
-            $participant_type = \core\IdP::TYPE_SP;
181
-        } else {
182
-            $participant_type = $extinfo['type'];
183
-        }
184
-        // fill the rest of the text
185
-        $introtext = "EXISTING-FED";
186
-        // do the token creation magic
187
-        $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId);
188
-        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP FUTURE  - Token created for " . implode(",", $validAddresses));
189
-        break;
190
-    default: // includes OPERATION_MODE_INVALID
191
-        // second param is TRUE, so the variable *will* contain a string
192
-        // i.e. ignore Scrutinizer type warning later
193
-        $wrongcontent = print_r($_POST, TRUE);
194
-        echo "<pre>Wrong parameters in POST:
140
+            $federation = $validator->existingFederation($newcountry);
141
+            $prettyprintname = $newinstname;
142
+            $introtext = "NEW-FED";
143
+            // send the user back to his federation overview page, append the result of the operation later
144
+            // do the token creation magic
145
+            $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $newinstname, 0, $newcountry, $participant_type);
146
+            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "ORG FUTURE  - Token created for $participant_type " . implode(",", $validAddresses));
147
+            break;
148
+        case OPERATION_MODE_NEWFROMDB:
149
+            $redirectDestination = "../overview_federation.php?";
150
+            if (count($validAddresses) == 0) {
151
+                header("Location: $redirectDestination"."invitation=INVALIDSYNTAX");
152
+                exit(1);
153
+            }
154
+            // a real external DB entry was submitted and all the required parameters are there
155
+            $externals = $validator->string($_POST['externals']);
156
+            [$fedId, $newexternalid] = explode('-', $externals, 2);
157
+            $extinfo = $catInstance->getExternalDBEntityDetails($newexternalid, strtoupper($fedId).'01');
158
+            $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($extinfo['country']);
159
+            if ($new_idp_authorized_fedadmin !== TRUE) {
160
+                throw new Exception("Something's wrong... you want to create a new " . $uiElements->nomenclatureParticipant . ", but are not a " . $uiElements->nomenclatureFed . " admin for the " . $uiElements->nomenclatureFed . " it should be in!");
161
+            }
162
+            $federation = $validator->existingFederation($extinfo['country']);
163
+            $newcountry = $extinfo['country'];
164
+            // see if the inst name is defined in the currently set language; if not, pick its English name; if N/A, pick the last in the list
165
+            $prettyprintname = "";
166
+            foreach ($extinfo['names'] as $lang => $name) {
167
+                if ($lang == $languageInstance->getLang()) {
168
+                    $prettyprintname = $name;
169
+                }
170
+            }
171
+            if ($prettyprintname == "" && isset($extinfo['names']['en'])) {
172
+                $prettyprintname = $extinfo['names']['en'];
173
+            }
174
+            if ($prettyprintname == "") {
175
+                foreach ($extinfo['names'] as $name) {
176
+                    $prettyprintname = $name;
177
+                }
178
+            }
179
+            if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') {
180
+                $participant_type = \core\IdP::TYPE_SP;
181
+            } else {
182
+                $participant_type = $extinfo['type'];
183
+            }
184
+            // fill the rest of the text
185
+            $introtext = "EXISTING-FED";
186
+            // do the token creation magic
187
+            $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId);
188
+            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP FUTURE  - Token created for " . implode(",", $validAddresses));
189
+            break;
190
+        default: // includes OPERATION_MODE_INVALID
191
+            // second param is TRUE, so the variable *will* contain a string
192
+            // i.e. ignore Scrutinizer type warning later
193
+            $wrongcontent = print_r($_POST, TRUE);
194
+            echo "<pre>Wrong parameters in POST:
195 195
 " . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent) . "
196 196
 </pre>";
197
-        exit(1);
197
+            exit(1);
198 198
 }
199 199
 
200 200
 // send, and invalidate the token immediately if the mail could not be sent!
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  */
22 22
 
23
-require_once dirname(dirname(dirname(__DIR__))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(__DIR__)))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $auth->authenticate();
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
         $idp = $validator->existingIdP($_GET['inst_id']);
103 103
         // editing IdPs is done from within the popup. When we're done, send the 
104 104
         // user back to the popup (append the result of the operation later)
105
-        $redirectDestination = "manageAdmins.inc.php?inst_id=" . $idp->identifier . "&";
105
+        $redirectDestination = "manageAdmins.inc.php?inst_id=".$idp->identifier."&";
106 106
         if (count($validAddresses) == 0) {
107
-            header("Location: $redirectDestination" . "invitation=INVALIDSYNTAX");
107
+            header("Location: $redirectDestination"."invitation=INVALIDSYNTAX");
108 108
             exit(1);
109 109
         }
110 110
         // is the user primary admin of this IdP?
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
         $fedadmin = $userObject->isFederationAdmin($idp->federation);
114 114
         // check if he is either one, if not, complain
115 115
         if (!$is_owner && !$fedadmin) {
116
-            echo "<p>" . sprintf(_("Something's wrong... you are a %s admin, but not for the %s the requested %s belongs to!"), $uiElements->nomenclatureFed, $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant) . "</p>";
116
+            echo "<p>".sprintf(_("Something's wrong... you are a %s admin, but not for the %s the requested %s belongs to!"), $uiElements->nomenclatureFed, $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant)."</p>";
117 117
             exit(1);
118 118
         }
119 119
 
120 120
         $prettyprintname = $idp->name;
121 121
         $newtokens = $mgmt->createTokens($fedadmin, $validAddresses, $idp);
122
-        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP " . $idp->identifier . " - Token created for " . implode(",", $validAddresses));
122
+        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP ".$idp->identifier." - Token created for ".implode(",", $validAddresses));
123 123
         $introtext = "CO-ADMIN";
124 124
         $participant_type = $idp->type;
125 125
         break;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $participant_type = $validator->partType($_POST['participant_type']);
136 136
         $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($newcountry);
137 137
         if ($new_idp_authorized_fedadmin !== TRUE) {
138
-            throw new Exception("Something's wrong... you want to create a new " . $uiElements->nomenclatureParticipant . ", but are not a " . $uiElements->nomenclatureFed . " admin for the " . $uiElements->nomenclatureFed . " it should be in!");
138
+            throw new Exception("Something's wrong... you want to create a new ".$uiElements->nomenclatureParticipant.", but are not a ".$uiElements->nomenclatureFed." admin for the ".$uiElements->nomenclatureFed." it should be in!");
139 139
         }
140 140
         $federation = $validator->existingFederation($newcountry);
141 141
         $prettyprintname = $newinstname;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         // send the user back to his federation overview page, append the result of the operation later
144 144
         // do the token creation magic
145 145
         $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $newinstname, 0, $newcountry, $participant_type);
146
-        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "ORG FUTURE  - Token created for $participant_type " . implode(",", $validAddresses));
146
+        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "ORG FUTURE  - Token created for $participant_type ".implode(",", $validAddresses));
147 147
         break;
148 148
     case OPERATION_MODE_NEWFROMDB:
149 149
         $redirectDestination = "../overview_federation.php?";
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         $extinfo = $catInstance->getExternalDBEntityDetails($newexternalid, strtoupper($fedId).'01');
158 158
         $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($extinfo['country']);
159 159
         if ($new_idp_authorized_fedadmin !== TRUE) {
160
-            throw new Exception("Something's wrong... you want to create a new " . $uiElements->nomenclatureParticipant . ", but are not a " . $uiElements->nomenclatureFed . " admin for the " . $uiElements->nomenclatureFed . " it should be in!");
160
+            throw new Exception("Something's wrong... you want to create a new ".$uiElements->nomenclatureParticipant.", but are not a ".$uiElements->nomenclatureFed." admin for the ".$uiElements->nomenclatureFed." it should be in!");
161 161
         }
162 162
         $federation = $validator->existingFederation($extinfo['country']);
163 163
         $newcountry = $extinfo['country'];
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                 $prettyprintname = $name;
177 177
             }
178 178
         }
179
-        if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') {
179
+        if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') {
180 180
             $participant_type = \core\IdP::TYPE_SP;
181 181
         } else {
182 182
             $participant_type = $extinfo['type'];
@@ -185,14 +185,14 @@  discard block
 block discarded – undo
185 185
         $introtext = "EXISTING-FED";
186 186
         // do the token creation magic
187 187
         $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId);
188
-        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP FUTURE  - Token created for " . implode(",", $validAddresses));
188
+        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP FUTURE  - Token created for ".implode(",", $validAddresses));
189 189
         break;
190 190
     default: // includes OPERATION_MODE_INVALID
191 191
         // second param is TRUE, so the variable *will* contain a string
192 192
         // i.e. ignore Scrutinizer type warning later
193 193
         $wrongcontent = print_r($_POST, TRUE);
194 194
         echo "<pre>Wrong parameters in POST:
195
-" . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent) . "
195
+" . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent)."
196 196
 </pre>";
197 197
         exit(1);
198 198
 }
@@ -217,14 +217,14 @@  discard block
 block discarded – undo
217 217
 }
218 218
 
219 219
 if (count($status) == 0) {
220
-    header("Location: $redirectDestination" . "invitation=FAILURE");
220
+    header("Location: $redirectDestination"."invitation=FAILURE");
221 221
     exit;
222 222
 }
223 223
 $finalDestParams = "invitation=SUCCESS";
224 224
 if (count($status) < count($totalSegments)) { // only a subset of mails was sent, update status
225 225
     $finalDestParams = "invitation=PARTIAL";
226 226
 }
227
-$finalDestParams .= "&successcount=" . count($status);
227
+$finalDestParams .= "&successcount=".count($status);
228 228
 if ($allEncrypted === TRUE) {
229 229
     $finalDestParams .= "&transportsecurity=ENCRYPTED";
230 230
 } elseif ($allClear === TRUE) {
@@ -233,4 +233,4 @@  discard block
 block discarded – undo
233 233
     $finalDestParams .= "&transportsecurity=PARTIAL";
234 234
 }
235 235
 
236
-header("Location: $redirectDestination" . $finalDestParams);
236
+header("Location: $redirectDestination".$finalDestParams);
Please login to merge, or discard this patch.
web/admin/overview_federation.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -461,17 +461,17 @@  discard block
 block discarded – undo
461 461
                 }
462 462
                 echo "<td class='inst_td'>
463 463
                          <input type='hidden' name='inst' value='" 
464
-                       . $index."'>"
465
-                       . "<span style='display:none' class='inst_name'>".$my_idp."</span>"
466
-                       . "<span>". $idp_instance->name."</span>"
467
-                       . " (<a href='overview_org.php?inst_id="
468
-                       . $idp_instance->identifier."'>" 
469
-                       . (in_array($index, $userIdps) ? _("manage") : _("view"))
470
-                       . "</a>)"
471
-                       . (empty($listOfSilverbulletRealms) ? "" : "<ul><li>" ) 
472
-                       . implode("</li><li>", $listOfSilverbulletRealms) 
473
-                       . (empty($listOfSilverbulletRealms) ? "" : "</li><ul>" )
474
-                       . "</td>";
464
+                        . $index."'>"
465
+                        . "<span style='display:none' class='inst_name'>".$my_idp."</span>"
466
+                        . "<span>". $idp_instance->name."</span>"
467
+                        . " (<a href='overview_org.php?inst_id="
468
+                        . $idp_instance->identifier."'>" 
469
+                        . (in_array($index, $userIdps) ? _("manage") : _("view"))
470
+                        . "</a>)"
471
+                        . (empty($listOfSilverbulletRealms) ? "" : "<ul><li>" ) 
472
+                        . implode("</li><li>", $listOfSilverbulletRealms) 
473
+                        . (empty($listOfSilverbulletRealms) ? "" : "</li><ul>" )
474
+                        . "</td>";
475 475
                 // deployment status; need to dive into profiles for this
476 476
                 // show happy eyeballs if at least one profile is configured/showtime     
477 477
                 if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
@@ -528,8 +528,8 @@  discard block
 block discarded – undo
528 528
                             echo "<form method='post' action='overview_federation.php' accept-charset='UTF-8'>
529 529
                                 <input type='hidden' name='invitation_id' value='".$oneinvite['token']."'/>
530 530
                                 <button class='delete' type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_DELETE."'>"._("Revoke Invitation")."</button> "
531
-                           . sprintf(_("(expires %s)"), $oneinvite['expiry'])
532
-                           . "</form>";
531
+                            . sprintf(_("(expires %s)"), $oneinvite['expiry'])
532
+                            . "</form>";
533 533
                         }
534 534
                         echo "      </td>";                          
535 535
                         echo "         </tr>";
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     <?php
110 110
     foreach ($cat->printCountryList(1) as $country => $name) {
111 111
         $selected = '';
112
-        if ($country == strtoupper($fed_id) ) {
112
+        if ($country == strtoupper($fed_id)) {
113 113
             $selected = 'selected';
114 114
         }
115 115
     echo "<option value='$country' $selected>$name</option>\n";
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
             ?>
322 322
         <tr>
323 323
             <th scope='col'><?php echo sprintf(_("%s Name"), $uiElements->nomenclatureParticipant); ?></th>
324
-            <?php if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') { ?>
324
+            <?php if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') { ?>
325 325
             <th scope='col'><?php echo _("Status") ?></th>
326 326
             <th scope='col'><?php echo $OpenRoamingSymbol ?></th>
327 327
             <th scope='col'><?php echo _("Cert"); ?></th>
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
         <?php
345 345
             /// nomenclature for 'federation', federation name, nomenclature for 'inst'
346 346
             echo "<tbody class='fedlist'>";
347
-            echo "<tr><td colspan='1'><strong>". _("Quick search:")." </strong><input style='background:#eeeeee;' type='text' id='qsearch_".$fedId."'></td>";
348
-            if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
347
+            echo "<tr><td colspan='1'><strong>"._("Quick search:")." </strong><input style='background:#eeeeee;' type='text' id='qsearch_".$fedId."'></td>";
348
+            if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
349 349
                 echo "<td style='border-bottom-style: dotted;border-bottom-width: 1px;'><input type='checkbox' name='profilecheck' id='profile_ck_".$fedId."'></td>";
350 350
                 echo "<td style='border-bottom-style: dotted;border-bottom-width: 1px;'><input type='checkbox' name='orcheck' id='or_ck_".$fedId."'></td>";
351 351
                 echo "<td style='border-bottom-style: dotted;border-bottom-width: 1px;'><input type='checkbox' name='brokencert' id='brokencert_ck_".$fedId."'></td>";
@@ -463,18 +463,18 @@  discard block
 block discarded – undo
463 463
                          <input type='hidden' name='inst' value='" 
464 464
                        . $index."'>"
465 465
                        . "<span style='display:none' class='inst_name'>".$my_idp."</span>"
466
-                       . "<span>". $idp_instance->name."</span>"
466
+                       . "<span>".$idp_instance->name."</span>"
467 467
                        . " (<a href='overview_org.php?inst_id="
468 468
                        . $idp_instance->identifier."'>" 
469 469
                        . (in_array($index, $userIdps) ? _("manage") : _("view"))
470 470
                        . "</a>)"
471
-                       . (empty($listOfSilverbulletRealms) ? "" : "<ul><li>" ) 
471
+                       . (empty($listOfSilverbulletRealms) ? "" : "<ul><li>") 
472 472
                        . implode("</li><li>", $listOfSilverbulletRealms) 
473
-                       . (empty($listOfSilverbulletRealms) ? "" : "</li><ul>" )
473
+                       . (empty($listOfSilverbulletRealms) ? "" : "</li><ul>")
474 474
                        . "</td>";
475 475
                 // deployment status; need to dive into profiles for this
476 476
                 // show happy eyeballs if at least one profile is configured/showtime     
477
-                if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
477
+                if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
478 478
                     echo  "<td>$profileIcon</td>";
479 479
                     echo "<td style='text-align: center'>$orIcon</td>";
480 480
                     echo "<td>$certIcon</td>";
Please login to merge, or discard this patch.
web/admin/edit_participant_result.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  */
22 22
 
23
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $loggerInstance = new \core\common\Logging();
@@ -33,15 +33,15 @@  discard block
 block discarded – undo
33 33
 $myInstOriginal = $validator->existingIdP($_GET['inst_id'], $_SESSION['user']);
34 34
 $instId = $myInstOriginal->identifier;
35 35
 
36
-$hello = _("To whom it may concern,") . "\n\n";
37
-$bye = _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.") . "\n\n" .
38
-        _("Greetings, ") . "\n\n" .
36
+$hello = _("To whom it may concern,")."\n\n";
37
+$bye = _("This mail is merely a cross-check because these changes can be security-relevant. If the change was expected, you do not need to take any action.")."\n\n".
38
+        _("Greetings, ")."\n\n".
39 39
         \config\Master::APPEARANCE['productname_long'];
40 40
 
41 41
 switch ($_POST['submitbutton']) {
42 42
     case web\lib\common\FormElements::BUTTON_DELETE:
43 43
         $myInstOriginal->destroy();
44
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP " . $instId);
44
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP ".$instId);
45 45
         header("Location: overview_user.php");
46 46
         exit;
47 47
     case web\lib\common\FormElements::BUTTON_FLUSH_AND_RESTART:
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
         }
52 52
         // flush all IdP attributes and send user to creation wizard
53 53
         $myInstOriginal->flushAttributes();
54
-        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over" . $instId);
55
-        $text = $hello .
56
-                sprintf(_("the %s %s / %s / (previously known as) '%s' has deleted all properties and is starting over freshly. This means that its not recognisable by its name any more, and it may assume a different name in the future. You will get another mail if and when the name change happens."), $ui->nomenclatureParticipant, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n" .
54
+        $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over".$instId);
55
+        $text = $hello.
56
+                sprintf(_("the %s %s / %s / (previously known as) '%s' has deleted all properties and is starting over freshly. This means that its not recognisable by its name any more, and it may assume a different name in the future. You will get another mail if and when the name change happens."), $ui->nomenclatureParticipant, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n".
57 57
                 $bye;
58 58
         $fed = new core\Federation($myInstOriginal->federation);
59 59
         if (\config\Master::MAILSETTINGS['notify_nro']) {
@@ -74,19 +74,19 @@  discard block
 block discarded – undo
74 74
             exit(0);
75 75
         }
76 76
         $inst_name = $myInstOriginal->name;
77
-        echo "<h1>" . sprintf(_("Submitted attributes for IdP '%s'"), $inst_name) . "</h1>";
77
+        echo "<h1>".sprintf(_("Submitted attributes for IdP '%s'"), $inst_name)."</h1>";
78 78
         echo "<table>";
79 79
         echo $optionParser->processSubmittedFields($myInstOriginal, $_POST, $_FILES);
80 80
         echo "</table>";
81 81
 // delete cached logo, if present
82
-        $dir = ROOT . '/web/downloads/logos/';
83
-        $globResult = glob($dir . $myInstOriginal->identifier . "_*.png");
82
+        $dir = ROOT.'/web/downloads/logos/';
83
+        $globResult = glob($dir.$myInstOriginal->identifier."_*.png");
84 84
         if ($globResult === FALSE) { // we should catch the improbable error condition
85 85
             $globResult = [];
86 86
         }
87 87
         array_map('unlink', $globResult);
88 88
         $loggerInstance->debug(4, "UNLINK from $dir\n");
89
-        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP " . $myInstOriginal->identifier . " - attributes changed");
89
+        $loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP ".$myInstOriginal->identifier." - attributes changed");
90 90
 
91 91
 // re-instantiate ourselves... profiles need fresh data
92 92
         $myInstReinstantiated = $validator->existingIdP($_GET['inst_id'], $_SESSION['user']);
@@ -95,10 +95,10 @@  discard block
 block discarded – undo
95 95
         if (count($significantChanges) > 0) {
96 96
             // send a notification/alert mail to someone we know is in charge
97 97
             /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
98
-            $text = $hello . sprintf(_("significant changes were made to the %s %s / %s / (previously known as) '%s'."), $ui->nomenclatureParticipant, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n";
98
+            $text = $hello.sprintf(_("significant changes were made to the %s %s / %s / (previously known as) '%s'."), $ui->nomenclatureParticipant, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n";
99 99
             if (isset($significantChanges[\core\IdP::INSTNAME_CHANGED])) {
100
-                $text .= sprintf(_("The %s has changed its name. The details are below:"), $ui->nomenclatureParticipant) . "\n\n";
101
-                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED] . "\n\n";
100
+                $text .= sprintf(_("The %s has changed its name. The details are below:"), $ui->nomenclatureParticipant)."\n\n";
101
+                $text .= $significantChanges[\core\IdP::INSTNAME_CHANGED]."\n\n";
102 102
             }
103 103
             $text .= $bye;
104 104
             // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
@@ -116,21 +116,21 @@  discard block
 block discarded – undo
116 116
 
117 117
         if (isset(\config\ConfAssistant::CONSORTIUM['ssid']) && count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0) {
118 118
             foreach (\config\ConfAssistant::CONSORTIUM['ssid'] as $ssidname) {
119
-                $ssids[] = $ssidname . " " . _("(WPA2/AES)");
119
+                $ssids[] = $ssidname." "._("(WPA2/AES)");
120 120
             }
121 121
         }
122 122
 
123 123
         foreach ($myInstReinstantiated->getAttributes("media:SSID") as $ssidname) {
124
-            $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES)");
124
+            $ssids[] = $ssidname['value']." "._("(WPA2/AES)");
125 125
         }
126 126
 
127 127
         $uiElements = new web\lib\admin\UIElements();
128
-        if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
128
+        if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] !== 'MSP') {
129 129
             echo "<table>";
130 130
             if (count($ssids) > 0) {
131 131
                 $printedlist = "";
132 132
                 foreach ($ssids as $names) {
133
-                    $printedlist = $printedlist . "$names ";
133
+                    $printedlist = $printedlist."$names ";
134 134
                 }
135 135
                 echo $uiElements->boxOkay(sprintf(_("Your installers will configure the following SSIDs: <strong>%s</strong>"), $printedlist), _("SSIDs configured"));
136 136
             }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $myfed = new \core\Federation($myInstReinstantiated->federation);
153 153
         $allow_sb = $myfed->getAttributes("fed:silverbullet");
154 154
         // only show IdP parts if fed has enabled hosted services && participant is an SP-type
155
-        if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL" && count($allow_sb) > 0 && preg_match("/IdP/", $myInstReinstantiated->type) ) {
155
+        if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL" && count($allow_sb) > 0 && preg_match("/IdP/", $myInstReinstantiated->type)) {
156 156
 // show the new profile jumpstart buttons only if we do not have any profile at all
157 157
             if (count($myInstReinstantiated->listProfiles()) == 0) {
158 158
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                 // did we get an email address? then, show the silverbullet jumpstart button
161 161
                 // otherwise, issue a smartass comment
162 162
                 if (count($myInstReinstantiated->getAttributes("support:email")) > 0) {
163
-                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$instId' accept-charset='UTF-8'><button type='submit'>" . sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME) . "</button></form>";
163
+                    echo "<form method='post' action='edit_silverbullet.php?inst_id=$instId' accept-charset='UTF-8'><button type='submit'>".sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME)."</button></form>";
164 164
                 } else {
165 165
                     echo "<table>";
166 166
                     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->nomenclatureParticipant), _("No support e-mail!"));
@@ -168,11 +168,11 @@  discard block
 block discarded – undo
168 168
                 }
169 169
 
170 170
                 if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == "LOCAL") {
171
-                    echo "<br/><form method='post' action='edit_profile.php?inst_id=$instId' accept-charset='UTF-8'><button type='submit'>" . _("Continue to RADIUS/EAP profile definition") . "</button></form>";
171
+                    echo "<br/><form method='post' action='edit_profile.php?inst_id=$instId' accept-charset='UTF-8'><button type='submit'>"._("Continue to RADIUS/EAP profile definition")."</button></form>";
172 172
                 }
173 173
             }
174 174
         }
175
-        echo "<br/><form method='post' action='overview_org.php?inst_id=$instId' accept-charset='UTF-8'><button type='submit'>" . _("Continue to dashboard") . "</button></form>";
175
+        echo "<br/><form method='post' action='overview_org.php?inst_id=$instId' accept-charset='UTF-8'><button type='submit'>"._("Continue to dashboard")."</button></form>";
176 176
 
177 177
         break;
178 178
     default:
Please login to merge, or discard this patch.
web/lib/admin/UIElements.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                 'display' => sprintf(_("Mint %s with CA on creation"), $this->nomenclatureIdP),
150 150
                 'help' => _("Set of default CAs to add to new IdPs on signup")],
151 151
             "fed:openroaming" => [
152
-                'display' => sprintf(_("OpenRoaming: Allow %s Opt-In"),$this->nomenclatureParticipant),
152
+                'display' => sprintf(_("OpenRoaming: Allow %s Opt-In"), $this->nomenclatureParticipant),
153 153
                 'help' => _("Allow IdP to set OpenRoaming support for its users.")],
154 154
             "fed:openroaming_customtarget" => ['display' => _("OpenRoaming: Custom NAPTR Target"), 'help' => "If you want your IdPs to use your own OpenRoaming → eduroam proxy then you can configure the hostname here; the realm check feature for IdPs will then warn them if the OpenRoaming destination server is not yours. This attribute does not need to be set, and the realm checks default to checking for the OpenRoaming → eduroam proxy operated by eduroam OT."],
155 155
             "fed:autoregister-synced" => [
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         ];
176 176
 
177 177
         if (!isset($displayNames[$input])) { // this is an error! throw an Exception
178
-            throw new \Exception("The translation of an option name was requested, but the option is not known to the system: " . htmlentities($input));
178
+            throw new \Exception("The translation of an option name was requested, but the option is not known to the system: ".htmlentities($input));
179 179
         }
180 180
         \core\common\Entity::outOfThePotatoes();
181 181
         // none of the strings have HTML in them, only translators can provide own text for it -> no threat, but complained about by the security review
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         foreach ($optionlist as $option) {
203 203
             $type = $optioninfo->optionType($option['name']);
204
-            if (preg_match('/^' . $class . '/', $option['name']) && $option['level'] == "$level") {
204
+            if (preg_match('/^'.$class.'/', $option['name']) && $option['level'] == "$level") {
205 205
                 // all non-multilang attribs get this assignment ...
206 206
                 $language = "";
207 207
                 $content = $option['value'];
@@ -219,19 +219,19 @@  discard block
 block discarded – undo
219 219
                         $locationMarkers[] = $coords;
220 220
                         break;
221 221
                     case "file":
222
-                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td>";
222
+                        $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td>";
223 223
                         switch ($option['name']) {
224 224
                             case "general:logo_file":
225 225
                             case "fed:logo_file":
226
-                                $retval .= $this->previewImageinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']);
226
+                                $retval .= $this->previewImageinHTML('ROWID-'.$option['level'].'-'.$option['row_id']);
227 227
                                 break;
228 228
                             case "eap:ca_file":
229 229
                             // fall-through intended: display both the same way
230 230
                             case "fed:minted_ca_file":
231
-                                $retval .= $this->previewCAinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']);
231
+                                $retval .= $this->previewCAinHTML('ROWID-'.$option['level'].'-'.$option['row_id']);
232 232
                                 break;
233 233
                             case "support:info_file":
234
-                                $retval .= $this->previewInfoFileinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']);
234
+                                $retval .= $this->previewInfoFileinHTML('ROWID-'.$option['level'].'-'.$option['row_id']);
235 235
                                 break;
236 236
                             default:
237 237
                         }
@@ -241,10 +241,10 @@  discard block
 block discarded – undo
241 241
                             // do not display the option at all; it gets auto-set by the ProfileSilverbullet constructor and doesn't have to be seen
242 242
                             break;
243 243
                         }
244
-                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>";
244
+                        $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>".($content == "on" ? _("on") : _("off"))."</strong></td></tr>";
245 245
                         break;
246 246
                     default:
247
-                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>";
247
+                        $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>$content</strong></td></tr>";
248 248
                 }
249 249
             }
250 250
         }
@@ -253,11 +253,11 @@  discard block
 block discarded – undo
253 253
             $locationCount = 0;
254 254
             foreach ($locationMarkers as $g) {
255 255
                 $locationCount++;
256
-                $marker .= '<marker name="' . $locationCount . '" lat="' . $g['lat'] . '" lng="' . $g['lon'] . '" />';
256
+                $marker .= '<marker name="'.$locationCount.'" lat="'.$g['lat'].'" lng="'.$g['lon'].'" />';
257 257
             }
258 258
             $marker .= '<\/markers>'; // some validator says this should be escaped
259 259
             $jMarker = json_encode($locationMarkers);
260
-            $retval .= '<tr><td><script>markers=\'' . $marker . '\'; jmarkers = \'' . $jMarker . '\';</script></td><td></td><td></td></tr>';
260
+            $retval .= '<tr><td><script>markers=\''.$marker.'\'; jmarkers = \''.$jMarker.'\';</script></td><td></td><td></td></tr>';
261 261
         }
262 262
         \core\common\Entity::outOfThePotatoes();
263 263
         return $retval;
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
         \core\common\Entity::intoThePotatoes();
274 274
         $idpoptions = $myInst->getAttributes();
275 275
         $retval = "<div class='infobox'>
276
-        <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant) . "</h2>
276
+        <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant)."</h2>
277 277
         <table>
278 278
             <tr>
279 279
                 <td>
280
-                    " . _("Country:") . "
280
+                    " . _("Country:")."
281 281
                 </td>
282 282
                 <td>
283 283
                 </td>
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
         $retval .= $myFed->name;
288 288
         $retval .= "</strong>
289 289
                 </td>
290
-            </tr>" . $this->infoblock($idpoptions, "general", "IdP") . "
290
+            </tr>" . $this->infoblock($idpoptions, "general", "IdP")."
291 291
         </table>
292 292
     </div>";
293 293
         $blocks = [["support", _("Global Helpdesk Details")]];        
@@ -296,9 +296,9 @@  discard block
 block discarded – undo
296 296
         }
297 297
         foreach ($blocks as $block) {
298 298
             $retval .= "<div class='infobox'>
299
-            <h2>" . $block[1] . "</h2>
299
+            <h2>" . $block[1]."</h2>
300 300
             <table>" .
301
-                    $this->infoblock($idpoptions, $block[0], "IdP") .
301
+                    $this->infoblock($idpoptions, $block[0], "IdP").
302 302
                     "</table>
303 303
         </div>";
304 304
         }
@@ -313,12 +313,12 @@  discard block
 block discarded – undo
313 313
      */
314 314
     private function displaySize(int $number) {
315 315
         if ($number > 1024 * 1024) {
316
-            return round($number / 1024 / 1024, 2) . " MiB";
316
+            return round($number / 1024 / 1024, 2)." MiB";
317 317
         }
318 318
         if ($number > 1024) {
319
-            return round($number / 1024, 2) . " KiB";
319
+            return round($number / 1024, 2)." KiB";
320 320
         }
321
-        return $number . " B";
321
+        return $number." B";
322 322
     }
323 323
 
324 324
     /**
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
         $caExpiryTrashhold = \config\ConfAssistant::CERT_WARNINGS['expiry_warning'];
374 374
         $rawResult = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE);
375 375
         if (is_bool($rawResult)) { // we didn't actually get a CA!
376
-            $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the certificate from the database!") . "</div>";
376
+            $retval = "<div class='ca-summary'>"._("There was an error while retrieving the certificate from the database!")."</div>";
377 377
             \core\common\Entity::outOfThePotatoes();
378 378
             return $retval;
379 379
         }
@@ -389,8 +389,8 @@  discard block
 block discarded – undo
389 389
 
390 390
         $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']);
391 391
         $details['name'] = preg_replace('/\//', "", $details['name']);
392
-        $certstatus = ( $details['root'] == 1 ? "R" : "I");
393
-        $certTooltip = ( $details['root'] == 1 ? _("Root CA") : _("Intermediate CA"));
392
+        $certstatus = ($details['root'] == 1 ? "R" : "I");
393
+        $certTooltip = ($details['root'] == 1 ? _("Root CA") : _("Intermediate CA"));
394 394
         $innerbgColor = "#0000ff";
395 395
         $leftBorderColor = "#00ff00";
396 396
         $message = "";
@@ -398,35 +398,35 @@  discard block
 block discarded – undo
398 398
             $leftBorderColor = "red";
399 399
             $message = _("This is a <strong>SERVER</strong> certificate!");
400 400
             if (\config\ConfAssistant::CERT_GUIDELINES !== '') {
401
-                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>". _("more info")."</a>";
401
+                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>"._("more info")."</a>";
402 402
             }
403 403
             $message .= "<br/>";
404
-            $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . $message . $details['name'] . "</div>";
404
+            $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>".$message.$details['name']."</div>";
405 405
             \core\common\Entity::outOfThePotatoes();
406 406
             return $retval;
407 407
         }
408 408
         $now = time();
409 409
         if ($now + \config\ConfAssistant::CERT_WARNINGS['expiry_critical'] > $details['full_details']['validTo_time_t']) {
410 410
             $leftBorderColor = "red";
411
-            $message = _("Certificate expired!") . "<br>";
412
-        } elseif($now + \config\ConfAssistant::CERT_WARNINGS['expiry_warning']  > $details['full_details']['validTo_time_t'] - $caExpiryTrashhold) {
411
+            $message = _("Certificate expired!")."<br>";
412
+        } elseif ($now + \config\ConfAssistant::CERT_WARNINGS['expiry_warning'] > $details['full_details']['validTo_time_t'] - $caExpiryTrashhold) {
413 413
             if ($leftBorderColor == "#00ff00") {
414 414
                 $leftBorderColor = "yellow";
415 415
             }
416
-            $message = _("Certificate close to expiry!") . "<br/>";            
416
+            $message = _("Certificate close to expiry!")."<br/>";            
417 417
         }
418 418
    
419 419
         if ($details['root'] == 1 && $details['basicconstraints_set'] == 0) {
420 420
             if ($leftBorderColor == "#00ff00") {
421 421
                 $leftBorderColor = "yellow";
422 422
             }
423
-            $message .= "<div style='max-width: 25em'><strong>" . _("Improper root certificate, required critical CA extension missing, will not reliably install!") . "</strong>";
423
+            $message .= "<div style='max-width: 25em'><strong>"._("Improper root certificate, required critical CA extension missing, will not reliably install!")."</strong>";
424 424
             if (\config\ConfAssistant::CERT_GUIDELINES !== '') {
425
-                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>". _("more info")."</a>";
425
+                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>"._("more info")."</a>";
426 426
             }
427 427
             $message .= "</div><br/>";
428 428
         }
429
-        $retval =  "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div title='$certTooltip' style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>" . $message . $details['name'] . "<br>" . $this->displayName('eap:ca_vailduntil') . " " . gmdate('Y-m-d H:i:s', $details['full_details']['validTo_time_t']) . " UTC</div>";
429
+        $retval = "<div class='ca-summary' style='border-left-color: $leftBorderColor'><div style='position:absolute; right: -15px; width:20px; height:20px; background-color:$innerbgColor; border-radius:10px; text-align: center;'><div title='$certTooltip' style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>".$message.$details['name']."<br>".$this->displayName('eap:ca_vailduntil')." ".gmdate('Y-m-d H:i:s', $details['full_details']['validTo_time_t'])." UTC</div>";
430 430
         \core\common\Entity::outOfThePotatoes();
431 431
         return $retval;
432 432
     }
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
      */
440 440
     public function previewImageinHTML($imageReference) {
441 441
         \core\common\Entity::intoThePotatoes();
442
-        $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=" . $imageReference . "' alt='" . _("Preview of logo file") . "'/>";
442
+        $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=".$imageReference."' alt='"._("Preview of logo file")."'/>";
443 443
         \core\common\Entity::outOfThePotatoes();
444 444
         return $retval;
445 445
     }
@@ -456,13 +456,13 @@  discard block
 block discarded – undo
456 456
         $ref = $validator->databaseReference($fileReference);
457 457
         $fileBlob = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE);
458 458
         if (is_bool($fileBlob)) { // we didn't actually get a file!
459
-            $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the file from the database!") . "</div>";
459
+            $retval = "<div class='ca-summary'>"._("There was an error while retrieving the file from the database!")."</div>";
460 460
             \core\common\Entity::outOfThePotatoes();
461 461
             return $retval;
462 462
         }
463 463
         $decodedFileBlob = base64_decode($fileBlob);
464 464
         $fileinfo = new \finfo();
465
-        $retval = "<div class='ca-summary'>" . _("File exists") . " (" . $fileinfo->buffer($decodedFileBlob, FILEINFO_MIME_TYPE) . ", " . $this->displaySize(strlen($decodedFileBlob)) . ")<br/><a href='inc/filepreview.php?id=$fileReference'>" . _("Preview") . "</a></div>";
465
+        $retval = "<div class='ca-summary'>"._("File exists")." (".$fileinfo->buffer($decodedFileBlob, FILEINFO_MIME_TYPE).", ".$this->displaySize(strlen($decodedFileBlob)).")<br/><a href='inc/filepreview.php?id=$fileReference'>"._("Preview")."</a></div>";
466 466
         \core\common\Entity::outOfThePotatoes();
467 467
         return $retval;
468 468
     }
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
             return "";
620 620
         }
621 621
 
622
-        $loggerInstance->debug(4, "Consortium logo is at: " . ROOT . "/web/resources/images/consortium_logo_large.png");
623
-        $logogd = imagecreatefrompng(ROOT . "/web/resources/images/consortium_logo_large.png");
622
+        $loggerInstance->debug(4, "Consortium logo is at: ".ROOT."/web/resources/images/consortium_logo_large.png");
623
+        $logogd = imagecreatefrompng(ROOT."/web/resources/images/consortium_logo_large.png");
624 624
         if ($logogd === FALSE) { // consortium logo is bogus; don't do anything
625 625
             return "";
626 626
         }
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
         imagecolorallocate($whiteimage, 255, 255, 255);
647 647
         // also make sure the initial placement is a multitude of 12; otherwise "two half" symbols might be affected
648 648
         $targetplacementx = (int) ($symbolsize * round(($sizeinput[0] / 2 - ($targetwidth - $symbolsize + 1) / 2) / $symbolsize));
649
-        $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1 ) / 2) / $symbolsize));
649
+        $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1) / 2) / $symbolsize));
650 650
         imagecopyresized($inputgd, $whiteimage, $targetplacementx - $symbolsize, $targetplacementy - $symbolsize, 0, 0, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize);
651 651
         imagecopyresized($inputgd, $logogd, $targetplacementx, $targetplacementy, 0, 0, $targetwidth, $targetheight, $sizelogo[0], $sizelogo[1]);
652 652
         ob_start();
@@ -696,9 +696,9 @@  discard block
 block discarded – undo
696 696
                 $message = "Your configuration appears to be fine.";
697 697
                 break;
698 698
             default:
699
-                throw new Exception("The result code level " . $test->test_result['global'] . " is not defined!");
699
+                throw new Exception("The result code level ".$test->test_result['global']." is not defined!");
700 700
         }
701
-        $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>" . $message . "<br>See below for details<br><hr>");
701
+        $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>".$message."<br>See below for details<br><hr>");
702 702
         foreach ($test->out as $testValue) {
703 703
             foreach ($testValue as $o) {
704 704
                 $out .= $this->boxFlexible($o['level'], $o['message']);
Please login to merge, or discard this patch.