Test Failed
Push — master ( 215916...1607c4 )
by Tomasz
09:30
created
utils/Update_eduroamDB1_2/clean_databases.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
3
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
4 4
 setlocale(LC_CTYPE, "en_US.UTF-8");
5 5
 require 'config.php';
6 6
 
Please login to merge, or discard this patch.
utils/Update_eduroamDB1_2/sync_databases.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * 
9 9
  */
10 10
 
11
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
11
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
12 12
 setlocale(LC_CTYPE, "en_US.UTF-8");
13 13
 require 'config.php';
14 14
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 // add CAT ids to view_active_institution2
132 132
 print "add CAT ids to view_active_institution2\n";
133
-$q ="update view_active_institution2 join view_active_institution1
133
+$q = "update view_active_institution2 join view_active_institution1
134 134
         on view_active_institution2.instid1=view_active_institution1.id_institution
135 135
         set view_active_institution2.cat_sync_id=view_active_institution1.cat_sync_id";
136 136
 $result = $db_local->query($q);
Please login to merge, or discard this patch.
core/User.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
             return false;
174 174
         }
175 175
         $entityId = $matches[1];
176
-        $url = \config\Diagnostics::EDUGAINRESOLVER['url'] . "?action=get_entity_name&type=idp&opt=2&e_id=$entityId";
177
-        \core\common\Logging::debug_s(4, $url, "URL: ","\n");
176
+        $url = \config\Diagnostics::EDUGAINRESOLVER['url']."?action=get_entity_name&type=idp&opt=2&e_id=$entityId";
177
+        \core\common\Logging::debug_s(4, $url, "URL: ", "\n");
178 178
         $ch = curl_init($url);
179 179
         if ($ch === false) {
180 180
             $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!");
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
             return false;            
201 201
         }
202 202
         if ($responseDetails['name'] === null) {
203
-            \core\common\Logging::debug_s(4,"User not in eduGAIN\n");
203
+            \core\common\Logging::debug_s(4, "User not in eduGAIN\n");
204 204
             return false;            
205 205
         }
206
-        \core\common\Logging::debug_s(4,"User in eduGAIN\n");
206
+        \core\common\Logging::debug_s(4, "User in eduGAIN\n");
207 207
         $_SESSION['eduGAIN'] = $responseDetails['regauth'];
208 208
         return true;
209 209
     }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
      * @return boolean did it work?
244 244
      */
245 245
     public static function sendMailToCATadmins($subject, $content) {
246
-        if (!isset(\config\Master::APPEARANCE['cat-admin-mail']) ||  \config\Master::APPEARANCE['cat-admin-mail'] === []) {
246
+        if (!isset(\config\Master::APPEARANCE['cat-admin-mail']) || \config\Master::APPEARANCE['cat-admin-mail'] === []) {
247 247
             return;
248 248
         }
249 249
         foreach (\config\Master::APPEARANCE['cat-admin-mail'] as $mailaddr) {
@@ -266,8 +266,8 @@  discard block
 block discarded – undo
266 266
         common\Entity::intoThePotatoes();
267 267
         $mail = \core\common\OutsideComm::mailHandle();
268 268
 // who to whom?
269
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System";
270
-        $mail->addReplyTo(\config\Master::APPEARANCE['support-contact']['developer-mail'], \config\Master::APPEARANCE['productname'] . " " . _("Feedback"));
269
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System";
270
+        $mail->addReplyTo(\config\Master::APPEARANCE['support-contact']['developer-mail'], \config\Master::APPEARANCE['productname']." "._("Feedback"));
271 271
         $mail->addAddress($mailaddr);
272 272
 // what do we want to say?
273 273
         $mail->Subject = $subject;
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                 }
334 334
                 $lookFor .= "$name";
335 335
             }
336
-            $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches);
336
+            $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches);
337 337
             if ($finding === 0 || $finding === false) {
338 338
                 return false;
339 339
             }
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                         $matchedProviders[] = $idp;
353 353
                         $name = $idp;
354 354
                         if ($skipCurl == 0) {
355
-                            $url = \config\Diagnostics::EDUGAINRESOLVER['url'] . "?action=get_entity_name&opt=2&type=idp&e_id=$idp&lang=$lang";
355
+                            $url = \config\Diagnostics::EDUGAINRESOLVER['url']."?action=get_entity_name&opt=2&type=idp&e_id=$idp&lang=$lang";
356 356
                             $ch = curl_init($url);
357 357
                             if ($ch === false) {
358 358
                                 $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!");
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
                             }
378 378
                             curl_close($ch);
379 379
                         }
380
-                        $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]] . " - IdP: " . $name;
380
+                        $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]]." - IdP: ".$name;
381 381
                     }
382 382
                     break;
383 383
                 case $providerStrings[2]:
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                     return false;
394 394
             }
395 395
         }
396
-        \core\common\Logging::debug_s(4,$listOfProviders, "PROVIDERS:\n", "\n");
396
+        \core\common\Logging::debug_s(4, $listOfProviders, "PROVIDERS:\n", "\n");
397 397
         return $listOfProviders;
398 398
     }
399 399
 }
400 400
\ No newline at end of file
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.
core/UserManagement.php 1 patch
Spacing   +10 added lines, -10 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
         }
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         // these require no further checking
412 412
         foreach ($extInstListTmp as $country => $extInstCountryList) {
413 413
             $len = count($extInstCountryList);
414
-            for($i = 0; $i < $len; ++$i) {
414
+            for ($i = 0; $i < $len; ++$i) {
415 415
                 $extInst = $extInstCountryList[$i];
416 416
                 if ($extInst['inst_id'] != NULL && in_array($extInst['inst_id'], $this->currentInstitutions['existing'])) {
417 417
                     unset($extInstList[$country][$i]);
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
             $names = $disectedNames['joint'];
498 498
             $realms = ExternalEduroamDBData::dissectCollapsedInstitutionRealms($extInst['realm']);
499 499
             $foundMatch = $this->checkForSimilarInstitutions($names, $realms);
500
-            common\Logging::debug_s(4, $foundMatch, "checkForSimilarInstitutions returned: ","\n");
500
+            common\Logging::debug_s(4, $foundMatch, "checkForSimilarInstitutions returned: ", "\n");
501 501
             if ($foundMatch == 0) {
502 502
                 $this->currentInstitutions['new'][] = [$extInst['external_db_id'], $disectedNames['perlang'], $country];
503 503
             }
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
      * @return string NULL - the date last seen or NULL if not recorded yet
698 698
      */
699 699
     public function getAdminLastAuth($user) {
700
-        $truncatedUser = substr($user,0,999);
700
+        $truncatedUser = substr($user, 0, 999);
701 701
         $result = $this->databaseHandle->exec("SELECT DATE(last_login) FROM admin_logins WHERE user_id='$truncatedUser'");
702 702
         if ($result->num_rows == 1) {
703 703
             $date = $result ->fetch_row()[0];
Please login to merge, or discard this patch.
core/CAT.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         parent::__construct();
110 110
         common\Entity::intoThePotatoes();
111 111
 
112
-        $this->catVersionString = sprintf("Unreleased %s Git Revision"    , "<a href='https://github.com/GEANT/CAT/tree/master/Changes.md'>") . "</a>";
112
+        $this->catVersionString = sprintf("Unreleased %s Git Revision", "<a href='https://github.com/GEANT/CAT/tree/master/Changes.md'>")."</a>";
113 113
 
114 114
         if (CAT::RELEASE_VERSION) {
115 115
             $major = CAT::VERSION_MAJOR;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
             if (CAT::VERSION_EXTRA != "") {
126 126
                 $temp_version .= "-$extra";
127 127
             }
128
-            $this->catVersionString = sprintf("Release <a href='%s'>%s</a>", "https://github.com/GEANT/CAT/tree/" . $branch . "/Changes.md", $temp_version);
128
+            $this->catVersionString = sprintf("Release <a href='%s'>%s</a>", "https://github.com/GEANT/CAT/tree/".$branch."/Changes.md", $temp_version);
129 129
 
130 130
         }
131 131
         $product = \config\Master::APPEARANCE['productname'];
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
         $maxYear = self::COPYRIGHT_MAX_YEAR;
134 134
         $holder = self::COPYRIGHT_HOLDER;
135 135
         $consortia = self::COPYRIGHT_CONSORTIA;
136
-        $this->catCopyright = "$product - " . $this->catVersionString . " &copy; $minYear-$maxYear $holder<br/>on behalf of $consortia; and others <a href='copyright.php'>Full Copyright and Licenses</a>";
136
+        $this->catCopyright = "$product - ".$this->catVersionString." &copy; $minYear-$maxYear $holder<br/>on behalf of $consortia; and others <a href='copyright.php'>Full Copyright and Licenses</a>";
137 137
         $this->catCopyrifhtAndLicense = "&copy; $minYear-$maxYear $holder<br/>on behalf of $consortia; and others <a href='copyright.php'>Full Copyright and Licenses</a>";
138
-        $this->catVersion = "$product<br>" . $this->catVersionString;
138
+        $this->catVersion = "$product<br>".$this->catVersionString;
139 139
 
140 140
         /* Federations are created in DB with bootstrapFederation, and listed via listFederations
141 141
          */
Please login to merge, or discard this patch.
web/admin/inc/sendinvite.inc.php 2 patches
Switch Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -315,12 +315,12 @@
 block discarded – undo
315 315
 }
316 316
 
317 317
 switch ($operationMode) {
318
-    case OPERATION_MODE_SELF_ADMIN_ADD:
319
-    case OPERATION_MODE_SELF_NEWFROMDB:
320
-        print("SUCCESS");
321
-        break;
322
-    default:
323
-        header("Location: $redirectDestination" . $finalDestParams);
318
+        case OPERATION_MODE_SELF_ADMIN_ADD:
319
+        case OPERATION_MODE_SELF_NEWFROMDB:
320
+            print("SUCCESS");
321
+            break;
322
+        default:
323
+            header("Location: $redirectDestination" . $finalDestParams);
324 324
 }
325 325
 
326 326
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 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();
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
         $idp = $validator->existingIdP($_GET['inst_id']);
115 115
         // editing IdPs is done from within the popup. When we're done, send the 
116 116
         // user back to the popup (append the result of the operation later)
117
-        $redirectDestination = "manageAdmins.inc.php?inst_id=" . $idp->identifier . "&";
117
+        $redirectDestination = "manageAdmins.inc.php?inst_id=".$idp->identifier."&";
118 118
         if (count($validAddresses) == 0) {
119
-            header("Location: $redirectDestination" . "invitation=INVALIDSYNTAX");
119
+            header("Location: $redirectDestination"."invitation=INVALIDSYNTAX");
120 120
             exit(1);
121 121
         }
122 122
         // is the user primary admin of this IdP?
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
         $fedadmin = $userObject->isFederationAdmin($idp->federation);
126 126
         // check if he is either one, if not, complain
127 127
         if (!$is_owner && !$fedadmin) {
128
-            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>";
128
+            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>";
129 129
             exit(1);
130 130
         }
131 131
         $prettyprintname = $idp->name;
132 132
         $newtokens = $mgmt->createTokens($fedadmin, $validAddresses, $idp);
133
-        \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP " . $idp->identifier . " - Token created for " . implode(",", $validAddresses));
133
+        \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP ".$idp->identifier." - Token created for ".implode(",", $validAddresses));
134 134
         $introtext = "CO-ADMIN";
135 135
         $participant_type = $idp->type;
136 136
         break;
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         $validAddresses = [$_SESSION['auth_email']];
144 144
         $prettyprintname = $idp->name;
145 145
         $newtokens = $mgmt->createTokens("FED", $validAddresses, $idp);
146
-        \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP (self)" . $idp->identifier . " - Token created for " . implode(",", $validAddresses));
146
+        \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP (self)".$idp->identifier." - Token created for ".implode(",", $validAddresses));
147 147
         $participant_type = $idp->type;
148 148
         $introtext = "SELF-ADMIN";
149 149
         break;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         $participant_type = $validator->partType($_POST['participant_type']);
160 160
         $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($newcountry);
161 161
         if ($new_idp_authorized_fedadmin !== TRUE) {
162
-            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!");
162
+            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!");
163 163
         }
164 164
         $federation = $validator->existingFederation($newcountry);
165 165
         $prettyprintname = $newinstname;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         // send the user back to his federation overview page, append the result of the operation later
168 168
         // do the token creation magic
169 169
         $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $newinstname, 0, $newcountry, $participant_type);
170
-        \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "ORG FUTURE  - Token created for $participant_type " . implode(",", $validAddresses));
170
+        \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "ORG FUTURE  - Token created for $participant_type ".implode(",", $validAddresses));
171 171
         break;
172 172
     case OPERATION_MODE_SELF_NEWFROMDB:
173 173
         $validAddresses = [$_SESSION['auth_email']];
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $found = [];
181 181
         foreach ($newIdPs as $allowed) {
182 182
             \core\common\Logging::debug_s(4, $allowed, "Allowed:\n", "\n");
183
-            if (strtoupper($allowed[2]) === $fedId && $allowed[0] ===  $newexternalid) {
183
+            if (strtoupper($allowed[2]) === $fedId && $allowed[0] === $newexternalid) {
184 184
                 $found = $allowed;
185 185
             }
186 186
         }
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                 $prettyprintname = $name;
209 209
             }
210 210
         }
211
-        if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') {
211
+        if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') {
212 212
             $participant_type = \core\IdP::TYPE_SP;
213 213
         } else {
214 214
             $participant_type = $extinfo['type'];
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         $introtext = "EXISTING-FED";
218 218
         // do the token creation magic
219 219
         $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId);
220
-        \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP FUTURE (self) - Token created for " . implode(",", $validAddresses));        
220
+        \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP FUTURE (self) - Token created for ".implode(",", $validAddresses));        
221 221
         break; 
222 222
     case OPERATION_MODE_NEWFROMDB:
223 223
         $redirectDestination = "../overview_federation.php?";
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         $extinfo = $catInstance->getExternalDBEntityDetails($newexternalid, strtoupper($fedId).'01');
232 232
         $new_idp_authorized_fedadmin = $userObject->isFederationAdmin($extinfo['country']);
233 233
         if ($new_idp_authorized_fedadmin !== TRUE) {
234
-            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!");
234
+            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!");
235 235
         }
236 236
         $federation = $validator->existingFederation($extinfo['country']);
237 237
         $newcountry = $extinfo['country'];
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
                 $prettyprintname = $name;
251 251
             }
252 252
         }
253
-        if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') {
253
+        if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') {
254 254
             $participant_type = \core\IdP::TYPE_SP;
255 255
         } else {
256 256
             $participant_type = $extinfo['type'];
@@ -259,14 +259,14 @@  discard block
 block discarded – undo
259 259
         $introtext = "EXISTING-FED";
260 260
         // do the token creation magic
261 261
         $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId);
262
-        \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP FUTURE  - Token created for " . implode(",", $validAddresses));
262
+        \core\common\Logging::writeSQLAudit_s($_SESSION['user'], "NEW", "IdP FUTURE  - Token created for ".implode(",", $validAddresses));
263 263
         break;
264 264
     default: // includes OPERATION_MODE_INVALID
265 265
         // second param is TRUE, so the variable *will* contain a string
266 266
         // i.e. ignore Scrutinizer type warning later
267 267
         $wrongcontent = print_r($_POST, TRUE);
268 268
         echo "<pre>Wrong parameters in POST:
269
-" . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent) . "
269
+" . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent)."
270 270
 </pre>";
271 271
         exit(1);
272 272
 }
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
             print("FAILURE");
298 298
             break;
299 299
         default:
300
-            header("Location: $redirectDestination" . "invitation=FAILURE");
300
+            header("Location: $redirectDestination"."invitation=FAILURE");
301 301
             exit;
302 302
     }
303 303
 }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 if (count($status) < count($totalSegments)) { // only a subset of mails was sent, update status
306 306
     $finalDestParams = "invitation=PARTIAL";
307 307
 }
308
-$finalDestParams .= "&successcount=" . count($status);
308
+$finalDestParams .= "&successcount=".count($status);
309 309
 if ($allEncrypted === TRUE) {
310 310
     $finalDestParams .= "&transportsecurity=ENCRYPTED";
311 311
 } elseif ($allClear === TRUE) {
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
         print("SUCCESS");
321 321
         break;
322 322
     default:
323
-        header("Location: $redirectDestination" . $finalDestParams);
323
+        header("Location: $redirectDestination".$finalDestParams);
324 324
 }
325 325
 
326 326
 
Please login to merge, or discard this patch.
web/admin/inc/manageAdmins.inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  */
21 21
 ?>
22 22
 <?php
23
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $languageInstance = new \core\common\Language();
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                 default:
124 124
                     throw new Exception("Error: unknown encryption status of invitation!?!");
125 125
             }
126
-            echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter) . " " . $cryptText, _("Sent successfully."));
126
+            echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter)." ".$cryptText, _("Sent successfully."));
127 127
             break;
128 128
         case "FAILURE":
129 129
             echo $uiElements->boxError(_("No invitation email could be sent!"), _("Sending failure!"));
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                 default:
144 144
                     throw new Exception("Error: unknown encryption status of invitation!?!");
145 145
             }
146
-            echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter) . " " . $cryptText, _("Partial success."));
146
+            echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter)." ".$cryptText, _("Partial success."));
147 147
             break;
148 148
         case "INVALIDSYNTAX":
149 149
             echo $uiElements->boxError(_("The invitation email address was malformed, no invitation was sent!"), _("The invitation email address was malformed, no invitation was sent!"));
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                 ?>
203 203
             </td>
204 204
             <td>
205
-                <form action='inc/manageAdmins.inc.php?inst_id=<?php echo $my_inst->identifier ?>' method='post' <?php echo ( $oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "" ); ?> accept-charset='UTF-8'>
205
+                <form action='inc/manageAdmins.inc.php?inst_id=<?php echo $my_inst->identifier ?>' method='post' <?php echo ($oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : ""); ?> accept-charset='UTF-8'>
206 206
                     <input type='hidden' name='admin_id' value='<?php echo $oneowner['ID']; ?>'></input>
207 207
                     <button type='submit' name='submitbutton' class='delete' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>'><?php echo _("Delete Administrator") ?></button>
208 208
                 </form>
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
 $pending_invites = $mgmt->listPendingInvitations($my_inst->identifier);
227 227
 $loggerInstance->debug(4, "Displaying pending invitations for $my_inst->identifier.\n");
228 228
 if (count($pending_invites) > 0) {
229
-    echo "<strong>" . _("Pending invitations for this IdP") . "</strong>";
229
+    echo "<strong>"._("Pending invitations for this IdP")."</strong>";
230 230
     echo "<table>";
231 231
     foreach ($pending_invites as $invitee) {
232
-        echo "<tr><td>" . $invitee['mail'] . "</td><td>" . sprintf(_("(expires %s)"), $invitee['expiry']) . "</td></tr>";
232
+        echo "<tr><td>".$invitee['mail']."</td><td>".sprintf(_("(expires %s)"), $invitee['expiry'])."</td></tr>";
233 233
     }
234 234
     echo "</table>";
235 235
 }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
     if (!$is_admin_himself) {
255 255
         echo "<form action='inc/manageAdmins.inc.php?inst_id=$my_inst->identifier' method='post' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'>
256
-    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_TAKECONTROL . "'>" . sprintf(_("Take control of this %s"), $uiElements->nomenclatureParticipant) . "</button>
256
+    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_TAKECONTROL."'>".sprintf(_("Take control of this %s"), $uiElements->nomenclatureParticipant)."</button>
257 257
 </form>";
258 258
     }
259 259
 }
Please login to merge, or discard this patch.
web/lib/admin/Authentication.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         if ($trailerPosition !== FALSE) {
143 143
             $base = substr($scriptself, 0, $trailerPosition);
144 144
             if ($base !== FALSE) {
145
-                $url = "//$servername" . $base . "/logout_check.php";
145
+                $url = "//$servername".$base."/logout_check.php";
146 146
             }
147 147
         }
148 148
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         if (!$handle instanceof \core\DBConnection) {
159 159
             $frontendHandle = $handle;
160 160
         }
161
-        $truncatedUser = substr($user,0,999);      
161
+        $truncatedUser = substr($user, 0, 999);      
162 162
         $handle->exec("INSERT INTO admin_logins (user_id, last_login) VALUES ('$truncatedUser', NOW()) ON DUPLICATE KEY UPDATE last_login=NOW()");
163 163
     }
164 164
 
Please login to merge, or discard this patch.