Test Failed
Push — master ( ae9588...7cf02b )
by Maja
10:58
created
core/IdP.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -115,12 +115,12 @@  discard block
 block discarded – undo
115 115
         $this->name = $this->languageInstance->getLocalisedValue($this->getAttributes('general:instname'));
116 116
         $eligibility = $this->eligibility($instQuery->type);
117 117
         if (in_array(IdP::ELIGIBILITY_IDP, $eligibility) && in_array(IdP::ELIGIBILITY_SP, $eligibility)) {
118
-            $eligType = IdP::TYPE_IDPSP . "";
118
+            $eligType = IdP::TYPE_IDPSP."";
119 119
             $this->type = $eligType;
120 120
         } elseif (in_array(IdP::ELIGIBILITY_IDP, $eligibility)) {
121
-            $eligType = IdP::TYPE_IDP . "";
121
+            $eligType = IdP::TYPE_IDP."";
122 122
         } else {
123
-            $eligType = IdP::TYPE_SP . "";
123
+            $eligType = IdP::TYPE_SP."";
124 124
         }
125 125
         $this->type = $eligType;
126 126
         $this->loggerInstance->debug(4, "--- END Constructing new IdP object $instId ... ---\n");
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     public function listProfiles(bool $activeOnly = FALSE)
136 136
     {
137
-        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : "")." ORDER BY preference";
137
+        $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : "")." ORDER BY preference";
138 138
         $allProfiles = $this->databaseHandle->exec($query);
139 139
         $returnarray = [];
140 140
         // SELECT -> resource, not boolean
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             $returnarray[] = $oneProfile;
145 145
         }
146 146
 
147
-        $this->loggerInstance->debug(4, "listProfiles: " . /** @scrutinizer ignore-type */ print_r($returnarray, true));
147
+        $this->loggerInstance->debug(4, "listProfiles: "./** @scrutinizer ignore-type */ print_r($returnarray, true));
148 148
         return $returnarray;
149 149
     }
150 150
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function listDeployments(bool $activeOnly = FALSE)
158 158
     {
159
-        $query = "SELECT deployment_id FROM deployment WHERE inst_id = $this->identifier" . ($activeOnly ? " AND status = " . AbstractDeployment::ACTIVE : "");
159
+        $query = "SELECT deployment_id FROM deployment WHERE inst_id = $this->identifier".($activeOnly ? " AND status = ".AbstractDeployment::ACTIVE : "");
160 160
         $allDeployments = $this->databaseHandle->exec($query);
161 161
         $returnarray = [];
162 162
         // SELECT -> resource, not boolean
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             $returnarray[] = new DeploymentManaged($this, $deploymentQuery->deployment_id);
165 165
         }
166 166
 
167
-        $this->loggerInstance->debug(4, "listDeployments: " . /** @scrutinizer ignore-type */ print_r($returnarray, true));
167
+        $this->loggerInstance->debug(4, "listDeployments: "./** @scrutinizer ignore-type */ print_r($returnarray, true));
168 168
         return $returnarray;
169 169
     }
170 170
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         $redirectProfileIds = [];
191 191
         $allProfileLevels = $this->databaseHandle->exec("SELECT profile_id, sufficient_config + showtime AS maxlevel FROM profile WHERE inst_id = $this->identifier ORDER BY maxlevel DESC");
192 192
         // SELECT yields a resource, not a boolean
193
-        if ($allProfileLevels->num_rows == 0 ) {
193
+        if ($allProfileLevels->num_rows == 0) {
194 194
             return self::PROFILES_INCOMPLETE;
195 195
         }
196 196
         $allProfilesArray = $allProfileLevels->fetch_all(MYSQLI_ASSOC);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $allProfiles = $this->databaseHandle->exec("SELECT MIN(openroaming) AS maxlevel FROM profile WHERE inst_id = $this->identifier");
219 219
         // SELECT yields a resource, not a boolean
220 220
         while ($res = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allProfiles)) {
221
-            return (is_numeric($res->maxlevel) ? (int)$res->maxlevel : AbstractProfile::OVERALL_OPENROAMING_LEVEL_NO ); // insts without profiles should get a "NO"
221
+            return (is_numeric($res->maxlevel) ? (int) $res->maxlevel : AbstractProfile::OVERALL_OPENROAMING_LEVEL_NO); // insts without profiles should get a "NO"
222 222
         }
223 223
         return AbstractProfile::OVERALL_OPENROAMING_LEVEL_NO;
224 224
     }
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
                 case AbstractProfile::PROFILETYPE_SILVERBULLET:
350 350
                     $theProfile = new ProfileSilverbullet($identifier, $this);
351 351
                     $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1);
352
-                    $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(\config\ConfAssistant::SILVERBULLET['realm_suffix']));
352
+                    $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(\config\ConfAssistant::SILVERBULLET['realm_suffix']));
353 353
                     return $theProfile;
354 354
                 default:
355 355
                     throw new Exception("This type of profile is unknown and can not be added.");
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
     public function getExternalDBId()
493 493
     {
494 494
         if (\config\ConfAssistant::CONSORTIUM['name'] == "eduroam" && isset(\config\ConfAssistant::CONSORTIUM['deployment-voodoo']) && \config\ConfAssistant::CONSORTIUM['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
495
-            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED);
495
+            $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED);
496 496
             // SELECT -> it's a resource, not a boolean
497 497
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) {
498 498
                 return FALSE;
@@ -558,16 +558,16 @@  discard block
 block discarded – undo
558 558
         }
559 559
         foreach ($baseline as $lang => $value) {
560 560
             if (!key_exists($lang, $newvalues)) {
561
-                $retval[IdP::INSTNAME_CHANGED] .= "#[Language " . strtoupper($lang) . "] DELETED";
561
+                $retval[IdP::INSTNAME_CHANGED] .= "#[Language ".strtoupper($lang)."] DELETED";
562 562
             } else {
563 563
                 if ($value != $newvalues[$lang]) {
564
-                    $retval[IdP::INSTNAME_CHANGED] .= "#[Language " . strtoupper($lang) . "] CHANGED from '" . $baseline[$lang] . "' to '" . $newvalues[$lang] . "'";
564
+                    $retval[IdP::INSTNAME_CHANGED] .= "#[Language ".strtoupper($lang)."] CHANGED from '".$baseline[$lang]."' to '".$newvalues[$lang]."'";
565 565
                 }
566 566
             }
567 567
         }
568 568
         foreach ($newvalues as $lang => $value) {
569 569
             if (!key_exists($lang, $baseline)) {
570
-                $retval[IdP::INSTNAME_CHANGED] .= "#[Language " . strtoupper($lang) . "] ADDED as '" . $value . "'";
570
+                $retval[IdP::INSTNAME_CHANGED] .= "#[Language ".strtoupper($lang)."] ADDED as '".$value."'";
571 571
             }
572 572
         }
573 573
         return $retval;
Please login to merge, or discard this patch.
web/admin/sort_profiles_result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 ?>
28 28
 
29 29
 <?php
30
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
31 31
 
32 32
 $deco = new \web\lib\admin\PageDecoration();
33 33
 $validator = new \web\lib\common\InputValidation();
Please login to merge, or discard this patch.
web/lib/admin/Wizard.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -64,80 +64,80 @@  discard block
 block discarded – undo
64 64
     
65 65
     private function setMessages() {
66 66
         // SUPPORT
67
-        $h = "<p>" . _("This section can be used to upload specific Terms of Use for your users and to display details of how your users can reach your local helpdesk.") . "</p>";
67
+        $h = "<p>"._("This section can be used to upload specific Terms of Use for your users and to display details of how your users can reach your local helpdesk.")."</p>";
68 68
         if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == "LOCAL") {
69
-            $h .= "<p>" .
70
-            sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."), $this->nomenclatureParticipant) . "</p>" .
71
-            "<p>" .
72
-            _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.") . "</p>";
69
+            $h .= "<p>".
70
+            sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."), $this->nomenclatureParticipant)."</p>".
71
+            "<p>".
72
+            _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.")."</p>";
73 73
             if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
74
-                $h .= "<p>" . sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), \config\ConfAssistant::SILVERBULLET['product_name']) . " " . _("This is the contact point for your organisation. It may be displayed publicly.") . "</p>";
74
+                $h .= "<p>".sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), \config\ConfAssistant::SILVERBULLET['product_name'])." "._("This is the contact point for your organisation. It may be displayed publicly.")."</p>";
75 75
             }
76 76
         } elseif (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
77
-            $h .= "<p>" . _("Providing at least a local support e-mail contact is required.") . " " . _("This is the contact point for your end users' level 1 support.") . "</p>";
77
+            $h .= "<p>"._("Providing at least a local support e-mail contact is required.")." "._("This is the contact point for your end users' level 1 support.")."</p>";
78 78
         }
79 79
         $this->helpMessage['support'] = $h;
80 80
 
81 81
         // MEDIA
82
-        $h = "<p>" .
83
-            sprintf(_("In this section, you define on which media %s should be configured on user devices."), \config\ConfAssistant::CONSORTIUM['display_name']) . "</p><ul>";
82
+        $h = "<p>".
83
+            sprintf(_("In this section, you define on which media %s should be configured on user devices."), \config\ConfAssistant::CONSORTIUM['display_name'])."</p><ul>";
84 84
         $h .= "<li>";
85
-        $h .= "<strong>" . ( count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:")) . " </strong>";
85
+        $h .= "<strong>".(count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:"))." </strong>";
86 86
         if (count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0) {
87 87
             $ssidlist = "";
88 88
             foreach (\config\ConfAssistant::CONSORTIUM['ssid'] as $ssid) {
89
-                $ssidlist .= ", '<strong>" . $ssid . "</strong>'";
89
+                $ssidlist .= ", '<strong>".$ssid."</strong>'";
90 90
             }
91 91
             $ssidlist = substr($ssidlist, 2);
92 92
              $h .= sprintf(ngettext("We will always configure this SSID for WPA2/AES: %s.", "We will always configure these SSIDs for WPA2/AES: %s.", count(\config\ConfAssistant::CONSORTIUM['ssid'])), $ssidlist);
93
-             $h .= "<br/>" . sprintf(_("It is also possible to define custom additional SSIDs with the option '%s' below."), $this->displayName("media:SSID"));
93
+             $h .= "<br/>".sprintf(_("It is also possible to define custom additional SSIDs with the option '%s' below."), $this->displayName("media:SSID"));
94 94
         } else {
95
-             $h .=  _("Please configure which SSIDs should be configured in the installers.");
95
+             $h .= _("Please configure which SSIDs should be configured in the installers.");
96 96
         }
97
-         $h .= " " . _("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible.");
97
+         $h .= " "._("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible.");
98 98
          $h .= "</li>";
99 99
 
100 100
         $h .= "<li>";
101
-        $h .= "<strong>" . ( count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:")) . " </strong>";
101
+        $h .= "<strong>".(count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:"))." </strong>";
102 102
         if (count(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi']) > 0) {
103 103
             $consortiumlist = "";
104 104
             foreach (\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'] as $oi) {
105
-                $consortiumlist .= ", '<strong>" . $oi . "</strong>'";
105
+                $consortiumlist .= ", '<strong>".$oi."</strong>'";
106 106
             }
107 107
             $consortiumlist = substr($consortiumlist, 2);
108 108
             $h .= sprintf(ngettext("We will always configure this Consortium OI: %s.", "We will always configure these Consortium OIs: %s.", count(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'])), $consortiumlist);
109 109
 
110
-            $h .= "<br/>" . sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $this->displayName("media:consortium_OI"));
110
+            $h .= "<br/>".sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $this->displayName("media:consortium_OI"));
111 111
         } else {
112 112
             $h .= _("Please configure which Consortium OIs should be configured in the installers.");
113 113
         }
114 114
         $h .= "</li>";
115
-        $h .= "<li><strong>" . _("Support for wired IEEE 802.1X:") . " </strong>"
116
-        . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail).") .
115
+        $h .= "<li><strong>"._("Support for wired IEEE 802.1X:")." </strong>"
116
+        . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail).").
117 117
         "</li>";
118
-        $h .= "<li><strong>" . _("Removal of bootstrap/onboarding SSIDs:") . " </strong>"
118
+        $h .= "<li><strong>"._("Removal of bootstrap/onboarding SSIDs:")." </strong>"
119 119
         . _("If you use a captive portal to distribute configurations, you may want to unconfigure/disable that SSID after the bootstrap process. With this option, the SSID will either be removed, or be defined as 'Only connect manually'.")
120 120
         . "</li>";
121 121
         $h .= "</ul>";
122 122
         $this->helpMessage['media'] = $h;
123 123
         
124 124
         // IDP GENERAL
125
-        $h = "<p>" .
126
-        _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:") . "</p>".
125
+        $h = "<p>".
126
+        _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:")."</p>".
127 127
             "<ul>".
128
-                "<li>"._("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).") . "</li>".
129
-                "<li>".sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."), $this->nomenclatureParticipant) . "</li>".
128
+                "<li>"._("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).")."</li>".
129
+                "<li>".sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."), $this->nomenclatureParticipant)."</li>".
130 130
             "</ul>";
131 131
         $this->helpMessage['idp_general'] = $h;
132 132
         
133 133
         // PROFILE GENERAL
134
-        $h = "<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>".
135
-            "<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>".
136
-            "<p>" . _("You can also tell us your RADIUS realm. ");
134
+        $h = "<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>".
135
+            "<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>".
136
+            "<p>"._("You can also tell us your RADIUS realm. ");
137 137
             if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] !== NULL) {
138 138
                $h .= sprintf(_("This is useful if you want to use the sanity check module later, which tests reachability of your realm in the %s infrastructure. "), \config\ConfAssistant::CONSORTIUM['display_name']);
139 139
             }
140
-        $h .= _("It is required to enter the realm name if you want to support anonymous outer identities (see below).") . "</p>";
140
+        $h .= _("It is required to enter the realm name if you want to support anonymous outer identities (see below).")."</p>";
141 141
         $this->helpMessage['profile'] = $h;
142 142
         
143 143
         // REALM
@@ -147,24 +147,24 @@  discard block
 block discarded – undo
147 147
         $this->helpMessage['realm'] = $h;
148 148
         
149 149
         // REDIRECT
150
-         $h ="<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>";
150
+         $h = "<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>";
151 151
         $this->helpMessage['redirect'] = $h;
152 152
         
153 153
         // EAP
154
-        $h = "<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>";
154
+        $h = "<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>";
155 155
         $this->helpMessage['eap_support'] = $h;
156 156
         
157 157
         // LOCATIOM
158
-        $h = "<p>" .
159
-                    _("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.") .
158
+        $h = "<p>".
159
+                    _("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.").
160 160
                     "</p>
161 161
                      <ul>" .
162 162
                     _("<li>Drag the marker in the map to your place, or</li>
163 163
 <li>enter your street address in the field below for lookup, or</li>
164
-<li>use the 'Locate Me!' button</li>") .
164
+<li>use the 'Locate Me!' button</li>").
165 165
                     "</ul>
166 166
                      <strong>" .
167
-                    _("We will use the coordinates as indicated by the marker for geolocation.") .
167
+                    _("We will use the coordinates as indicated by the marker for geolocation.").
168 168
                     "</strong>";
169 169
         $this->helpMessage['location'] = $h;
170 170
     }
Please login to merge, or discard this patch.
web/admin/overview_org.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 <?php
29
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
29
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
30 30
 
31 31
 function displaySilverbulletPropertyWidget(&$theProfile, $readonly, &$uiElements) {
32 32
     ?>
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
                 <ul style='margin:1px'>
44 44
                     <?php
45 45
                     foreach ($completeness as $missing_attrib) {
46
-                        echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
46
+                        echo "<li>".$uiElements->displayName($missing_attrib)."</li>";
47 47
                     }
48 48
                     ?>
49 49
                 </ul>
50 50
             </div>
51 51
             <?php
52 52
         } else {
53
-            echo sprintf(_("You can create up to %d users."), $maxusers[0]['value']) . "<br/>" . sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $theProfile->realm);
53
+            echo sprintf(_("You can create up to %d users."), $maxusers[0]['value'])."<br/>".sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $theProfile->realm);
54 54
         }
55 55
         ?>
56 56
         <br/>
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         if ($readonly === FALSE) {
60 60
             ?>
61 61
             <form action='edit_silverbullet.php?inst_id=<?php echo $theProfile->institution; ?>&amp;profile_id=<?php echo $theProfile->identifier; ?>' method='POST'>
62
-                <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
62
+                <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
63 63
             </form>
64 64
             <?php
65 65
         }
@@ -95,21 +95,21 @@  discard block
 block discarded – undo
95 95
                 $has_overrides = TRUE;
96 96
             }
97 97
         }
98
-        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>";
98
+        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>";
99 99
         $typelist = $theProfile->getEapMethodsinOrderOfPreference();
100 100
         $allcomplete = TRUE;
101 101
         foreach ($typelist as $eaptype) {
102 102
             $buffer_eaptypediv .= $eaptype->getPrintableRep();
103 103
             $completeness = $theProfile->isEapTypeDefinitionComplete($eaptype);
104 104
             if ($completeness === true) {
105
-                $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>";
105
+                $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>";
106 106
             } else {
107 107
                 $buffer_eaptypediv .= " <div class='notacceptable'>";
108 108
                 $buffer_eaptypediv .= _("Information needed!");
109 109
                 if (is_array($completeness)) {
110 110
                     $buffer_eaptypediv .= "<ul style='margin:1px'>";
111 111
                     foreach ($completeness as $missing_attrib) {
112
-                        $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
112
+                        $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>";
113 113
                     }
114 114
                     $buffer_eaptypediv .= "</ul>";
115 115
                 }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             foreach ($attribs as $attrib) {
122 122
                 if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) {
123 123
                     $justOnce = TRUE;
124
-                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>";
124
+                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='"._("Options on EAP Method/Device level are in effect.")."'>";
125 125
                 }
126 126
             }
127 127
             $buffer_eaptypediv .= "<br/>";
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         if ($theProfile->isRedirected()) {
148 148
             $iconData = $uiElements->iconData('PROFILES_REDIRECTED');
149 149
             $iconData['text'] = _("Profile redirected");
150
-            $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
150
+            $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
151 151
             
152 152
         } 
153 153
         
@@ -155,15 +155,15 @@  discard block
 block discarded – undo
155 155
         switch ($certStatus) {
156 156
             case core\AbstractProfile::CERT_STATUS_OK:
157 157
                 $iconData = $uiElements->iconData('CERT_STATUS_OK');
158
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
158
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
159 159
                 break;
160 160
             case core\AbstractProfile::CERT_STATUS_WARN:
161 161
                 $iconData = $uiElements->iconData('CERT_STATUS_WARN');
162
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));                
162
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));                
163 163
                 break;
164 164
             case core\AbstractProfile::CERT_STATUS_ERROR:
165 165
                 $iconData = $uiElements->iconData('CERT_STATUS_ERROR');
166
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
166
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
167 167
                 break;            
168 168
         }
169 169
         $buffer_headline .= "</div>";
@@ -189,11 +189,11 @@  discard block
 block discarded – undo
189 189
                 if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") {
190 190
                     $diagUrl = "../diag/";
191 191
                 } else {
192
-                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/";
192
+                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/";
193 193
                 }
194 194
                 ?>
195
-                <form action='<?php echo $diagUrl . "action_realmcheck.php?inst_id=" . $theProfile->institution . "&profile_id=" . $theProfile->identifier ?>' method='post' accept-charset='UTF-8'>
196
-                    <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link . $_SERVER['SCRIPT_NAME']); ?>'/>
195
+                <form action='<?php echo $diagUrl."action_realmcheck.php?inst_id=".$theProfile->institution."&profile_id=".$theProfile->identifier ?>' method='post' accept-charset='UTF-8'>
196
+                    <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link.$_SERVER['SCRIPT_NAME']); ?>'/>
197 197
                     <button type='submit' name='profile_action' value='check' <?php echo ($has_realm ? "" : "disabled='disabled'"); ?> title='<?php echo _("The realm can only be checked if you configure the realm!"); ?>'>
198 198
                         <?php echo _("Check realm reachability"); ?>
199 199
                     </button>
@@ -241,9 +241,9 @@  discard block
 block discarded – undo
241 241
                 ?>
242 242
                 <div style='display: flex;'>
243 243
                     <?php
244
-                    $idpLevelUrl = $link . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $theProfile->institution;
245
-                    $displayurl = $idpLevelUrl . "&amp;profile=" . $theProfile->identifier;
246
-                    $QRurl = $idpLevelUrl . "&profile=" . $theProfile->identifier;
244
+                    $idpLevelUrl = $link.dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$theProfile->institution;
245
+                    $displayurl = $idpLevelUrl."&amp;profile=".$theProfile->identifier;
246
+                    $QRurl = $idpLevelUrl."&profile=".$theProfile->identifier;
247 247
                     $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([
248 248
                                 'outputType' => \chillerlan\QRCode\QRCode::OUTPUT_IMAGE_PNG,
249 249
                                 'eccLevel' => \chillerlan\QRCode\QRCode::ECC_H,
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
                     if (empty($rawQr)) {
256 256
                         throw new Exception("Something went seriously wrong during QR code generation!");
257 257
                     }
258
-                    $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
258
+                    $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
259 259
                     $size = getimagesize($uri);
260
-                    echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>";
260
+                    echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>";
261 261
 
262 262
                     //echo "<nobr>$displayurl</nobr></a>";
263 263
                     echo "<p>$displayurl</p></a>";
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
             <h2><?php
302 302
                 switch ($deploymentObject->consortium) {
303 303
                     case "eduroam":
304
-                        $displayname = config\ConfAssistant::CONSORTIUM['name'] . " " . core\DeploymentManaged::PRODUCTNAME;
304
+                        $displayname = config\ConfAssistant::CONSORTIUM['name']." ".core\DeploymentManaged::PRODUCTNAME;
305 305
                         break;
306 306
                     case "OpenRoaming":
307 307
                         $displayname = "OpenRoaming ANP";
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
                     default:
310 310
                         throw new Exception("We are supposed to operate on a roaming consortium we don't know.");
311 311
                 }
312
-                echo $displayname . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)";
312
+                echo $displayname." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)";
313 313
                 ?></h2>
314 314
             <table>
315 315
                 <caption><?php echo _("Deployment Details"); ?></caption>
@@ -323,13 +323,13 @@  discard block
 block discarded – undo
323 323
                     <td><strong><?php echo _("Your primary RADIUS server") ?></strong><br/>
324 324
                         <?php
325 325
                         if ($deploymentObject->host1_v4 !== NULL) {
326
-                            echo _("IPv4") . ": " . $deploymentObject->host1_v4;
326
+                            echo _("IPv4").": ".$deploymentObject->host1_v4;
327 327
                         }
328 328
                         if ($deploymentObject->host1_v4 !== NULL && $deploymentObject->host1_v6 !== NULL) {
329 329
                             echo "<br/>";
330 330
                         }
331 331
                         if ($deploymentObject->host1_v6 !== NULL) {
332
-                            echo _("IPv6") . ": " . $deploymentObject->host1_v6;
332
+                            echo _("IPv6").": ".$deploymentObject->host1_v6;
333 333
                         }
334 334
                         ?>
335 335
                     </td>
@@ -337,9 +337,9 @@  discard block
 block discarded – undo
337 337
                     <td><?php echo $deploymentObject->port1; ?></td>
338 338
                     <td>
339 339
                         <?php
340
-                        echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] .
341
-                        "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] .
342
-                        "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>";
340
+                        echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon'].
341
+                        "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text'].
342
+                        "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>";
343 343
                         ?>
344 344
                     </td>
345 345
                 </tr>
@@ -347,22 +347,22 @@  discard block
 block discarded – undo
347 347
                     <td><strong><?php echo _("Your backup RADIUS server") ?><br/></strong>
348 348
                         <?php
349 349
                         if ($deploymentObject->host2_v4 !== NULL) {
350
-                            echo _("IPv4") . ": " . $deploymentObject->host2_v4;
350
+                            echo _("IPv4").": ".$deploymentObject->host2_v4;
351 351
                         }
352 352
                         if ($deploymentObject->host2_v4 !== NULL && $deploymentObject->host2_v6 !== NULL) {
353 353
                             echo "<br/>";
354 354
                         }
355 355
                         if ($deploymentObject->host2_v6 !== NULL) {
356
-                            echo _("IPv6") . ": " . $deploymentObject->host2_v6;
356
+                            echo _("IPv6").": ".$deploymentObject->host2_v6;
357 357
                         }
358 358
                         ?></td>
359 359
                     <td><?php echo _("RADIUS port number: ") ?></td>
360 360
                     <td><?php echo $deploymentObject->port2; ?></td>
361 361
                     <td>
362 362
                         <?php
363
-                        echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
364
-                        "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] .
365
-                        "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>";
363
+                        echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
364
+                        "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text'].
365
+                        "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>";
366 366
                         ?>
367 367
                     </td>
368 368
                 </tr>
@@ -414,12 +414,12 @@  discard block
 block discarded – undo
414 414
                             if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) {
415 415
                                 echo '<br>';
416 416
                                 if ($res['FAILURE'] == 2) {
417
-                                    echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
417
+                                    echo ' <span style="color: red;">'._("Activation failure.").'</span>';
418 418
                                 } else {
419 419
                                     if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
420
-                                        echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>';
420
+                                        echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>';
421 421
                                     } else {
422
-                                        echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>';
422
+                                        echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>';
423 423
                                     }
424 424
                                 }
425 425
                             }
@@ -454,12 +454,12 @@  discard block
 block discarded – undo
454 454
                                 if ($res['FAILURE'] > 0) {
455 455
                                     echo '<br>';
456 456
                                     if ($res['FAILURE'] == 2) {
457
-                                        echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>';
457
+                                        echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>';
458 458
                                     } else {
459 459
                                         if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
460
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>';
460
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>';
461 461
                                         } else {
462
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>';
462
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>';
463 463
                                         }
464 464
                                     }
465 465
                                 }
@@ -480,24 +480,24 @@  discard block
 block discarded – undo
480 480
         </div>
481 481
         <div style='width:20px;'></div> <!-- QR code space, reserved -->
482 482
         <div style='display: table-cell; min-width:200px;'>
483
-            <?php $tablecaption = _("Hotspot Usage Statistics");?>
483
+            <?php $tablecaption = _("Hotspot Usage Statistics"); ?>
484 484
             <h1><?php echo $tablecaption; ?></h1>
485
-            <h2><?php echo _("5 most recent authentications");?></h2>
486
-            <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)");?></p>
485
+            <h2><?php echo _("5 most recent authentications"); ?></h2>
486
+            <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)"); ?></p>
487 487
             <table class='authrecord'>
488
-    <caption><?php echo $tablecaption;?></caption>
488
+    <caption><?php echo $tablecaption; ?></caption>
489 489
     <tr style='text-align: left;'>
490
-        <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th>
491
-        <th scope="col"><strong><?php echo _("Realm");?></strong></th>
492
-        <th scope="col"><strong><?php echo _("MAC Address");?></strong></th>
493
-        <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th>
494
-        <th scope="col"><strong><?php echo _("Result");?></strong></th>
495
-        <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th>
490
+        <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th>
491
+        <th scope="col"><strong><?php echo _("Realm"); ?></strong></th>
492
+        <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th>
493
+        <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th>
494
+        <th scope="col"><strong><?php echo _("Result"); ?></strong></th>
495
+        <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th>
496 496
     </tr>
497 497
     <?php
498
-    $userAuthData = $deploymentObject->retrieveStatistics(0,5);
498
+    $userAuthData = $deploymentObject->retrieveStatistics(0, 5);
499 499
     foreach ($userAuthData as $oneRecord) {
500
-        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>"
500
+        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>"
501 501
                 . "<td>".$oneRecord['activity_time']."</td>"
502 502
                 . "<td>".$oneRecord['realm']."</td>"
503 503
                 . "<td>".$oneRecord['mac']."</td>"
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
             }
661 661
             ?>
662 662
         </h2>
663
-    <?php if(count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?>
663
+    <?php if (count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?>
664 664
                     <form method='post' action='sort_profiles.php?inst_id=<?php echo $my_inst->identifier; ?>' accept-charset='UTF-8'>
665 665
                         <div>
666 666
                             <button type='submit' name='profile_sorting'>
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
                         <div>
729 729
                             <input type="hidden" name="consortium" value="eduroam"/>
730 730
                             <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'>
731
-                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?>
731
+                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?>
732 732
                             </button>
733 733
                             <span style='color: red;'>
734 734
                             <?php if ($hasMail == 0) { 
Please login to merge, or discard this patch.
web/admin/duplicate_profile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 ?>
28 28
 
29 29
 <?php
30
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
31 31
 
32 32
 $deco = new \web\lib\admin\PageDecoration();
33 33
 $validator = new \web\lib\common\InputValidation();
Please login to merge, or discard this patch.
web/admin/duplicate_profile_result.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 ?>
30 30
 
31 31
 <?php
32
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
32
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
33 33
 
34 34
 $deco = new \web\lib\admin\PageDecoration();
35 35
 $validator = new \web\lib\common\InputValidation();
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
     } 
102 102
 }
103 103
 
104
-$newProfileName =  $validator->string($_POST['new_profile'], true);
104
+$newProfileName = $validator->string($_POST['new_profile'], true);
105 105
 $origProfileName = $validator->string($_POST['orig_profile_name'], true);
106 106
 $handle = \core\DBConnection::handle("INST");
107 107
 
108 108
 $result = runSelect($my_profile->identifier, $fields, 'profile', $handle);
109 109
 $row = $result->fetch_assoc();
110
-$row['showtime']= 0;
110
+$row['showtime'] = 0;
111 111
 $row['preference'] = 1000;
112 112
 copyRow($row, $fields, 'profile', $handle);
113 113
 $newProfileId = $handle->lastID();
Please login to merge, or discard this patch.
web/admin/action_req_certificate.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  */
28 28
 ?>
29 29
 <?php
30
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
31 31
 $auth = new \web\lib\admin\Authentication();
32 32
 $deco = new \web\lib\admin\PageDecoration();
33 33
 $validator = new \web\lib\common\InputValidation();
@@ -90,23 +90,23 @@  discard block
 block discarded – undo
90 90
     $subject_prefix = implode(', ', array_reverse($DN));
91 91
     /* Messages */
92 92
     $messages = [
93
-    'WRONG_SUBJECT' => _('Submitted Certificate Signing Request contains subject field that does not start with ') . 
94
-                       $subject_prefix  . '<br>' . _("See CSR generation rules below."),
93
+    'WRONG_SUBJECT' => _('Submitted Certificate Signing Request contains subject field that does not start with '). 
94
+                       $subject_prefix.'<br>'._("See CSR generation rules below."),
95 95
     'WRONG_CRL' => _('Submitted Certificate Signing Request is broken - unable to extract the public key from CSR')
96 96
     ];
97 97
     $settings = array();
98
-    if  (isset($_SESSION['CSR_ERRORS']) && $_SESSION['CSR_ERRORS'] != '') {
99
-        print '<h3 id="errorbox"><font color="red">'. $messages[$_SESSION['CSR_ERRORS']].'</font></h3>';
98
+    if (isset($_SESSION['CSR_ERRORS']) && $_SESSION['CSR_ERRORS'] != '') {
99
+        print '<h3 id="errorbox"><font color="red">'.$messages[$_SESSION['CSR_ERRORS']].'</font></h3>';
100 100
         unset($_SESSION['CSR_ERRORS']);
101 101
     }
102
-    if  (isset($_SESSION['FORM_SETTINGS']) && $_SESSION['FORM_SETTINGS'] != '') {
102
+    if (isset($_SESSION['FORM_SETTINGS']) && $_SESSION['FORM_SETTINGS'] != '') {
103 103
         $settings = $_SESSION['FORM_SETTINGS'];
104 104
         unset($_SESSION['FORM_SETTINGS']);
105 105
     }
106 106
     if (empty($settings) && isset($_POST['LEVEL'])) {
107 107
         $settings = array('LEVEL' => $_POST['LEVEL'], 'NRO-list' => $_POST['NRO-list'], 'INST-list' => $_POST['INST-list']);
108 108
     }
109
-    if  ( isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) {
109
+    if (isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) {
110 110
         // basic sanity checks before we hand this over to openssl
111 111
         $sanitisedCsr = $validator->string($_POST['CSR'] ?? "", TRUE);
112 112
         //print $sanitisedCsr; 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         $dc = array();
122 122
         if (!empty($subject_keys) && $subject_keys[0] == 'DC' && $subject['DC']) {
123 123
             foreach ($subject['DC'] as $v) {
124
-                $dc[] = 'DC=' . $v;
124
+                $dc[] = 'DC='.$v;
125 125
             }
126 126
             if ($DN !== array_reverse($dc)) {
127 127
                 $dc = array();
@@ -141,12 +141,12 @@  discard block
 block discarded – undo
141 141
                 }
142 142
                 $fed = $validator->existingFederation($_POST['NRO-list']);
143 143
                 $country = strtoupper($fed->tld);
144
-                $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country ;
144
+                $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country;
145 145
                 $DN[] = "C=$code";
146
-                $DN[] = "O=NRO of " . iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[$country]['name']);
146
+                $DN[] = "O=NRO of ".iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[$country]['name']);
147 147
                 $serverInfo = $externalDb->listExternalTlsServersFederation($fed->tld);
148 148
                 $serverList = explode(",", array_key_first($serverInfo));
149
-                $DN[] = "CN=" . $serverList[0];
149
+                $DN[] = "CN=".$serverList[0];
150 150
                 $policies[] = "eduroam IdP";
151 151
                 $policies[] = "eduroam SP";
152 152
                 $firstName = $serverInfo[array_key_first($serverInfo)][0]["name"];
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                     throw new Exception(sprintf("Sorry: you are not %s admin for the %s requested in the form.", $uiElements->nomenclatureFed, $uiElements->nomenclatureFed));
163 163
                 }
164 164
                 $country = strtoupper($matches[1]);
165
-                $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country ;
165
+                $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country;
166 166
                 $DN[] = "C=$code";
167 167
                 $serverInfo = $extInsts[$_POST['INST-list']];
168 168
                 if (isset($serverInfo["names"]["en"])) {
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
 		    $modou = 1;
177 177
 		    $ou = str_replace(",", "/,", $ou);
178 178
 		}
179
-		$ou = preg_replace('/\s+/', ' ',  $ou);
179
+		$ou = preg_replace('/\s+/', ' ', $ou);
180 180
 		if (strlen($ou) >= 64) {
181 181
 			$ou = substr($ou, 0, 64);
182 182
 			$modou += 2;
183 183
 		}
184 184
                 $DN[] = "O=".iconv('UTF-8', 'ASCII//TRANSLIT', $ou);
185 185
                 $serverList = explode(",", $serverInfo["servers"]);
186
-                $DN[] = "CN=" . $serverList[0];
186
+                $DN[] = "CN=".$serverList[0];
187 187
                 switch ($serverInfo["type"]) {
188 188
                     case core\IdP::TYPE_IDPSP:
189 189
                         $policies[] = "eduroam IdP";
@@ -202,13 +202,13 @@  discard block
 block discarded – undo
202 202
             default:
203 203
                 throw new Exception("Sorry: Unknown level of issuance requested.");
204 204
         }
205
-        echo "<p style='font-size: large'>" . _("Requesting a certificate with the following properties");
205
+        echo "<p style='font-size: large'>"._("Requesting a certificate with the following properties");
206 206
         echo "<ul>";
207
-        echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>";
208
-	echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN);
207
+        echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>";
208
+	echo "<li>"._("Distinguished Name: ").implode(", ", $DN);
209 209
 	if ($modou > 0) {
210 210
 	    echo " (";
211
-            echo _("Organization field adjusted"). ': ';
211
+            echo _("Organization field adjusted").': ';
212 212
 	    $desc = array();
213 213
 	    if ($modou >= 2) {
214 214
 		$desc[] = _("truncated to 64 chars");
@@ -220,8 +220,8 @@  discard block
 block discarded – undo
220 220
 	    echo ")";
221 221
 	}
222 222
         echo "</li>";
223
-        echo "<li>" . _("subjectAltName:DNS : ") . implode(", ", $serverList) . "</li>";
224
-        echo "<li>" . _("Requester Contact Details: ") . $firstName . " &lt;" . $firstMail . "&gt;" . "</li>";
223
+        echo "<li>"._("subjectAltName:DNS : ").implode(", ", $serverList)."</li>";
224
+        echo "<li>"._("Requester Contact Details: ").$firstName." &lt;".$firstMail."&gt;"."</li>";
225 225
         echo "</ul></p>";
226 226
 
227 227
         $vettedCsr = $validator->string($_POST['CSR'], true);
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         $loggerInstance->debug(2, $DN, "CERT DN: ", "\n");
238 238
         // our certs can be good for max 5 years
239 239
         $fed->requestCertificate($user->identifier, $newCsrWithMeta, $expiryDays);
240
-        echo "<p>" . _("The certificate was requested.") . "</p>";
240
+        echo "<p>"._("The certificate was requested.")."</p>";
241 241
         ?>
242 242
         <form action="overview_certificates.php" method="GET">
243 243
             <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button>
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
         switch (count($feds)) {
256 256
             case 0:
257 257
                 echo "<div>";
258
-                echo $uiElements->boxRemark("<strong>" . sprintf(_("None of your %s servers has complete information in the database."),$uiElements->nomenclatureFed)."</strong>" . _("At least the DNS names of TLS servers and a role-based contact mail address are required."));
258
+                echo $uiElements->boxRemark("<strong>".sprintf(_("None of your %s servers has complete information in the database."), $uiElements->nomenclatureFed)."</strong>"._("At least the DNS names of TLS servers and a role-based contact mail address are required."));
259 259
                 echo "</div>";
260 260
                 break;
261 261
             case 1:
@@ -263,22 +263,22 @@  discard block
 block discarded – undo
263 263
                 if (empty($settings) || (isset($settings['LEVEL']) && $settings['LEVEL'] == 'NRO')) {
264 264
                     echo ' checked';
265 265
                 }
266
-                echo '>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>';
267
-                echo " <strong>" . $cat->knownFederations[$feds[0]->tld]['name'] . "</strong>";
268
-                echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $feds[0]->tld . '"/>';
266
+                echo '>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>';
267
+                echo " <strong>".$cat->knownFederations[$feds[0]->tld]['name']."</strong>";
268
+                echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$feds[0]->tld.'"/>';
269 269
                 break;
270 270
             default:
271 271
                 echo '<input type="radio" name="LEVEL" id="NRO" value="NRO"';
272 272
                 if (empty($settings) || isset($settings['LEVEL']) && $settings['LEVEL'] == 'NRO') {
273 273
                     echo ' checked';
274 274
                 }
275
-                echo '>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>';
275
+                echo '>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>';
276 276
                 ?>
277 277
                 <select name="NRO-list" id="NRO-list">
278 278
                     <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option>
279 279
                     <?php
280 280
                     foreach ($feds as $oneFed) {
281
-                        echo '<option value="' . strtoupper($oneFed->tld) . '">' . $cat->knownFederations[$oneFed->tld]['name'] . "</option>";
281
+                        echo '<option value="'.strtoupper($oneFed->tld).'">'.$cat->knownFederations[$oneFed->tld]['name']."</option>";
282 282
                         #echo '<option value="AAA' . strtoupper($oneFed->tld) . '">' . $oneIdP["names"][$langObject->getLang()] . "</option>";
283 283
                         
284 284
                     }
@@ -291,18 +291,18 @@  discard block
 block discarded – undo
291 291
         <script>
292 292
             var instservers = [];
293 293
             var instpolicies = [];
294
-            var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo));?>';
294
+            var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?>';
295 295
         <?php 
296 296
         $allIdPs = [];
297 297
         foreach ($allAuthorizedFeds as $oneFed) {
298 298
             foreach ($externalDb->listExternalTlsServersInstitution($oneFed['value']) as $id => $oneIdP) {
299
-                $allIdPs[$id] = '[' . substr($id, 0, 2) . '] ' . $oneIdP["name"];            
300
-                echo "instservers['" . $id . "']='" . str_replace(",", ", ", $oneIdP["servers"]) . "';\n";
301
-                echo "instpolicies['" . $id . "']='";
299
+                $allIdPs[$id] = '['.substr($id, 0, 2).'] '.$oneIdP["name"];            
300
+                echo "instservers['".$id."']='".str_replace(",", ", ", $oneIdP["servers"])."';\n";
301
+                echo "instpolicies['".$id."']='";
302 302
                 if ($oneIdP["type"] == 'IdPSP') {
303 303
                     echo "eduroam IdP/SP";
304 304
                 } else {
305
-                    echo "eduroam " . $oneIdP["type"];
305
+                    echo "eduroam ".$oneIdP["type"];
306 306
                 }
307 307
                 echo "';\n";
308 308
             }
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
             <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option>
341 341
 <?php
342 342
 foreach ($allIdPs as $id => $name) {
343
-    echo '<option value="' . $id . '"';
343
+    echo '<option value="'.$id.'"';
344 344
     if (isset($settings['INST-list']) && $settings['INST-list'] == $id) { echo ' selected'; }
345
-    echo '>' . $name . "</option>";
345
+    echo '>'.$name."</option>";
346 346
 }
347 347
 ?>
348 348
         </select>
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
             <?php 
352 352
             echo _('According to the above settings you will receive')
353 353
             ?>
354
-            <span id='certlevel'><?php echo _('NRO level certificate');?></span>
354
+            <span id='certlevel'><?php echo _('NRO level certificate'); ?></span>
355 355
             
356 356
         for server names:
357 357
         <span id='serversinfo'><?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?></span>
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         <?php
368 368
         } else {
369 369
             echo "<div>";
370
-            echo $uiElements->boxRemark(sprintf(_("<strong>No organisation inside your %s has complete information in the database</strong>."." "._("At least the DNS names of TLS servers and a role-based contact mail address are required.")),$uiElements->nomenclatureFed), "No TLS capable org!", true);
370
+            echo $uiElements->boxRemark(sprintf(_("<strong>No organisation inside your %s has complete information in the database</strong>."." "._("At least the DNS names of TLS servers and a role-based contact mail address are required.")), $uiElements->nomenclatureFed), "No TLS capable org!", true);
371 371
             echo "</div>";
372 372
         }
373 373
         ?>
@@ -377,10 +377,10 @@  discard block
 block discarded – undo
377 377
         <h2><?php echo _("2. CSR generation"); ?></h2>
378 378
         <p>
379 379
         <?php 
380
-        echo _("The CSR subject field has to start with ") .'<b>' . $subject_prefix . '</b><br>';
380
+        echo _("The CSR subject field has to start with ").'<b>'.$subject_prefix.'</b><br>';
381 381
         echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p>
382 382
         <?php 
383
-        echo "<b>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /". implode('/', array_reverse($DN)) ."/C=XY/O=WillBeReplaced/CN=will.be.replaced</b>";
383
+        echo "<b>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /".implode('/', array_reverse($DN))."/C=XY/O=WillBeReplaced/CN=will.be.replaced</b>";
384 384
         ?>
385 385
         <h2><?php echo _("3. Submission"); ?></h2>
386 386
 <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/>
Please login to merge, or discard this patch.