@@ -30,9 +30,9 @@ |
||
30 | 30 | $checkval = "OK-NEW"; |
31 | 31 | } |
32 | 32 | |
33 | -if (!isset($_GET['token']) || ( $checkval != "OK-NEW" && $checkval != "OK-EXISTING")) { |
|
33 | +if (!isset($_GET['token']) || ($checkval != "OK-NEW" && $checkval != "OK-EXISTING")) { |
|
34 | 34 | pageheader(_("Error creating new IdP binding!"), "ADMIN-IDP"); |
35 | - echo "<h1>"._("Error creating new IdP binding!")."</h1>"; |
|
35 | + echo "<h1>" . _("Error creating new IdP binding!") . "</h1>"; |
|
36 | 36 | if ($checkval == "FAIL-ALREADYCONSUMED") { |
37 | 37 | echo "<p>" . _("Sorry... this token has already been used to create an institution. If you got it from a mailing list, probably someone else used it before you.") . "</p>"; |
38 | 38 | } elseif ($checkval == "FAIL-EXPIRED") { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | <script src="js/option_expand.js" type="text/javascript"></script> |
24 | 24 | </head> |
25 | 25 | <body> |
26 | - <?php productheader("USERMGMT",CAT::get_lang()); ?> |
|
26 | + <?php productheader("USERMGMT", CAT::get_lang()); ?> |
|
27 | 27 | <h1> |
28 | 28 | <?php _("Editing User Attributes"); ?> |
29 | 29 | </h1> |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | </button> |
49 | 49 | </fieldset> |
50 | 50 | <div> |
51 | - <button type='submit' name='submitbutton' value='<?php echo BUTTON_SAVE;?>'> |
|
51 | + <button type='submit' name='submitbutton' value='<?php echo BUTTON_SAVE; ?>'> |
|
52 | 52 | <?php echo _("Save data"); ?> |
53 | 53 | </button> |
54 | 54 | <button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location="overview_user.php"'> |
@@ -67,7 +67,7 @@ |
||
67 | 67 | $has_inst = $inst_mgmt->listInstitutionsByAdmin($_SESSION['user']); |
68 | 68 | |
69 | 69 | if (Config::$CONSORTIUM['name'] == 'eduroam') |
70 | - $helptext = " <h3 style='display:inline;'>" . sprintf(_("(Need help? Refer to the <a href='%s'>IdP administrator manual</a>)"),"https://wiki.geant.org/x/SwB_AQ")."</h3>"; |
|
70 | + $helptext = " <h3 style='display:inline;'>" . sprintf(_("(Need help? Refer to the <a href='%s'>IdP administrator manual</a>)"), "https://wiki.geant.org/x/SwB_AQ") . "</h3>"; |
|
71 | 71 | else |
72 | 72 | $helptext = ""; |
73 | 73 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | pageheader(sprintf(_("%s: Federation Customisation (submission completed)"), Config::$APPEARANCE['productname']), "FEDERATION"); |
26 | 26 | $my_fed = valid_Fed($_GET['fed_id'], $_SESSION['user']); |
27 | 27 | if (isset($_POST['submitbutton'])) { |
28 | - if (( $_POST['submitbutton'] == BUTTON_SAVE) && isset($_POST['option']) && isset($_POST['value'])) { // here we go |
|
28 | + if (($_POST['submitbutton'] == BUTTON_SAVE) && isset($_POST['option']) && isset($_POST['value'])) { // here we go |
|
29 | 29 | $fed_name = $my_fed->identifier; |
30 | 30 | echo "<h1>" . sprintf(_("Submitted attributes for federation '%s'"), $fed_name) . "</h1>"; |
31 | 31 | $remaining_attribs = $my_fed->beginflushAttributes(); |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | if ($realm == FALSE) { |
133 | 133 | echo UI_error(_("Realm check username cannot be configured: realm is missing!")); |
134 | 134 | } else { |
135 | - $profile->setRealmcheckUser(true,$checkuser_name); |
|
136 | - echo UI_okay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name."@".$realm)); |
|
135 | + $profile->setRealmcheckUser(true, $checkuser_name); |
|
136 | + echo UI_okay(sprintf(_("Special username for realm check is <strong>%s</strong>, the value is <strong>%s</strong>"), _("ON"), $checkuser_name . "@" . $realm)); |
|
137 | 137 | } |
138 | 138 | } else { |
139 | 139 | $profile->setRealmCheckUser(false); |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | if ($realm == FALSE) { |
145 | 145 | echo UI_error(_("Realm check username cannot be configured: realm is missing!")); |
146 | 146 | } else { |
147 | - $profile->setInputVerificationPreference($verify,$hint); |
|
147 | + $profile->setInputVerificationPreference($verify, $hint); |
|
148 | 148 | if ($hint) { |
149 | - $extratext = " ".sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."),$realm); |
|
149 | + $extratext = " " . sprintf(_("and the input field will be prefilled with '<strong>@%s</strong>'."), $realm); |
|
150 | 150 | } else { |
151 | 151 | $extratext = "."; |
152 | 152 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | |
155 | 155 | } |
156 | 156 | } else { |
157 | - $profile->setInputVerificationPreference(false,false); |
|
157 | + $profile->setInputVerificationPreference(false, false); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | // see if we want to add a footnote: anon_id |
100 | 100 | $anon = $my_profile->getAttributes("internal:use_anon_outer"); |
101 | 101 | $anon = $anon[0]['value']; |
102 | - if ( $anon !== "" && isset($factory->device->specialities['anon_id'])) { |
|
102 | + if ($anon !== "" && isset($factory->device->specialities['anon_id'])) { |
|
103 | 103 | if (isset($factory->device->specialities['anon_id'][serialize($method)])) { |
104 | 104 | $footnotetext = $factory->device->specialities['anon_id'][serialize($method)]; |
105 | 105 | $display_footnote = TRUE; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | } |
151 | 151 | ?> |
152 | 152 | <form method='post' action='overview_idp.php?inst_id=<?php echo $my_inst->identifier; ?>' accept-charset='UTF-8'> |
153 | - <button type='submit' name='submitbutton' value='<?php echo BUTTON_CLOSE;?>'> |
|
153 | + <button type='submit' name='submitbutton' value='<?php echo BUTTON_CLOSE; ?>'> |
|
154 | 154 | <?php echo _("Return to dashboard"); ?> |
155 | 155 | </button> |
156 | 156 | </form> |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | |
303 | 303 | <?php |
304 | 304 | if ($wizard_style) { |
305 | - 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>"; |
|
305 | + 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>"; |
|
306 | 306 | echo "<p>" . _("On some platforms, the installers can suggest username endings and/or verify the user input to contain the realm suffix (sub-realms will pass this validation).") . "</p>"; |
307 | 307 | 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 inforamtion which of those (outer ID) username we can use for testing.") . "</p>"; |
308 | 308 | } |
@@ -313,35 +313,35 @@ discard block |
||
313 | 313 | // UI table to align elements |
314 | 314 | echo "<table><tr>"; |
315 | 315 | // checkbox for "verify |
316 | - echo "<td><span id='verify_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'>" . _("Verify user input to contain realm suffix:") . "</span></td> |
|
317 | - <td><input type='checkbox' " . ($verify != FALSE ? "checked" : "" ) . ($realm == "" ? "disabled" : "" ) . " name='verify_support' onclick=' |
|
316 | + echo "<td><span id='verify_label' style='" . ($realm == "" ? "color:#999999" : "") . "'>" . _("Verify user input to contain realm suffix:") . "</span></td> |
|
317 | + <td><input type='checkbox' " . ($verify != FALSE ? "checked" : "") . ($realm == "" ? "disabled" : "") . " name='verify_support' onclick=' |
|
318 | 318 | if (this.form.elements[\"verify_support\"].checked != true) { |
319 | 319 | this.form.elements[\"hint_support\"].setAttribute(\"disabled\", \"disabled\"); |
320 | 320 | } else { |
321 | 321 | this.form.elements[\"hint_support\"].removeAttribute(\"disabled\"); |
322 | 322 | };'/> |
323 | - <span id='hint_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'>" . _("Prefill user input with realm suffix:") . "</span> |
|
324 | - <input type='checkbox' " . ($verify == FALSE ? "disabled" : "" ) . " name='hint_support' " . ( $hint != FALSE ? "checked" : "" ) . " /></td>"; |
|
323 | + <span id='hint_label' style='" . ($realm == "" ? "color:#999999" : "") . "'>" . _("Prefill user input with realm suffix:") . "</span> |
|
324 | + <input type='checkbox' " . ($verify == FALSE ? "disabled" : "") . " name='hint_support' " . ($hint != FALSE ? "checked" : "") . " /></td>"; |
|
325 | 325 | echo "</tr><tr>"; |
326 | 326 | // checkbox and input field for anonymity support, available only when realm is known |
327 | - echo "<td><span id='anon_support_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'>" . _("Enable Anonymous Outer Identity:") . "</span></td> |
|
328 | - <td><input type='checkbox' " . ($use_anon != FALSE ? "checked" : "" ) . ($realm == "" ? "disabled" : "" ) . " name='anon_support' onclick=' |
|
327 | + echo "<td><span id='anon_support_label' style='" . ($realm == "" ? "color:#999999" : "") . "'>" . _("Enable Anonymous Outer Identity:") . "</span></td> |
|
328 | + <td><input type='checkbox' " . ($use_anon != FALSE ? "checked" : "") . ($realm == "" ? "disabled" : "") . " name='anon_support' onclick=' |
|
329 | 329 | if (this.form.elements[\"anon_support\"].checked != true) { |
330 | 330 | this.form.elements[\"anon_local\"].setAttribute(\"disabled\", \"disabled\"); |
331 | 331 | } else { |
332 | 332 | this.form.elements[\"anon_local\"].removeAttribute(\"disabled\"); |
333 | 333 | };'/> |
334 | - <input type='text' " . ($checkuser_outer == FALSE ? "disabled" : "" ) . " name='anon_local' value='$anon_local'/></td>"; |
|
334 | + <input type='text' " . ($checkuser_outer == FALSE ? "disabled" : "") . " name='anon_local' value='$anon_local'/></td>"; |
|
335 | 335 | echo "</tr><tr>"; |
336 | 336 | // checkbox and input field for check realm outer id, available only when realm is known |
337 | - echo "<td><span id='checkuser_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'>" . _("Use special Outer Identity for realm checks:") . "</span></td> |
|
338 | - <td><input type='checkbox' " . ($checkuser_outer != FALSE ? "checked" : "" ) . ($realm == "" ? "disabled" : "" ) . " name='checkuser_support' onclick=' |
|
337 | + echo "<td><span id='checkuser_label' style='" . ($realm == "" ? "color:#999999" : "") . "'>" . _("Use special Outer Identity for realm checks:") . "</span></td> |
|
338 | + <td><input type='checkbox' " . ($checkuser_outer != FALSE ? "checked" : "") . ($realm == "" ? "disabled" : "") . " name='checkuser_support' onclick=' |
|
339 | 339 | if (this.form.elements[\"checkuser_support\"].checked != true) { |
340 | 340 | this.form.elements[\"checkuser_local\"].setAttribute(\"disabled\", \"disabled\"); |
341 | 341 | } else { |
342 | 342 | this.form.elements[\"checkuser_local\"].removeAttribute(\"disabled\"); |
343 | 343 | };'/> |
344 | - <input type='text' " . ($checkuser_outer == FALSE ? "disabled" : "" ) . " name='checkuser_local' value='$checkuser_value'/></td>"; |
|
344 | + <input type='text' " . ($checkuser_outer == FALSE ? "disabled" : "") . " name='checkuser_local' value='$checkuser_value'/></td>"; |
|
345 | 345 | echo "</tr></table>"; |
346 | 346 | ?> |
347 | 347 | </p> |
@@ -355,14 +355,14 @@ discard block |
||
355 | 355 | <p> |
356 | 356 | |
357 | 357 | <?php |
358 | - echo "<span id='redirect_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'><label for='redirect'>" . _("Redirect end users to own web page:") . "</label></span> |
|
359 | - <input type='checkbox' name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked " ) . "onclick=' |
|
358 | + echo "<span id='redirect_label' style='" . ($realm == "" ? "color:#999999" : "") . "'><label for='redirect'>" . _("Redirect end users to own web page:") . "</label></span> |
|
359 | + <input type='checkbox' name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked ") . "onclick=' |
|
360 | 360 | if (this.form.elements[\"redirect\"].checked != true) { |
361 | 361 | this.form.elements[\"redirect_target\"].setAttribute(\"disabled\", \"disabled\"); |
362 | 362 | } else { |
363 | 363 | this.form.elements[\"redirect_target\"].removeAttribute(\"disabled\"); |
364 | 364 | };'/> |
365 | - <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled" ) . "/>"; |
|
365 | + <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled") . "/>"; |
|
366 | 366 | ?> |
367 | 367 | </p> |
368 | 368 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | function priority($eap_type, $isenabled, $priority) { |
379 | 379 | echo "<td><select id='$eap_type-priority' name='$eap_type-priority' " . (!$isenabled ? "disabled='disabled'" : "") . ">"; |
380 | 380 | for ($a = 1; $a < 7; $a = $a + 1) |
381 | - echo "<option id='$eap_type-$a' value='$a' " . ( $isenabled && $a == $priority ? "selected" : "" ) . ">$a</option>"; |
|
381 | + echo "<option id='$eap_type-$a' value='$a' " . ($isenabled && $a == $priority ? "selected" : "") . ">$a</option>"; |
|
382 | 382 | echo "</select></td>"; |
383 | 383 | } |
384 | 384 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | function return_error($code, $description) { |
32 | 32 | echo "<CAT-API-Response>\n"; |
33 | - echo " <error>\n <code>".$code."</code>\n <description>$description</description>\n </error>\n"; |
|
33 | + echo " <error>\n <code>" . $code . "</code>\n <description>$description</description>\n </error>\n"; |
|
34 | 34 | echo "</CAT-API-Response>\n"; |
35 | 35 | } |
36 | 36 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | if (!isset($_POST['APIKEY'])) { |
45 | - return_error(ERROR_NO_APIKEY,"POST did not contain an APIKEY"); |
|
45 | + return_error(ERROR_NO_APIKEY, "POST did not contain an APIKEY"); |
|
46 | 46 | exit(1); |
47 | 47 | } |
48 | 48 | |
@@ -54,25 +54,25 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | if ($checkval == "FAIL") { |
57 | - return_error(ERROR_INVALID_APIKEY,"APIKEY is invalid"); |
|
57 | + return_error(ERROR_INVALID_APIKEY, "APIKEY is invalid"); |
|
58 | 58 | exit(1); |
59 | 59 | } |
60 | 60 | |
61 | 61 | // it's a valid admin; what does he want to do? |
62 | 62 | |
63 | 63 | if (!isset($_POST['ACTION'])) { |
64 | - return_error(ERROR_NO_ACTION,"POST did not contain the desired ACTION"); |
|
64 | + return_error(ERROR_NO_ACTION, "POST did not contain the desired ACTION"); |
|
65 | 65 | exit(1); |
66 | 66 | } |
67 | 67 | |
68 | 68 | $sanitised_action = valid_string_db($_POST['ACTION']); |
69 | 69 | |
70 | -switch($sanitised_action) { |
|
70 | +switch ($sanitised_action) { |
|
71 | 71 | case 'NEWINST': |
72 | 72 | // fine... we need two parameters for that: |
73 | 73 | // mail address, inst name |
74 | 74 | if (!isset($_POST['NEWINST_PRIMARYADMIN'])) { |
75 | - return_error(ERROR_MISSING_PARAMETER,"POST missed at least one required parameter (NEWINST_PRIMARYADMIN)"); |
|
75 | + return_error(ERROR_MISSING_PARAMETER, "POST missed at least one required parameter (NEWINST_PRIMARYADMIN)"); |
|
76 | 76 | exit(1); |
77 | 77 | } |
78 | 78 | // alright: create the IdP, fill in attributes |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | // TODO For 1.1, make sure that pSF gets is field as a parameter, not implicitly via POST |
86 | 86 | $original_post = $_POST; |
87 | 87 | foreach ($_POST['option'] as $optindex => $optname) |
88 | - if (!preg_match("/^general:/",$optname) && !preg_match("/^support:/",$optname) && !preg_match("/^eap:/",$optname)) |
|
88 | + if (!preg_match("/^general:/", $optname) && !preg_match("/^support:/", $optname) && !preg_match("/^eap:/", $optname)) |
|
89 | 89 | unset($_POST['option'][$optindex]); |
90 | 90 | // now process all inst-wide options |
91 | - processSubmittedFields($idp, [],0,0,TRUE); |
|
91 | + processSubmittedFields($idp, [], 0, 0, TRUE); |
|
92 | 92 | $_POST = $original_post; |
93 | 93 | // same thing for profile options |
94 | 94 | foreach ($_POST['option'] as $optindex => $optname) |
95 | - if (!preg_match("/^profile:/",$optname) || $optname == "profile:QR-user") |
|
95 | + if (!preg_match("/^profile:/", $optname) || $optname == "profile:QR-user") |
|
96 | 96 | unset($_POST['option'][$optindex]); |
97 | 97 | // if we do have profile-level options - create a profile and fill in the values! |
98 | 98 | if (count($_POST['option']) > 0) { |
@@ -106,44 +106,44 @@ discard block |
||
106 | 106 | foreach ($_POST['option'] as $optindex => $optname) { |
107 | 107 | switch ($optname) { |
108 | 108 | case "profile-api:anon": |
109 | - if (isset($_POST['value'][$optindex."-0"])) |
|
110 | - $theanonid = valid_string_db($_POST['value'][$optindex."-0"]); |
|
109 | + if (isset($_POST['value'][$optindex . "-0"])) |
|
110 | + $theanonid = valid_string_db($_POST['value'][$optindex . "-0"]); |
|
111 | 111 | break; |
112 | 112 | case "profile-api:realm": |
113 | - if (isset($_POST['value'][$optindex."-0"]) && valid_Realm($_POST['value'][$optindex."-0"])) |
|
114 | - $therealm = $_POST['value'][$optindex."-0"]; |
|
113 | + if (isset($_POST['value'][$optindex . "-0"]) && valid_Realm($_POST['value'][$optindex . "-0"])) |
|
114 | + $therealm = $_POST['value'][$optindex . "-0"]; |
|
115 | 115 | break; |
116 | 116 | case "profile-api:useanon": |
117 | - if (isset($_POST['value'][$optindex."-3"]) && valid_boolean($_POST['value'][$optindex."-3"]) == "on") |
|
117 | + if (isset($_POST['value'][$optindex . "-3"]) && valid_boolean($_POST['value'][$optindex . "-3"]) == "on") |
|
118 | 118 | $use_anon = TRUE; |
119 | 119 | break; |
120 | 120 | case "profile-api:eaptype": |
121 | 121 | $pref = 0; |
122 | - if (isset($_POST['value'][$optindex."-0"]) && |
|
123 | - is_numeric($_POST['value'][$optindex."-0"]) && |
|
124 | - $_POST['value'][$optindex."-0"] >= 1 && |
|
125 | - $_POST['value'][$optindex."-0"] <= 7 ) { |
|
126 | - switch ($_POST['value'][$optindex."-0"]) { |
|
122 | + if (isset($_POST['value'][$optindex . "-0"]) && |
|
123 | + is_numeric($_POST['value'][$optindex . "-0"]) && |
|
124 | + $_POST['value'][$optindex . "-0"] >= 1 && |
|
125 | + $_POST['value'][$optindex . "-0"] <= 7) { |
|
126 | + switch ($_POST['value'][$optindex . "-0"]) { |
|
127 | 127 | case 1: |
128 | - $newprofile->addSupportedEapMethod (EAP::$TTLS_PAP, $pref); |
|
128 | + $newprofile->addSupportedEapMethod(EAP::$TTLS_PAP, $pref); |
|
129 | 129 | break; |
130 | 130 | case 2: |
131 | - $newprofile->addSupportedEapMethod (EAP::$PEAP_MSCHAP2, $pref); |
|
131 | + $newprofile->addSupportedEapMethod(EAP::$PEAP_MSCHAP2, $pref); |
|
132 | 132 | break; |
133 | 133 | case 3: |
134 | - $newprofile->addSupportedEapMethod (EAP::$TLS, $pref); |
|
134 | + $newprofile->addSupportedEapMethod(EAP::$TLS, $pref); |
|
135 | 135 | break; |
136 | 136 | case 4: |
137 | - $newprofile->addSupportedEapMethod (EAP::$FAST_GTC, $pref); |
|
137 | + $newprofile->addSupportedEapMethod(EAP::$FAST_GTC, $pref); |
|
138 | 138 | break; |
139 | 139 | case 5: |
140 | - $newprofile->addSupportedEapMethod (EAP::$TTLS_GTC, $pref); |
|
140 | + $newprofile->addSupportedEapMethod(EAP::$TTLS_GTC, $pref); |
|
141 | 141 | break; |
142 | 142 | case 6: |
143 | - $newprofile->addSupportedEapMethod (EAP::$TTLS_MSCHAP2, $pref); |
|
143 | + $newprofile->addSupportedEapMethod(EAP::$TTLS_MSCHAP2, $pref); |
|
144 | 144 | break; |
145 | 145 | case 7: |
146 | - $newprofile->addSupportedEapMethod (EAP::$PWD, $pref); |
|
146 | + $newprofile->addSupportedEapMethod(EAP::$PWD, $pref); |
|
147 | 147 | break; |
148 | 148 | } |
149 | 149 | $pref = $pref + 1; |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | } |
155 | 155 | } |
156 | 156 | if ($therealm != "") { |
157 | - $newprofile->setRealm ($theanonid."@".$therealm); |
|
157 | + $newprofile->setRealm($theanonid . "@" . $therealm); |
|
158 | 158 | if ($use_anon) { |
159 | - $newprofile->setAnonymousIDSupport (true); |
|
159 | + $newprofile->setAnonymousIDSupport(true); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | // re-instantiate $profile, we need to do completion checks and need fresh data for isEapTypeDefinitionComplete() |
@@ -169,30 +169,30 @@ discard block |
||
169 | 169 | // and send it back to the caller |
170 | 170 | $URL = "https://" . $_SERVER['SERVER_NAME'] . dirname($_SERVER['SCRIPT_NAME']) . "/action_enrollment.php?token=$newtoken"; |
171 | 171 | echo "<CAT-API-Response>\n"; |
172 | - echo " <success action='NEWINST'>\n <enrollment_URL>$URL</enrollment_URL>\n <inst_unique_id>".$idp->identifier."</inst_unique_id>\n </success>\n"; |
|
172 | + echo " <success action='NEWINST'>\n <enrollment_URL>$URL</enrollment_URL>\n <inst_unique_id>" . $idp->identifier . "</inst_unique_id>\n </success>\n"; |
|
173 | 173 | echo "</CAT-API-Response>\n"; |
174 | 174 | exit(0); |
175 | 175 | break; |
176 | 176 | case 'ADMINCOUNT': |
177 | 177 | if (!isset($_POST['INST_IDENTIFIER'])) { |
178 | - return_error(ERROR_MISSING_PARAMETER,"Parameter missing (INST_IDENTIFIER)"); |
|
178 | + return_error(ERROR_MISSING_PARAMETER, "Parameter missing (INST_IDENTIFIER)"); |
|
179 | 179 | exit(1); |
180 | 180 | } |
181 | 181 | $wannabeidp = valid_IdP($_POST['INST_IDENTIFIER']); |
182 | - if (! $wannabeidp instanceof IdP) { |
|
183 | - return_error(ERROR_INVALID_PARAMETER,"Parameter invalid (INST_IDENTIFIER)"); |
|
182 | + if (!$wannabeidp instanceof IdP) { |
|
183 | + return_error(ERROR_INVALID_PARAMETER, "Parameter invalid (INST_IDENTIFIER)"); |
|
184 | 184 | exit(1); |
185 | 185 | } |
186 | 186 | if (strtoupper($wannabeidp->federation) != strtoupper($federation)) { |
187 | - return_error(ERROR_INVALID_PARAMETER,"Parameter invalid (INST_IDENTIFIER)"); |
|
187 | + return_error(ERROR_INVALID_PARAMETER, "Parameter invalid (INST_IDENTIFIER)"); |
|
188 | 188 | exit(1); |
189 | 189 | } |
190 | 190 | echo "<CAT-API-Response>\n"; |
191 | - echo " <success action='ADMINCOUNT'>\n <number_of_admins>".count($wannabeidp->owner())."</number_of_admins>\n </success>\n"; |
|
191 | + echo " <success action='ADMINCOUNT'>\n <number_of_admins>" . count($wannabeidp->owner()) . "</number_of_admins>\n </success>\n"; |
|
192 | 192 | echo "</CAT-API-Response>\n"; |
193 | 193 | exit(0); |
194 | 194 | break; |
195 | 195 | default: |
196 | - return_error(ERROR_INVALID_ACTION,"POST contained an unknown ACTION"); |
|
196 | + return_error(ERROR_INVALID_ACTION, "POST contained an unknown ACTION"); |
|
197 | 197 | exit(1); |
198 | 198 | } |
199 | 199 | \ No newline at end of file |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | if (!in_array($user->identifier, Config::$SUPERADMINS) && !in_array("I do not care about security!", Config::$SUPERADMINS)) |
51 | 51 | header("Location: overview_user.php"); |
52 | 52 | |
53 | -$cat = pageheader("By. Your. Command.","SUPERADMIN", FALSE); // no auth in pageheader; we did our own before |
|
53 | +$cat = pageheader("By. Your. Command.", "SUPERADMIN", FALSE); // no auth in pageheader; we did our own before |
|
54 | 54 | |
55 | 55 | ?> |
56 | 56 | <h1>By. Your. Command.</h1> |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | </legend> |
62 | 62 | <?php |
63 | 63 | if (isset($_POST['admin_action'])) { |
64 | - if($_POST['admin_action'] == BUTTON_SANITY_TESTS) |
|
64 | + if ($_POST['admin_action'] == BUTTON_SANITY_TESTS) |
|
65 | 65 | include("sanity_tests.php"); |
66 | 66 | } |
67 | 67 | ?> |
68 | 68 | <button type="submit" name="admin_action" value="<?php echo BUTTON_SANITY_TESTS; ?>">Run configuration check</button> |
69 | 69 | </fieldset> |
70 | -<?php if($no_security) { |
|
70 | +<?php if ($no_security) { |
|
71 | 71 | print "<h2 style='color: red'>In order to do more you need to configure the SUPERADMIN section in config/config.php and login as one.</h2>"; |
72 | 72 | |
73 | 73 | } else { |