Issues (204)

Security Analysis    13 potential vulnerabilities

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  Response Splitting (2)
Response Splitting can be used to send arbitrary responses.
  File Manipulation (6)
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection (1)
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Cross-Site Scripting (1)
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

web/admin/edit_profile.php (3 issues)

1
<?php
2
/*
3
 * *****************************************************************************
4
 * Contributions to this work were made on behalf of the GÉANT project, a 
5
 * project that has received funding from the European Union’s Framework 
6
 * Programme 7 under Grant Agreements No. 238875 (GN3) and No. 605243 (GN3plus),
7
 * Horizon 2020 research and innovation programme under Grant Agreements No. 
8
 * 691567 (GN4-1) and No. 731122 (GN4-2).
9
 * On behalf of the aforementioned projects, GEANT Association is the sole owner
10
 * of the copyright in all material which was developed by a member of the GÉANT
11
 * project. GÉANT Vereniging (Association) is registered with the Chamber of 
12
 * Commerce in Amsterdam with registration number 40535155 and operates in the 
13
 * UK as a branch of GÉANT VerenrdStuiging.
14
 * 
15
 * Registered office: Hoekenrode 3, 1102BR Amsterdam, The Netherlands. 
16
 * UK branch address: City House, 126-130 Hills Road, Cambridge CB2 1PQ, UK
17
 *
18
 * License: see the web/copyright.inc.php file in the file structure or
19
 *          <base_url>/copyright.php after deploying the software
20
 */
21
22
/**
23
 * This page is used to edit a RADIUS profile by its administrator.
24
 * 
25
 * @author Stefan Winter <[email protected]>
26
 */
27
?>
28
<?php
29
require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
31
$deco = new \web\lib\admin\PageDecoration();
32
$validator = new \web\lib\common\InputValidation();
33
$uiElements = new web\lib\admin\UIElements();
34
35
echo $deco->defaultPagePrelude(sprintf(_("%s: IdP Enrollment Wizard (Step 3)"), \config\Master::APPEARANCE['productname']));
36
$langInstance = new core\common\Language();
37
?>
38
<script src="js/XHR.js" type="text/javascript"></script>
39
<script src="js/option_expand.js" type="text/javascript"></script>
40
41
<!-- JQuery --> 
42
<script type="text/javascript" src="../external/jquery/jquery-ui.js"></script> 
43
<link rel="stylesheet" type="text/css" href="../external/jquery/jquery-ui.css" />
44
<!-- EAP sorting code -->
45
<script type="text/javascript" src="js/eapSorter.js"></script>
46
<link rel='stylesheet' type='text/css' href='css/eapSorter.css.php' />
47
<!-- EAP sorting code end -->
48
<script type="text/javascript" src="js/wizard.js"></script> 
49
<link rel='stylesheet' type='text/css' href='css/wizard.css.php' />
50
51
<?php
52
// initialize inputs
53
54
[$my_inst, $editMode] = $validator->existingIdPInt($_GET['inst_id'], $_SESSION['user']);
55
56
if ($editMode == 'readonly') {
57
    print('<style>button.newoption {visibility: hidden}'
58
            . '#submitbutton {visibility: hidden} '
59
            . 'button.delete {visibility: hidden} '
60
            . 'input {pointer-events: none} '
61
            . '.ui-sortable-handle {pointer-events: none}</style>');
62
}
63
$fed = new \core\Federation($my_inst->federation);
64
$anonLocal = "anonymous";
65
$useAnon = FALSE;
66
$checkuserOuter = FALSE;
67
$checkuserValue = "anonymous";
68
$verify = TRUE; // default to check the verify-realm box for new profiles 
69
$hint = FALSE;
70
$realm = "";
71
$prefill_name = "";
72
$blacklisted = FALSE;
73
$loggerInstance = new \core\common\Logging();
74
75
if (isset($_GET['profile_id'])) { // oh! We should edit an existing profile, not create a new one!
76
    if (isset($_GET['wizard']) && $_GET['wizard'] == "true") {
77
        $wizardStyle = TRUE;
78
    } else {
79
        $wizardStyle = FALSE;
80
    }
81
    $my_profile = $validator->existingProfile($_GET['profile_id'], $my_inst->identifier);
82
    if (!$my_profile instanceof \core\ProfileRADIUS) {
83
        throw new Exception("This page is only for editing RADIUS profiles!");
84
    }
85
86
    $useAnon = $my_profile->getAttributes("internal:use_anon_outer");
87
    if (count($useAnon) > 0) {
88
        $useAnon = $useAnon[0]['value'];
89
        $anonLocal = $my_profile->getAttributes("internal:anon_local_value")[0]['value'];
90
    }
91
92
    $checkuserOuter = $my_profile->getAttributes("internal:checkuser_outer");
93
    if (count($checkuserOuter) > 0) {
94
        $checkuserOuter = $checkuserOuter[0]['value'];
95
        $checkuserValue = $my_profile->getAttributes("internal:checkuser_value")[0]['value'];
96
    }
97
98
    $verify = $my_profile->getAttributes("internal:verify_userinput_suffix")[0]['value'];
99
    $hint = $my_profile->getAttributes("internal:hint_userinput_suffix")[0]['value'];
100
    $realm = $my_profile->getAttributes("internal:realm")[0]['value'];
101
102
    $prefill_name = $my_profile->name;
103
    $prefill_methods = $my_profile->getEapMethodsinOrderOfPreference();
104
    $profile_options = $my_profile->getAttributes();
105
106
    // is there a general redirect? it is one which have device = 0
107
    $blacklistEntries = $my_profile->getAttributes("device-specific:redirect");
108
    $blacklisted = FALSE;
109
    foreach ($blacklistEntries as $oneEntry) {
110
        if (!isset($oneEntry['device']) || $oneEntry['device'] === NULL) { // don't act on device-level redirects
111
            $blacklisted = $oneEntry['value'];
112
        }
113
    }
114
} else {
115
//    $loggerInstance = new \core\common\Logging();
116
    $wizardStyle = TRUE;
117
    $prefill_methods = [];
118
    $minting = $fed->getAttributes("fed:minted_ca_file");
119
    $temp_profile = NULL;
120
    $profile_options = [];
121
    if (count($minting) > 0) {
122
        $temp_profile = $my_inst->newProfile(core\AbstractProfile::PROFILETYPE_RADIUS);
123
        foreach ($minting as $oneMint) {
124
            $temp_profile->addAttribute("eap:ca_file", $oneMint['lang'], base64_encode($oneMint['value']));
125
            $my_profile = new \core\ProfileRADIUS($temp_profile->identifier);
126
            $profile_options = $my_profile->getAttributes();
127
        }
128
    }
129
    if (isset($_POST['username_to_detect']) && isset($_POST['realm_to_detect'])) {
130
        $detectRealm = $validator->string($_POST['realm_to_detect']);
131
        $localname = $validator->string($_POST['username_to_detect']);
132
        $checker = new \core\diag\RADIUSTests($detectRealm, $localname);
133
        $detectionResult = $checker->autodetectCAWithProbe($localname . "@" . $detectRealm);
134
        $loggerInstance->debug(2, "CA Auto-Detection yields:");
135
        $loggerInstance->debug(2, $detectionResult);
136
        if ($detectionResult['ROOT_CA'] !== NULL) { // we are lucky!
137
            $temp_profile = $my_inst->newProfile(core\AbstractProfile::PROFILETYPE_RADIUS);
138
            $temp_profile->addAttribute("eap:ca_file", "C", base64_encode($detectionResult['ROOT_CA']));
139
            $temp_profile->addAttribute("eap:server_name", "C", $detectionResult['NAME']);
140
            $temp_profile->setRealm($detectRealm);
141
            // We have created a RADIUS profile, not SilverBullet, so that function is guaranteed to exist
142
            $temp_profile/** @scrutinizer ignore-call */->setRealmCheckUser(TRUE, $localname);
0 ignored issues
show
The method setRealmCheckUser() does not exist on core\ProfileSilverbullet. Did you maybe mean setRealm()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

142
            $temp_profile/** @scrutinizer ignore-call */->/** @scrutinizer ignore-call */ 
143
                                                          setRealmCheckUser(TRUE, $localname);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
143
            $my_profile = new \core\ProfileRADIUS($temp_profile->identifier);
144
            $profile_options = $my_profile->getAttributes();
145
            $realm = $my_profile->getAttributes("internal:realm")[0]['value'];
146
            $checkuserOuter = TRUE;
147
            $checkuserValue = $my_profile->getAttributes("internal:checkuser_value")[0]['value'];
148
        }
149
    }
150
    if ($temp_profile !== NULL) {
151
    }
152
}
153
$wizard = new \web\lib\admin\Wizard($wizardStyle);
154
$wizard->setMessages();
155
?>
156
</head>
157
<body>
158
    <?php
159
    echo $deco->productheader("ADMIN-IDP");
160
    ?>
161
    <div id="wizard_help_window"><img id="wizard_menu_close" src="../resources/images/icons/button_cancel.png" ALT="Close"/><div></div></div>
162
    <h1>
163
        <?php
164
        if ($wizardStyle) {
165
            echo _("Step 3: Defining a user group profile");
166
        } else {
167
            if ($editMode == 'fullaccess') {
168
                printf(_("Edit profile '%s' ..."), $prefill_name);
169
            } else {
170
                printf(_("View profile '%s' ..."), $prefill_name);
171
            }
172
        }
173
        ?>
174
    </h1>
175
    <?php
176
    echo $uiElements->instLevelInfoBoxes($my_inst);
177
178
    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'>
179
                <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
180
    $optionDisplay = new \web\lib\admin\OptionDisplay($profile_options, \core\Options::LEVEL_PROFILE);
181
    ?>
182
    <fieldset class="option_container">
183
        <legend>
184
            <strong><?php echo _("General Profile properties"); ?></strong>
185
        </legend>
186
        <?php
187
        if ($wizardStyle) {
188
             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>";
189
        }
190
         ?>
191
        <h3><?php echo _("Profile Name and RADIUS realm"); ?>
192
        </h3>
193
        <?php    
194
        echo $wizard->displayHelp("profile");
195
        echo $optionDisplay->prefilledOptionTable("profile", $my_inst->federation);
196
        ?>
197
        <button type='button' class='newoption' onclick='getXML("profile", "<?php echo $my_inst->federation ?>")'><?php echo _("Add new option"); ?></button>
198
        <table>
199
            <caption><?php echo _("Basic Realm Information"); ?></caption>
200
            <tr>
201
                <th class="wai-invisible" scope="col"><?php echo _("Realm:"); ?></th>
202
                <th class="wai-invisible" scope="col"><?php echo _("Realm input field"); ?></th>
203
            </tr>
204
            <?php
205
            ?>
206
            <tr>
207
                <td>
208
                    <label for="realm">
209
                        <?php echo _("Realm:"); ?>
210
                    </label>
211
                </td>
212
                <td>
213
                    <?php echo "<input id='realm' name='realm' value='$realm' onkeyup='
214
                                 if (this.value.length > 0)
215
                                      { this.form.elements[\"anon_support\"].removeAttribute(\"disabled\");
216
                                        document.getElementById(\"anon_support_label\").removeAttribute(\"style\");
217
                                         this.form.elements[\"checkuser_support\"].removeAttribute(\"disabled\");
218
                                       
219
                                        this.form.elements[\"verify_support\"].removeAttribute(\"disabled\");
220
                                        document.getElementById(\"checkuser_label\").removeAttribute(\"style\");
221
                                        document.getElementById(\"verify_label\").removeAttribute(\"style\");
222
                                        document.getElementById(\"hint_label\").removeAttribute(\"style\");
223
                                        document.getElementById(\"verify_label\").removeAttribute(\"style\");
224
225
                                      } else
226
                                      { this.form.elements[\"anon_support\"].checked = false;
227
                                        this.form.elements[\"anon_support\"].setAttribute(\"disabled\", \"disabled\");
228
                                        this.form.elements[\"anon_local\"].setAttribute(\"disabled\", \"disabled\");
229
                                        document.getElementById(\"anon_support_label\").setAttribute(\"style\", \"color:#999999\");
230
                                        this.form.elements[\"verify_support\"].checked = false;
231
                                        this.form.elements[\"verify_support\"].setAttribute(\"disabled\", \"disabled\");                                        
232
                                        this.form.elements[\"checkuser_support\"].checked = false;
233
                                        this.form.elements[\"checkuser_support\"].setAttribute(\"disabled\", \"disabled\");
234
                                        this.form.elements[\"checkuser_local\"].setAttribute(\"disabled\", \"disabled\");
235
                                        document.getElementById(\"checkuser_label\").setAttribute(\"style\", \"color:#999999\");
236
                                        this.form.elements[\"hint_support\"].checked = false;
237
                                        this.form.elements[\"hint_support\"].setAttribute(\"disabled\", \"disabled\");
238
                                        document.getElementById(\"verify_label\").setAttribute(\"style\", \"color:#999999\");                                        
239
                                        document.getElementById(\"hint_label\").setAttribute(\"style\", \"color:#999999\");
240
                                      };'/>"; ?>
241
                </td>
242
            </tr>
243
        </table>
244
        <h3><?php echo _("Realm Options"); ?></h3>
245
246
        <?php
247
        echo $wizard->displayHelp("realm");
248
        ?>
249
        <p>
250
251
252
            <!-- UI table to align elements-->
253
        <table>
254
            <caption><?php echo _("Username Handling Options"); ?></caption>
255
            <tr>
256
                <th class="wai-invisible" scope="col"><?php echo _("Option name"); ?></th>
257
                <th class="wai-invisible" scope="col"><?php echo _("Option checkbox"); ?></th>
258
            </tr>
259
            <tr>
260
                <th colspan="2" style="text-align: left;"><?php echo _("Outer Identity Handling"); ?></th>
261
            </tr>
262
            <tr>
263
                <!-- checkbox and input field for anonymity support, available only when realm is known-->
264
                <td>
265
                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
266
                        <?php echo _("Enable Anonymous Outer Identity:"); ?>
267
                    </span>
268
                </td>
269
                <td>
270
                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='anon_support' onclick='
271
                            if (this.form.elements["anon_support"].checked !== true) {
272
                                this.form.elements["anon_local"].setAttribute("disabled", "disabled");
273
                            } else {
274
                                this.form.elements["anon_local"].removeAttribute("disabled");
275
                            }
276
                            ;'/>
277
                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : "" ); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
278
                </td>
279
            </tr>
280
            <tr>
281
                <!-- checkbox and input field for check realm outer id, available only when realm is known-->
282
                <td>
283
                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
284
                        <?php echo _("Use special Outer Identity for realm checks:"); ?>
285
                    </span>
286
                </td>
287
                <td>
288
                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='checkuser_support' onclick='
289
                            if (this.form.elements["checkuser_support"].checked !== true) {
290
                                this.form.elements["checkuser_local"].setAttribute("disabled", "disabled");
291
                            } else {
292
                                this.form.elements["checkuser_local"].removeAttribute("disabled");
293
                            }
294
                            ;'/>
295
                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : "" ); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
296
                </td>
297
            </tr>
298
            <tr>
299
                <th colspan="2" style="border-top: 2px solid; text-align: left;"><?php echo _("Inner Identity (Username) Handling"); ?></th>
300
            </tr>
301
            <tr>
302
                <!-- checkbox for "verify-->
303
                <td>
304
                    <span id='verify_label'>
305
                        <?php echo _("Enforce realm suffix in username"); ?>
306
                    </span>
307
                </td>
308
                <td>
309
                    <input type='checkbox' <?php
310
                    echo ($verify != FALSE ? "checked" : "" );
311
                    ?> name='verify_support' onclick='
312
                                if (this.form.elements["verify_support"].checked !== true || this.form.elements["realm"].value.length == 0) {
313
                                    this.form.elements["hint_support"].setAttribute("disabled", "disabled");
314
                                } else {
315
                                    this.form.elements["hint_support"].removeAttribute("disabled");
316
                                }
317
                                ;'/>
318
                </td>
319
            </tr>
320
            <tr>
321
                <td>
322
                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
323
                        <?php echo _("Enforce exact realm in username"); ?>
324
                    </span>
325
                </td>
326
                <td>
327
                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : "" ); ?> name='hint_support' <?php echo ( $hint != FALSE ? "checked" : "" ); ?> />
328
                </td>
329
            </tr>
330
        </table>
331
    </p>
332
333
    <h3><?php echo _("Installer Download Location"); ?></h3>
334
335
    <?php
336
    echo $wizard->displayHelp("redirect");
337
     ?>
338
    <p>
339
340
        <?php
341
        echo "<span id='redirect_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'><label for='redirect'>" . _("Redirect end users to own web page:") . "</label></span>
342
                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked " ) . "onclick='
343
                              if (this.form.elements[\"redirect\"].checked != true) {
344
                                this.form.elements[\"redirect_target\"].setAttribute(\"disabled\", \"disabled\");
345
                              } else {
346
                                this.form.elements[\"redirect_target\"].removeAttribute(\"disabled\");
347
                              };'/>
348
                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled" ) . "/>";
349
        ?>
350
    </p>
351
352
</fieldset>
353
<fieldset class="option_container">
354
    <legend><strong><?php echo _("Supported EAP types"); ?></strong></legend>
355
    <?php
356
    echo $wizard->displayHelp("eap_support");
357
    ?>
358
    <?php
359
    $methods = \core\common\EAP::listKnownEAPTypes();
360
    ?>
361
362
    <?php
363
// new EAP sorting code  
364
365
    foreach ($methods as $a) {
366
        $display = $a->getPrintableRep();
367
        $enabled = FALSE;
368
        foreach ($prefill_methods as $prio => $value) {
369
            if ($a->getPrintableRep() == $value->getPrintableRep()) {
370
                $enabled = TRUE;
371
                $countactive = $prio + 1;
372
            }
373
        }
374
    }
375
    ?>
376
    <div>
377
        <table style="border:none">
378
            <caption><?php echo _("EAP type support"); ?></caption>
379
            <tr>
380
                <th scope="row_id" style="vertical-align:top; padding:1em">
381
                    <?php echo _('Supported EAP types for this profile'); ?>
382
                </th>
383
                <td id="supported_eap">
384
                    <ol id="sortable1" class="eapmethods">
385
                        <?php
386
                        $D = [];
387
                        foreach ($prefill_methods as $prio => $value) {
388
                            print '<li>' . $value->getPrintableRep() . "</li>\n";
389
                            $D[$value->getPrintableRep()] = $prio;
390
                        }
391
                        ?>
392
                    </ol>
393
                </td>
394
                <td rowspan=3 style="text-align:center; width:12em; padding:1em">
395
                    <?php echo _('Use "drag &amp; drop" to mark an EAP method and move it to the supported (green) area. Prioritisation is done automatically, depending on where you "drop" the method.'); ?>
396
                </td>
397
            </tr>
398
            <tr id="eap_bottom_row">
399
                <td colspan="2"> </td>
400
            </tr>
401
            <tr>
402
                <th scope="row_id" style="vertical-align:top; padding:1em">
403
                    <?php echo _('Unsupported EAP types'); ?>
404
                </th>
405
                <td style="vertical-align:top" id="unsupported_eap">
406
                    <ol id="sortable2" class="eapmethods">
407
                        <?php
408
                        foreach ($methods as $a) {
0 ignored issues
show
Comprehensibility Bug introduced by
$a is overwriting a variable from outer foreach loop.
Loading history...
409
                            if ($a->getArrayRep() == \core\common\EAP::EAPTYPE_SILVERBULLET) {
410
                                continue;
411
                            }
412
                            $display = $a->getPrintableRep();
413
                            if (!isset($D[$a->getPrintableRep()])) {
414
                                print '<li class="eap1">' . $a->getPrintableRep() . "</li>\n";
415
                            }
416
                        }
417
                        ?>
418
                    </ol>
419
                </td>
420
            </tr>
421
        </table>
422
    </div>
423
    <?php
424
    foreach ($methods as $a) {
0 ignored issues
show
Comprehensibility Bug introduced by
$a is overwriting a variable from outer foreach loop.
Loading history...
425
        $display = $a->getPrintableRep();
426
        $v = isset($D[$display]) ? $D[$display] : '';
427
        print '<input type="hidden" class="eapm" name="' . $display . '" id="EAP-' . $display . '" value="' . $display . '">';
428
        print '<input type="hidden" class="eapmv" name="' . $display . '-priority" id="EAP-' . $display . '-priority" value="' . $v . '">';
429
    }
430
    ?>
431
    <br style="clear:both;" />
432
</fieldset>
433
<?php
434
$idp_options = $my_inst->getAttributes();
435
436
$optionsAlreadySet = array_column($idp_options, "name");
437
438
$has_support_options = [];
439
$has_media_options = [];
440
$has_eap_options = [];
441
$support_text = "";
442
$media_text = "";
443
$eap_text = "";
444
445
foreach ($optionsAlreadySet as $optionNames) {
446
    if (preg_match("/^support:/", $optionNames)) {
447
        $has_support_options[$optionNames] = "SET";
448
        $support_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
449
    }
450
    if (preg_match("/^media:/", $optionNames)) {
451
        $has_media_options[$optionNames] = "SET";
452
        $media_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
453
    }
454
}
455
$fields = [
456
    "support" => _("Helpdesk Details for this profile"),
457
    "eap" => _("EAP Details for this profile"),
458
    "media" => _("Media Properties for this profile")];
459
460
foreach ($fields as $name => $description) {
461
    echo "<fieldset class='option_container' id='" . $name . "_override'>
462
    <legend><strong>$description</strong></legend>
463
    <p>";
464
    echo $wizard->displayHelp($name);
465
    if (count(${"has_" . $name . "_options"}) > 0) {
466
        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>");
467
    }
468
    echo "</p>";
469
    echo $optionDisplay->prefilledOptionTable($name, $my_inst->federation);
470
    ?>
471
    <button type='button' class='newoption' onclick='getXML("<?php echo $name ?>", "<?php echo $my_inst->federation ?>")'><?php echo _("Add new option"); ?></button>
472
    <?php
473
    echo "</fieldset>";
474
}
475
if ($wizardStyle) {
476
    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>";
477
}
478
if ($editMode == 'readonly') {
479
    $discardLabel = _("Return");
480
}
481
if ($editMode == 'fullaccess') {
482
    $discardLabel = _("Discard changes");
483
}
484
echo "<p><button type='submit' id='submitbutton' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' id=='abortbutton' style='visibility: visible' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>".$discardLabel."</button></p></form>";
485
echo $deco->footer();
486
487