Passed
Push — release_2_0 ( aff697...948471 )
by Stefan
08:18
created
web/admin/edit_profile_result.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 $auth = new \web\lib\admin\Authentication();
25 25
 $deco = new \web\lib\admin\PageDecoration();
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             $profile = $validator->Profile($_GET['profile_id'], $my_inst->identifier);
57 57
         } else {
58 58
             $profile = $my_inst->newProfile(core\AbstractProfile::PROFILETYPE_RADIUS);
59
-            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP " . $my_inst->identifier . " - Profile created");
59
+            $loggerInstance->writeAudit($_SESSION['user'], "NEW", "IdP ".$my_inst->identifier." - Profile created");
60 60
         }
61 61
 
62 62
         if (!$profile instanceof \core\ProfileRADIUS) {
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             $uiElements = new web\lib\admin\UIElements();
119 119
             // set realm info, if submitted
120 120
             if ($realm !== FALSE) {
121
-                $profile->setRealm($anonLocal . "@" . $realm);
121
+                $profile->setRealm($anonLocal."@".$realm);
122 122
                 echo $uiElements->boxOkay(sprintf(_("Realm: <strong>%s</strong>"), $realm));
123 123
             } else {
124 124
                 $profile->setRealm("");
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                     echo $uiElements->boxError(_("Realm check username cannot be configured: realm is missing!"));
142 142
                 } else {
143 143
                     $profile->setRealmcheckUser(true, $checkuser_name);
144
-                    echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name . "@" . $realm));
144
+                    echo $uiElements->boxOkay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name."@".$realm));
145 145
                 }
146 146
             } else {
147 147
                 $profile->setRealmCheckUser(false);
@@ -153,12 +153,12 @@  discard block
 block discarded – undo
153 153
                 $extratext = "";
154 154
                 if (!empty($realm)) {
155 155
                     if ($hint !== FALSE) {
156
-                        $extratext = " " . sprintf(_("The realm portion MUST be exactly '...@%s'."), $realm);
156
+                        $extratext = " ".sprintf(_("The realm portion MUST be exactly '...@%s'."), $realm);
157 157
                     } else {
158
-                        $extratext = " " . sprintf(_("The realm portion MUST end with '%s' but sub-realms of it are allowed (i.e. 'user@%s' and 'user@<...>.%s' are both acceptable)."), $realm, $realm, $realm);
158
+                        $extratext = " ".sprintf(_("The realm portion MUST end with '%s' but sub-realms of it are allowed (i.e. 'user@%s' and 'user@<...>.%s' are both acceptable)."), $realm, $realm, $realm);
159 159
                     }
160 160
                 }
161
-                echo $uiElements->boxOkay(_("Where possible, supplicants will verify that username inputs contain a syntactically correct realm.") . $extratext);
161
+                echo $uiElements->boxOkay(_("Where possible, supplicants will verify that username inputs contain a syntactically correct realm.").$extratext);
162 162
             } else {
163 163
                 $profile->setInputVerificationPreference(false, false);
164 164
             }
@@ -190,29 +190,29 @@  discard block
 block discarded – undo
190 190
                 echo $uiElements->boxOkay(_("Redirection is <strong>OFF</strong>"));
191 191
             }
192 192
 
193
-            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - attributes changed");
193
+            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - attributes changed");
194 194
 
195 195
             foreach (\core\common\EAP::listKnownEAPTypes() as $a) {
196 196
                 if ($a->getIntegerRep() == \core\common\EAP::INTEGER_SILVERBULLET) { // do not allow adding silverbullet via the backdoor
197 197
                     continue;
198 198
                 }
199
-                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep() . "-priority"]) && is_numeric($_POST[$a->getPrintableRep() . "-priority"])) {
200
-                    $priority = (int) $_POST[$a->getPrintableRep() . "-priority"];
199
+                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep()."-priority"]) && is_numeric($_POST[$a->getPrintableRep()."-priority"])) {
200
+                    $priority = (int) $_POST[$a->getPrintableRep()."-priority"];
201 201
                     // add EAP type to profile as requested, but ...
202 202
                     $profile->addSupportedEapMethod($a, $priority);
203
-                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - supported EAP types changed");
203
+                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - supported EAP types changed");
204 204
                     // see if we can enable the EAP type, or if info is missing
205 205
                     $eapcompleteness = $profile->isEapTypeDefinitionComplete($a);
206 206
                     if ($eapcompleteness === true) {
207
-                        echo $uiElements->boxOkay(_("Supported EAP Type: ") . "<strong>" . $a->getPrintableRep() . "</strong>");
207
+                        echo $uiElements->boxOkay(_("Supported EAP Type: ")."<strong>".$a->getPrintableRep()."</strong>");
208 208
                     } else {
209 209
                         $warntext = "";
210 210
                         if (is_array($eapcompleteness)) {
211 211
                             foreach ($eapcompleteness as $item) {
212
-                                $warntext .= "<strong>" . $uiElements->displayName($item) . "</strong> ";
212
+                                $warntext .= "<strong>".$uiElements->displayName($item)."</strong> ";
213 213
                             }
214 214
                         }
215
-                        echo $uiElements->boxWarning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), $a->getPrintableRep(), $warntext) . "<br/>" . _("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you."));
215
+                        echo $uiElements->boxWarning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), $a->getPrintableRep(), $warntext)."<br/>"._("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you."));
216 216
                     }
217 217
                 }
218 218
             }
@@ -222,23 +222,23 @@  discard block
 block discarded – undo
222 222
             if (count($significantChanges) > 0) {
223 223
                 $myInstOriginal = new \core\IdP($profile->institution);
224 224
                 // send a notification/alert mail to someone we know is in charge
225
-                $text = _("To whom it may concern,") . "\n\n";
225
+                $text = _("To whom it may concern,")."\n\n";
226 226
                 /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
227
-                $text .= sprintf(_("significant changes were made to a RADIUS deployment profile of the %s %s / %s / '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name) . "\n\n";
227
+                $text .= sprintf(_("significant changes were made to a RADIUS deployment profile of the %s %s / %s / '%s'."), $ui->nomenclatureInst, strtoupper($myInstOriginal->federation), $myInstOriginal->identifier, $myInstOriginal->name)."\n\n";
228 228
                 if (isset($significantChanges[\core\AbstractProfile::CA_CLASH_ADDED])) {
229
-                    $text .= _("WARNING! A new trusted root CA was added, and it has the exact same name as a previously existing root CA. This may (but does not necessarily) mean that this is an attempt to insert an unauthorised trust root by disguising as the genuine one. The details are below:") . "\n\n";
230
-                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED] . "\n\n";
229
+                    $text .= _("WARNING! A new trusted root CA was added, and it has the exact same name as a previously existing root CA. This may (but does not necessarily) mean that this is an attempt to insert an unauthorised trust root by disguising as the genuine one. The details are below:")."\n\n";
230
+                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED]."\n\n";
231 231
                 }
232 232
                 if (isset($significantChanges[\core\AbstractProfile::CA_ADDED])) {
233 233
                     $text .= _("A new trusted root CA was added. The details are below:\n\n");
234
-                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED] . "\n\n";
234
+                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED]."\n\n";
235 235
                 }
236 236
                 if (isset($significantChanges[\core\AbstractProfile::SERVERNAME_ADDED])) {
237
-                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:") . "\n\n";
238
-                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED] . "\n\n";
237
+                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:")."\n\n";
238
+                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED]."\n\n";
239 239
                 }
240
-                $text .= _("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";
241
-                $text .= _("Greetings, ") . "\n\n" . CONFIG['APPEARANCE']['productname_long'];
240
+                $text .= _("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";
241
+                $text .= _("Greetings, ")."\n\n".CONFIG['APPEARANCE']['productname_long'];
242 242
                 // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
243 243
                 $fed = new core\Federation($myInstOriginal->federation);
244 244
                 foreach ($fed->listFederationAdmins() as $id) {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         <?php
258 258
         if (count($reloadedProfile->getEapMethodsinOrderOfPreference(1)) > 0) {
259 259
             echo "<form method='post' action='overview_installers.php?inst_id=$my_inst->identifier&profile_id=$reloadedProfile->identifier' accept-charset='UTF-8'>
260
-        <button type='submit'>" . _("Continue to Installer Fine-Tuning and Download") . "</button>
260
+        <button type='submit'>"._("Continue to Installer Fine-Tuning and Download")."</button>
261 261
     </form>";
262 262
         }
263 263
         echo $deco->footer();
Please login to merge, or discard this patch.