Passed
Push — release_2_0 ( c99898...ea195d )
by Stefan
08:44
created
web/admin/edit_profile_result.php 1 patch
Spacing   +22 added lines, -22 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);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                 } else {
155 155
                     $profile->setInputVerificationPreference($verify, $hint);
156 156
                     if ($hint !== FALSE) {
157
-                        $extratext = " " . sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm);
157
+                        $extratext = " ".sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm);
158 158
                     } else {
159 159
                         $extratext = ".";
160 160
                     }
@@ -191,29 +191,29 @@  discard block
 block discarded – undo
191 191
                 echo $uiElements->boxOkay(_("Redirection is <strong>OFF</strong>"));
192 192
             }
193 193
 
194
-            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - attributes changed");
194
+            $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - attributes changed");
195 195
 
196 196
             foreach (\core\common\EAP::listKnownEAPTypes() as $a) {
197 197
                 if ($a->getIntegerRep() == \core\common\EAP::INTEGER_SILVERBULLET) { // do not allow adding silverbullet via the backdoor
198 198
                     continue;
199 199
                 }
200
-                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep() . "-priority"]) && is_numeric($_POST[$a->getPrintableRep() . "-priority"])) {
201
-                    $priority = (int) $_POST[$a->getPrintableRep() . "-priority"];
200
+                if (isset($_POST[$a->getPrintableRep()]) && isset($_POST[$a->getPrintableRep()."-priority"]) && is_numeric($_POST[$a->getPrintableRep()."-priority"])) {
201
+                    $priority = (int) $_POST[$a->getPrintableRep()."-priority"];
202 202
                     // add EAP type to profile as requested, but ...
203 203
                     $profile->addSupportedEapMethod($a, $priority);
204
-                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - supported EAP types changed");
204
+                    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$profile->identifier." - supported EAP types changed");
205 205
                     // see if we can enable the EAP type, or if info is missing
206 206
                     $eapcompleteness = $profile->isEapTypeDefinitionComplete($a);
207 207
                     if ($eapcompleteness === true) {
208
-                        echo $uiElements->boxOkay(_("Supported EAP Type: ") . "<strong>" . $a->getPrintableRep() . "</strong>");
208
+                        echo $uiElements->boxOkay(_("Supported EAP Type: ")."<strong>".$a->getPrintableRep()."</strong>");
209 209
                     } else {
210 210
                         $warntext = "";
211 211
                         if (is_array($eapcompleteness)) {
212 212
                             foreach ($eapcompleteness as $item) {
213
-                                $warntext .= "<strong>" . $uiElements->displayName($item) . "</strong> ";
213
+                                $warntext .= "<strong>".$uiElements->displayName($item)."</strong> ";
214 214
                             }
215 215
                         }
216
-                        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
+                        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."));
217 217
                     }
218 218
                 }
219 219
             }
@@ -223,23 +223,23 @@  discard block
 block discarded – undo
223 223
             if (count($significantChanges) > 0) {
224 224
                 $myInstOriginal = new \core\IdP($profile->institution);
225 225
                 // send a notification/alert mail to someone we know is in charge
226
-                $text = _("To whom it may concern,") . "\n\n";
226
+                $text = _("To whom it may concern,")."\n\n";
227 227
                 /// were made to the *Identity Provider* *LU* / integer number of IdP / (previously known as) Name
228
-                $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
+                $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";
229 229
                 if (isset($significantChanges[\core\AbstractProfile::CA_CLASH_ADDED])) {
230
-                    $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";
231
-                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED] . "\n\n";
230
+                    $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";
231
+                    $text .= $significantChanges[\core\AbstractProfile::CA_CLASH_ADDED]."\n\n";
232 232
                 }
233 233
                 if (isset($significantChanges[\core\AbstractProfile::CA_ADDED])) {
234 234
                     $text .= _("A new trusted root CA was added. The details are below:\n\n");
235
-                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED] . "\n\n";
235
+                    $text .= $significantChanges[\core\AbstractProfile::CA_ADDED]."\n\n";
236 236
                 }
237 237
                 if (isset($significantChanges[\core\AbstractProfile::SERVERNAME_ADDED])) {
238
-                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:") . "\n\n";
239
-                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED] . "\n\n";
238
+                    $text .= _("A new acceptable server name for the authentication server was added. The details are below:")."\n\n";
239
+                    $text .= $significantChanges[\core\AbstractProfile::SERVERNAME_ADDED]."\n\n";
240 240
                 }
241
-                $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";
242
-                $text .= _("Greetings, ") . "\n\n" . CONFIG['APPEARANCE']['productname_long'];
241
+                $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";
242
+                $text .= _("Greetings, ")."\n\n".CONFIG['APPEARANCE']['productname_long'];
243 243
                 // (currently, send hard-wired to NRO - future: for linked insts, check eduroam DBv2 and send to registered admins directly)
244 244
                 $fed = new core\Federation($myInstOriginal->federation);
245 245
                 foreach ($fed->listFederationAdmins() as $id) {
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         <?php
259 259
         if (count($reloadedProfile->getEapMethodsinOrderOfPreference(1)) > 0) {
260 260
             echo "<form method='post' action='overview_installers.php?inst_id=$my_inst->identifier&profile_id=$reloadedProfile->identifier' accept-charset='UTF-8'>
261
-        <button type='submit'>" . _("Continue to Installer Fine-Tuning and Download") . "</button>
261
+        <button type='submit'>"._("Continue to Installer Fine-Tuning and Download")."</button>
262 262
     </form>";
263 263
         }
264 264
         echo $deco->footer();
Please login to merge, or discard this patch.