Passed
Push — release_2_0 ( 53068b...06e5a8 )
by Stefan
08:16
created
web/admin/edit_profile.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 ?>
29 29
 <?php
30
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
31 31
 
32 32
 $deco = new \web\lib\admin\PageDecoration();
33 33
 $validator = new \web\lib\common\InputValidation();
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
     <?php
128 128
     echo $uiElements->instLevelInfoBoxes($my_inst);
129 129
 
130
-    echo "<form enctype='multipart/form-data' action='edit_profile_result.php?inst_id=$my_inst->identifier" . ($my_profile !== NULL ? "&amp;profile_id=" . $my_profile->identifier : "") . "' method='post' accept-charset='UTF-8'>
131
-                <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE'] . "'>";
130
+    echo "<form enctype='multipart/form-data' action='edit_profile_result.php?inst_id=$my_inst->identifier".($my_profile !== NULL ? "&amp;profile_id=".$my_profile->identifier : "")."' method='post' accept-charset='UTF-8'>
131
+                <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE']."'>";
132 132
     $optionDisplay = new \web\lib\admin\OptionDisplay($profile_options, "Profile");
133 133
     ?>
134 134
     <fieldset class="option_container">
@@ -137,19 +137,19 @@  discard block
 block discarded – undo
137 137
         </legend>
138 138
         <?php
139 139
         if ($wizardStyle) {
140
-            echo "<p>" . _("We will now define a profile for your user group(s).  You can add as many profiles as you like by choosing the appropriate button on the end of the page. After we are done, the wizard is finished and you will be taken to the main IdP administration page.") . "</p>";
140
+            echo "<p>"._("We will now define a profile for your user group(s).  You can add as many profiles as you like by choosing the appropriate button on the end of the page. After we are done, the wizard is finished and you will be taken to the main IdP administration page.")."</p>";
141 141
         }
142 142
         ?>
143 143
         <h3><?php echo _("Profile Name and RADIUS realm"); ?></h3>
144 144
         <?php
145 145
         if ($wizardStyle) {
146
-            echo "<p>" . _("First of all we need a name for the profile. This will be displayed to end users, so you may want to choose a descriptive name like 'Professors', 'Students of the Faculty of Bioscience', etc.") . "</p>";
147
-            echo "<p>" . _("Optionally, you can provide a longer descriptive text about who this profile is for. If you specify it, it will be displayed on the download page after the user has selected the profile name in the list.") . "</p>";
148
-            echo "<p>" . _("You can also tell us your RADIUS realm. ");
146
+            echo "<p>"._("First of all we need a name for the profile. This will be displayed to end users, so you may want to choose a descriptive name like 'Professors', 'Students of the Faculty of Bioscience', etc.")."</p>";
147
+            echo "<p>"._("Optionally, you can provide a longer descriptive text about who this profile is for. If you specify it, it will be displayed on the download page after the user has selected the profile name in the list.")."</p>";
148
+            echo "<p>"._("You can also tell us your RADIUS realm. ");
149 149
             if (CONFIG['FUNCTIONALITY_LOCATIONS']['DIAGNOSTICS'] !== NULL) {
150 150
                 printf(_("This is useful if you want to use the sanity check module later, which tests reachability of your realm in the %s infrastructure. "), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
151 151
             }
152
-            echo _("It is required to enter the realm name if you want to support anonymous outer identities (see below).") . "</p>";
152
+            echo _("It is required to enter the realm name if you want to support anonymous outer identities (see below).")."</p>";
153 153
         }
154 154
 
155 155
         echo $optionDisplay->prefilledOptionTable("profile");
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
 
204 204
         <?php
205 205
         if ($wizardStyle) {
206
-            echo "<p>" . sprintf(_("Some installers support a feature called 'Anonymous outer identity'. If you don't know what this is, please read <a href='%s'>this article</a>."), "https://confluence.terena.org/display/H2eduroam/eap-types") . "</p>";
207
-            echo "<p>" . _("On some platforms, the installers can suggest username endings and/or verify the user input to contain the realm suffix.") . "</p>";
208
-            echo "<p>" . _("The realm check feature needs to know an outer ID which actually gets a chance to authenticate. If your RADIUS server lets only select usernames pass, it is useful to supply the information which of those (outer ID) username we can use for testing.") . "</p>";
206
+            echo "<p>".sprintf(_("Some installers support a feature called 'Anonymous outer identity'. If you don't know what this is, please read <a href='%s'>this article</a>."), "https://confluence.terena.org/display/H2eduroam/eap-types")."</p>";
207
+            echo "<p>"._("On some platforms, the installers can suggest username endings and/or verify the user input to contain the realm suffix.")."</p>";
208
+            echo "<p>"._("The realm check feature needs to know an outer ID which actually gets a chance to authenticate. If your RADIUS server lets only select usernames pass, it is useful to supply the information which of those (outer ID) username we can use for testing.")."</p>";
209 209
         }
210 210
         ?>
211 211
         <p>
@@ -214,46 +214,46 @@  discard block
 block discarded – undo
214 214
             <!-- UI table to align elements-->
215 215
         <table style="margin-left: 25px; border-collapse: collapse;">
216 216
             <tr>
217
-                <th colspan="2" style="text-align: left;"><?php echo _("Outer Identity Handling");?></th>
217
+                <th colspan="2" style="text-align: left;"><?php echo _("Outer Identity Handling"); ?></th>
218 218
             </tr>
219 219
             <tr>
220 220
                 <!-- checkbox and input field for anonymity support, available only when realm is known-->
221 221
                 <td>
222
-                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
222
+                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
223 223
                         <?php echo _("Enable Anonymous Outer Identity:"); ?>
224 224
                     </span>
225 225
                 </td>
226 226
                 <td>
227
-                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='anon_support' onclick='
227
+                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "").($realm == "" ? " disabled" : ""); ?> name='anon_support' onclick='
228 228
                             if (this.form.elements["anon_support"].checked !== true) {
229 229
                                 this.form.elements["anon_local"].setAttribute("disabled", "disabled");
230 230
                             } else {
231 231
                                 this.form.elements["anon_local"].removeAttribute("disabled");
232 232
                             }
233 233
                             ;'/>
234
-                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : "" ); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
234
+                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : ""); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
235 235
                 </td>
236 236
             </tr>
237 237
             <tr>
238 238
                 <!-- checkbox and input field for check realm outer id, available only when realm is known-->
239 239
                 <td>
240
-                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
240
+                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
241 241
                         <?php echo _("Use special Outer Identity for realm checks:"); ?>
242 242
                     </span>
243 243
                 </td>
244 244
                 <td>
245
-                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='checkuser_support' onclick='
245
+                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "").($realm == "" ? " disabled" : ""); ?> name='checkuser_support' onclick='
246 246
                             if (this.form.elements["checkuser_support"].checked !== true) {
247 247
                                 this.form.elements["checkuser_local"].setAttribute("disabled", "disabled");
248 248
                             } else {
249 249
                                 this.form.elements["checkuser_local"].removeAttribute("disabled");
250 250
                             }
251 251
                             ;'/>
252
-                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : "" ); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
252
+                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : ""); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
253 253
                 </td>
254 254
             </tr>
255 255
             <tr>
256
-                <th colspan="2" style="border-top: 2px solid; text-align: left;"><?php echo _("Inner Identity (Username) Handling");?></th>
256
+                <th colspan="2" style="border-top: 2px solid; text-align: left;"><?php echo _("Inner Identity (Username) Handling"); ?></th>
257 257
             </tr>
258 258
             <tr>
259 259
                 <!-- checkbox for "verify-->
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                 </td>
265 265
                 <td>
266 266
                     <input type='checkbox' <?php
267
-                    echo ($verify != FALSE ? "checked" : "" );
267
+                    echo ($verify != FALSE ? "checked" : "");
268 268
                     ?> name='verify_support' onclick='
269 269
                             if (this.form.elements["verify_support"].checked !== true || this.form.elements["realm"].value.length == 0) {
270 270
                                 this.form.elements["hint_support"].setAttribute("disabled", "disabled");
@@ -276,12 +276,12 @@  discard block
 block discarded – undo
276 276
             </tr>
277 277
             <tr>
278 278
                 <td>
279
-                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
279
+                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
280 280
                         <?php echo _("Enforce exact realm in username"); ?>
281 281
                     </span>
282 282
                 </td>
283 283
                 <td>
284
-                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : "" ); ?> name='hint_support' <?php echo ( $hint != FALSE ? "checked" : "" ); ?> />
284
+                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : ""); ?> name='hint_support' <?php echo ($hint != FALSE ? "checked" : ""); ?> />
285 285
                 </td>
286 286
             </tr>
287 287
         </table>
@@ -291,20 +291,20 @@  discard block
 block discarded – undo
291 291
 
292 292
     <?php
293 293
     if ($wizardStyle) {
294
-        echo "<p>" . _("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).") . "</p>";
294
+        echo "<p>"._("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).")."</p>";
295 295
     }
296 296
     ?>
297 297
     <p>
298 298
 
299 299
         <?php
300
-        echo "<span id='redirect_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'><label for='redirect'>" . _("Redirect end users to own web page:") . "</label></span>
301
-                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked " ) . "onclick='
300
+        echo "<span id='redirect_label' style='".($realm == "" ? "color:#999999" : "")."'><label for='redirect'>"._("Redirect end users to own web page:")."</label></span>
301
+                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked ")."onclick='
302 302
                               if (this.form.elements[\"redirect\"].checked != true) {
303 303
                                 this.form.elements[\"redirect_target\"].setAttribute(\"disabled\", \"disabled\");
304 304
                               } else {
305 305
                                 this.form.elements[\"redirect_target\"].removeAttribute(\"disabled\");
306 306
                               };'/>
307
-                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled" ) . "/>";
307
+                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled")."/>";
308 308
         ?>
309 309
     </p>
310 310
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
     <legend><strong><?php echo _("Supported EAP types"); ?></strong></legend>
314 314
     <?php
315 315
     if ($wizardStyle) {
316
-        echo "<p>" . _("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.") . "</p>";
316
+        echo "<p>"._("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.")."</p>";
317 317
     }
318 318
     ?>
319 319
     <?php
@@ -327,9 +327,9 @@  discard block
 block discarded – undo
327 327
      * @return void
328 328
      */
329 329
     function priority(string $eapType, bool $isenabled, int $priority) {
330
-        echo "<td><select id='$eapType-priority' name='$eapType-priority' " . (!$isenabled ? "disabled='disabled'" : "") . ">";
330
+        echo "<td><select id='$eapType-priority' name='$eapType-priority' ".(!$isenabled ? "disabled='disabled'" : "").">";
331 331
         for ($a = 1; $a < 7; $a = $a + 1) {
332
-            echo "<option id='$eapType-$a' value='$a' " . ( $isenabled && $a == $priority ? "selected" : "" ) . ">$a</option>";
332
+            echo "<option id='$eapType-$a' value='$a' ".($isenabled && $a == $priority ? "selected" : "").">$a</option>";
333 333
         }
334 334
         echo "</select></td>";
335 335
     }
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      * @return void
346 346
      */
347 347
     function inherited_options($idpwideoptions, $eapType, $isVisible) {
348
-        echo "<td><div style='" . (!$isVisible ? "visibility:hidden" : "") . "' class='inheritedoptions' id='$eapType-inherited-global'>";
348
+        echo "<td><div style='".(!$isVisible ? "visibility:hidden" : "")."' class='inheritedoptions' id='$eapType-inherited-global'>";
349 349
 
350 350
         $eapoptions = [];
351 351
 
@@ -358,12 +358,12 @@  discard block
 block discarded – undo
358 358
         $eapoptionsNames = array_count_values($eapoptions);
359 359
 
360 360
         if (count($eapoptionsNames) > 0) {
361
-            echo "<strong>" . _("EAP options inherited from Global level:") . "</strong><br />";
361
+            echo "<strong>"._("EAP options inherited from Global level:")."</strong><br />";
362 362
             foreach ($eapoptionsNames as $optionname => $count) {
363 363
                 /// option count and enumeration
364 364
                 /// Example: "(3x) Server Name"
365 365
                 $uiElements = new web\lib\admin\UIElements();
366
-                printf(_("(%dx) %s") . "<br />", $count, $uiElements->displayName($optionname));
366
+                printf(_("(%dx) %s")."<br />", $count, $uiElements->displayName($optionname));
367 367
             }
368 368
         }
369 369
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
                         <?php
399 399
                         $D = [];
400 400
                         foreach ($prefill_methods as $prio => $value) {
401
-                            print '<li>' . $value->getPrintableRep() . "</li>\n";
401
+                            print '<li>'.$value->getPrintableRep()."</li>\n";
402 402
                             $D[$value->getPrintableRep()] = $prio;
403 403
                         }
404 404
                         ?>
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
                             }
425 425
                             $display = $a->getPrintableRep();
426 426
                             if (!isset($D[$a->getPrintableRep()])) {
427
-                                print '<li class="eap1">' . $a->getPrintableRep() . "</li>\n";
427
+                                print '<li class="eap1">'.$a->getPrintableRep()."</li>\n";
428 428
                             }
429 429
                         }
430 430
                         ?>
@@ -437,8 +437,8 @@  discard block
 block discarded – undo
437 437
     foreach ($methods as $a) {
438 438
         $display = $a->getPrintableRep();
439 439
         $v = isset($D[$display]) ? $D[$display] : '';
440
-        print '<input type="hidden" class="eapm" name="' . $display . '" id="EAP-' . $display . '" value="' . $display . '">';
441
-        print '<input type="hidden" class="eapmv" name="' . $display . '-priority" id="EAP-' . $display . '-priority" value="' . $v . '">';
440
+        print '<input type="hidden" class="eapm" name="'.$display.'" id="EAP-'.$display.'" value="'.$display.'">';
441
+        print '<input type="hidden" class="eapmv" name="'.$display.'-priority" id="EAP-'.$display.'-priority" value="'.$v.'">';
442 442
     }
443 443
     ?>
444 444
     <br style="clear:both;" />
@@ -458,11 +458,11 @@  discard block
 block discarded – undo
458 458
 foreach ($optionsAlreadySet as $optionNames) {
459 459
     if (preg_match("/^support:/", $optionNames)) {
460 460
         $has_support_options[$optionNames] = "SET";
461
-        $support_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
461
+        $support_text .= "<li><strong>".$uiElements->displayName($optionNames)."</strong></li>";
462 462
     }
463 463
     if (preg_match("/^media:/", $optionNames)) {
464 464
         $has_media_options[$$optionNames] = "SET";
465
-        $media_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
465
+        $media_text .= "<li><strong>".$uiElements->displayName($optionNames)."</strong></li>";
466 466
     }
467 467
 }
468 468
 $fields = [
@@ -471,22 +471,22 @@  discard block
 block discarded – undo
471 471
     "media" => _("Media Properties for this profile")];
472 472
 
473 473
 foreach ($fields as $name => $description) {
474
-    echo "<fieldset class='option_container' id='" . $name . "_override'>
474
+    echo "<fieldset class='option_container' id='".$name."_override'>
475 475
     <legend><strong>$description</strong></legend>
476 476
     <p>";
477 477
 
478
-    if (count(${"has_" . $name . "_options"}) > 0) {
479
-        printf(ngettext("The option %s is already defined IdP-wide. If you set it here on profile level, this setting will override the IdP-wide one.", "The options %s are already defined IdP-wide. If you set them here on profile level, these settings will override the IdP-wide ones.", count(${"has_" . $name . "_options"})), "<ul>" . ${$name . "_text"} . "</ul>");
478
+    if (count(${"has_".$name."_options"}) > 0) {
479
+        printf(ngettext("The option %s is already defined IdP-wide. If you set it here on profile level, this setting will override the IdP-wide one.", "The options %s are already defined IdP-wide. If you set them here on profile level, these settings will override the IdP-wide ones.", count(${"has_".$name."_options"})), "<ul>".${$name."_text"}."</ul>");
480 480
     }
481 481
 
482 482
     echo "</p>";
483 483
     echo $optionDisplay->prefilledOptionTable($name);
484
-    echo "<button type='button' class='newoption' onclick='getXML(\"$name\")'>" . _("Add new option") . "</button>";
484
+    echo "<button type='button' class='newoption' onclick='getXML(\"$name\")'>"._("Add new option")."</button>";
485 485
     echo "</fieldset>";
486 486
 }
487 487
 
488 488
 if ($wizardStyle) {
489
-    echo "<p>" . _("When you are sure that everything is correct, please click on 'Save data' and you will be taken to your IdP Dashboard page.") . "</p>";
489
+    echo "<p>"._("When you are sure that everything is correct, please click on 'Save data' and you will be taken to your IdP Dashboard page.")."</p>";
490 490
 }
491
-echo "<p><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>";
491
+echo "<p><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>";
492 492
 echo $deco->footer();
Please login to merge, or discard this patch.