Passed
Push — release_2_0 ( fb07bb...07486d )
by Stefan
17:09 queued 11s
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,25 +214,25 @@  discard block
 block discarded – undo
214 214
             <!-- UI table to align elements-->
215 215
         <table style="margin-left: 15px;">
216 216
             <tr>
217
-                <th colspan="2" style="border-right: 1px solid; text-align: left;"><?php echo _("Outer Identity Handling");?></th>
218
-                <th colspan="2"><?php echo _("Inner Identity (Username) Handling");?></th>
217
+                <th colspan="2" style="border-right: 1px solid; text-align: left;"><?php echo _("Outer Identity Handling"); ?></th>
218
+                <th colspan="2"><?php echo _("Inner Identity (Username) Handling"); ?></th>
219 219
             </tr>
220 220
             <tr>
221 221
                 <!-- checkbox and input field for anonymity support, available only when realm is known-->
222 222
                 <td>
223
-                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
223
+                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
224 224
                         <?php echo _("Enable Anonymous Outer Identity:"); ?>
225 225
                     </span>
226 226
                 </td>
227 227
                 <td style="border-right: 1px solid">
228
-                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='anon_support' onclick='
228
+                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "").($realm == "" ? " disabled" : ""); ?> name='anon_support' onclick='
229 229
                             if (this.form.elements["anon_support"].checked !== true) {
230 230
                                 this.form.elements["anon_local"].setAttribute("disabled", "disabled");
231 231
                             } else {
232 232
                                 this.form.elements["anon_local"].removeAttribute("disabled");
233 233
                             }
234 234
                             ;'/>
235
-                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : "" ); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
235
+                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : ""); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
236 236
                 </td>    
237 237
                 <!-- checkbox for "verify-->
238 238
                 <td>
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                 </td>
243 243
                 <td>
244 244
                     <input type='checkbox' <?php
245
-                    echo ($verify != FALSE ? "checked" : "" );
245
+                    echo ($verify != FALSE ? "checked" : "");
246 246
                     ?> name='verify_support' onclick='
247 247
                             if (this.form.elements["verify_support"].checked !== true || this.form.elements["realm"].value.length == 0) {
248 248
                                 this.form.elements["hint_support"].setAttribute("disabled", "disabled");
@@ -254,27 +254,27 @@  discard block
 block discarded – undo
254 254
             <tr></tr>
255 255
                 <!-- checkbox and input field for check realm outer id, available only when realm is known-->
256 256
                 <td>
257
-                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
257
+                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
258 258
                         <?php echo _("Use special Outer Identity for realm checks:"); ?>
259 259
                     </span>
260 260
                 </td>
261 261
                 <td style="border-right: 1px solid">
262
-                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='checkuser_support' onclick='
262
+                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "").($realm == "" ? " disabled" : ""); ?> name='checkuser_support' onclick='
263 263
                             if (this.form.elements["checkuser_support"].checked !== true) {
264 264
                                 this.form.elements["checkuser_local"].setAttribute("disabled", "disabled");
265 265
                             } else {
266 266
                                 this.form.elements["checkuser_local"].removeAttribute("disabled");
267 267
                             }
268 268
                             ;'/>
269
-                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : "" ); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
269
+                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : ""); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
270 270
                 </td>
271 271
                 <td>
272
-                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
272
+                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
273 273
                         <?php echo _("Enforce exact realm in username"); ?>
274 274
                     </span>
275 275
                 </td>
276 276
                 <td>
277
-                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : "" ); ?> name='hint_support' <?php echo ( $hint != FALSE ? "checked" : "" ); ?> />
277
+                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : ""); ?> name='hint_support' <?php echo ($hint != FALSE ? "checked" : ""); ?> />
278 278
                 </td>
279 279
             </tr>
280 280
         </table>
@@ -284,20 +284,20 @@  discard block
 block discarded – undo
284 284
 
285 285
     <?php
286 286
     if ($wizardStyle) {
287
-        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>";
287
+        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>";
288 288
     }
289 289
     ?>
290 290
     <p>
291 291
 
292 292
         <?php
293
-        echo "<span id='redirect_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'><label for='redirect'>" . _("Redirect end users to own web page:") . "</label></span>
294
-                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked " ) . "onclick='
293
+        echo "<span id='redirect_label' style='".($realm == "" ? "color:#999999" : "")."'><label for='redirect'>"._("Redirect end users to own web page:")."</label></span>
294
+                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked ")."onclick='
295 295
                               if (this.form.elements[\"redirect\"].checked != true) {
296 296
                                 this.form.elements[\"redirect_target\"].setAttribute(\"disabled\", \"disabled\");
297 297
                               } else {
298 298
                                 this.form.elements[\"redirect_target\"].removeAttribute(\"disabled\");
299 299
                               };'/>
300
-                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled" ) . "/>";
300
+                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled")."/>";
301 301
         ?>
302 302
     </p>
303 303
 
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
     <legend><strong><?php echo _("Supported EAP types"); ?></strong></legend>
307 307
     <?php
308 308
     if ($wizardStyle) {
309
-        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>";
309
+        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>";
310 310
     }
311 311
     ?>
312 312
     <?php
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
      * @return void
321 321
      */
322 322
     function priority(string $eapType, bool $isenabled, int $priority) {
323
-        echo "<td><select id='$eapType-priority' name='$eapType-priority' " . (!$isenabled ? "disabled='disabled'" : "") . ">";
323
+        echo "<td><select id='$eapType-priority' name='$eapType-priority' ".(!$isenabled ? "disabled='disabled'" : "").">";
324 324
         for ($a = 1; $a < 7; $a = $a + 1) {
325
-            echo "<option id='$eapType-$a' value='$a' " . ( $isenabled && $a == $priority ? "selected" : "" ) . ">$a</option>";
325
+            echo "<option id='$eapType-$a' value='$a' ".($isenabled && $a == $priority ? "selected" : "").">$a</option>";
326 326
         }
327 327
         echo "</select></td>";
328 328
     }
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
      * @return void
339 339
      */
340 340
     function inherited_options($idpwideoptions, $eapType, $isVisible) {
341
-        echo "<td><div style='" . (!$isVisible ? "visibility:hidden" : "") . "' class='inheritedoptions' id='$eapType-inherited-global'>";
341
+        echo "<td><div style='".(!$isVisible ? "visibility:hidden" : "")."' class='inheritedoptions' id='$eapType-inherited-global'>";
342 342
 
343 343
         $eapoptions = [];
344 344
 
@@ -351,12 +351,12 @@  discard block
 block discarded – undo
351 351
         $eapoptionsNames = array_count_values($eapoptions);
352 352
 
353 353
         if (count($eapoptionsNames) > 0) {
354
-            echo "<strong>" . _("EAP options inherited from Global level:") . "</strong><br />";
354
+            echo "<strong>"._("EAP options inherited from Global level:")."</strong><br />";
355 355
             foreach ($eapoptionsNames as $optionname => $count) {
356 356
                 /// option count and enumeration
357 357
                 /// Example: "(3x) Server Name"
358 358
                 $uiElements = new web\lib\admin\UIElements();
359
-                printf(_("(%dx) %s") . "<br />", $count, $uiElements->displayName($optionname));
359
+                printf(_("(%dx) %s")."<br />", $count, $uiElements->displayName($optionname));
360 360
             }
361 361
         }
362 362
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
                         <?php
392 392
                         $D = [];
393 393
                         foreach ($prefill_methods as $prio => $value) {
394
-                            print '<li>' . $value->getPrintableRep() . "</li>\n";
394
+                            print '<li>'.$value->getPrintableRep()."</li>\n";
395 395
                             $D[$value->getPrintableRep()] = $prio;
396 396
                         }
397 397
                         ?>
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
                             }
418 418
                             $display = $a->getPrintableRep();
419 419
                             if (!isset($D[$a->getPrintableRep()])) {
420
-                                print '<li class="eap1">' . $a->getPrintableRep() . "</li>\n";
420
+                                print '<li class="eap1">'.$a->getPrintableRep()."</li>\n";
421 421
                             }
422 422
                         }
423 423
                         ?>
@@ -430,8 +430,8 @@  discard block
 block discarded – undo
430 430
     foreach ($methods as $a) {
431 431
         $display = $a->getPrintableRep();
432 432
         $v = isset($D[$display]) ? $D[$display] : '';
433
-        print '<input type="hidden" class="eapm" name="' . $display . '" id="EAP-' . $display . '" value="' . $display . '">';
434
-        print '<input type="hidden" class="eapmv" name="' . $display . '-priority" id="EAP-' . $display . '-priority" value="' . $v . '">';
433
+        print '<input type="hidden" class="eapm" name="'.$display.'" id="EAP-'.$display.'" value="'.$display.'">';
434
+        print '<input type="hidden" class="eapmv" name="'.$display.'-priority" id="EAP-'.$display.'-priority" value="'.$v.'">';
435 435
     }
436 436
     ?>
437 437
     <br style="clear:both;" />
@@ -451,11 +451,11 @@  discard block
 block discarded – undo
451 451
 foreach ($optionsAlreadySet as $optionNames) {
452 452
     if (preg_match("/^support:/", $optionNames)) {
453 453
         $has_support_options[$optionNames] = "SET";
454
-        $support_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
454
+        $support_text .= "<li><strong>".$uiElements->displayName($optionNames)."</strong></li>";
455 455
     }
456 456
     if (preg_match("/^media:/", $optionNames)) {
457 457
         $has_media_options[$$optionNames] = "SET";
458
-        $media_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
458
+        $media_text .= "<li><strong>".$uiElements->displayName($optionNames)."</strong></li>";
459 459
     }
460 460
 }
461 461
 $fields = [
@@ -464,22 +464,22 @@  discard block
 block discarded – undo
464 464
     "media" => _("Media Properties for this profile")];
465 465
 
466 466
 foreach ($fields as $name => $description) {
467
-    echo "<fieldset class='option_container' id='" . $name . "_override'>
467
+    echo "<fieldset class='option_container' id='".$name."_override'>
468 468
     <legend><strong>$description</strong></legend>
469 469
     <p>";
470 470
 
471
-    if (count(${"has_" . $name . "_options"}) > 0) {
472
-        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>");
471
+    if (count(${"has_".$name."_options"}) > 0) {
472
+        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>");
473 473
     }
474 474
 
475 475
     echo "</p>";
476 476
     echo $optionDisplay->prefilledOptionTable($name);
477
-    echo "<button type='button' class='newoption' onclick='getXML(\"$name\")'>" . _("Add new option") . "</button>";
477
+    echo "<button type='button' class='newoption' onclick='getXML(\"$name\")'>"._("Add new option")."</button>";
478 478
     echo "</fieldset>";
479 479
 }
480 480
 
481 481
 if ($wizardStyle) {
482
-    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>";
482
+    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>";
483 483
 }
484
-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>";
484
+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>";
485 485
 echo $deco->footer();
Please login to merge, or discard this patch.