Completed
Branch master (03ec64)
by Brook
14:43
created
web/admin/overview_user.php 1 patch
Braces   +24 added lines, -18 removed lines patch added patch discarded remove patch
@@ -54,22 +54,26 @@  discard block
 block discarded – undo
54 54
     </div>
55 55
     <div>
56 56
         <?php
57
-        if (!Config::$DB['userdb-readonly'])
58
-            echo "<a href='edit_user.php'><button>" . _("Edit User Details") . "</button></a>";
57
+        if (!Config::$DB['userdb-readonly']) {
58
+                    echo "<a href='edit_user.php'><button>" . _("Edit User Details") . "</button></a>";
59
+        }
59 60
 
60
-        if ($user->isFederationAdmin())
61
-            echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . _('Click here to manage your federations') . "</button></form>";
62
-        if ($user->isSuperadmin())
63
-            echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . _('Click here to access the superadmin page') . "</button></form>";
61
+        if ($user->isFederationAdmin()) {
62
+                    echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . _('Click here to manage your federations') . "</button></form>";
63
+        }
64
+        if ($user->isSuperadmin()) {
65
+                    echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . _('Click here to access the superadmin page') . "</button></form>";
66
+        }
64 67
         ?>
65 68
     </div>
66 69
     <?php
67 70
     $has_inst = $inst_mgmt->listInstitutionsByAdmin($_SESSION['user']);
68 71
 
69
-    if (Config::$CONSORTIUM['name'] == 'eduroam')
70
-        $helptext = "&nbsp;<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
-    else
72
-        $helptext = "";
72
+    if (Config::$CONSORTIUM['name'] == 'eduroam') {
73
+            $helptext = "&nbsp;<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>";
74
+    } else {
75
+            $helptext = "";
76
+    }
73 77
 
74 78
     if (sizeof($has_inst) > 0) {
75 79
         // we need to run the Federation constructor
@@ -121,25 +125,27 @@  discard block
 block discarded – undo
121 125
                         }
122 126
                     } else { // don't list self
123 127
                         unset($admins[$number]);
124
-                        if ($username['LEVEL'] == "FED")
125
-                            $i_am_blessed = TRUE;
128
+                        if ($username['LEVEL'] == "FED") {
129
+                                                    $i_am_blessed = TRUE;
130
+                        }
126 131
                     }
127 132
                 }
128 133
                 $number_of_other_admins = count($admins); // only the unnamed remain
129
-                if ($number_of_other_admins > 0)
130
-                    echo ngettext("other user", "other users", $number_of_other_admins);
134
+                if ($number_of_other_admins > 0) {
135
+                                    echo ngettext("other user", "other users", $number_of_other_admins);
136
+                }
131 137
                 // foreach ($the_inst->owner() as $admin)
132 138
                 // if ($admin != $_SESSION['user'])
133 139
                 // echo $admin . "<br/>";
134 140
                 echo "</td><td>";
135
-                if ($i_am_blessed)
136
-                    echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $the_inst->identifier . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>" . _("Add/Remove Administrators") . "</button></form></div>";
141
+                if ($i_am_blessed) {
142
+                                    echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $the_inst->identifier . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>" . _("Add/Remove Administrators") . "</button></form></div>";
143
+                }
137 144
                 echo "</td></tr>";
138 145
             }
139 146
         }
140 147
         echo "</table>";
141
-    }
142
-    else {
148
+    } else {
143 149
         echo "<h2>" . _("You are not managing any institutions.") . "</h2>";
144 150
     };
145 151
     if (Config::$CONSORTIUM['selfservice_registration'] === NULL) {
Please login to merge, or discard this patch.
web/admin/edit_profile_result.php 1 patch
Braces   +24 added lines, -14 removed lines patch added patch discarded remove patch
@@ -48,25 +48,29 @@  discard block
 block discarded – undo
48 48
 // extended input checks
49 49
 
50 50
 $realm = FALSE;
51
-if (isset($_POST['realm']) && $_POST['realm'] != "")
51
+if (isset($_POST['realm']) && $_POST['realm'] != "") {
52 52
     $realm = valid_Realm($_POST['realm']);
53
+}
53 54
 
54 55
 $anon = FALSE;
55
-if (isset($_POST['anon_support']))
56
+if (isset($_POST['anon_support'])) {
56 57
     $anon = valid_boolean($_POST['anon_support']);
58
+}
57 59
 
58 60
 $anon_local = "anonymous";
59 61
 if (isset($_POST['anon_local'])) {
60 62
     $anon_local = valid_string_db($_POST['anon_local']);
61 63
 } else if ($my_profile !== FALSE) { // get the old anon outer id from DB. People don't appreciate "forgetting" it when unchecking anon id
62 64
     $local = $my_profile->getAttributes("internal:anon_local_value");
63
-    if (isset($local[0]))
64
-        $anon_local = $local[0]['value'];
65
-}
65
+    if (isset($local[0])) {
66
+            $anon_local = $local[0]['value'];
67
+    }
68
+    }
66 69
 
67 70
 $checkuser = FALSE;
68
-if (isset($_POST['checkuser_support']))
71
+if (isset($_POST['checkuser_support'])) {
69 72
     $checkuser = valid_boolean($_POST['checkuser_support']);
73
+}
70 74
 
71 75
 $checkuser_name = "anonymous";
72 76
 if (isset($_POST['checkuser_local'])) {
@@ -77,15 +81,18 @@  discard block
 block discarded – undo
77 81
 
78 82
 $verify = FALSE;
79 83
 $hint = FALSE;
80
-if (isset($_POST['verify_support']))
84
+if (isset($_POST['verify_support'])) {
81 85
     $verify = valid_boolean($_POST['checkuser_support']);
82
-if (isset($_POST['hint_support']))
86
+}
87
+if (isset($_POST['hint_support'])) {
83 88
     $hint = valid_boolean($_POST['hint_support']);
89
+}
84 90
 
85 91
 
86 92
 $redirect = FALSE;
87
-if (isset($_POST['redirect']))
93
+if (isset($_POST['redirect'])) {
88 94
     $redirect = valid_boolean($_POST['redirect']);
95
+}
89 96
 
90 97
 // did the user submit info? If so, submit to DB and go on to the 'dashboard' or 'next profile' page.
91 98
 // if not, what is he doing on this page anyway!
@@ -113,8 +120,9 @@  discard block
 block discarded – undo
113 120
     if ($realm != FALSE) {
114 121
         $profile->setRealm($anon_local . "@" . $realm);
115 122
         echo UI_okay(sprintf(_("Realm: <strong>%s</strong>"), $realm));
116
-    } else
117
-        $profile->setRealm("");
123
+    } else {
124
+            $profile->setRealm("");
125
+    }
118 126
     // set anon ID, if submitted
119 127
     if ($anon != FALSE) {
120 128
         if ($realm == FALSE) {
@@ -190,9 +198,10 @@  discard block
 block discarded – undo
190 198
                 echo UI_okay(_("Supported EAP Type: ") . "<strong>" . display_name($a) . "</strong>");
191 199
             } else {
192 200
                 $warntext = "";
193
-                if (is_array($eapcompleteness))
194
-                    foreach ($eapcompleteness as $item)
201
+                if (is_array($eapcompleteness)) {
202
+                                    foreach ($eapcompleteness as $item)
195 203
                         $warntext .= "<strong>" . display_name($item) . "</strong> ";
204
+                }
196 205
                 echo UI_warning(sprintf(_("Supported EAP Type: <strong>%s</strong> is missing required information %s !"), display_name($a), $warntext) . "<br/>" . _("The EAP type was added to the profile, but you need to complete the missing information before we can produce installers for you."));
197 206
             }
198 207
         }
@@ -207,9 +216,10 @@  discard block
 block discarded – undo
207 216
     <button type='submit'><?php echo _("Continue to dashboard"); ?></button>
208 217
 </form>
209 218
 <?php
210
-if (count($profile->getEapMethodsinOrderOfPreference(1)) > 0)
219
+if (count($profile->getEapMethodsinOrderOfPreference(1)) > 0) {
211 220
     echo "<form method='post' action='overview_installers.php?inst_id=$my_inst->identifier&profile_id=$profile->identifier' accept-charset='UTF-8'>
212 221
         <button type='submit'>" . _("Continue to Installer Fine-Tuning and Download") . "</button>
213 222
     </form>";
223
+}
214 224
 footer();
215 225
 ?>
216 226
\ No newline at end of file
Please login to merge, or discard this patch.
web/admin/overview_installers.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     ?>
Please login to merge, or discard this patch.
web/admin/edit_profile.php 1 patch
Braces   +69 added lines, -47 removed lines patch added patch discarded remove patch
@@ -157,9 +157,10 @@  discard block
 block discarded – undo
157 157
     if (count($blacklisted) > 0) {
158 158
         $blacklisted = unserialize($blacklisted[0]['value']);
159 159
         $blacklisted = $blacklisted['content'];
160
-    } else
161
-        $blacklisted = FALSE;
162
-} else {
160
+    } else {
161
+            $blacklisted = FALSE;
162
+    }
163
+    } else {
163 164
     $wizard_style = TRUE;
164 165
     $edit_mode = FALSE;
165 166
 }
@@ -173,10 +174,11 @@  discard block
 block discarded – undo
173 174
     ?>
174 175
     <h1>
175 176
         <?php
176
-        if ($wizard_style)
177
-            echo _("Step 3: Defining a user group profile");
178
-        else
179
-            printf(_("Edit profile '%s' ..."), $prefill_name);
177
+        if ($wizard_style) {
178
+                    echo _("Step 3: Defining a user group profile");
179
+        } else {
180
+                    printf(_("Edit profile '%s' ..."), $prefill_name);
181
+        }
180 182
         ?>
181 183
     </h1>
182 184
     <div class='infobox'>
@@ -219,8 +221,9 @@  discard block
 block discarded – undo
219 221
             <strong><?php echo _("General Profile properties"); ?></strong>
220 222
         </legend>
221 223
         <?php
222
-        if ($wizard_style)
223
-            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>";
224
+        if ($wizard_style) {
225
+                    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>";
226
+        }
224 227
         ?>
225 228
         <h3><?php echo _("Profile Name and RADIUS realm"); ?></h3>
226 229
         <?php
@@ -228,8 +231,9 @@  discard block
 block discarded – undo
228 231
             echo "<p>" . _("First of all we need a name for the profile. This will be displayed to end users, so you may want to choose a descriptive name like 'Professors', 'Students of the Faculty of Bioscience', etc.") . "</p>";
229 232
             echo "<p>" . _("Optionally, you can provide a longer descriptive text about who this profile is for. If you specify it, it will be displayed on the download page after the user has selected the profile name in the list.") . "</p>";
230 233
             echo "<p>" . _("You can also tell us your RADIUS realm. ");
231
-            if (count(Config::$RADIUSTESTS['UDP-hosts']) > 0 || Config::$RADIUSTESTS['TLS-discoverytag'] != "")
232
-                printf(_("This is useful if you want to use the sanity check module later, which tests reachability of your realm in the %s infrastructure. "), CONFIG::$CONSORTIUM['name']);
234
+            if (count(Config::$RADIUSTESTS['UDP-hosts']) > 0 || Config::$RADIUSTESTS['TLS-discoverytag'] != "") {
235
+                            printf(_("This is useful if you want to use the sanity check module later, which tests reachability of your realm in the %s infrastructure. "), CONFIG::$CONSORTIUM['name']);
236
+            }
233 237
             echo _("It is required to enter the realm name if you want to support anonymous outer identities (see below).") . "</p>";
234 238
         }
235 239
         ?>
@@ -240,9 +244,10 @@  discard block
 block discarded – undo
240 244
             if ($edit_mode) {
241 245
                 $existing_attribs = $my_profile->getAttributes();
242 246
 
243
-                foreach ($existing_attribs as $existing_attribute)
244
-                    if ($existing_attribute['level'] == "Profile")
247
+                foreach ($existing_attribs as $existing_attribute) {
248
+                                    if ($existing_attribute['level'] == "Profile")
245 249
                         $prepopulate[] = $existing_attribute;
250
+                }
246 251
             }
247 252
             add_option("profile", $prepopulate);
248 253
             ?>
@@ -349,8 +354,9 @@  discard block
 block discarded – undo
349 354
         <h3><?php echo _("Installer Download Location"); ?></h3>
350 355
 
351 356
         <?php
352
-        if ($wizard_style)
353
-            echo "<p>" . _("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).") . "</p>";
357
+        if ($wizard_style) {
358
+                    echo "<p>" . _("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).") . "</p>";
359
+        }
354 360
         ?>
355 361
         <p>
356 362
 
@@ -370,15 +376,17 @@  discard block
 block discarded – undo
370 376
     <fieldset class="option_container">
371 377
         <legend><strong><?php echo _("Supported EAP types"); ?></strong></legend>
372 378
         <?php
373
-        if ($wizard_style)
374
-            echo "<p>" . _("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.") . "</p>";
379
+        if ($wizard_style) {
380
+                    echo "<p>" . _("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.") . "</p>";
381
+        }
375 382
         ?>
376 383
         <?php
377 384
 
378 385
         function priority($eap_type, $isenabled, $priority) {
379 386
             echo "<td><select id='$eap_type-priority' name='$eap_type-priority' " . (!$isenabled ? "disabled='disabled'" : "") . ">";
380
-            for ($a = 1; $a < 7; $a = $a + 1)
381
-                echo "<option id='$eap_type-$a' value='$a' " . ( $isenabled && $a == $priority ? "selected" : "" ) . ">$a</option>";
387
+            for ($a = 1; $a < 7; $a = $a + 1) {
388
+                            echo "<option id='$eap_type-$a' value='$a' " . ( $isenabled && $a == $priority ? "selected" : "" ) . ">$a</option>";
389
+            }
382 390
             echo "</select></td>";
383 391
         }
384 392
 
@@ -387,18 +395,20 @@  discard block
 block discarded – undo
387 395
 
388 396
             $eapoptions = [];
389 397
 
390
-            foreach ($idpwideoptions as $option)
391
-                if ($option['level'] == "IdP" && preg_match('/^eap/', $option['name']))
398
+            foreach ($idpwideoptions as $option) {
399
+                            if ($option['level'] == "IdP" && preg_match('/^eap/', $option['name']))
392 400
                     $eapoptions[] = $option['name'];
401
+            }
393 402
 
394 403
             $eapoptions = array_count_values($eapoptions);
395 404
 
396 405
             if (count($eapoptions) > 0) {
397 406
                 echo "<strong>" . _("EAP options inherited from Global level:") . "</strong><br />";
398
-                foreach ($eapoptions as $optionname => $count)
399
-                /// option count and enumeration
407
+                foreach ($eapoptions as $optionname => $count) {
408
+                                /// option count and enumeration
400 409
                 /// Example: "(3x) Server Name"
401 410
                     printf(_("(%dx) %s") . "<br />", $count, display_name($optionname));
411
+                }
402 412
             }
403 413
 
404 414
             echo "</div></td>";
@@ -413,10 +423,11 @@  discard block
 block discarded – undo
413 423
         foreach ($methods as $a) {
414 424
             $display = display_name($a);
415 425
             $enabled = FALSE;
416
-            if ($edit_mode)
417
-                foreach ($prefill_methods as $prio => $value) {
426
+            if ($edit_mode) {
427
+                            foreach ($prefill_methods as $prio => $value) {
418 428
                     if (display_name($a) == display_name($value)) {
419 429
                         $enabled = TRUE;
430
+            }
420 431
                         $countactive = $prio + 1;
421 432
                     }
422 433
                 }
@@ -455,8 +466,9 @@  discard block
 block discarded – undo
455 466
                             <?php
456 467
                             foreach ($methods as $a) {
457 468
                                 $display = display_name($a);
458
-                                if (!isset($D[display_name($a)]))
459
-                                    print '<li class="eap1">' . display_name($a) . "</li>\n";
469
+                                if (!isset($D[display_name($a)])) {
470
+                                                                    print '<li class="eap1">' . display_name($a) . "</li>\n";
471
+                                }
460 472
                             }
461 473
                             ?>
462 474
                         </ol>
@@ -480,13 +492,15 @@  discard block
 block discarded – undo
480 492
             <?php
481 493
             $idp_options = $my_inst->getAttributes();
482 494
             $has_support_options = [];
483
-            foreach ($idp_options as $idp_option)
484
-                if (preg_match("/^support:/", $idp_option['name']))
495
+            foreach ($idp_options as $idp_option) {
496
+                            if (preg_match("/^support:/", $idp_option['name']))
485 497
                     $has_support_options[$idp_option['name']] = "SET";
498
+            }
486 499
             if (count($has_support_options) > 0) {
487 500
                 $text = "<ul>";
488
-                foreach ($has_support_options as $key => $value)
489
-                    $text .= "<li><strong>" . display_name($key) . "</strong></li>";
501
+                foreach ($has_support_options as $key => $value) {
502
+                                    $text .= "<li><strong>" . display_name($key) . "</strong></li>";
503
+                }
490 504
                 $text .= "</ul>";
491 505
                 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_support_options)), $text);
492 506
             }
@@ -497,9 +511,10 @@  discard block
 block discarded – undo
497 511
             $prepopulate = [];
498 512
             if ($edit_mode) {
499 513
                 $existing_attribs = $my_profile->getAttributes();
500
-                foreach ($existing_attribs as $existing_attribute)
501
-                    if ($existing_attribute['level'] == "Profile")
514
+                foreach ($existing_attribs as $existing_attribute) {
515
+                                    if ($existing_attribute['level'] == "Profile")
502 516
                         $prepopulate[] = $existing_attribute;
517
+                }
503 518
             }
504 519
             add_option("support", $prepopulate);
505 520
             ?>
@@ -511,13 +526,15 @@  discard block
 block discarded – undo
511 526
         <p>
512 527
             <?php
513 528
             $has_eap_options = [];
514
-            foreach ($idp_options as $idp_option)
515
-                if (preg_match("/^eap:/", $idp_option['name']))
529
+            foreach ($idp_options as $idp_option) {
530
+                            if (preg_match("/^eap:/", $idp_option['name']))
516 531
                     $has_eap_options[$idp_option['name']] = "SET";
532
+            }
517 533
             if (count($has_eap_options) > 0) {
518 534
                 $text = "<ul>";
519
-                foreach ($has_eap_options as $key => $value)
520
-                    $text .= "<li><strong>" . display_name($key) . "</strong></li>";
535
+                foreach ($has_eap_options as $key => $value) {
536
+                                    $text .= "<li><strong>" . display_name($key) . "</strong></li>";
537
+                }
521 538
                 $text .= "</ul>";
522 539
                 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_eap_options)), $text);
523 540
             }
@@ -528,9 +545,10 @@  discard block
 block discarded – undo
528 545
             $prepopulate = [];
529 546
             if ($edit_mode) {
530 547
                 $existing_attribs = $my_profile->getAttributes();
531
-                foreach ($existing_attribs as $existing_attribute)
532
-                    if ($existing_attribute['level'] == "Profile")
548
+                foreach ($existing_attribs as $existing_attribute) {
549
+                                    if ($existing_attribute['level'] == "Profile")
533 550
                         $prepopulate[] = $existing_attribute;
551
+                }
534 552
             }
535 553
             add_option("eap", $prepopulate);
536 554
             ?>
@@ -543,13 +561,15 @@  discard block
 block discarded – undo
543 561
             <?php
544 562
             $idp_options = $my_inst->getAttributes();
545 563
             $has_support_options = array();
546
-            foreach ($idp_options as $idp_option)
547
-                if (preg_match("/^media:/", $idp_option['name']))
564
+            foreach ($idp_options as $idp_option) {
565
+                            if (preg_match("/^media:/", $idp_option['name']))
548 566
                     $has_support_options[$idp_option['name']] = "SET";
567
+            }
549 568
             if (count($has_support_options) > 0) {
550 569
                 $text = "<ul>";
551
-                foreach ($has_support_options as $key => $value)
552
-                    $text .= "<li><strong>" . display_name($key) . "</strong></li>";
570
+                foreach ($has_support_options as $key => $value) {
571
+                                    $text .= "<li><strong>" . display_name($key) . "</strong></li>";
572
+                }
553 573
                 $text .= "</ul>";
554 574
                 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_support_options)), $text);
555 575
             }
@@ -560,17 +580,19 @@  discard block
 block discarded – undo
560 580
             $prepopulate = array();
561 581
             if ($edit_mode) {
562 582
                 $existing_attribs = $my_profile->getAttributes();
563
-                foreach ($existing_attribs as $existing_attribute)
564
-                    if ($existing_attribute['level'] == "Profile")
583
+                foreach ($existing_attribs as $existing_attribute) {
584
+                                    if ($existing_attribute['level'] == "Profile")
565 585
                         $prepopulate[] = $existing_attribute;
586
+                }
566 587
             }
567 588
             add_option("media", $prepopulate);
568 589
             ?>
569 590
         </table>
570 591
         <button type='button' class='newoption' onclick='addDefaultMediaOptions()'><?php echo _("Add new option"); ?></button></fieldset>
571 592
     <?php
572
-    if ($wizard_style)
573
-        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>";
593
+    if ($wizard_style) {
594
+            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>";
595
+    }
574 596
     echo "<p><button type='submit' name='submitbutton' value='" . BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>";
575 597
     footer();
576 598
     ?>
Please login to merge, or discard this patch.
web/admin/API.php 1 patch
Braces   +17 added lines, -11 removed lines patch added patch discarded remove patch
@@ -46,9 +46,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
web/admin/112365365321.php 1 patch
Braces   +14 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,8 +47,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
web/admin/inc/geo_widget.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -280,8 +280,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
web/admin/inc/common.inc.php 1 patch
Braces   +65 added lines, -45 removed lines patch added patch discarded remove patch
@@ -81,8 +81,9 @@  discard block
 block discarded – undo
81 81
         $DisplayNames[_("SSID (with WPA/TKIP)")] = "media:SSID_with_legacy";
82 82
     }
83 83
 
84
-    if (!empty(Config::$CONSORTIUM['interworking-consortium-oi']) && count(Config::$CONSORTIUM['interworking-consortium-oi']) > 0)
85
-        $DisplayNames[_("Additional HS20 Consortium OI")] = "media:consortium_OI";
84
+    if (!empty(Config::$CONSORTIUM['interworking-consortium-oi']) && count(Config::$CONSORTIUM['interworking-consortium-oi']) > 0) {
85
+            $DisplayNames[_("Additional HS20 Consortium OI")] = "media:consortium_OI";
86
+    }
86 87
     $DisplayNames[_("HS20 Consortium OI")] = "media:consortium_OI";
87 88
 
88 89
     $find = array_search($input, $DisplayNames);
@@ -96,8 +97,9 @@  discard block
 block discarded – undo
96 97
 
97 98
 function tooltip($input) {
98 99
     $descriptions = [];
99
-    if (count(Config::$CONSORTIUM['ssid']) > 0)
100
-        $descriptions[sprintf(_("This attribute can be set if you want to configure an additional SSID besides the default SSIDs for %s. It is almost always a bad idea not to use the default SSIDs. The only exception is if you have premises with an overlap of the radio signal with another %s hotspot. Typical misconceptions about additional SSIDs include: I want to have a local SSID for my own users. It is much better to use the default SSID and separate user groups with VLANs. That approach has two advantages: 1) your users will configure %s properly because it is their everyday SSID; 2) if you use a custom name and advertise this one as extra secure, your users might at some point roam to another place which happens to have the same SSID name. They might then be misled to believe that they are connecting to an extra secure network while they are not."), Config::$CONSORTIUM['name'], Config::$CONSORTIUM['name'], Config::$CONSORTIUM['name'])] = "media:SSID";
100
+    if (count(Config::$CONSORTIUM['ssid']) > 0) {
101
+            $descriptions[sprintf(_("This attribute can be set if you want to configure an additional SSID besides the default SSIDs for %s. It is almost always a bad idea not to use the default SSIDs. The only exception is if you have premises with an overlap of the radio signal with another %s hotspot. Typical misconceptions about additional SSIDs include: I want to have a local SSID for my own users. It is much better to use the default SSID and separate user groups with VLANs. That approach has two advantages: 1) your users will configure %s properly because it is their everyday SSID; 2) if you use a custom name and advertise this one as extra secure, your users might at some point roam to another place which happens to have the same SSID name. They might then be misled to believe that they are connecting to an extra secure network while they are not."), Config::$CONSORTIUM['name'], Config::$CONSORTIUM['name'], Config::$CONSORTIUM['name'])] = "media:SSID";
102
+    }
101 103
 
102 104
     $find = array_search($input, $descriptions);
103 105
 
@@ -118,16 +120,20 @@  discard block
 block discarded – undo
118 120
     ];
119 121
 
120 122
     $retval = "";
121
-    if (!$omittabletags)
122
-        $retval .= "<tr><td>";
123
+    if (!$omittabletags) {
124
+            $retval .= "<tr><td>";
125
+    }
123 126
     $caption = $caption !== 0 ? $caption : $UI_messages[$level]['text'];
124 127
     $retval .= "<img class='icon' src='" . $UI_messages[$level]['icon'] . "' alt='" . $caption . "' title='" . $caption . "'/>";
125
-    if (!$omittabletags)
126
-        $retval .= "</td><td>";
127
-    if ($text !== 0)
128
-        $retval .= $text;
129
-    if (!$omittabletags)
130
-        $retval .= "</td></tr>";
128
+    if (!$omittabletags) {
129
+            $retval .= "</td><td>";
130
+    }
131
+    if ($text !== 0) {
132
+            $retval .= $text;
133
+    }
134
+    if (!$omittabletags) {
135
+            $retval .= "</td></tr>";
136
+    }
131 137
     return $retval;
132 138
 }
133 139
 
@@ -236,8 +242,9 @@  discard block
 block discarded – undo
236 242
     if ($optiontype == "eap:ca_file") {
237 243
         // echo "Checking $optiontype with file $filename";
238 244
         $cert = X509::processCertificate($filename);
239
-        if ($cert)
240
-            return TRUE;
245
+        if ($cert) {
246
+                    return TRUE;
247
+        }
241 248
         // echo "Error! The certificate seems broken!";
242 249
         return FALSE;
243 250
     }
@@ -250,8 +257,9 @@  discard block
 block discarded – undo
250 257
         $filetype = $info->buffer($filename, FILEINFO_MIME_TYPE);
251 258
 
252 259
         // we only take plain text files in UTF-8!
253
-        if ( $filetype == "text/plain" && iconv("UTF-8", "UTF-8", $filename) !== FALSE)
254
-            return TRUE;
260
+        if ( $filetype == "text/plain" && iconv("UTF-8", "UTF-8", $filename) !== FALSE) {
261
+                    return TRUE;
262
+        }
255 263
     }
256 264
 
257 265
     return FALSE;
@@ -261,23 +269,26 @@  discard block
 block discarded – undo
261 269
 
262 270
     $reference = valid_DB_reference($ref);
263 271
 
264
-    if ($reference == FALSE)
265
-        return;
272
+    if ($reference == FALSE) {
273
+            return;
274
+    }
266 275
     
267 276
     // the data is either public (just give it away) or not; in this case, only
268 277
     // release if the data belongs to admin himself
269 278
     if ($checkpublic) {
270 279
         // we might be called without session context (filepreview) so get the
271 280
         // context if needed
272
-        if (session_status() != PHP_SESSION_ACTIVE)
273
-            session_start();
281
+        if (session_status() != PHP_SESSION_ACTIVE) {
282
+                    session_start();
283
+        }
274 284
         $owners = DBConnection::isDataRestricted($reference["table"], $reference["rowindex"]);
275 285
 
276 286
         $owners_condensed = [];
277 287
         
278 288
         if ($owners !== FALSE) { // see if we're authenticated and owners of the data
279
-            foreach ($owners as $oneowner)
280
-                $owners_condensed[] = $oneowner['ID'];
289
+            foreach ($owners as $oneowner) {
290
+                            $owners_condensed[] = $oneowner['ID'];
291
+            }
281 292
             if (!isAuthenticated()) {
282 293
                 return FALSE; // admin-only, but we are not an admin
283 294
             } elseif (array_search($_SESSION['user'], $owners_condensed) === FALSE) {
@@ -289,51 +300,59 @@  discard block
 block discarded – undo
289 300
     }
290 301
 
291 302
     $blob = DBConnection::fetchRawDataByIndex($reference["table"], $reference["rowindex"]);
292
-    if (!$blob)
293
-        return FALSE;
303
+    if (!$blob) {
304
+            return FALSE;
305
+    }
294 306
     return $blob;
295 307
 }
296 308
 
297 309
 function display_size($number) {
298
-    if ($number > 1024 * 1024)
299
-        return round($number / 1024 / 1024, 2) . " MiB";
300
-    if ($number > 1024)
301
-        return round($number / 1024, 2) . " KiB";
310
+    if ($number > 1024 * 1024) {
311
+            return round($number / 1024 / 1024, 2) . " MiB";
312
+    }
313
+    if ($number > 1024) {
314
+            return round($number / 1024, 2) . " KiB";
315
+    }
302 316
     return $number . " B";
303 317
 }
304 318
 
305 319
 function previewCAinHTML($ca_reference) {
306 320
     $found = preg_match("/^ROWID-.*/", $ca_reference);
307
-    if (!$found)
308
-        return "<div>" . _("Error, ROWID expected.") . "</div>";
321
+    if (!$found) {
322
+            return "<div>" . _("Error, ROWID expected.") . "</div>";
323
+    }
309 324
 
310 325
     $ca_blob = base64_decode(getBlobFromDB($ca_reference, FALSE));
311 326
 
312 327
     $func = new X509;
313 328
     $details = $func->processCertificate($ca_blob);
314
-    if ($details === FALSE)
315
-        return _("There was an error processing the certificate!");
329
+    if ($details === FALSE) {
330
+            return _("There was an error processing the certificate!");
331
+    }
316 332
 
317 333
     $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']);
318 334
     $details['name'] = preg_replace('/\//', "", $details['name']);
319 335
     $certstatus = ( $details['root'] == 1 ? "R" : "I");
320
-    if ($details['ca'] == 0 && $details['root'] != 1)
321
-        return "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon;  border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . _("This is a <strong>SERVER</strong> certificate!") . "<br/>" . $details['name'] . "</div>";
322
-    else
323
-        return "<div class='ca-summary'                                ><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:#0000ff; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>" . $details['name'] . "</div>";
324
-}
336
+    if ($details['ca'] == 0 && $details['root'] != 1) {
337
+            return "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon;  border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . _("This is a <strong>SERVER</strong> certificate!") . "<br/>" . $details['name'] . "</div>";
338
+    } else {
339
+            return "<div class='ca-summary'                                ><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:#0000ff; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>" . $details['name'] . "</div>";
340
+    }
341
+    }
325 342
 
326 343
 function previewImageinHTML($image_reference) {
327 344
     $found = preg_match("/^ROWID-.*/", $image_reference);
328
-    if (!$found)
329
-        return "<div>" . _("Error, ROWID expected.") . "</div>";
345
+    if (!$found) {
346
+            return "<div>" . _("Error, ROWID expected.") . "</div>";
347
+    }
330 348
     return "<img style='max-width:150px' src='inc/filepreview.php?id=" . $image_reference . "' alt='" . _("Preview of logo file") . "'/>";
331 349
 }
332 350
 
333 351
 function previewInfoFileinHTML($file_reference) {
334 352
     $found = preg_match("/^ROWID-.*/", $file_reference);
335
-    if (!$found)
336
-        return _("<div>Error, ROWID expected, got $file_reference.</div>");
353
+    if (!$found) {
354
+            return _("<div>Error, ROWID expected, got $file_reference.</div>");
355
+    }
337 356
 
338 357
     $file_blob = unserialize(getBlobFromDB($file_reference, FALSE));
339 358
     $file_blob = base64_decode($file_blob['content']);
@@ -360,10 +379,11 @@  discard block
 block discarded – undo
360 379
                 /* echo "<pre>";
361 380
                   print_r($taggedarray);
362 381
                   echo "</pre>"; */
363
-                if ($taggedarray['lang'] == 'C')
364
-                    $language = _("default/other languages");
365
-                else
366
-                    $language = Config::$LANGUAGES[$taggedarray['lang']]['display'];
382
+                if ($taggedarray['lang'] == 'C') {
383
+                                    $language = _("default/other languages");
384
+                } else {
385
+                                    $language = Config::$LANGUAGES[$taggedarray['lang']]['display'];
386
+                }
367 387
                 $content = $taggedarray["content"];
368 388
             } else {
369 389
                 $language = "";
Please login to merge, or discard this patch.
web/admin/inc/manageAdmins.inc.php 1 patch
Braces   +34 added lines, -25 removed lines patch added patch discarded remove patch
@@ -45,9 +45,10 @@  discard block
 block discarded – undo
45 45
 $is_admin_with_blessing = FALSE;
46 46
 $owners = $my_inst->owner();
47 47
 foreach ($owners as $oneowner) {
48
-    if ($oneowner['ID'] == $_SESSION['user'] && $oneowner['LEVEL'] == "FED")
49
-        $is_admin_with_blessing = TRUE;
50
-}
48
+    if ($oneowner['ID'] == $_SESSION['user'] && $oneowner['LEVEL'] == "FED") {
49
+            $is_admin_with_blessing = TRUE;
50
+    }
51
+    }
51 52
 
52 53
 // if none of the two, send the user away
53 54
 
@@ -65,8 +66,9 @@  discard block
 block discarded – undo
65 66
             $ownermgmt->removeAdminFromIdP($my_inst, $_POST['admin_id']);
66 67
             // if the user deleted himself, go back to overview page. Otherwise, just stay here and display the remaining owners
67 68
             // we don't decide about that here; it's done by JS magic in the calling button
68
-            if ($_POST['admin_id'] == $_SESSION['user'])
69
-                header("Location: $dest");
69
+            if ($_POST['admin_id'] == $_SESSION['user']) {
70
+                            header("Location: $dest");
71
+            }
70 72
         } else {
71 73
             echo "Fatal Error: asked to delete an administrator, but no administrator ID was given!";
72 74
             exit(1);
@@ -91,12 +93,13 @@  discard block
 block discarded – undo
91 93
 if (isset($_GET['invitation'])) {
92 94
     echo "<div class='ca-summary' style='position:relative;'><table>";
93 95
 
94
-    if ($_GET['invitation'] == "SUCCESS")
95
-        echo UI_remark(_("The invitation email was sent successfully."), _("The invitation email was sent."));
96
-    else if ($_GET['invitation'] == "FAILURE")
97
-        echo UI_error(_("The invitation email could not be sent!"), _("The invitation email could not be sent!"));
98
-    else
99
-        echo UI_error(_("Error: unknown result code of invitation!?!"), _("Unknown result!"));
96
+    if ($_GET['invitation'] == "SUCCESS") {
97
+            echo UI_remark(_("The invitation email was sent successfully."), _("The invitation email was sent."));
98
+    } else if ($_GET['invitation'] == "FAILURE") {
99
+            echo UI_error(_("The invitation email could not be sent!"), _("The invitation email could not be sent!"));
100
+    } else {
101
+            echo UI_error(_("Error: unknown result code of invitation!?!"), _("Unknown result!"));
102
+    }
100 103
 
101 104
     echo "</table></div>";
102 105
 }
@@ -119,20 +122,22 @@  discard block
 block discarded – undo
119 122
     foreach ($my_inst->owner() as $oneowner) {
120 123
         $ownerinfo = new User($oneowner['ID']);
121 124
         $ownername = $ownerinfo->getAttributes("user:realname");
122
-        if (count($ownername) > 0)
123
-            $prettyprint = $ownername[0]['value'];
124
-        else
125
-            $prettyprint = _("User without name");
125
+        if (count($ownername) > 0) {
126
+                    $prettyprint = $ownername[0]['value'];
127
+        } else {
128
+                    $prettyprint = _("User without name");
129
+        }
126 130
         echo "
127 131
             <tr>
128 132
               <td>
129 133
                  <strong>$prettyprint</strong>
130 134
                  <br/>";
131 135
 
132
-        if ($oneowner['MAIL'] != "SELF-APPOINTED")
133
-            printf(_("(originally invited as %s)"), $oneowner['MAIL']);
134
-        else
135
-            echo _("(self-appointed)");
136
+        if ($oneowner['MAIL'] != "SELF-APPOINTED") {
137
+                    printf(_("(originally invited as %s)"), $oneowner['MAIL']);
138
+        } else {
139
+                    echo _("(self-appointed)");
140
+        }
136 141
 
137 142
         echo "</td>
138 143
               <td>
@@ -153,8 +158,9 @@  discard block
 block discarded – undo
153 158
 if (count($pending_invites) > 0) {
154 159
     echo "<strong>" . _("Pending invitations for this IdP") . "</strong>";
155 160
     echo "<table>";
156
-    foreach ($pending_invites as $invitee)
157
-        echo "<tr><td>$invitee</td></tr>";
161
+    foreach ($pending_invites as $invitee) {
162
+            echo "<tr><td>$invitee</td></tr>";
163
+    }
158 164
     echo "</table>";
159 165
 }
160 166
 ?>
@@ -167,14 +173,17 @@  discard block
 block discarded – undo
167 173
 if ($is_fed_admin) {
168 174
     $is_admin_himself = FALSE;
169 175
     foreach ($owners as $oneowner) {
170
-        if ($oneowner['ID'] == $_SESSION['user'])
171
-            $is_admin_himself = TRUE;
176
+        if ($oneowner['ID'] == $_SESSION['user']) {
177
+                    $is_admin_himself = TRUE;
178
+        }
172 179
     }
173 180
 
174
-    if (!$is_admin_himself) echo "<form action='inc/manageAdmins.inc.php?inst_id=$my_inst->identifier' method='post' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'>
181
+    if (!$is_admin_himself) {
182
+        echo "<form action='inc/manageAdmins.inc.php?inst_id=$my_inst->identifier' method='post' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'>
175 183
     <button type='submit' name='submitbutton' value='" . BUTTON_TAKECONTROL . "'>" . _("Take control of this institution") . "</button>
176 184
 </form>";
177
-}
185
+    }
186
+    }
178 187
 ?>
179 188
 <hr/>
180 189
 <form action='inc/manageAdmins.inc.php?inst_id=<?php echo $my_inst->identifier; ?>' method='post' accept-charset='UTF-8'>
Please login to merge, or discard this patch.