@@ -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> |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | } else { |
126 | 126 | echo "<td class='compat_secondary'></td>"; |
127 | 127 | } |
128 | + } else { |
|
129 | + echo "<td class='compat_unsupported'></td>"; |
|
128 | 130 | } |
129 | - else |
|
130 | - echo "<td class='compat_unsupported'></td>"; |
|
131 | 131 | } |
132 | 132 | echo "</tr>"; |
133 | 133 | } |
@@ -144,8 +144,9 @@ discard block |
||
144 | 144 | <?php |
145 | 145 | if (count($footnotes)) { |
146 | 146 | echo "<p><strong>" . _("Footnotes:") . "</strong></p><table>"; |
147 | - foreach ($footnotes as $number => $text) |
|
148 | - echo "<tr><td>($number) - </td><td>$text</td></tr>"; |
|
147 | + foreach ($footnotes as $number => $text) { |
|
148 | + echo "<tr><td>($number) - </td><td>$text</td></tr>"; |
|
149 | + } |
|
149 | 150 | echo "</table>"; |
150 | 151 | } |
151 | 152 | ?> |
@@ -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 |
@@ -46,9 +46,10 @@ discard block |
||
46 | 46 | exit(1); |
47 | 47 | } |
48 | 48 | |
49 | -foreach (Config::$CONSORTIUM['registration_API_keys'] as $key => $fed_name) |
|
49 | +foreach (Config::$CONSORTIUM['registration_API_keys'] as $key => $fed_name) { |
|
50 | 50 | if ($_POST['APIKEY'] == $key) { |
51 | 51 | $mode = "API"; |
52 | +} |
|
52 | 53 | $federation = $fed_name; |
53 | 54 | $checkval = "OK-NEW"; |
54 | 55 | } |
@@ -84,16 +85,18 @@ discard block |
||
84 | 85 | // POST, but I need to do some sanitising first. |
85 | 86 | // TODO For 1.1, make sure that pSF gets is field as a parameter, not implicitly via POST |
86 | 87 | $original_post = $_POST; |
87 | - foreach ($_POST['option'] as $optindex => $optname) |
|
88 | - if (!preg_match("/^general:/",$optname) && !preg_match("/^support:/",$optname) && !preg_match("/^eap:/",$optname)) |
|
88 | + foreach ($_POST['option'] as $optindex => $optname) { |
|
89 | + if (!preg_match("/^general:/",$optname) && !preg_match("/^support:/",$optname) && !preg_match("/^eap:/",$optname)) |
|
89 | 90 | unset($_POST['option'][$optindex]); |
91 | + } |
|
90 | 92 | // now process all inst-wide options |
91 | 93 | processSubmittedFields($idp, [],0,0,TRUE); |
92 | 94 | $_POST = $original_post; |
93 | 95 | // same thing for profile options |
94 | - foreach ($_POST['option'] as $optindex => $optname) |
|
95 | - if (!preg_match("/^profile:/",$optname) || $optname == "profile:QR-user") |
|
96 | + foreach ($_POST['option'] as $optindex => $optname) { |
|
97 | + if (!preg_match("/^profile:/",$optname) || $optname == "profile:QR-user") |
|
96 | 98 | unset($_POST['option'][$optindex]); |
99 | + } |
|
97 | 100 | // if we do have profile-level options - create a profile and fill in the values! |
98 | 101 | if (count($_POST['option']) > 0) { |
99 | 102 | $newprofile = $idp->newProfile(); |
@@ -106,16 +109,19 @@ discard block |
||
106 | 109 | foreach ($_POST['option'] as $optindex => $optname) { |
107 | 110 | switch ($optname) { |
108 | 111 | case "profile-api:anon": |
109 | - if (isset($_POST['value'][$optindex."-0"])) |
|
110 | - $theanonid = valid_string_db($_POST['value'][$optindex."-0"]); |
|
112 | + if (isset($_POST['value'][$optindex."-0"])) { |
|
113 | + $theanonid = valid_string_db($_POST['value'][$optindex."-0"]); |
|
114 | + } |
|
111 | 115 | break; |
112 | 116 | case "profile-api:realm": |
113 | - if (isset($_POST['value'][$optindex."-0"]) && valid_Realm($_POST['value'][$optindex."-0"])) |
|
114 | - $therealm = $_POST['value'][$optindex."-0"]; |
|
117 | + if (isset($_POST['value'][$optindex."-0"]) && valid_Realm($_POST['value'][$optindex."-0"])) { |
|
118 | + $therealm = $_POST['value'][$optindex."-0"]; |
|
119 | + } |
|
115 | 120 | break; |
116 | 121 | case "profile-api:useanon": |
117 | - if (isset($_POST['value'][$optindex."-3"]) && valid_boolean($_POST['value'][$optindex."-3"]) == "on") |
|
118 | - $use_anon = TRUE; |
|
122 | + if (isset($_POST['value'][$optindex."-3"]) && valid_boolean($_POST['value'][$optindex."-3"]) == "on") { |
|
123 | + $use_anon = TRUE; |
|
124 | + } |
|
119 | 125 | break; |
120 | 126 | case "profile-api:eaptype": |
121 | 127 | $pref = 0; |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | authenticate(); |
44 | 44 | $no_security = 0; |
45 | 45 | } else { |
46 | - $no_security = 1; |
|
46 | + $no_security = 1; |
|
47 | 47 | } |
48 | 48 | $user = new User((!in_array("I do not care about security!", Config::$SUPERADMINS) ? $_SESSION['user'] : "UNIDENTIFIED")); |
49 | 49 | |
@@ -61,16 +61,16 @@ 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 | 70 | <?php if($no_security) { |
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>"; |
|
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 | - } else { |
|
73 | + } else { |
|
74 | 74 | ?> |
75 | 75 | <fieldset class="option_container"> |
76 | 76 | <legend> |
@@ -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 { |
@@ -47,8 +47,9 @@ discard block |
||
47 | 47 | } |
48 | 48 | $user = new User((!in_array("I do not care about security!", Config::$SUPERADMINS) ? $_SESSION['user'] : "UNIDENTIFIED")); |
49 | 49 | |
50 | -if (!in_array($user->identifier, Config::$SUPERADMINS) && !in_array("I do not care about security!", Config::$SUPERADMINS)) |
|
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 | |
53 | 54 | $cat = pageheader("By. Your. Command.","SUPERADMIN", FALSE); // no auth in pageheader; we did our own before |
54 | 55 | |
@@ -61,8 +62,9 @@ discard block |
||
61 | 62 | </legend> |
62 | 63 | <?php |
63 | 64 | if (isset($_POST['admin_action'])) { |
64 | - if($_POST['admin_action'] == BUTTON_SANITY_TESTS) |
|
65 | - include("sanity_tests.php"); |
|
65 | + if($_POST['admin_action'] == BUTTON_SANITY_TESTS) { |
|
66 | + include("sanity_tests.php"); |
|
67 | + } |
|
66 | 68 | } |
67 | 69 | ?> |
68 | 70 | <button type="submit" name="admin_action" value="<?php echo BUTTON_SANITY_TESTS; ?>">Run configuration check</button> |
@@ -77,10 +79,11 @@ discard block |
||
77 | 79 | <strong>Administrative actions</strong> |
78 | 80 | </legend> |
79 | 81 | <?php |
80 | - if (isset($_POST['admin_action'])) |
|
81 | - switch ($_POST['admin_action']) { |
|
82 | + if (isset($_POST['admin_action'])) { |
|
83 | + switch ($_POST['admin_action']) { |
|
82 | 84 | case BUTTON_PURGECACHE: |
83 | 85 | $result = DBConnection::exec("INST", "UPDATE downloads SET download_path = NULL"); |
86 | + } |
|
84 | 87 | // we do NOT break here - after the DB deletion comes the normal |
85 | 88 | // filesystem cleanup |
86 | 89 | case BUTTON_DELETE: |
@@ -99,11 +102,13 @@ discard block |
||
99 | 102 | |
100 | 103 | /* This is the correct way to loop over the directory. */ |
101 | 104 | while (false !== ($entry = readdir($handle))) { |
102 | - if ($entry === '.' || $entry === '..') |
|
103 | - continue; |
|
105 | + if ($entry === '.' || $entry === '..') { |
|
106 | + continue; |
|
107 | + } |
|
104 | 108 | $ftime = $tm - filemtime($downloads . '/' . $entry); |
105 | - if ($ftime < 3600) |
|
106 | - continue; |
|
109 | + if ($ftime < 3600) { |
|
110 | + continue; |
|
111 | + } |
|
107 | 112 | if (isset($Cache[$entry])) { |
108 | 113 | // print "Keep: $entry\n"; |
109 | 114 | continue; |
@@ -283,7 +283,7 @@ |
||
283 | 283 | if ($wizard) |
284 | 284 | echo "<p>". |
285 | 285 | _("The user download interface (see <a href='../'>here</a>), uses geolocation to suggest possibly matching IdPs to the user. The more precise you define the location here, the easier your users will find you."). |
286 | - "</p> |
|
286 | + "</p> |
|
287 | 287 | <ul>". |
288 | 288 | _("<li>Drag the marker in the map to your place, or</li> |
289 | 289 | <li>enter your street address in the field below for lookup, or</li> |
@@ -280,8 +280,8 @@ discard block |
||
280 | 280 | echo "<fieldset class='option_container'> |
281 | 281 | <legend><strong>". _("Location")."</strong></legend>"; |
282 | 282 | |
283 | - if ($wizard) |
|
284 | - echo "<p>". |
|
283 | + if ($wizard) { |
|
284 | + echo "<p>". |
|
285 | 285 | _("The user download interface (see <a href='../'>here</a>), uses geolocation to suggest possibly matching IdPs to the user. The more precise you define the location here, the easier your users will find you."). |
286 | 286 | "</p> |
287 | 287 | <ul>". |
@@ -292,6 +292,7 @@ discard block |
||
292 | 292 | <strong>". |
293 | 293 | _("We will use the coordinates as indicated by the marker for geolocation."). |
294 | 294 | "</strong>"; |
295 | + } |
|
295 | 296 | if ($additional) { |
296 | 297 | echo _("You can enter an <strong>additional</strong> location here. You can see the already defined locations in the 'General Information' field."); |
297 | 298 | } |
@@ -71,19 +71,19 @@ discard block |
||
71 | 71 | * |
72 | 72 | */ |
73 | 73 | function locator_magic() { |
74 | - geocoder.geocode({'address':\"$inst_name\", 'region':\"".strtolower($inst_country)."\"}, |
|
74 | + geocoder.geocode({'address':\"$inst_name\", 'region':\"" . strtolower($inst_country) . "\"}, |
|
75 | 75 | function(r,status) { |
76 | 76 | if(status != google.maps.GeocoderStatus.OK) { |
77 | - locate_country(\"".Federation::$federationList[strtoupper($inst_country)]."\"); |
|
77 | + locate_country(\"".Federation::$federationList[strtoupper($inst_country)] . "\"); |
|
78 | 78 | } else { |
79 | 79 | var i; |
80 | 80 | for(i = 0; i < r.length; i++) { |
81 | 81 | Addr = getAddressElements(r[i].address_components); |
82 | - if(Addr.country == \"". strtoupper($inst_country)."\") |
|
82 | + if(Addr.country == \"". strtoupper($inst_country) . "\") |
|
83 | 83 | break; |
84 | 84 | } |
85 | - if(Addr.country != \"". strtoupper($inst_country)."\") |
|
86 | - locate_country(\"". Federation::$federationList[strtoupper($inst_country)]."\"); |
|
85 | + if(Addr.country != \"". strtoupper($inst_country) . "\") |
|
86 | + locate_country(\"". Federation::$federationList[strtoupper($inst_country)] . "\"); |
|
87 | 87 | else { |
88 | 88 | addMarker(r[i].geometry.location,15,null); |
89 | 89 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | function markerClicked(m) { |
98 | 98 | info_window.close(); |
99 | - var t = \"". _("This is location ")."\"+m.info; |
|
99 | + var t = \"". _("This is location ") . "\"+m.info; |
|
100 | 100 | info_window.setContent(t); |
101 | 101 | info_window.setPosition(m.getPosition()); |
102 | 102 | info_window.open(map,m); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | function getAddressLocation() { |
176 | 176 | var city = $('#address').val(); |
177 | 177 | if(city == '') { |
178 | - alert(\""._("nothing entered in the address field")."\"); |
|
178 | + alert(\""._("nothing entered in the address field") . "\"); |
|
179 | 179 | return false; |
180 | 180 | } |
181 | 181 | geocoder.geocode( { 'address': city}, function(results, status) { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * trigger geolocation |
196 | 196 | */ |
197 | 197 | function locateMe() { |
198 | - $('#address').val(\"". _("locating")."\"); |
|
198 | + $('#address').val(\"". _("locating") . "\"); |
|
199 | 199 | navigator.geolocation.getCurrentPosition(locate_succes,locate_fail,{maximumAge:3600000, timeout:5000}); |
200 | 200 | } |
201 | 201 | |
@@ -278,19 +278,19 @@ discard block |
||
278 | 278 | |
279 | 279 | function geo_widget_body($wizard, $additional) { |
280 | 280 | echo "<fieldset class='option_container'> |
281 | - <legend><strong>". _("Location")."</strong></legend>"; |
|
281 | + <legend><strong>". _("Location") . "</strong></legend>"; |
|
282 | 282 | |
283 | 283 | if ($wizard) |
284 | - echo "<p>". |
|
285 | - _("The user download interface (see <a href='../'>here</a>), uses geolocation to suggest possibly matching IdPs to the user. The more precise you define the location here, the easier your users will find you."). |
|
284 | + echo "<p>" . |
|
285 | + _("The user download interface (see <a href='../'>here</a>), uses geolocation to suggest possibly matching IdPs to the user. The more precise you define the location here, the easier your users will find you.") . |
|
286 | 286 | "</p> |
287 | 287 | <ul>". |
288 | 288 | _("<li>Drag the marker in the map to your place, or</li> |
289 | 289 | <li>enter your street address in the field below for lookup, or</li> |
290 | -<li>use the 'Locate Me!' button</li>"). |
|
290 | +<li>use the 'Locate Me!' button</li>") . |
|
291 | 291 | "</ul> |
292 | 292 | <strong>". |
293 | - _("We will use the coordinates as indicated by the marker for geolocation."). |
|
293 | + _("We will use the coordinates as indicated by the marker for geolocation.") . |
|
294 | 294 | "</strong>"; |
295 | 295 | if ($additional) { |
296 | 296 | echo _("You can enter an <strong>additional</strong> location here. You can see the already defined locations in the 'General Information' field."); |
@@ -59,10 +59,11 @@ |
||
59 | 59 | |
60 | 60 | $url = $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], "/inc/logout.php")) . "/logout_check.php"; |
61 | 61 | |
62 | - if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") |
|
63 | - $url = "https://" . $url; |
|
64 | - else |
|
65 | - $url = "http://" . $url; |
|
62 | + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") { |
|
63 | + $url = "https://" . $url; |
|
64 | + } else { |
|
65 | + $url = "http://" . $url; |
|
66 | + } |
|
66 | 67 | |
67 | 68 | $as->logout([ |
68 | 69 | 'ReturnTo' => $url, |
@@ -140,7 +140,7 @@ |
||
140 | 140 | $message .= wordwrap(_("Additional message from your federation administrator:"),72) . " |
141 | 141 | --------------------------------- |
142 | 142 | " |
143 | - . wordwrap($customtext[0]['value'],72) . " |
|
143 | + . wordwrap($customtext[0]['value'],72) . " |
|
144 | 144 | --------------------------------- |
145 | 145 | |
146 | 146 | "; |
@@ -130,17 +130,17 @@ discard block |
||
130 | 130 | // then, send out the mail |
131 | 131 | $message = _("Hello,") . " |
132 | 132 | |
133 | -" . wordwrap($introtext, 72) . " |
|
133 | +" . wordwrap($introtext, 72) . " |
|
134 | 134 | |
135 | 135 | "; |
136 | 136 | |
137 | 137 | if ($new_idp_authorized_fedadmin) { // see if we are supposed to add a custom message |
138 | 138 | $customtext = $federation->getAttributes('fed:custominvite'); |
139 | 139 | if (count($customtext) > 0) |
140 | - $message .= wordwrap(_("Additional message from your federation administrator:"),72) . " |
|
140 | + $message .= wordwrap(_("Additional message from your federation administrator:"), 72) . " |
|
141 | 141 | --------------------------------- |
142 | 142 | " |
143 | - . wordwrap($customtext[0]['value'],72) . " |
|
143 | + . wordwrap($customtext[0]['value'], 72) . " |
|
144 | 144 | --------------------------------- |
145 | 145 | |
146 | 146 | "; |
@@ -158,8 +158,7 @@ discard block |
||
158 | 158 | _("and enter the invitation token") . " |
159 | 159 | $newtoken |
160 | 160 | " . ( /* $new_idp_authorized_fedadmin */ FALSE ? |
161 | - wordwrap(_("manually. If you reply to this mail, you will reach the federation administrators of your federation."), 72) : |
|
162 | - wordwrap(_("manually. Please do not reply to this mail; this is a send-only address.")) ) . " |
|
161 | + wordwrap(_("manually. If you reply to this mail, you will reach the federation administrators of your federation."), 72) : wordwrap(_("manually. Please do not reply to this mail; this is a send-only address.")) ) . " |
|
163 | 162 | |
164 | 163 | " . wordwrap(_("Do NOT forward the mail before the token has expired - or the recipients may be able to consume the token on your behalf!"), 72) . " |
165 | 164 |
@@ -24,8 +24,9 @@ discard block |
||
24 | 24 | $fed_privs = $user_object->getAttributes("user:fedadmin"); |
25 | 25 | // a new IdP was requested and all the required parameters are there |
26 | 26 | foreach ($fed_privs as $onefed) { |
27 | - if (strtolower($onefed['value']) == strtolower($country)) |
|
28 | - return TRUE; |
|
27 | + if (strtolower($onefed['value']) == strtolower($country)) { |
|
28 | + return TRUE; |
|
29 | + } |
|
29 | 30 | } |
30 | 31 | echo "<p>" . _("Something's wrong... you want to create a new institution, but are not a federation admin for the federation it should be in!") . "</p>"; |
31 | 32 | exit(1); |
@@ -40,8 +41,9 @@ discard block |
||
40 | 41 | $new_idp_authorized_fedadmin = FALSE; |
41 | 42 | |
42 | 43 | // check if the user is authenticated, and we have a valid mail address |
43 | -if (!isset($_SESSION['user']) || !isset($_POST['mailaddr'])) |
|
44 | +if (!isset($_SESSION['user']) || !isset($_POST['mailaddr'])) { |
|
44 | 45 | exit(1); |
46 | +} |
|
45 | 47 | |
46 | 48 | $newmailaddress = valid_string_db($_POST['mailaddr']); |
47 | 49 | $newcountry = ""; |
@@ -58,8 +60,9 @@ discard block |
||
58 | 60 | $is_owner = FALSE; |
59 | 61 | $owners = $idp->owner(); |
60 | 62 | foreach ($owners as $oneowner) { |
61 | - if ($oneowner['ID'] == $_SESSION['user'] && $oneowner['LEVEL'] == "FED") |
|
62 | - $is_owner = TRUE; |
|
63 | + if ($oneowner['ID'] == $_SESSION['user'] && $oneowner['LEVEL'] == "FED") { |
|
64 | + $is_owner = TRUE; |
|
65 | + } |
|
63 | 66 | } |
64 | 67 | // check if he is (also) federation admin for the federation this IdP is in. His invitations have more blessing then. |
65 | 68 | $fedadmin = $user_object->isFederationAdmin($idp->federation); |
@@ -99,14 +102,17 @@ discard block |
||
99 | 102 | // see if the inst name is defined in the currently set language; if not, pick its English name; if N/A, pick the last in the list |
100 | 103 | $ourlang = CAT::get_lang(); |
101 | 104 | $prettyprintname = ""; |
102 | - foreach ($extinfo['names'] as $lang => $name) |
|
103 | - if ($lang == $ourlang) |
|
105 | + foreach ($extinfo['names'] as $lang => $name) { |
|
106 | + if ($lang == $ourlang) |
|
104 | 107 | $prettyprintname = $name; |
105 | - if ($prettyprintname == "" && isset($extinfo['names']['en'])) |
|
106 | - $prettyprintname = $extinfo['names']['en']; |
|
107 | - if ($prettyprintname == "") |
|
108 | - foreach ($extinfo['names'] as $name) |
|
108 | + } |
|
109 | + if ($prettyprintname == "" && isset($extinfo['names']['en'])) { |
|
110 | + $prettyprintname = $extinfo['names']['en']; |
|
111 | + } |
|
112 | + if ($prettyprintname == "") { |
|
113 | + foreach ($extinfo['names'] as $name) |
|
109 | 114 | $prettyprintname = $name; |
115 | + } |
|
110 | 116 | // fill the rest of the text |
111 | 117 | $introtext = sprintf(_("a %s operator has invited you to manage the IdP \"%s\"."), Config::$CONSORTIUM['name'], $prettyprintname) . " " . sprintf(_("This invitation is valid for 24 hours from now, i.e. until %s."), strftime("%x %X", time() + 86400)); |
112 | 118 | $redirect_destination = "../overview_federation.php?"; |
@@ -124,8 +130,9 @@ discard block |
||
124 | 130 | } |
125 | 131 | // are we on https? |
126 | 132 | $proto = "http://"; |
127 | -if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") |
|
133 | +if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") { |
|
128 | 134 | $proto = "https://"; |
135 | +} |
|
129 | 136 | |
130 | 137 | // then, send out the mail |
131 | 138 | $message = _("Hello,") . " |
@@ -136,15 +143,16 @@ discard block |
||
136 | 143 | |
137 | 144 | if ($new_idp_authorized_fedadmin) { // see if we are supposed to add a custom message |
138 | 145 | $customtext = $federation->getAttributes('fed:custominvite'); |
139 | - if (count($customtext) > 0) |
|
140 | - $message .= wordwrap(_("Additional message from your federation administrator:"),72) . " |
|
146 | + if (count($customtext) > 0) { |
|
147 | + $message .= wordwrap(_("Additional message from your federation administrator:"),72) . " |
|
141 | 148 | --------------------------------- |
142 | 149 | " |
143 | 150 | . wordwrap($customtext[0]['value'],72) . " |
144 | 151 | --------------------------------- |
145 | 152 | |
146 | 153 | "; |
147 | -} |
|
154 | + } |
|
155 | + } |
|
148 | 156 | |
149 | 157 | $message .= wordwrap(_("To enlist as an administrator for that IdP, please click on the following link:"), 72) . " |
150 | 158 | |
@@ -192,8 +200,9 @@ discard block |
||
192 | 200 | // $mail->addReplyTo($fedadmin->getAttributes("user:email")['value'], $fedadmin->getAttributes("user:realname")['value']); |
193 | 201 | } |
194 | 202 | } |
195 | -if (isset(Config::$APPEARANCE['invitation-bcc-mail']) && Config::$APPEARANCE['invitation-bcc-mail'] !== NULL) |
|
203 | +if (isset(Config::$APPEARANCE['invitation-bcc-mail']) && Config::$APPEARANCE['invitation-bcc-mail'] !== NULL) { |
|
196 | 204 | $mail->addBCC(Config::$APPEARANCE['invitation-bcc-mail']); |
205 | +} |
|
197 | 206 | |
198 | 207 | // all addresses are wrapped in a string, but PHPMailer needs a structured list of addressees |
199 | 208 | // sigh... so convert as needed |
@@ -201,20 +210,23 @@ discard block |
||
201 | 210 | $recipients = explode(", ", $newmailaddress); |
202 | 211 | |
203 | 212 | // fill the destinations in PHPMailer API |
204 | -foreach ($recipients as $recipient) |
|
213 | +foreach ($recipients as $recipient) { |
|
205 | 214 | $mail->addAddress($recipient); |
215 | +} |
|
206 | 216 | |
207 | 217 | // what do we want to say? |
208 | 218 | $mail->Subject = sprintf(_("%s: you have been invited to manage an IdP"), Config::$APPEARANCE['productname']); |
209 | 219 | $mail->Body = $message; |
210 | 220 | |
211 | -if (isset(Config::$CONSORTIUM['certfilename'], Config::$CONSORTIUM['keyfilename'], Config::$CONSORTIUM['keypass'])) |
|
221 | +if (isset(Config::$CONSORTIUM['certfilename'], Config::$CONSORTIUM['keyfilename'], Config::$CONSORTIUM['keypass'])) { |
|
212 | 222 | $mail->sign(Config::$CONSORTIUM['certfilename'], Config::$CONSORTIUM['keyfilename'], Config::$CONSORTIUM['keypass']); |
223 | +} |
|
213 | 224 | |
214 | 225 | $sent = $mail->send(); |
215 | 226 | |
216 | 227 | // invalidate the token immediately if the mail could not be sent! |
217 | -if (!$sent) |
|
228 | +if (!$sent) { |
|
218 | 229 | $mgmt->invalidateToken($newtoken); |
230 | +} |
|
219 | 231 | $status = ($sent ? "SUCCESS" : "FAILURE"); |
220 | 232 | header("Location: $redirect_destination" . "invitation=$status"); |
221 | 233 | \ No newline at end of file |
@@ -25,33 +25,33 @@ |
||
25 | 25 | $list = $optioninfo->availableOptions($_GET["class"]); |
26 | 26 | |
27 | 27 | switch ($_GET['class']) { |
28 | - case "general": |
|
29 | - $blacklist_item = array_search("general:geo_coordinates", $list); |
|
30 | - if ($blacklist_item !== FALSE) { |
|
31 | - unset($list[$blacklist_item]); |
|
32 | - $list = array_values($list); |
|
33 | - } |
|
34 | - break; |
|
35 | - case "user": |
|
36 | - $blacklist_item = array_search("user:fedadmin", $list); |
|
37 | - if ($blacklist_item !== FALSE) { |
|
38 | - unset($list[$blacklist_item]); |
|
39 | - $list = array_values($list); |
|
40 | - } |
|
41 | - break; |
|
42 | - case "eap": |
|
43 | - case "support": |
|
44 | - case "profile": |
|
45 | - case "media": |
|
46 | - case "fed": |
|
47 | - $list = array_values($list); |
|
48 | - break; |
|
49 | - case "device-specific": |
|
50 | - case "eap-specific": |
|
51 | - break; |
|
52 | - default: |
|
53 | - debug(1,"Unknown type of option!"); |
|
54 | - exit(1); |
|
28 | + case "general": |
|
29 | + $blacklist_item = array_search("general:geo_coordinates", $list); |
|
30 | + if ($blacklist_item !== FALSE) { |
|
31 | + unset($list[$blacklist_item]); |
|
32 | + $list = array_values($list); |
|
33 | + } |
|
34 | + break; |
|
35 | + case "user": |
|
36 | + $blacklist_item = array_search("user:fedadmin", $list); |
|
37 | + if ($blacklist_item !== FALSE) { |
|
38 | + unset($list[$blacklist_item]); |
|
39 | + $list = array_values($list); |
|
40 | + } |
|
41 | + break; |
|
42 | + case "eap": |
|
43 | + case "support": |
|
44 | + case "profile": |
|
45 | + case "media": |
|
46 | + case "fed": |
|
47 | + $list = array_values($list); |
|
48 | + break; |
|
49 | + case "device-specific": |
|
50 | + case "eap-specific": |
|
51 | + break; |
|
52 | + default: |
|
53 | + debug(1,"Unknown type of option!"); |
|
54 | + exit(1); |
|
55 | 55 | } |
56 | 56 | // echo "<pre>".print_r($list)."</pre>"; |
57 | 57 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | case "eap-specific": |
51 | 51 | break; |
52 | 52 | default: |
53 | - debug(1,"Unknown type of option!"); |
|
53 | + debug(1, "Unknown type of option!"); |
|
54 | 54 | exit(1); |
55 | 55 | } |
56 | 56 | // echo "<pre>".print_r($list)."</pre>"; |
@@ -26,24 +26,28 @@ |
||
26 | 26 | // shouldn't throw E_NOTICE |
27 | 27 | if (@unserialize($blob) !== FALSE) { // an array? must be lang-tagged content |
28 | 28 | $blob = unserialize($blob); |
29 | - if (!isset($blob['content'])) |
|
30 | - return; |
|
29 | + if (!isset($blob['content'])) { |
|
30 | + return; |
|
31 | + } |
|
31 | 32 | $blob = base64_decode($blob['content']); |
32 | 33 | } else { |
33 | 34 | $blob = base64_decode($blob); |
34 | 35 | } |
35 | 36 | |
36 | - if ($blob === FALSE) |
|
37 | - return; |
|
37 | + if ($blob === FALSE) { |
|
38 | + return; |
|
39 | + } |
|
38 | 40 | |
39 | 41 | // Set data type and caching for 30 days |
40 | 42 | $info = new finfo(); |
41 | 43 | $filetype = $info->buffer($blob, FILEINFO_MIME_TYPE); |
42 | 44 | header("Content-type: " . $filetype); |
43 | - if ($filetype == "text/rtf" || $filetype == "application/rtf") |
|
44 | - header("Content-Disposition: attachment; filename='download.rtf'"); |
|
45 | - if ($filetype == "text/plain") |
|
46 | - header("Content-Disposition: attachment; filename='download.txt'"); |
|
45 | + if ($filetype == "text/rtf" || $filetype == "application/rtf") { |
|
46 | + header("Content-Disposition: attachment; filename='download.rtf'"); |
|
47 | + } |
|
48 | + if ($filetype == "text/plain") { |
|
49 | + header("Content-Disposition: attachment; filename='download.txt'"); |
|
50 | + } |
|
47 | 51 | header("Cache-Control: must-revalidate"); |
48 | 52 | $offset = 60 * 60 * 24 * 30; |
49 | 53 | $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; |
@@ -20,9 +20,10 @@ discard block |
||
20 | 20 | // print_r($prepopulate); |
21 | 21 | if (is_array($prepopulate) && ( count($prepopulate) > 1 || $class == "device-specific" || $class == "eap-specific") ) { // editing... fill with values |
22 | 22 | $a = 0; |
23 | - foreach ($prepopulate as $option) |
|
24 | - if (preg_match("/$class:/", $option['name']) && !preg_match("/(profile:QR-user|user:fedadmin)/", $option['name'])) { |
|
23 | + foreach ($prepopulate as $option) { |
|
24 | + if (preg_match("/$class:/", $option['name']) && !preg_match("/(profile:QR-user|user:fedadmin)/", $option['name'])) { |
|
25 | 25 | $optiontypearray = $optioninfo->optionType($option['name']); |
26 | + } |
|
26 | 27 | debug(5, "About to execute optiontext with PREFILL!\n"); |
27 | 28 | echo optiontext($a, [$option['name']], ($optiontypearray["type"] == "file" ? 'ROWID-' . $option['level'] . '-' . $option['row'] : $option['value'])); |
28 | 29 | } |
@@ -52,8 +53,9 @@ discard block |
||
52 | 53 | echo "</pre>"; */ |
53 | 54 | // add as many options as there are different option types |
54 | 55 | |
55 | - foreach (array_keys($list) as $key) |
|
56 | - echo optiontext($key, $list); |
|
56 | + foreach (array_keys($list) as $key) { |
|
57 | + echo optiontext($key, $list); |
|
58 | + } |
|
57 | 59 | } |
58 | 60 | } |
59 | 61 | |
@@ -154,10 +156,11 @@ discard block |
||
154 | 156 | $content = $prefill; |
155 | 157 | } |
156 | 158 | $language; |
157 | - if ($taggedarray['lang'] == 'C') |
|
158 | - $language = _("(default/other languages)"); |
|
159 | - else |
|
160 | - $language = "(" . strtoupper($taggedarray['lang']) . ")"; |
|
159 | + if ($taggedarray['lang'] == 'C') { |
|
160 | + $language = _("(default/other languages)"); |
|
161 | + } else { |
|
162 | + $language = "(" . strtoupper($taggedarray['lang']) . ")"; |
|
163 | + } |
|
161 | 164 | $retval .= $language; |
162 | 165 | $retval .= "<input type='hidden' name='value[S$rowid-lang]' id='S" . $rowid . "-input-langselect' value='" . $taggedarray["lang"] . "' style='display:block'>"; |
163 | 166 | } else { |
@@ -197,12 +200,13 @@ discard block |
||
197 | 200 | $retval .= "<strong>$content</strong><input type='hidden' name='value[S$rowid-1]' id='S" . $rowid . "-input-text' value=\"".htmlspecialchars($content)."\" style='display:block'>"; |
198 | 201 | break; |
199 | 202 | case "boolean": |
200 | - if ($content == "on") |
|
201 | - /// Device assessment is "on" |
|
203 | + if ($content == "on") { |
|
204 | + /// Device assessment is "on" |
|
202 | 205 | $display_option = _("on"); |
203 | - else |
|
204 | - /// Device assessment is "off" |
|
206 | + } else { |
|
207 | + /// Device assessment is "off" |
|
205 | 208 | $display_option = _("off"); |
209 | + } |
|
206 | 210 | $retval .= "<strong>$display_option</strong><input type='hidden' name='value[S$rowid-3]' id='S" . $rowid . "-input-boolean' value='$content' style='display:block'>"; |
207 | 211 | break; |
208 | 212 | default: |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | // print_r($prepopulate); |
19 | 19 | $optioninfo = Options::instance(); |
20 | 20 | // print_r($prepopulate); |
21 | - if (is_array($prepopulate) && ( count($prepopulate) > 1 || $class == "device-specific" || $class == "eap-specific") ) { // editing... fill with values |
|
21 | + if (is_array($prepopulate) && (count($prepopulate) > 1 || $class == "device-specific" || $class == "eap-specific")) { // editing... fill with values |
|
22 | 22 | $a = 0; |
23 | 23 | foreach ($prepopulate as $option) |
24 | 24 | if (preg_match("/$class:/", $option['name']) && !preg_match("/(profile:QR-user|user:fedadmin)/", $option['name'])) { |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | $a = 0; |
113 | 113 | foreach ($list as $key => $value) { |
114 | 114 | $listtype = $optioninfo->optionType($value); |
115 | - $retval .="<option id='option-S$rowid-v-$value' value='$value#" . $listtype["type"] . "#" . $listtype["flag"] . "#' "; |
|
115 | + $retval .= "<option id='option-S$rowid-v-$value' value='$value#" . $listtype["type"] . "#" . $listtype["flag"] . "#' "; |
|
116 | 116 | if ($a == $defaultselect) { |
117 | 117 | $retval .= "selected='selected'"; |
118 | 118 | $activelisttype = $listtype; |
119 | 119 | } |
120 | - $retval .=">" . display_name($value). "</option>"; |
|
120 | + $retval .= ">" . display_name($value) . "</option>"; |
|
121 | 121 | $a++; |
122 | 122 | } |
123 | - $retval .="</select></td>"; |
|
124 | - $retval .="<td> |
|
123 | + $retval .= "</select></td>"; |
|
124 | + $retval .= "<td> |
|
125 | 125 | <select style='display:" . ($activelisttype["flag"] == "ML" ? "block" : "none") . "' name='value[S$rowid-lang]' id='S" . $rowid . "-input-langselect'> |
126 | 126 | <option value='' name='select_language' selected>" . _("select language") . "</option> |
127 | 127 | <option value='C' name='all_languages'>" . _("default/other languages") . "</option>"; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $global_location_count++; |
183 | 183 | $location_index = $global_location_count; |
184 | 184 | $link = "<button id='location_b_$global_location_count' class='location_button'>" . _("Click to see location") . " $global_location_count</button>"; |
185 | - $retval .="<input readonly style='display:none' type='text' name='value[S$rowid-1]' id='S" . $rowid . "-input-text' value='$prefill'>$link"; |
|
185 | + $retval .= "<input readonly style='display:none' type='text' name='value[S$rowid-1]' id='S" . $rowid . "-input-text' value='$prefill'>$link"; |
|
186 | 186 | break; |
187 | 187 | case "file": |
188 | 188 | $retval .= "<input readonly type='text' name='value[S$rowid-1]' id='S" . $rowid . "-input-string' style='display:none' value='" . urlencode($content) . "'>"; |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | }; |
203 | 203 | break; |
204 | 204 | case "string": |
205 | - $retval .= "<strong>$content</strong><input type='hidden' name='value[S$rowid-0]' id='S" . $rowid . "-input-string' value=\"".htmlspecialchars($content)."\" style='display:block'>"; |
|
205 | + $retval .= "<strong>$content</strong><input type='hidden' name='value[S$rowid-0]' id='S" . $rowid . "-input-string' value=\"" . htmlspecialchars($content) . "\" style='display:block'>"; |
|
206 | 206 | break; |
207 | 207 | case "integer": |
208 | - $retval .= "<strong>$content</strong><input type='hidden' name='value[S$rowid-4]' id='S" . $rowid . "-input-integer' value=\"".htmlspecialchars($content)."\" style='display:block'>"; |
|
208 | + $retval .= "<strong>$content</strong><input type='hidden' name='value[S$rowid-4]' id='S" . $rowid . "-input-integer' value=\"" . htmlspecialchars($content) . "\" style='display:block'>"; |
|
209 | 209 | break; |
210 | 210 | case "text": |
211 | - $retval .= "<strong>$content</strong><input type='hidden' name='value[S$rowid-1]' id='S" . $rowid . "-input-text' value=\"".htmlspecialchars($content)."\" style='display:block'>"; |
|
211 | + $retval .= "<strong>$content</strong><input type='hidden' name='value[S$rowid-1]' id='S" . $rowid . "-input-text' value=\"" . htmlspecialchars($content) . "\" style='display:block'>"; |
|
212 | 212 | break; |
213 | 213 | case "boolean": |
214 | 214 | if ($content == "on") |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | }; |
228 | 228 | $retval .= "</td>"; |
229 | 229 | } |
230 | - $retval .=" |
|
230 | + $retval .= " |
|
231 | 231 | |
232 | 232 | <td> |
233 | 233 | <button type='button' class='delete' onclick='deleteOption(" . $location_index . ",\"option-S" . $rowid . "\")'>-</button> |