Test Failed
Push — master ( 239970...076b28 )
by Tomasz
10:54
created
web/admin/inc/sendinvite.inc.php 2 patches
Switch Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -98,99 +98,99 @@
 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
-        $participant_type = $extinfo['type'];
180
-        // fill the rest of the text
181
-        $introtext = "EXISTING-FED";
182
-        // do the token creation magic
183
-        $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId);
184
-        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP FUTURE  - Token created for " . implode(",", $validAddresses));
185
-        break;
186
-    default: // includes OPERATION_MODE_INVALID
187
-        // second param is TRUE, so the variable *will* contain a string
188
-        // i.e. ignore Scrutinizer type warning later
189
-        $wrongcontent = print_r($_POST, TRUE);
190
-        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
+            $participant_type = $extinfo['type'];
180
+            // fill the rest of the text
181
+            $introtext = "EXISTING-FED";
182
+            // do the token creation magic
183
+            $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId);
184
+            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP FUTURE  - Token created for " . implode(",", $validAddresses));
185
+            break;
186
+        default: // includes OPERATION_MODE_INVALID
187
+            // second param is TRUE, so the variable *will* contain a string
188
+            // i.e. ignore Scrutinizer type warning later
189
+            $wrongcontent = print_r($_POST, TRUE);
190
+            echo "<pre>Wrong parameters in POST:
191 191
 " . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent) . "
192 192
 </pre>";
193
-        exit(1);
193
+            exit(1);
194 194
 }
195 195
 
196 196
 // send, and invalidate the token immediately if the mail could not be sent!
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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'];
@@ -181,14 +181,14 @@  discard block
 block discarded – undo
181 181
         $introtext = "EXISTING-FED";
182 182
         // do the token creation magic
183 183
         $newtokens = $mgmt->createTokens(TRUE, $validAddresses, $prettyprintname, $newexternalid, $fedId);
184
-        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP FUTURE  - Token created for " . implode(",", $validAddresses));
184
+        $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP FUTURE  - Token created for ".implode(",", $validAddresses));
185 185
         break;
186 186
     default: // includes OPERATION_MODE_INVALID
187 187
         // second param is TRUE, so the variable *will* contain a string
188 188
         // i.e. ignore Scrutinizer type warning later
189 189
         $wrongcontent = print_r($_POST, TRUE);
190 190
         echo "<pre>Wrong parameters in POST:
191
-" . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent) . "
191
+" . htmlspecialchars(/** @scrutinizer ignore-type */ $wrongcontent)."
192 192
 </pre>";
193 193
         exit(1);
194 194
 }
@@ -213,14 +213,14 @@  discard block
 block discarded – undo
213 213
 }
214 214
 
215 215
 if (count($status) == 0) {
216
-    header("Location: $redirectDestination" . "invitation=FAILURE");
216
+    header("Location: $redirectDestination"."invitation=FAILURE");
217 217
     exit;
218 218
 }
219 219
 $finalDestParams = "invitation=SUCCESS";
220 220
 if (count($status) < count($totalSegments)) { // only a subset of mails was sent, update status
221 221
     $finalDestParams = "invitation=PARTIAL";
222 222
 }
223
-$finalDestParams .= "&successcount=" . count($status);
223
+$finalDestParams .= "&successcount=".count($status);
224 224
 if ($allEncrypted === TRUE) {
225 225
     $finalDestParams .= "&transportsecurity=ENCRYPTED";
226 226
 } elseif ($allClear === TRUE) {
@@ -229,4 +229,4 @@  discard block
 block discarded – undo
229 229
     $finalDestParams .= "&transportsecurity=PARTIAL";
230 230
 }
231 231
 
232
-header("Location: $redirectDestination" . $finalDestParams);
232
+header("Location: $redirectDestination".$finalDestParams);
Please login to merge, or discard this patch.
web/admin/inc/manageDBLink.inc.php 1 patch
Spacing   +20 added lines, -20 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
 $auth->authenticate();
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
 // if we have a pushed close button, submit attributes and send user back to the overview page
37 37
 // if external DB sync is disabled globally, the user never gets to this page. If he came here *anyway* -> send him back immediately.
38
-if ((isset($_POST['submitbutton']) && $_POST['submitbutton'] == web\lib\common\FormElements::BUTTON_CLOSE ) || \config\Master::DB['enforce-external-sync'] == FALSE) {
38
+if ((isset($_POST['submitbutton']) && $_POST['submitbutton'] == web\lib\common\FormElements::BUTTON_CLOSE) || \config\Master::DB['enforce-external-sync'] == FALSE) {
39 39
     header("Location: ../overview_federation.php");
40 40
     exit;
41 41
 }
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
     $cat = new \core\CAT();
93 93
     switch ($my_inst->getExternalDBSyncState()) {
94 94
         case \core\IdP::EXTERNAL_DB_SYNCSTATE_SYNCED:
95
-            printf(_("This %s is linked to the %s database."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name']) . "</p>";
96
-            echo "<p>" . sprintf(_("The following information about the IdP is stored in the %s DB and %s DB:"), \config\Master::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['display_name']) . "</p>";
97
-            echo "<table><tr><td>" . sprintf(_("Information in <strong>%s Database</strong>"), \config\Master::APPEARANCE['productname']) . "</td><td>" . sprintf(_("Information in <strong>%s Database</strong>"), \config\ConfAssistant::CONSORTIUM['display_name']) . "</td></tr>";
95
+            printf(_("This %s is linked to the %s database."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name'])."</p>";
96
+            echo "<p>".sprintf(_("The following information about the IdP is stored in the %s DB and %s DB:"), \config\Master::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['display_name'])."</p>";
97
+            echo "<table><tr><td>".sprintf(_("Information in <strong>%s Database</strong>"), \config\Master::APPEARANCE['productname'])."</td><td>".sprintf(_("Information in <strong>%s Database</strong>"), \config\ConfAssistant::CONSORTIUM['display_name'])."</td></tr>";
98 98
             echo "<tr><td>";
99 99
             // left-hand side: CAT DB
100 100
             echo "<table>";
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                 } else {
107 107
                     $language = \config\Master::LANGUAGES[$name['lang']]['display'] ?? "(unsupported language)";
108 108
                 }
109
-                echo "<tr><td>" . sprintf(_("%s Name (%s)"), $uiElements->nomenclatureParticipant, $language) . "</td><td>" . $name['value'] . "</td></tr>";
109
+                echo "<tr><td>".sprintf(_("%s Name (%s)"), $uiElements->nomenclatureParticipant, $language)."</td><td>".$name['value']."</td></tr>";
110 110
             }
111 111
 
112 112
             $admins = $my_inst->listOwners();
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                 if (count($username) == 0) {
118 118
                     $username[0]['value'] = _("Unnamed User");
119 119
                 }
120
-                echo "<tr><td>" . _("Administrator [invited as]") . "</td><td>" . $username[0]['value'] . " [" . $admin['MAIL'] . "]</td></tr>";
120
+                echo "<tr><td>"._("Administrator [invited as]")."</td><td>".$username[0]['value']." [".$admin['MAIL']."]</td></tr>";
121 121
             }
122 122
             echo "</table>";
123 123
             // end of left-hand side
@@ -127,38 +127,38 @@  discard block
 block discarded – undo
127 127
             $externalid = $extIdObject->external_db_id;
128 128
             $ROid = $extIdObject->ROid;
129 129
             if (is_bool($extIdObject)) { // we are in SYNCED state so this cannot happen
130
-                throw new Exception("We are in SYNCSTATE_SYNCED but still there is no external DB Id available for the " . $uiElements->nomenclatureParticipant . "!");
130
+                throw new Exception("We are in SYNCSTATE_SYNCED but still there is no external DB Id available for the ".$uiElements->nomenclatureParticipant."!");
131 131
             }
132 132
 
133 133
             $extinfo = $cat->getExternalDBEntityDetails($externalid, $ROid);
134 134
 
135 135
             echo "<table>";
136 136
             foreach ($extinfo['names'] as $lang => $name) {
137
-                echo "<tr><td>" . sprintf(_("%s Name (%s)"), $uiElements->nomenclatureParticipant, $lang) . "</td><td>$name</td>";
137
+                echo "<tr><td>".sprintf(_("%s Name (%s)"), $uiElements->nomenclatureParticipant, $lang)."</td><td>$name</td>";
138 138
             }
139 139
             foreach ($extinfo['admins'] as $number => $admin_details) {
140
-                echo "<tr><td>" . _("Administrator email") . "</td><td>" . $admin_details['email'] . "</td></tr>";
140
+                echo "<tr><td>"._("Administrator email")."</td><td>".$admin_details['email']."</td></tr>";
141 141
             }
142 142
             echo "</table>";
143 143
             // end of right-hand side
144 144
             echo "</td></tr></table>";
145
-            echo "<p>" . _("If this mapping is not correct any more, you can remove the link:") . " ";
145
+            echo "<p>"._("If this mapping is not correct any more, you can remove the link:")." ";
146 146
             echo "<form name='form-unlink-inst' action='inc/manageDBLink.inc.php?inst_id=$my_inst->identifier' method='post' accept-charset='UTF-8'>";
147
-            echo "<button type='submit' class='delete' name='submitbutton' id='submit' value='" . web\lib\common\FormElements::BUTTON_DELETE . "'>" . _("Unlink") . "</button></form>";
147
+            echo "<button type='submit' class='delete' name='submitbutton' id='submit' value='".web\lib\common\FormElements::BUTTON_DELETE."'>"._("Unlink")."</button></form>";
148 148
             break;
149 149
         case \core\IdP::EXTERNAL_DB_SYNCSTATE_NOT_SYNCED:
150 150
             $temparray = [];
151
-            printf(_("This %s is not yet linked to the %s database."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name']) . " ";
152
-            echo "<strong>" . _("This means that its profiles are not made available on the user download page.") . "</strong> ";
151
+            printf(_("This %s is not yet linked to the %s database."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name'])." ";
152
+            echo "<strong>"._("This means that its profiles are not made available on the user download page.")."</strong> ";
153 153
             printf(_("You can link it to the %s database below."), \config\ConfAssistant::CONSORTIUM['display_name']);
154 154
             $candidates = $my_inst->getExternalDBSyncCandidates($my_inst->type);
155 155
             echo "<br/><form name='form-link-inst' action='inc/manageDBLink.inc.php?inst_id=$my_inst->identifier' method='post' accept-charset='UTF-8'>";
156
-            printf(_("Please select an entity from the %s DB which corresponds to this CAT %s."), \config\ConfAssistant::CONSORTIUM['display_name'], $uiElements->nomenclatureParticipant) . " ";
156
+            printf(_("Please select an entity from the %s DB which corresponds to this CAT %s."), \config\ConfAssistant::CONSORTIUM['display_name'], $uiElements->nomenclatureParticipant)." ";
157 157
             if (count($candidates) > 0) {
158 158
                 printf(_("Particularly promising entries (names in CAT and %s DB are a 100%% match) are on top of the list."), \config\ConfAssistant::CONSORTIUM['display_name']);
159 159
             }
160 160
             echo "<table>";
161
-            echo "<tr><th>" . _("Link to this entity?") . "</th><th>" . sprintf(_("%s Name"), $uiElements->nomenclatureParticipant) . "</th><th>" . _("Administrators") . "</th></tr>";
161
+            echo "<tr><th>"._("Link to this entity?")."</th><th>".sprintf(_("%s Name"), $uiElements->nomenclatureParticipant)."</th><th>"._("Administrators")."</th></tr>";
162 162
 
163 163
             foreach ($candidates as $candidate) {
164 164
                 $info = $cat->getExternalDBEntityDetails($candidate, strtoupper($my_inst->federation).'01');
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 }
169 169
                 echo "</td><td>";
170 170
                 foreach ($info['admins'] as $number => $admin_details) {
171
-                    echo "[E-Mail] " . $admin_details['email'] . "<br/>";
171
+                    echo "[E-Mail] ".$admin_details['email']."<br/>";
172 172
                 }
173 173
                 echo "</td></tr>";
174 174
                 $temparray[] = $candidate;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             $buffer = "";
181 181
 
182 182
             foreach ($unmappedentities as $v) {
183
-                $buffer .= "<option value='" . $v['ID'] . "'>[ID " . $v['ID'] . "] " . $v['name'] . "</option>";
183
+                $buffer .= "<option value='".$v['ID']."'>[ID ".$v['ID']."] ".$v['name']."</option>";
184 184
             }
185 185
 
186 186
             if ($buffer != "") {
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
             }
192 192
             // issue a big red warning if there are no link candidates at all in the federation
193 193
             if (empty($buffer) && empty($candidates)) {
194
-                echo "<tr><td style='color:#ff0000' colspan='2'>" . sprintf(_('There is no single unmapped %s in the external database for this %s!'), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureFed) . "</td></tr>";
194
+                echo "<tr><td style='color:#ff0000' colspan='2'>".sprintf(_('There is no single unmapped %s in the external database for this %s!'), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureFed)."</td></tr>";
195 195
             }
196
-            echo "</table><button type='submit' name='submitbutton' id='submit' value='" . web\lib\common\FormElements::BUTTON_SAVE . "' disabled >" . _("Create Link") . "</button></form>";
196
+            echo "</table><button type='submit' name='submitbutton' id='submit' value='".web\lib\common\FormElements::BUTTON_SAVE."' disabled >"._("Create Link")."</button></form>";
197 197
             break;
198 198
         default:
199 199
     }
Please login to merge, or discard this patch.
web/admin/action_enrollment.php 2 patches
Switch Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -52,37 +52,37 @@
 block discarded – undo
52 52
 }
53 53
 
54 54
 switch ($_GET['token']) {
55
-    case "EDUGAIN-SELF-REGISTER":
56
-        $token = "EDUGAIN-SELF-REGISTER";
57
-        $extIdUnfiltered = filter_input(INPUT_GET,'extid');
58
-        $extIdArray = explode('-', htmlspecialchars(strip_tags($extIdUnfiltered)), 2);
59
-        $ROid = $extIdArray[0];
60
-        $extId = $extIdArray[1];
61
-        $fed = new \core\Federation(strtoupper(substr($ROid,0,2)));
62
-        $newInstFlag = $fed->getAttributes('fed:autoregister-new-inst');
63
-        if ($newInstFlag === []) {
64
-            $elements->errorPage(_("Error creating new IdP!"),_("You tried to register in self-service, but this federation does not allow self-service!"));
65
-        }
66
-        // we must be sure that this person admins the ext institution 
67
-        if ($validator->existingExtInstitution($extId, $userEmail, $ROid) === 1) {
55
+        case "EDUGAIN-SELF-REGISTER":
56
+            $token = "EDUGAIN-SELF-REGISTER";
57
+            $extIdUnfiltered = filter_input(INPUT_GET,'extid');
58
+            $extIdArray = explode('-', htmlspecialchars(strip_tags($extIdUnfiltered)), 2);
59
+            $ROid = $extIdArray[0];
60
+            $extId = $extIdArray[1];
61
+            $fed = new \core\Federation(strtoupper(substr($ROid,0,2)));
62
+            $newInstFlag = $fed->getAttributes('fed:autoregister-new-inst');
63
+            if ($newInstFlag === []) {
64
+                $elements->errorPage(_("Error creating new IdP!"),_("You tried to register in self-service, but this federation does not allow self-service!"));
65
+            }
66
+            // we must be sure that this person admins the ext institution 
67
+            if ($validator->existingExtInstitution($extId, $userEmail, $ROid) === 1) {
68
+                $checkval = \core\UserManagement::TOKENSTATUS_OK_NEW;
69
+                print "IdP ".$extId." in $ROid will be created";
70
+            }
71
+            // and check that this institution does not match anuthing in CAT.
72
+            $usermgmt = new \core\UserManagement();
73
+            if ($usermgmt->checkForCatMatch($extId, $ROid) === 1) {
74
+                $elements->errorPage(_("Error creating new IdP!"),_("You tried to register a new institution while it already has a match in CAT or your email is not not listed as admin for this institution in the eduroam DB!"));            
75
+            }
76
+            break;
77
+        case "SELF-REGISTER":
78
+            $token = "SELF-REGISTER";
68 79
             $checkval = \core\UserManagement::TOKENSTATUS_OK_NEW;
69
-            print "IdP ".$extId." in $ROid will be created";
70
-        }
71
-        // and check that this institution does not match anuthing in CAT.
72
-        $usermgmt = new \core\UserManagement();
73
-        if ($usermgmt->checkForCatMatch($extId, $ROid) === 1) {
74
-            $elements->errorPage(_("Error creating new IdP!"),_("You tried to register a new institution while it already has a match in CAT or your email is not not listed as admin for this institution in the eduroam DB!"));            
75
-        }
76
-        break;
77
-    case "SELF-REGISTER":
78
-        $token = "SELF-REGISTER";
79
-        $checkval = \core\UserManagement::TOKENSTATUS_OK_NEW;
80
-        $federation = \config\ConfAssistant::CONSORTIUM['selfservice_registration'];
81
-        break;
82
-    default:
83
-        $tokenUnfiltered = $validator->token(filter_input(INPUT_GET,'token'));
84
-        $token = htmlspecialchars(strip_tags($tokenUnfiltered));
85
-        $checkval = $usermgmt->checkTokenValidity($token);
80
+            $federation = \config\ConfAssistant::CONSORTIUM['selfservice_registration'];
81
+            break;
82
+        default:
83
+            $tokenUnfiltered = $validator->token(filter_input(INPUT_GET,'token'));
84
+            $token = htmlspecialchars(strip_tags($tokenUnfiltered));
85
+            $checkval = $usermgmt->checkTokenValidity($token);
86 86
 }
87 87
 
88 88
 if ($checkval < 0) {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 ?>
31 31
 <?php
32 32
 
33
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
33
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
34 34
 
35 35
 $auth = new \web\lib\admin\Authentication();
36 36
 $deco = new \web\lib\admin\PageDecoration();
@@ -44,24 +44,24 @@  discard block
 block discarded – undo
44 44
 
45 45
 
46 46
 if (!isset($_GET['token'])) {
47
-    $elements->errorPage(_("Error creating new IdP binding!"),_("This page needs to be called with a valid invitation token!"));
47
+    $elements->errorPage(_("Error creating new IdP binding!"), _("This page needs to be called with a valid invitation token!"));
48 48
 }
49 49
 
50 50
 if (\config\ConfAssistant::CONSORTIUM['selfservice_registration'] === NULL && $_GET['token'] == "SELF-REGISTER") {
51
-    $elements->errorPage(_("Error creating new IdP binding!"),_("You tried to register in self-service, but this deployment does not allow self-service!"));
51
+    $elements->errorPage(_("Error creating new IdP binding!"), _("You tried to register in self-service, but this deployment does not allow self-service!"));
52 52
 }
53 53
 
54 54
 switch ($_GET['token']) {
55 55
     case "EDUGAIN-SELF-REGISTER":
56 56
         $token = "EDUGAIN-SELF-REGISTER";
57
-        $extIdUnfiltered = filter_input(INPUT_GET,'extid');
57
+        $extIdUnfiltered = filter_input(INPUT_GET, 'extid');
58 58
         $extIdArray = explode('-', htmlspecialchars(strip_tags($extIdUnfiltered)), 2);
59 59
         $ROid = $extIdArray[0];
60 60
         $extId = $extIdArray[1];
61
-        $fed = new \core\Federation(strtoupper(substr($ROid,0,2)));
61
+        $fed = new \core\Federation(strtoupper(substr($ROid, 0, 2)));
62 62
         $newInstFlag = $fed->getAttributes('fed:autoregister-new-inst');
63 63
         if ($newInstFlag === []) {
64
-            $elements->errorPage(_("Error creating new IdP!"),_("You tried to register in self-service, but this federation does not allow self-service!"));
64
+            $elements->errorPage(_("Error creating new IdP!"), _("You tried to register in self-service, but this federation does not allow self-service!"));
65 65
         }
66 66
         // we must be sure that this person admins the ext institution 
67 67
         if ($validator->existingExtInstitution($extId, $userEmail, $ROid) === 1) {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         // and check that this institution does not match anuthing in CAT.
72 72
         $usermgmt = new \core\UserManagement();
73 73
         if ($usermgmt->checkForCatMatch($extId, $ROid) === 1) {
74
-            $elements->errorPage(_("Error creating new IdP!"),_("You tried to register a new institution while it already has a match in CAT or your email is not not listed as admin for this institution in the eduroam DB!"));            
74
+            $elements->errorPage(_("Error creating new IdP!"), _("You tried to register a new institution while it already has a match in CAT or your email is not not listed as admin for this institution in the eduroam DB!"));            
75 75
         }
76 76
         break;
77 77
     case "SELF-REGISTER":
@@ -80,23 +80,23 @@  discard block
 block discarded – undo
80 80
         $federation = \config\ConfAssistant::CONSORTIUM['selfservice_registration'];
81 81
         break;
82 82
     default:
83
-        $tokenUnfiltered = $validator->token(filter_input(INPUT_GET,'token'));
83
+        $tokenUnfiltered = $validator->token(filter_input(INPUT_GET, 'token'));
84 84
         $token = htmlspecialchars(strip_tags($tokenUnfiltered));
85 85
         $checkval = $usermgmt->checkTokenValidity($token);
86 86
 }
87 87
 
88 88
 if ($checkval < 0) {
89 89
     echo $deco->pageheader(_("Error creating new IdP binding!"), "ADMIN-IDP");
90
-    echo "<h1>" . _("Error creating new IdP binding!") . "</h1>";
90
+    echo "<h1>"._("Error creating new IdP binding!")."</h1>";
91 91
     switch ($checkval) {
92 92
         case \core\UserManagement::TOKENSTATUS_FAIL_ALREADYCONSUMED:
93
-            echo "<p>" . sprintf(_("Sorry... this token has already been used. The %s is already created. If you got the invitation from a mailing list, probably someone else used it before you."), $elements->nomenclatureParticipant) . "</p>";
93
+            echo "<p>".sprintf(_("Sorry... this token has already been used. The %s is already created. If you got the invitation from a mailing list, probably someone else used it before you."), $elements->nomenclatureParticipant)."</p>";
94 94
             break;
95 95
         case \core\UserManagement::TOKENSTATUS_FAIL_EXPIRED:
96
-            echo "<p>" . sprintf(_("Sorry... this token has expired. Invitation tokens are valid for 24 hours. The %s administrator can create a new one for you."), $elements->nomenclatureFed) . "</p>";
96
+            echo "<p>".sprintf(_("Sorry... this token has expired. Invitation tokens are valid for 24 hours. The %s administrator can create a new one for you."), $elements->nomenclatureFed)."</p>";
97 97
             break;
98 98
         default:
99
-            echo "<p>" . _("Sorry... you have come to the enrollment page without a valid token. Are you a nasty person? If not, you should go to <a href='overview_user.php'>your profile page</a> instead.") . "</p>";
99
+            echo "<p>"._("Sorry... you have come to the enrollment page without a valid token. Are you a nasty person? If not, you should go to <a href='overview_user.php'>your profile page</a> instead.")."</p>";
100 100
     }
101 101
     echo $deco->footer();
102 102
     throw new Exception("Terminating because something is wrong with the token we received.");
@@ -110,17 +110,17 @@  discard block
 block discarded – undo
110 110
 switch ($token) {
111 111
     case "EDUGAIN-SELF-REGISTER":
112 112
         $newidp = $usermgmt->createIdPFromExternal($extId, $fed, $user);
113
-        $loggerInstance->writeAudit($user, "MOD", "IdP " . $newidp->identifier . " - selfservice eduGAIN registration");
113
+        $loggerInstance->writeAudit($user, "MOD", "IdP ".$newidp->identifier." - selfservice eduGAIN registration");
114 114
         break;    
115 115
     case "SELF-REGISTER":
116 116
         $fed = new \core\Federation($federation);
117 117
         $newidp = new \core\IdP($fed->newIdP(core\IdP::TYPE_IDPSP, $user, "FED", "SELFSERVICE"));
118
-        $loggerInstance->writeAudit($user, "MOD", "IdP " . $newidp->identifier . " - selfservice registration");
118
+        $loggerInstance->writeAudit($user, "MOD", "IdP ".$newidp->identifier." - selfservice registration");
119 119
         break;
120 120
     default:
121 121
         $newidp = $usermgmt->createIdPFromToken($token, $user);
122 122
         $usermgmt->invalidateToken($token);
123
-        $loggerInstance->writeAudit($user, "MOD", "IdP " . $newidp->identifier . " - Token used and invalidated");
123
+        $loggerInstance->writeAudit($user, "MOD", "IdP ".$newidp->identifier." - Token used and invalidated");
124 124
         break;
125 125
 }
126 126
 
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
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             sprintf(_("%s: Do not terminate EAP"), \core\ProfileSilverbullet::PRODUCTNAME) => "fed:silverbullet-noterm",
136 136
             sprintf(_("%s: max users per profile"), \core\ProfileSilverbullet::PRODUCTNAME) => "fed:silverbullet-maxusers",
137 137
             sprintf(_("Mint %s with CA on creation"), $this->nomenclatureIdP) => "fed:minted_ca_file",
138
-            sprintf(_("OpenRoaming: Allow %s Opt-In"),$this->nomenclatureParticipant) => "fed:openroaming",
138
+            sprintf(_("OpenRoaming: Allow %s Opt-In"), $this->nomenclatureParticipant) => "fed:openroaming",
139 139
             _("OpenRoaming: Custom NAPTR Target") => "fed:openroaming_customtarget",
140 140
             _("Allow admins listed in eduroam DB to become admins for synced CAT institutions") => "fed:autoregister-synced",
141 141
             _("Allow admins listed in eduroam DB to create new institutions") => "fed:autoregister-new-inst",
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $find = array_keys($displayNames, $input, TRUE);
150 150
 
151 151
         if (count($find) == 0) { // this is an error! throw an Exception
152
-            throw new \Exception("The translation of an option name was requested, but the option is not known to the system: " . htmlentities($input));
152
+            throw new \Exception("The translation of an option name was requested, but the option is not known to the system: ".htmlentities($input));
153 153
         }
154 154
         \core\common\Entity::outOfThePotatoes();
155 155
         // 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
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
         foreach ($optionlist as $option) {
173 173
             $type = $optioninfo->optionType($option['name']);
174
-            if (preg_match('/^' . $class . '/', $option['name']) && $option['level'] == "$level") {
174
+            if (preg_match('/^'.$class.'/', $option['name']) && $option['level'] == "$level") {
175 175
                 // all non-multilang attribs get this assignment ...
176 176
                 $language = "";
177 177
                 $content = $option['value'];
@@ -189,19 +189,19 @@  discard block
 block discarded – undo
189 189
                         $locationMarkers[] = $coords;
190 190
                         break;
191 191
                     case "file":
192
-                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td>";
192
+                        $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td>";
193 193
                         switch ($option['name']) {
194 194
                             case "general:logo_file":
195 195
                             case "fed:logo_file":
196
-                                $retval .= $this->previewImageinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']);
196
+                                $retval .= $this->previewImageinHTML('ROWID-'.$option['level'].'-'.$option['row_id']);
197 197
                                 break;
198 198
                             case "eap:ca_file":
199 199
                             // fall-through intended: display both the same way
200 200
                             case "fed:minted_ca_file":
201
-                                $retval .= $this->previewCAinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']);
201
+                                $retval .= $this->previewCAinHTML('ROWID-'.$option['level'].'-'.$option['row_id']);
202 202
                                 break;
203 203
                             case "support:info_file":
204
-                                $retval .= $this->previewInfoFileinHTML('ROWID-' . $option['level'] . '-' . $option['row_id']);
204
+                                $retval .= $this->previewInfoFileinHTML('ROWID-'.$option['level'].'-'.$option['row_id']);
205 205
                                 break;
206 206
                             default:
207 207
                         }
@@ -211,10 +211,10 @@  discard block
 block discarded – undo
211 211
                             // do not display the option at all; it gets auto-set by the ProfileSilverbullet constructor and doesn't have to be seen
212 212
                             break;
213 213
                         }
214
-                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>";
214
+                        $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>".($content == "on" ? _("on") : _("off"))."</strong></td></tr>";
215 215
                         break;
216 216
                     default:
217
-                        $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>";
217
+                        $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>$content</strong></td></tr>";
218 218
                 }
219 219
             }
220 220
         }
@@ -223,11 +223,11 @@  discard block
 block discarded – undo
223 223
             $locationCount = 0;
224 224
             foreach ($locationMarkers as $g) {
225 225
                 $locationCount++;
226
-                $marker .= '<marker name="' . $locationCount . '" lat="' . $g['lat'] . '" lng="' . $g['lon'] . '" />';
226
+                $marker .= '<marker name="'.$locationCount.'" lat="'.$g['lat'].'" lng="'.$g['lon'].'" />';
227 227
             }
228 228
             $marker .= '<\/markers>'; // some validator says this should be escaped
229 229
             $jMarker = json_encode($locationMarkers);
230
-            $retval .= '<tr><td><script>markers=\'' . $marker . '\'; jmarkers = \'' . $jMarker . '\';</script></td><td></td><td></td></tr>';
230
+            $retval .= '<tr><td><script>markers=\''.$marker.'\'; jmarkers = \''.$jMarker.'\';</script></td><td></td><td></td></tr>';
231 231
         }
232 232
         \core\common\Entity::outOfThePotatoes();
233 233
         return $retval;
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
         \core\common\Entity::intoThePotatoes();
244 244
         $idpoptions = $myInst->getAttributes();
245 245
         $retval = "<div class='infobox'>
246
-        <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant) . "</h2>
246
+        <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant)."</h2>
247 247
         <table>
248 248
             <tr>
249 249
                 <td>
250
-                    " . _("Country:") . "
250
+                    " . _("Country:")."
251 251
                 </td>
252 252
                 <td>
253 253
                 </td>
@@ -257,16 +257,16 @@  discard block
 block discarded – undo
257 257
         $retval .= $myFed->name;
258 258
         $retval .= "</strong>
259 259
                 </td>
260
-            </tr>" . $this->infoblock($idpoptions, "general", "IdP") . "
260
+            </tr>" . $this->infoblock($idpoptions, "general", "IdP")."
261 261
         </table>
262 262
     </div>";
263 263
 
264 264
         $blocks = [["support", _("Global Helpdesk Details")], ["media", _("Media Properties")]];
265 265
         foreach ($blocks as $block) {
266 266
             $retval .= "<div class='infobox'>
267
-            <h2>" . $block[1] . "</h2>
267
+            <h2>" . $block[1]."</h2>
268 268
             <table>" .
269
-                    $this->infoblock($idpoptions, $block[0], "IdP") .
269
+                    $this->infoblock($idpoptions, $block[0], "IdP").
270 270
                     "</table>
271 271
         </div>";
272 272
         }
@@ -281,12 +281,12 @@  discard block
 block discarded – undo
281 281
      */
282 282
     private function displaySize(int $number) {
283 283
         if ($number > 1024 * 1024) {
284
-            return round($number / 1024 / 1024, 2) . " MiB";
284
+            return round($number / 1024 / 1024, 2)." MiB";
285 285
         }
286 286
         if ($number > 1024) {
287
-            return round($number / 1024, 2) . " KiB";
287
+            return round($number / 1024, 2)." KiB";
288 288
         }
289
-        return $number . " B";
289
+        return $number." B";
290 290
     }
291 291
 
292 292
     /**
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
         $caExpiryTrashhold = \config\ConfAssistant::CERT_WARNINGS['expiry_warning'];
342 342
         $rawResult = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE);
343 343
         if (is_bool($rawResult)) { // we didn't actually get a CA!
344
-            $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the certificate from the database!") . "</div>";
344
+            $retval = "<div class='ca-summary'>"._("There was an error while retrieving the certificate from the database!")."</div>";
345 345
             \core\common\Entity::outOfThePotatoes();
346 346
             return $retval;
347 347
         }
@@ -357,8 +357,8 @@  discard block
 block discarded – undo
357 357
 
358 358
         $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']);
359 359
         $details['name'] = preg_replace('/\//', "", $details['name']);
360
-        $certstatus = ( $details['root'] == 1 ? "R" : "I");
361
-        $certTooltip = ( $details['root'] == 1 ? _("Root CA") : _("Intermediate CA"));
360
+        $certstatus = ($details['root'] == 1 ? "R" : "I");
361
+        $certTooltip = ($details['root'] == 1 ? _("Root CA") : _("Intermediate CA"));
362 362
         $innerbgColor = "#0000ff";
363 363
         $leftBorderColor = "#00ff00";
364 364
         $message = "";
@@ -366,35 +366,35 @@  discard block
 block discarded – undo
366 366
             $leftBorderColor = "red";
367 367
             $message = _("This is a <strong>SERVER</strong> certificate!");
368 368
             if (\config\ConfAssistant::CERT_GUIDELINES !== '') {
369
-                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>". _("more info")."</a>";
369
+                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>"._("more info")."</a>";
370 370
             }
371 371
             $message .= "<br/>";
372
-            $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>";
372
+            $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>";
373 373
             \core\common\Entity::outOfThePotatoes();
374 374
             return $retval;
375 375
         }
376 376
         $now = time();
377 377
         if ($now + \config\ConfAssistant::CERT_WARNINGS['expiry_critical'] > $details['full_details']['validTo_time_t']) {
378 378
             $leftBorderColor = "red";
379
-            $message = _("Certificate expired!") . "<br>";
380
-        } elseif($now + \config\ConfAssistant::CERT_WARNINGS['expiry_warning']  > $details['full_details']['validTo_time_t'] - $caExpiryTrashhold) {
379
+            $message = _("Certificate expired!")."<br>";
380
+        } elseif ($now + \config\ConfAssistant::CERT_WARNINGS['expiry_warning'] > $details['full_details']['validTo_time_t'] - $caExpiryTrashhold) {
381 381
             if ($leftBorderColor == "#00ff00") {
382 382
                 $leftBorderColor = "yellow";
383 383
             }
384
-            $message = _("Certificate close to expiry!") . "<br/>";            
384
+            $message = _("Certificate close to expiry!")."<br/>";            
385 385
         }
386 386
    
387 387
         if ($details['root'] == 1 && $details['basicconstraints_set'] == 0) {
388 388
             if ($leftBorderColor == "#00ff00") {
389 389
                 $leftBorderColor = "yellow";
390 390
             }
391
-            $message .= "<div style='max-width: 25em'><strong>" . _("Improper root certificate, required critical CA extension missing, will not reliably install!") . "</strong>";
391
+            $message .= "<div style='max-width: 25em'><strong>"._("Improper root certificate, required critical CA extension missing, will not reliably install!")."</strong>";
392 392
             if (\config\ConfAssistant::CERT_GUIDELINES !== '') {
393
-                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>". _("more info")."</a>";
393
+                $message .= "<br/><a target='_blank' href='".\config\ConfAssistant::CERT_GUIDELINES."'>"._("more info")."</a>";
394 394
             }
395 395
             $message .= "</div><br/>";
396 396
         }
397
-        $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>";
397
+        $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>";
398 398
         \core\common\Entity::outOfThePotatoes();
399 399
         return $retval;
400 400
     }
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
      */
408 408
     public function previewImageinHTML($imageReference) {
409 409
         \core\common\Entity::intoThePotatoes();
410
-        $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=" . $imageReference . "' alt='" . _("Preview of logo file") . "'/>";
410
+        $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=".$imageReference."' alt='"._("Preview of logo file")."'/>";
411 411
         \core\common\Entity::outOfThePotatoes();
412 412
         return $retval;
413 413
     }
@@ -424,13 +424,13 @@  discard block
 block discarded – undo
424 424
         $ref = $validator->databaseReference($fileReference);
425 425
         $fileBlob = UIElements::getBlobFromDB($ref['table'], $ref['rowindex'], FALSE);
426 426
         if (is_bool($fileBlob)) { // we didn't actually get a file!
427
-            $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the file from the database!") . "</div>";
427
+            $retval = "<div class='ca-summary'>"._("There was an error while retrieving the file from the database!")."</div>";
428 428
             \core\common\Entity::outOfThePotatoes();
429 429
             return $retval;
430 430
         }
431 431
         $decodedFileBlob = base64_decode($fileBlob);
432 432
         $fileinfo = new \finfo();
433
-        $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>";
433
+        $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>";
434 434
         \core\common\Entity::outOfThePotatoes();
435 435
         return $retval;
436 436
     }
@@ -587,8 +587,8 @@  discard block
 block discarded – undo
587 587
             return "";
588 588
         }
589 589
 
590
-        $loggerInstance->debug(4, "Consortium logo is at: " . ROOT . "/web/resources/images/consortium_logo_large.png");
591
-        $logogd = imagecreatefrompng(ROOT . "/web/resources/images/consortium_logo_large.png");
590
+        $loggerInstance->debug(4, "Consortium logo is at: ".ROOT."/web/resources/images/consortium_logo_large.png");
591
+        $logogd = imagecreatefrompng(ROOT."/web/resources/images/consortium_logo_large.png");
592 592
         if ($logogd === FALSE) { // consortium logo is bogus; don't do anything
593 593
             return "";
594 594
         }
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
         imagecolorallocate($whiteimage, 255, 255, 255);
615 615
         // also make sure the initial placement is a multitude of 12; otherwise "two half" symbols might be affected
616 616
         $targetplacementx = (int) ($symbolsize * round(($sizeinput[0] / 2 - ($targetwidth - $symbolsize + 1) / 2) / $symbolsize));
617
-        $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1 ) / 2) / $symbolsize));
617
+        $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize + 1) / 2) / $symbolsize));
618 618
         imagecopyresized($inputgd, $whiteimage, $targetplacementx - $symbolsize, $targetplacementy - $symbolsize, 0, 0, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize);
619 619
         imagecopyresized($inputgd, $logogd, $targetplacementx, $targetplacementy, 0, 0, $targetwidth, $targetheight, $sizelogo[0], $sizelogo[1]);
620 620
         ob_start();
@@ -664,9 +664,9 @@  discard block
 block discarded – undo
664 664
                 $message = "Your configuration appears to be fine.";
665 665
                 break;
666 666
             default:
667
-                throw new Exception("The result code level " . $test->test_result['global'] . " is not defined!");
667
+                throw new Exception("The result code level ".$test->test_result['global']." is not defined!");
668 668
         }
669
-        $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>" . $message . "<br>See below for details<br><hr>");
669
+        $out .= $this->boxFlexible($test->test_result['global'], "<br><strong>Test Summary</strong><br>".$message."<br>See below for details<br><hr>");
670 670
         foreach ($test->out as $testValue) {
671 671
             foreach ($testValue as $o) {
672 672
                 $out .= $this->boxFlexible($o['level'], $o['message']);
Please login to merge, or discard this patch.
web/lib/common/InputValidation.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     private function inputValidationError($customtext)
41 41
     {
42 42
         \core\common\Entity::intoThePotatoes();
43
-        $retval = "<p>" . _("Input validation error: ") . $customtext . "</p>";
43
+        $retval = "<p>"._("Input validation error: ").$customtext."</p>";
44 44
         \core\common\Entity::outOfThePotatoes();
45 45
         return $retval;
46 46
     }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $postFed = $fedIdentifiers[$correctIndex];
98 98
         $temp = new \core\Federation($postFed);
99 99
         if ($owner === NULL) {
100
-            return [$temp,'readonly'];
100
+            return [$temp, 'readonly'];
101 101
         }
102 102
         $user = new \core\User($owner);        
103 103
         foreach ($temp->listFederationAdmins() as $oneowner) {
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
                 return [$temp, 'fullaccess'];
106 106
             }
107 107
         }
108
-        if ($user->isSuperadmin()|| $user->isSupport()) {
108
+        if ($user->isSuperadmin() || $user->isSupport()) {
109 109
                 $this->loggerInstance->debug(4, "You are the superadmin/support\n");
110
-                return [$temp,'readonly'];                
110
+                return [$temp, 'readonly'];                
111 111
             }
112 112
         throw new Exception($this->inputValidationError(sprintf("User is not %s administrator!", \core\common\Entity::$nomenclature_fed)));
113 113
     }
@@ -168,18 +168,18 @@  discard block
 block discarded – undo
168 168
             }
169 169
             if ($user->isFederationAdmin($temp->federation)) {
170 170
                 $this->loggerInstance->debug(4, "You are fed admin for this IdP\n");
171
-                return [$temp,'readonly'];
171
+                return [$temp, 'readonly'];
172 172
             }
173 173
             if ($user->isSuperadmin() || $user->isSupport()) {
174 174
                 $this->loggerInstance->debug(4, "You are the superadmin/support\n");
175
-                return [$temp,'readonly'];                
175
+                return [$temp, 'readonly'];                
176 176
             }
177 177
             throw new Exception($this->inputValidationError("This IdP identifier is not accessible!"));
178 178
         }
179 179
         if ($claimedFedBinding !== NULL && strtoupper($temp->federation) != strtoupper($claimedFedBinding->tld)) {
180 180
             throw new Exception($this->inputValidationError("This IdP does not belong to the claimed federation!"));
181 181
         }
182
-        return [$temp,'nouser'];
182
+        return [$temp, 'nouser'];
183 183
     }
184 184
 
185 185
     /**
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      * @throws Exception
258 258
      */
259 259
     public function existingExtInstitution($extId, $userEmail = NULL, $ROid = NULL) {
260
-        if ($ROid === NULL || !preg_match('/^[A-Z][A-Z]01$/', $ROid) ) {
260
+        if ($ROid === NULL || !preg_match('/^[A-Z][A-Z]01$/', $ROid)) {
261 261
             throw new Exception("$ROid: No correct federation identifier profided");
262 262
         }
263 263
         if ($userEmail === NULL) {
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
         try {
646 646
             $image->readImageBlob($binary);
647 647
         } catch (\ImagickException $exception) {
648
-            echo "Error" . $exception->getMessage();
648
+            echo "Error".$exception->getMessage();
649 649
             return FALSE;
650 650
         }
651 651
         // image survived the sanity check
Please login to merge, or discard this patch.
core/DBConnection.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -62,24 +62,24 @@  discard block
 block discarded – undo
62 62
             case "EXTERNAL":
63 63
             case "FRONTEND":
64 64
             case "DIAGNOSTICS":
65
-                if (!isset(self::${"instance" . $theDb})) {
65
+                if (!isset(self::${"instance".$theDb})) {
66 66
                     $class = __CLASS__;
67
-                    self::${"instance" . $theDb} = new $class($database);
68
-                    DBConnection::${"instance" . $theDb}->databaseInstance = $theDb;
67
+                    self::${"instance".$theDb} = new $class($database);
68
+                    DBConnection::${"instance".$theDb}->databaseInstance = $theDb;
69 69
                 }
70
-                return self::${"instance" . $theDb};
70
+                return self::${"instance".$theDb};
71 71
             case "RADIUS":
72
-                if (!isset(self::${"instance" . $theDb})) {
72
+                if (!isset(self::${"instance".$theDb})) {
73 73
                     $class = __CLASS__;
74 74
                     foreach (\config\ConfAssistant::DB as $name => $oneRadiusAuthDb) {
75 75
                         $theInstance = new $class($name);
76
-                        self::${"instance" . $theDb}[] = $theInstance;
76
+                        self::${"instance".$theDb}[] = $theInstance;
77 77
                         $theInstance->databaseInstance = $theDb;
78 78
                     }
79 79
                 }
80
-                return self::${"instance" . $theDb};
80
+                return self::${"instance".$theDb};
81 81
             default:
82
-                throw new Exception("This type of database (" . strtoupper($database) . ") is not known!");
82
+                throw new Exception("This type of database (".strtoupper($database).") is not known!");
83 83
         }
84 84
     }
85 85
     
@@ -123,18 +123,18 @@  discard block
 block discarded – undo
123 123
             }
124 124
         }
125 125
         // log exact query to debug log, if log level is at 5
126
-        $this->loggerInstance->debug(5, "DB ATTEMPT: ".$this->databaseInstance .": " . $querystring . "\n");
126
+        $this->loggerInstance->debug(5, "DB ATTEMPT: ".$this->databaseInstance.": ".$querystring."\n");
127 127
         if ($types !== NULL) {
128
-            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: " . /** @scrutinizer ignore-type */ print_r($arguments, true));
128
+            $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: "./** @scrutinizer ignore-type */ print_r($arguments, true));
129 129
         }
130 130
 
131 131
         if ($this->connection->connect_error) {
132
-            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number" . $this->connection->connect_error . ")!");
132
+            throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number".$this->connection->connect_error.")!");
133 133
         }
134 134
         if ($types === NULL) {
135 135
             $result = $this->connection->query($querystring);
136 136
             if ($result === FALSE) {
137
-                throw new Exception("DB: Unable to execute simple statement! Error was --> " . $this->connection->error . " <--");
137
+                throw new Exception("DB: Unable to execute simple statement! Error was --> ".$this->connection->error." <--");
138 138
             }
139 139
         } else {
140 140
             // fancy! prepared statement with dedicated argument list
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 }
151 151
                 $prepResult = $statementObject->prepare($querystring);
152 152
                 if ($prepResult === FALSE) {
153
-                    throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--.");
153
+                    throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ".$statementObject->error." <--.");
154 154
                 }
155 155
                 $this->preparedStatements[$querystring] = $statementObject;
156 156
             }
@@ -163,11 +163,11 @@  discard block
 block discarded – undo
163 163
             array_unshift($localArray, $types);
164 164
             $retval = call_user_func_array([$statementObject, "bind_param"], $localArray);
165 165
             if ($retval === FALSE) {
166
-                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--");
166
+                throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> ".var_export($localArray, TRUE)." <--. Error was --> ".$statementObject->error." <--");
167 167
             }
168 168
             $result = $statementObject->execute();
169 169
             if ($result === FALSE) {
170
-                throw new Exception("DB: Unable to execute prepared statement! Error was --> " . $statementObject->error . " <--");
170
+                throw new Exception("DB: Unable to execute prepared statement! Error was --> ".$statementObject->error." <--");
171 171
             }
172 172
             $selectResult = $statementObject->get_result();
173 173
             if ($selectResult !== FALSE) {
@@ -177,14 +177,14 @@  discard block
 block discarded – undo
177 177
 
178 178
         // all cases where $result could be FALSE have been caught earlier
179 179
         if ($this->connection->errno) {
180
-            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was " . $this->connection->errno . "!");
180
+            throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was ".$this->connection->errno."!");
181 181
         }
182 182
 
183 183
 
184 184
         if ($isMoreThanSelect || \config\Master::DEBUG_LEVEL == 5) {
185
-            $this->loggerInstance->writeSQLAudit("[DB: " . strtoupper($this->databaseInstance) . "] " . $querystring);
185
+            $this->loggerInstance->writeSQLAudit("[DB: ".strtoupper($this->databaseInstance)."] ".$querystring);
186 186
             if ($types !== NULL) {
187
-                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: " . /** @scrutinizer ignore-type */ print_r($arguments, true));
187
+                $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: "./** @scrutinizer ignore-type */ print_r($arguments, true));
188 188
             }
189 189
         }
190 190
         return $result;
@@ -282,14 +282,14 @@  discard block
 block discarded – undo
282 282
         if (isset(\config\Master::DB[$databaseCapitalised])) {
283 283
             $this->connection = new \mysqli(\config\Master::DB[$databaseCapitalised]['host'], \config\Master::DB[$databaseCapitalised]['user'], \config\Master::DB[$databaseCapitalised]['pass'], \config\Master::DB[$databaseCapitalised]['db']);
284 284
             if ($this->connection->connect_error) {
285
-                throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ").");
285
+                throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.").");
286 286
             }
287 287
             $this->readOnly = \config\Master::DB[$databaseCapitalised]['readonly'];
288 288
             $this->dbName = \config\Master::DB[$databaseCapitalised]['db'];
289 289
         } else { // one of the RADIUS DBs
290 290
             $this->connection = new \mysqli(\config\ConfAssistant::DB[$databaseCapitalised]['host'], \config\ConfAssistant::DB[$databaseCapitalised]['user'], \config\ConfAssistant::DB[$databaseCapitalised]['pass'], \config\ConfAssistant::DB[$databaseCapitalised]['db']);
291 291
             if ($this->connection->connect_error) {
292
-                throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ").");
292
+                throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.").");
293 293
             }
294 294
             $this->readOnly = \config\ConfAssistant::DB[$databaseCapitalised]['readonly'];
295 295
             $this->dbName = \config\ConfAssistant::DB[$databaseCapitalised]['db'];
Please login to merge, or discard this patch.
core/common/Logging.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     private function writeToFile($filename, $message)
51 51
     {
52
-        file_put_contents(\config\Master::PATHS['logdir'] . "/$filename", sprintf("%-015s", microtime(TRUE)) . $message, FILE_APPEND);
52
+        file_put_contents(\config\Master::PATHS['logdir']."/$filename", sprintf("%-015s", microtime(TRUE)).$message, FILE_APPEND);
53 53
     }
54 54
 
55 55
     /**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     private static function writeToFile_s($filename, $message)
63 63
     {
64
-        file_put_contents(\config\Master::PATHS['logdir'] . "/$filename", sprintf("%-015s", microtime(TRUE)) . $message, FILE_APPEND);
64
+        file_put_contents(\config\Master::PATHS['logdir']."/$filename", sprintf("%-015s", microtime(TRUE)).$message, FILE_APPEND);
65 65
     }
66 66
     
67 67
     /**
@@ -89,9 +89,9 @@  discard block
 block discarded – undo
89 89
             $output .= " [$file / $function / $line] ";
90 90
         }
91 91
         if (is_string($stuff)) {
92
-            $output .= $prefix . $stuff . $suffix;
92
+            $output .= $prefix.$stuff.$suffix;
93 93
         } else {
94
-            $output .= $prefix . var_export($stuff, TRUE) . $suffix;
94
+            $output .= $prefix.var_export($stuff, TRUE).$suffix;
95 95
         }
96 96
         $this->writeToFile("debug.log", $output);
97 97
 
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
             $output .= " [$file / $function / $line] ";
124 124
         }
125 125
         if (is_string($stuff)) {
126
-            $output .= $prefix . $stuff . $suffix;
126
+            $output .= $prefix.$stuff.$suffix;
127 127
         } else {
128
-            $output .= $prefix . var_export($stuff, TRUE) . $suffix;
128
+            $output .= $prefix.var_export($stuff, TRUE).$suffix;
129 129
         }
130 130
         self::writeToFile_s("debug.log", $output);
131 131
         return;
@@ -173,6 +173,6 @@  discard block
 block discarded – undo
173 173
         $logTextStep1 = preg_replace("/[\n\r]/", "", $query);
174 174
         $logTextStep2 = preg_replace("/ +/", " ", $logTextStep1);
175 175
         $logTextStep3 = iconv("UTF-8", "UTF-8//IGNORE", $logTextStep2);
176
-        $this->writeToFile("audit-SQL.log", " " . $logTextStep3 . "\n");
176
+        $this->writeToFile("audit-SQL.log", " ".$logTextStep3."\n");
177 177
     }
178 178
 }
179 179
\ No newline at end of file
Please login to merge, or discard this patch.
core/IdP.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
         $this->name = $this->languageInstance->getLocalisedValue($this->getAttributes('general:instname'));
116 116
         $eligibility = $this->eligibility($instQuery->type);
117 117
         if (in_array(IdP::ELIGIBILITY_IDP, $eligibility) && in_array(IdP::ELIGIBILITY_SP, $eligibility)) {
118
-            $eligType = IdP::TYPE_IDPSP . "";
118
+            $eligType = IdP::TYPE_IDPSP."";
119 119
             $this->type = $eligType;
120 120
         } elseif (in_array(IdP::ELIGIBILITY_IDP, $eligibility)) {
121
-            $eligType = IdP::TYPE_IDP . "";
121
+            $eligType = IdP::TYPE_IDP."";
122 122
         } else {
123
-            $eligType = IdP::TYPE_SP . "";
123
+            $eligType = IdP::TYPE_SP."";
124 124
         }
125 125
         $this->type = $eligType;
126 126
         $this->loggerInstance->debug(4, "--- END Constructing new IdP object $instId ... ---\n");
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     public function listProfiles(bool $activeOnly = FALSE)
136 136
     {
137
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "")." ORDER BY preference";
137
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "")." ORDER BY preference";
138 138
         $allProfiles = $this->databaseHandle->exec($query);
139 139
         $returnarray = [];
140 140
         // SELECT -> resource, not boolean
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             $returnarray[] = $oneProfile;
145 145
         }
146 146
 
147
-        $this->loggerInstance->debug(4, "listProfiles: " . /** @scrutinizer ignore-type */ print_r($returnarray, true));
147
+        $this->loggerInstance->debug(4, "listProfiles: "./** @scrutinizer ignore-type */ print_r($returnarray, true));
148 148
         return $returnarray;
149 149
     }
150 150
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function listDeployments(bool $activeOnly = FALSE)
158 158
     {
159
-        $query = "SELECT deployment_id FROM deployment WHERE inst_id = $this->identifier" . ($activeOnly ? " AND status = " . AbstractDeployment::ACTIVE : "");
159
+        $query = "SELECT deployment_id FROM deployment WHERE inst_id = $this->identifier".($activeOnly ? " AND status = ".AbstractDeployment::ACTIVE : "");
160 160
         $allDeployments = $this->databaseHandle->exec($query);
161 161
         $returnarray = [];
162 162
         // SELECT -> resource, not boolean
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             $returnarray[] = new DeploymentManaged($this, $deploymentQuery->deployment_id);
165 165
         }
166 166
 
167
-        $this->loggerInstance->debug(4, "listDeployments: " . /** @scrutinizer ignore-type */ print_r($returnarray, true));
167
+        $this->loggerInstance->debug(4, "listDeployments: "./** @scrutinizer ignore-type */ print_r($returnarray, true));
168 168
         return $returnarray;
169 169
     }
170 170
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         $redirectProfileIds = [];
191 191
         $allProfileLevels = $this->databaseHandle->exec("SELECT profile_id, sufficient_config + showtime AS maxlevel FROM profile WHERE inst_id = $this->identifier ORDER BY maxlevel DESC");
192 192
         // SELECT yields a resource, not a boolean
193
-        if ($allProfileLevels->num_rows == 0 ) {
193
+        if ($allProfileLevels->num_rows == 0) {
194 194
             return self::PROFILES_INCOMPLETE;
195 195
         }
196 196
         $allProfilesArray = $allProfileLevels->fetch_all(MYSQLI_ASSOC);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $allProfiles = $this->databaseHandle->exec("SELECT MIN(openroaming) AS maxlevel FROM profile WHERE inst_id = $this->identifier");
219 219
         // SELECT yields a resource, not a boolean
220 220
         while ($res = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allProfiles)) {
221
-            return (is_numeric($res->maxlevel) ? (int)$res->maxlevel : AbstractProfile::OVERALL_OPENROAMING_LEVEL_NO ); // insts without profiles should get a "NO"
221
+            return (is_numeric($res->maxlevel) ? (int) $res->maxlevel : AbstractProfile::OVERALL_OPENROAMING_LEVEL_NO); // insts without profiles should get a "NO"
222 222
         }
223 223
         return AbstractProfile::OVERALL_OPENROAMING_LEVEL_NO;
224 224
     }
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
350 350
                     $theProfile = new ProfileSilverbullet($identifier, $this);
351 351
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
352
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(\config\ConfAssistant::SILVERBULLET['realm_suffix']));
352
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(\config\ConfAssistant::SILVERBULLET['realm_suffix']));
353 353
                     return $theProfile;
354 354
                 default:
355 355
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
     public function getExternalDBId()
493 493
     {
494 494
         if (\config\ConfAssistant::CONSORTIUM['name'] == "eduroam" && isset(\config\ConfAssistant::CONSORTIUM['deployment-voodoo']) && \config\ConfAssistant::CONSORTIUM['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
495
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id, country FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
495
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id, country FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
496 496
             // SELECT -> it's a resource, not a boolean
497 497
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
498 498
                 return FALSE;
@@ -560,16 +560,16 @@  discard block
 block discarded – undo
560 560
         }
561 561
         foreach ($baseline as $lang => $value) {
562 562
             if (!key_exists($lang, $newvalues)) {
563
-                $retval[IdP::INSTNAME_CHANGED] .= "#[Language " . strtoupper($lang) . "] DELETED";
563
+                $retval[IdP::INSTNAME_CHANGED] .= "#[Language ".strtoupper($lang)."] DELETED";
564 564
             } else {
565 565
                 if ($value != $newvalues[$lang]) {
566
-                    $retval[IdP::INSTNAME_CHANGED] .= "#[Language " . strtoupper($lang) . "] CHANGED from '" . $baseline[$lang] . "' to '" . $newvalues[$lang] . "'";
566
+                    $retval[IdP::INSTNAME_CHANGED] .= "#[Language ".strtoupper($lang)."] CHANGED from '".$baseline[$lang]."' to '".$newvalues[$lang]."'";
567 567
                 }
568 568
             }
569 569
         }
570 570
         foreach ($newvalues as $lang => $value) {
571 571
             if (!key_exists($lang, $baseline)) {
572
-                $retval[IdP::INSTNAME_CHANGED] .= "#[Language " . strtoupper($lang) . "] ADDED as '" . $value . "'";
572
+                $retval[IdP::INSTNAME_CHANGED] .= "#[Language ".strtoupper($lang)."] ADDED as '".$value."'";
573 573
             }
574 574
         }
575 575
         return $retval;
Please login to merge, or discard this patch.
core/User.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
     public function isFromEduGAIN()
170 170
     {
171 171
         $loggerInstance = new common\Logging();
172
-        $entityId = preg_replace('/^.*=!/','', $_SESSION['user']);
173
-        $url = \config\Diagnostics::EDUGAINRESOLVER['url'] . "?action=get_entity_name&type=idp&e_id=$entityId";
172
+        $entityId = preg_replace('/^.*=!/', '', $_SESSION['user']);
173
+        $url = \config\Diagnostics::EDUGAINRESOLVER['url']."?action=get_entity_name&type=idp&e_id=$entityId";
174 174
         $ch = curl_init($url);
175 175
         if ($ch === FALSE) {
176 176
             $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!");
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
         common\Entity::intoThePotatoes();
215 215
         $mail = \core\common\OutsideComm::mailHandle();
216 216
 // who to whom?
217
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System";
218
-        $mail->addReplyTo(\config\Master::APPEARANCE['support-contact']['developer-mail'], \config\Master::APPEARANCE['productname'] . " " . _("Feedback"));
217
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System";
218
+        $mail->addReplyTo(\config\Master::APPEARANCE['support-contact']['developer-mail'], \config\Master::APPEARANCE['productname']." "._("Feedback"));
219 219
         $mail->addAddress($mailaddr[0]["value"]);
220 220
 // what do we want to say?
221 221
         $mail->Subject = $subject;
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
                 }
281 281
                 $lookFor .= "$name";
282 282
             }
283
-            $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches);
283
+            $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches);
284 284
             if ($finding === 0 || $finding === FALSE) {
285 285
                 return FALSE;
286 286
             }
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
                         $matchedProviders[] = $idp;
299 299
                         $name = $idp;
300 300
                         if ($skipCurl == 0) {
301
-                            $url = \config\Diagnostics::EDUGAINRESOLVER['url'] . "?action=get_entity_name&type=idp&e_id=$idp&lang=$lang";
301
+                            $url = \config\Diagnostics::EDUGAINRESOLVER['url']."?action=get_entity_name&type=idp&e_id=$idp&lang=$lang";
302 302
                             $ch = curl_init($url);
303 303
                             if ($ch === FALSE) {
304 304
                                 $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!");
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
                             }
315 315
                             curl_close($ch);
316 316
                         }
317
-                        $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]] . " - IdP: " . $name;
317
+                        $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]]." - IdP: ".$name;
318 318
                     }
319 319
                     break;
320 320
                 case $providerStrings[1]:
Please login to merge, or discard this patch.