Test Failed
Push — master ( 8776a5...e6a1a9 )
by Maja
10:31
created
web/diag/adminQuery.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  * License: see the web/copyright.inc.php file in the file structure or
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  */
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 $languageInstance = new \core\common\Language();
24 24
 $languageInstance->setTextDomain("diagnostics");
25 25
 $loggerInstance = new \core\common\Logging();
@@ -63,47 +63,47 @@  discard block
 block discarded – undo
63 63
     $select = "<div id='sp_abuse_problem'>
64 64
 <select style='margin-left: 0px;' id='select_sp_problem'>";
65 65
     foreach ($sp_problem as $pname => $pdesc) {
66
-        $select = $select . "<option value='$pname'>$pdesc</option>\n";
66
+        $select = $select."<option value='$pname'>$pdesc</option>\n";
67 67
     }
68
-    $select = $select . "</select></div>";
68
+    $select = $select."</select></div>";
69 69
     $res = "
70 70
 <input type='hidden' name='token' id='token' value=''>
71 71
 <input type='hidden' name='tests_result' id='tests_result' value=''>
72 72
 <table id='sp_questions'>
73 73
     <tr id='sp_problem_selector'>
74
-        <td>" . _("Select your problem") . "</td>
74
+        <td>" . _("Select your problem")."</td>
75 75
         <td>$select</td>
76 76
     </tr>
77 77
     <tr>
78
-        <td>" . _("What is the realm of the IdP in question?") . "</td>
78
+        <td>"._("What is the realm of the IdP in question?")."</td>
79 79
         <td>
80 80
                 <input type='text' name='admin_realm' id='admin_realm' value='$realmFromURL'>
81
-                <button class='diag_button' id='realm_in_db_admin' style='display: none;' accesskey='R' type='button'>" .
82
-                _("Check this realm") .
81
+                <button class='diag_button' id='realm_in_db_admin' style='display: none;' accesskey='R' type='button'>".
82
+                _("Check this realm").
83 83
                 "</button>
84 84
                 <div id='tests_info_area'></div>
85 85
         </td>
86 86
     </tr>
87 87
     <tr id='outer_user_row' class='hidden_row'>
88
-        <td>" . _("Do you prefer to use a specific outer identity for diagnostics test?") . "</td>
88
+        <td>" . _("Do you prefer to use a specific outer identity for diagnostics test?")."</td>
89 89
         <td>  <input type='text' name='outer_user' id='outer_user' value=''><span id='outer_user_realm'></span>
90 90
     </tr>
91 91
     <tr class='hidden_row'>
92
-        <td>" . _("What is the authentication timestamp of the user session in question?") . "</td>
92
+        <td>" . _("What is the authentication timestamp of the user session in question?")."</td>
93 93
         <td><input type='text' id='timestamp' name='timestamp'>
94 94
             <div id='datepicker'></div>
95 95
         </td>
96 96
     </tr>
97 97
     <tr class='hidden_row'>
98
-        <td>" . _("What is the MAC address of the user session in question?") . "</td>
98
+        <td>" . _("What is the MAC address of the user session in question?")."</td>
99 99
         <td><input type='text' id='mac' name='mac'></td>
100 100
     </tr>
101 101
     <tr class='hidden_row'>
102
-        <td>" . _("Additional comments") . "</td>
102
+        <td>" . _("Additional comments")."</td>
103 103
         <td><textarea id='freetext' name='freetext' cols='60' rows='5'></textarea></td>
104 104
     </tr>
105 105
     <tr class='hidden_row'>
106
-        <td>" . _("Please specify an email address on which the IdP can contact you") . "</td>
106
+        <td>" . _("Please specify an email address on which the IdP can contact you")."</td>
107 107
         <td><input type='text' id='email' name='email'></td>
108 108
     </tr>
109 109
     <tr>
@@ -111,82 +111,82 @@  discard block
 block discarded – undo
111 111
         <td></td>
112 112
     </tr>
113 113
     <tr class='hidden_row' id='send_query_to_idp'>
114
-        <td>" . _("Now you can send your query") . "</td>
115
-        <td><button type='submit' class='diag_button' id='submit_idp_query' name='go'>" . _("Send") . "</button></td>
114
+        <td>" . _("Now you can send your query")."</td>
115
+        <td><button type='submit' class='diag_button' id='submit_idp_query' name='go'>" . _("Send")."</button></td>
116 116
     </tr>
117 117
  </table>";
118
-    $res = $res . $javascript;
118
+    $res = $res.$javascript;
119 119
 }
120 120
 if ($queryType == 'idp') {
121 121
     $select = "<div id='idp_reported_problem' style='display:;'>
122 122
 <select style='margin-left:0px;' id='select_idp_problem'>";
123 123
     foreach ($idp_problem as $pname => $pdesc) {
124
-        $select = $select . "<option value='$pname'>$pdesc</option>\n";
124
+        $select = $select."<option value='$pname'>$pdesc</option>\n";
125 125
     }
126
-    $select = $select . "</select></div>";
126
+    $select = $select."</select></div>";
127 127
     $res = "
128 128
 <table id='idp_questions'>
129 129
     <tr>
130
-        <td>" . _("Select your problem") . "</td>
130
+        <td>" . _("Select your problem")."</td>
131 131
         <td>$select</td>
132 132
     </tr>
133 133
     <tr>
134
-        <td>" . _("Identify the SP by one of following means") . "</td>
134
+        <td>"._("Identify the SP by one of following means")."</td>
135 135
         <td></td>
136 136
     </tr>
137 137
     <tr id='by_opname'>
138
-        <td>" . _("SP Operator-Name attribute") . "</td>
138
+        <td>" . _("SP Operator-Name attribute")."</td>
139 139
         <td><input type='text' id='opname' name='opname' value=''></td>
140 140
     </tr>
141 141
     <tr id='spmanually'>
142
-        <td>" . _("Select the SP manually:") . "</td>
142
+        <td>" . _("Select the SP manually:")."</td>
143 143
         <td>
144 144
             <div id='select_asp_country'><a href='' id='asp_countries_list'>
145
-            <span id='opnameselect'>" . _("click to select country and organisation") . "</a></span>
145
+            <span id='opnameselect'>" . _("click to select country and organisation")."</a></span>
146 146
             </div>
147 147
             <div id='select_asp_area'></div>
148 148
         </td>
149 149
     </tr>
150 150
     <tr id='asp_desc' style='display: none;'>
151
-        <td>" . _("or") . ' ' . _("at least describe the SP location") . "</td>
151
+        <td>" . _("or").' '._("at least describe the SP location")."</td>
152 152
         <td><input type='text' id='asp_location' name='asp_location' value=''></td>
153 153
     </tr>
154 154
     <tr>
155
-        <td>" . _("What is the outer ID of the user session in question?") . "</td>
155
+        <td>" . _("What is the outer ID of the user session in question?")."</td>
156 156
         <td><input type='text' id='outer_id' name='outer_id' value=''></td>
157 157
     </tr>
158 158
     <tr>
159
-        <td>" . _("What is the authentication timestamp of the user session in question?") . "</td>
159
+        <td>" . _("What is the authentication timestamp of the user session in question?")."</td>
160 160
         <td>
161 161
             <input type='text' id='timestamp' name='timestamp'>
162 162
             <div id='datepicker'></div>
163 163
         </td>
164 164
     </tr>
165 165
     <tr>
166
-        <td>" . _("What is the MAC address of the user session in question?") . "</td>
166
+        <td>" . _("What is the MAC address of the user session in question?")."</td>
167 167
         <td><input type='text' id='mac' name='mac'></td>
168 168
     </tr>
169 169
     <tr>
170
-        <td>" . _("Additional comments about the problem") . "</td>
170
+        <td>" . _("Additional comments about the problem")."</td>
171 171
         <td><textarea id='freetext' name='freetext' cols='60' rows='5'></textarea></td>
172 172
     </tr>
173 173
     <tr>
174
-        <td>" . _("Do you have any contact details by which the user wishes to be contacted by the SP?") . "</td>
174
+        <td>" . _("Do you have any contact details by which the user wishes to be contacted by the SP?")."</td>
175 175
         <td><textarea id='c_details' name='c_details' cols='60' rows='5'></textarea></td>
176 176
     </tr>
177 177
     <tr>
178
-        <td>" . _("Please specify an email address on which the SP can contact you") . "</td>
178
+        <td>" . _("Please specify an email address on which the SP can contact you")."</td>
179 179
         <td><input type='text' id='email' name='email'></td>
180 180
     </tr>
181 181
     <tr class='hidden_row' id='send_query_to_sp'>
182
-        <td>" . _("Now you can send your query") . "</td>
183
-        <td><button type='submit' class='diag_button' id='submit_sp_query' name='go'>" . _("Send") . "</button></td>
182
+        <td>" . _("Now you can send your query")."</td>
183
+        <td><button type='submit' class='diag_button' id='submit_sp_query' name='go'>" . _("Send")."</button></td>
184 184
     </tr>
185 185
 </table>";
186
-    $res = $res . $javascript;
186
+    $res = $res.$javascript;
187 187
 }
188 188
 if ($queryType == 'idp_send' || $queryType == 'sp_send') {
189
-    include_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
189
+    include_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
190 190
     $cat = new \core\CAT();
191 191
     $returnArray = array();
192 192
     if (count((array) $o) > 0) {
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
             switch ($key) {
196 196
                 case 'realm':
197 197
                     $pos = strpos($value, '@');
198
-                    if ($pos !== FALSE ) {
199
-                        $value = substr($value, $pos+1);
198
+                    if ($pos !== FALSE) {
199
+                        $value = substr($value, $pos + 1);
200 200
                     }
201 201
                 case 'email':
202 202
                     $returnArray[$key] = filter_var($value, FILTER_VALIDATE_EMAIL);
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         $mail = \core\common\OutsideComm::mailHandle();
238 238
         $emails = ['[email protected]'];
239 239
         //$emails = explode(',', $returnArray['idpcontact']);
240
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System";
240
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System";
241 241
         foreach ($emails as $email) {
242 242
             $mail->addAddress($email);
243 243
         }
@@ -247,11 +247,11 @@  discard block
 block discarded – undo
247 247
         } else {
248 248
             $link = 'http://';
249 249
         }
250
-        $link .= $_SERVER['SERVER_NAME'] . \core\CAT::getRootUrlPath() . '/diag/show_realmcheck.php?token=' . $returnArray['token'];
250
+        $link .= $_SERVER['SERVER_NAME'].\core\CAT::getRootUrlPath().'/diag/show_realmcheck.php?token='.$returnArray['token'];
251 251
         $returnArray['testurl'] = $link;
252 252
         $mail->Subject = _('Suspected a technical problem with the IdP');
253
-        $txt = _("We suspect a technical problem with the IdP handling the realm") . ' ' . 
254
-                $returnArray['realm'] . ".\n";
253
+        $txt = _("We suspect a technical problem with the IdP handling the realm").' '. 
254
+                $returnArray['realm'].".\n";
255 255
         $txt .= _("The CAT diagnostic test was run for this realm during reporting.\n");
256 256
         $txt .= _("The overall result was ");
257 257
         if ($returnArray['tests_result'] == 0) {
@@ -259,15 +259,15 @@  discard block
 block discarded – undo
259 259
         } else {
260 260
             $txt .= _("failure");
261 261
         }
262
-        $txt .= ".\n" . _("To see details go to ");
262
+        $txt .= ".\n"._("To see details go to ");
263 263
         $txt .= "$link\n\n";
264
-        $txt .= _("The reported problem details are as follows") . "\n";
265
-        $txt .= _("timestamp") . ": " . $returnArray['timestamp'] . "\n";
266
-        $txt .= _("client MAC address") . ": " . $returnArray['mac'] . "\n";
264
+        $txt .= _("The reported problem details are as follows")."\n";
265
+        $txt .= _("timestamp").": ".$returnArray['timestamp']."\n";
266
+        $txt .= _("client MAC address").": ".$returnArray['mac']."\n";
267 267
         if ($returnArray['freetext']) {
268
-            $txt .= _("additional comments") . ': ' . $returnArray['freetext'] . "\n";
268
+            $txt .= _("additional comments").': '.$returnArray['freetext']."\n";
269 269
         }
270
-        $txt .= "\n" . _("You can contact the incident reporter at") . ' ' . $returnArray['email'];
270
+        $txt .= "\n"._("You can contact the incident reporter at").' '.$returnArray['email'];
271 271
         
272 272
         $mail->Body = $txt;
273 273
         $sent = $mail->send();
Please login to merge, or discard this patch.
web/diag/findRealm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $telepath = new \core\diag\Telepath($givenRealm);
109 109
             $outerUser = $telepath->getOuter();
110 110
         }
111
-        $testsuite = new \core\diag\RADIUSTests($givenRealm, $outerUser . '@' . $givenRealm);
111
+        $testsuite = new \core\diag\RADIUSTests($givenRealm, $outerUser.'@'.$givenRealm);
112 112
        
113 113
         $naptr = $rfc7585suite->relevantNAPTR(); 
114 114
         if ($naptr != \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED && $naptr > 0) {
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 $json_data = json_encode($returnArray);
207 207
 
208 208
 if ($token) {
209
-    $loggerInstance->debug(4, 'JSON data written to ' .$jsonDir.'/'.$token);
209
+    $loggerInstance->debug(4, 'JSON data written to '.$jsonDir.'/'.$token);
210 210
     file_put_contents($jsonDir.'/'.$token.'/realm', $json_data);
211 211
 }
212 212
 header("Content-type: application/json; utf-8");
Please login to merge, or discard this patch.
web/admin/edit_hotspot.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
                     $deployment->deactivate();
110 110
                 }
111 111
                 header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . 
112
-                       $deployment->identifier);
112
+                        $deployment->identifier);
113 113
                 exit(0);
114 114
             case web\lib\common\FormElements::BUTTON_REMOVESP:
115 115
                 $deployment->remove();
Please login to merge, or discard this patch.
Switch Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -158,12 +158,12 @@
 block discarded – undo
158 158
     }
159 159
     if (isset($_POST['command'])) {
160 160
         switch ($_POST['command']) {
161
-        case web\lib\common\FormElements::BUTTON_CLOSE:
162
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier) . '#profilebox_' . $deployment->identifier;
163
-            exit(0);
164
-        default:
165
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
166
-            exit(0);
161
+            case web\lib\common\FormElements::BUTTON_CLOSE:
162
+                header("Location: overview_org.php?inst_id=" . $my_inst->identifier) . '#profilebox_' . $deployment->identifier;
163
+                exit(0);
164
+            default:
165
+                header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
166
+                exit(0);
167 167
         }
168 168
     }
169 169
     $vlan = $deployment->getAttributes("managedsp:vlan")[0]['value'] ?? NULL;
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 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
 
32 32
 $deco = new \web\lib\admin\PageDecoration();
33 33
 $validator = new \web\lib\common\InputValidation();
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
             ( $_POST['consortium'] == "OpenRoaming" && count($myfed->getAttributes("fed:openroaming")) > 0 )
42 42
             )
43 43
     ) {*/
44
-    if (isset($_POST['consortium']) &&  $_POST['consortium'] == "eduroam")
44
+    if (isset($_POST['consortium']) && $_POST['consortium'] == "eduroam")
45 45
     {
46 46
         $deployment = $my_inst->newDeployment(\core\AbstractDeployment::DEPLOYMENTTYPE_MANAGED, $_POST['consortium']);
47
-        header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
47
+        header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
48 48
         exit(0);
49 49
     } else {
50 50
         throw new Exception("Desired consortium for Managed SP needs to be specified, and allowed!");
@@ -101,19 +101,19 @@  discard block
 block discarded – undo
101 101
                 if (isset($_POST['agreement']) && $_POST['agreement'] == "true") {
102 102
                     $deployment->addAttribute("hiddenmanagedsp:tou_accepted", NULL, 1);
103 103
                 }
104
-                header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
104
+                header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
105 105
                 exit(0);
106 106
             case web\lib\common\FormElements::BUTTON_DELETE:
107 107
                 $response = $deployment->setRADIUSconfig();
108 108
                 if (in_array('OK', $response)) {
109 109
                     $deployment->deactivate();
110 110
                 }
111
-                header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . 
111
+                header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'. 
112 112
                        $deployment->identifier);
113 113
                 exit(0);
114 114
             case web\lib\common\FormElements::BUTTON_REMOVESP:
115 115
                 $deployment->remove();
116
-                header("Location: overview_org.php?inst_id=" . $my_inst->identifier);
116
+                header("Location: overview_org.php?inst_id=".$my_inst->identifier);
117 117
                 exit(0);
118 118
             case web\lib\common\FormElements::BUTTON_ACTIVATE:
119 119
                 if (count($deployment->getAttributes("hiddenmanagedsp:tou_accepted")) > 0) {
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                     if (in_array('OK', $response)) {
122 122
                         $deployment->activate();
123 123
                     }
124
-                    header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier);
124
+                    header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'.$deployment->identifier);
125 125
                     exit(0);
126 126
                 } else {
127 127
                     throw new Exception("Activate button pushed without acknowledged ToUs!");
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 } else {
151 151
                     $response = ['NOOP', 'NOOP'];
152 152
                 }
153
-                header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier);
153
+                header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'.$deployment->identifier);
154 154
                 exit(0);
155 155
             default:
156 156
                 throw new Exception("Unknown button action requested!");
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
     if (isset($_POST['command'])) {
160 160
         switch ($_POST['command']) {
161 161
         case web\lib\common\FormElements::BUTTON_CLOSE:
162
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier) . '#profilebox_' . $deployment->identifier;
162
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier).'#profilebox_'.$deployment->identifier;
163 163
             exit(0);
164 164
         default:
165
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
165
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
166 166
             exit(0);
167 167
         }
168 168
     }
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     echo $uiElements->instLevelInfoBoxes($my_inst);
190 190
     $deploymentOptions = $deployment->getAttributes();
191 191
     echo "<form enctype='multipart/form-data' action='edit_hotspot.php?inst_id=$my_inst->identifier&amp;deployment_id=$deployment->identifier' method='post' accept-charset='UTF-8'>
192
-                <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
192
+                <input type='hidden' name='MAX_FILE_SIZE' value='".\config\Master::MAX_UPLOAD_SIZE."'>";
193 193
     $optionDisplay = new \web\lib\admin\OptionDisplay($deploymentOptions, \core\Options::LEVEL_PROFILE);
194 194
     ?>
195 195
     <fieldset class='option_container' id='managedsp_override'>
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                 <!-- input for VLAN identifier for home users-->
224 224
                 <td>
225 225
                     <span id='vlan_label'>
226
-                        <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " " . _("(unset with '0')"))); ?>
226
+                        <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " "._("(unset with '0')"))); ?>
227 227
                     </span>
228 228
                 </td>
229 229
                 <td>
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     </fieldset>
244 244
 
245 245
     <?php
246
-    echo "<p><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>";
246
+    echo "<p><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>";
247 247
     echo $deco->footer();
248 248
 
249 249
     
250 250
\ No newline at end of file
Please login to merge, or discard this patch.
web/admin/overview_radsec_readiness.php 1 patch
Spacing   +22 added lines, -22 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
 $auth = new \web\lib\admin\Authentication();
32 32
 $deco = new \web\lib\admin\PageDecoration();
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
         echo '<br/>';
83 83
         echo _("In the 'Timestamp' column we show last update time.");
84 84
         echo '<p/>';
85
-        echo _('To check eduroam database specification see') . 
86
-                ' <a target="_blank" href="https://monitor.eduroam.org/eduroam-database/v2/docs/eduroam-database-ver30112021.pdf">' .
87
-                _('this document') . '</a><p/>';
85
+        echo _('To check eduroam database specification see'). 
86
+                ' <a target="_blank" href="https://monitor.eduroam.org/eduroam-database/v2/docs/eduroam-database-ver30112021.pdf">'.
87
+                _('this document').'</a><p/>';
88 88
         echo _('If you cannot find your institution on this list it means that this institiution is not present in your upstream data.');        
89 89
         echo '<p/>';
90 90
         $allAuthorizedFeds = $user->getAttributes("user:fedadmin");
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
         ?>
94 94
         
95 95
     <select name="INST-list" id="INST-list">
96
-        <option value=""><?php echo _('---PLEASE CHOOSE---');?></option>
96
+        <option value=""><?php echo _('---PLEASE CHOOSE---'); ?></option>
97 97
         <?php 
98 98
         $instdata = array();
99 99
         foreach ($extInsts as $iid => $oneInst) {
100
-            print '<option value="' . $iid . '">' . $oneInst['name'] . '</option>';
100
+            print '<option value="'.$iid.'">'.$oneInst['name'].'</option>';
101 101
             $instdata[$iid] = array();
102 102
             $instdata[$iid]['name'] = $oneInst['name'];   
103 103
             $instdata[$iid]['type'] = _('no data');
@@ -111,22 +111,22 @@  discard block
 block discarded – undo
111 111
             $contactdata = '';
112 112
             foreach ($oneInst['contacts'] as $oneContact) {
113 113
                 if ($contactdata != '') {
114
-                    $contactdata = $contactdata . '<br>';
114
+                    $contactdata = $contactdata.'<br>';
115 115
                 }
116 116
                 if ($oneContact['name']) {
117
-                    $contactdata = $contactdata . $oneContact['name'];
117
+                    $contactdata = $contactdata.$oneContact['name'];
118 118
                 }
119 119
                 if ($contactdata != '') {
120
-                    $contactdata = $contactdata . '<br>';
120
+                    $contactdata = $contactdata.'<br>';
121 121
                 }
122 122
                 if ($oneContact['mail']) {
123
-                    $contactdata = $contactdata . $oneContact['mail'];
123
+                    $contactdata = $contactdata.$oneContact['mail'];
124 124
                 }
125 125
                 if ($contactdata != '') {
126
-                    $contactdata = $contactdata . '<br>';
126
+                    $contactdata = $contactdata.'<br>';
127 127
                 }
128 128
                 if ($oneContact['phone']) {
129
-                    $contactdata = $contactdata . $oneContact['phone'];
129
+                    $contactdata = $contactdata.$oneContact['phone'];
130 130
                 }        
131 131
             }
132 132
             if ($contactdata == '') {
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
             var instts = [];
146 146
             <?php
147 147
             foreach (array_keys($instdata) as $iid) {
148
-                echo "instservers['" . $iid . "']='" . $instdata[$iid]['servers']. "';\n";
149
-                echo "instname['" . $iid . "']='" . $instdata[$iid]['name']. "';\n";
150
-                echo "insttype['" . $iid . "']='" . $instdata[$iid]['type']. "';\n";
151
-                echo "instcontact['" . $iid . "']='" . $instdata[$iid]['contacts']. "';\n";
152
-                echo "instts['" . $iid . "']='" . $instdata[$iid]['ts']. "';\n";
148
+                echo "instservers['".$iid."']='".$instdata[$iid]['servers']."';\n";
149
+                echo "instname['".$iid."']='".$instdata[$iid]['name']."';\n";
150
+                echo "insttype['".$iid."']='".$instdata[$iid]['type']."';\n";
151
+                echo "instcontact['".$iid."']='".$instdata[$iid]['contacts']."';\n";
152
+                echo "instts['".$iid."']='".$instdata[$iid]['ts']."';\n";
153 153
             }
154 154
             ?>
155 155
             $(document).ready(function(){
@@ -171,18 +171,18 @@  discard block
 block discarded – undo
171 171
     <div id="instdata_area">
172 172
         <table>
173 173
             <tr><th align="left" width="350">
174
-                    <?php echo _('Name');?>
174
+                    <?php echo _('Name'); ?>
175 175
                 </th><th align="left" width="100">
176
-                    <?php echo _('Type');?>
176
+                    <?php echo _('Type'); ?>
177 177
                 </th>
178 178
                 <th align="left" width="200">
179
-                    <?php echo _('Servers');?>
179
+                    <?php echo _('Servers'); ?>
180 180
                 </th>
181 181
                 <th align="left" width="200">
182
-                    <?php echo _('Contact data');?>
182
+                    <?php echo _('Contact data'); ?>
183 183
                 </th>
184 184
                 <th align="left" width="100">
185
-                    <?php echo _('Timestamp');?>
185
+                    <?php echo _('Timestamp'); ?>
186 186
                 </th>
187 187
             </tr>
188 188
             <tr id="toshow"></tr>
Please login to merge, or discard this patch.
web/admin/overview_org.php 1 patch
Spacing   +62 added lines, -62 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
 
32 32
 function displaySilverbulletPropertyWidget(&$theProfile, $readonly, &$uiElements) {
33 33
     ?>
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
                 <ul style='margin:1px'>
45 45
                     <?php
46 46
                     foreach ($completeness as $missing_attrib) {
47
-                        echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
47
+                        echo "<li>".$uiElements->displayName($missing_attrib)."</li>";
48 48
                     }
49 49
                     ?>
50 50
                 </ul>
51 51
             </div>
52 52
             <?php
53 53
         } else {
54
-            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
+            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);
55 55
         }
56 56
         ?>
57 57
         <br/>
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         if ($readonly === FALSE) {
61 61
             ?>
62 62
             <form action='edit_silverbullet.php?inst_id=<?php echo $theProfile->institution; ?>&amp;profile_id=<?php echo $theProfile->identifier; ?>' method='POST'>
63
-                <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
63
+                <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
64 64
             </form>
65 65
             <?php
66 66
         }
@@ -96,21 +96,21 @@  discard block
 block discarded – undo
96 96
                 $has_overrides = TRUE;
97 97
             }
98 98
         }
99
-        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>";
99
+        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>";
100 100
         $typelist = $theProfile->getEapMethodsinOrderOfPreference();
101 101
         $allcomplete = TRUE;
102 102
         foreach ($typelist as $eaptype) {
103 103
             $buffer_eaptypediv .= $eaptype->getPrintableRep();
104 104
             $completeness = $theProfile->isEapTypeDefinitionComplete($eaptype);
105 105
             if ($completeness === true) {
106
-                $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>";
106
+                $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>";
107 107
             } else {
108 108
                 $buffer_eaptypediv .= " <div class='notacceptable'>";
109 109
                 $buffer_eaptypediv .= _("Information needed!");
110 110
                 if (is_array($completeness)) {
111 111
                     $buffer_eaptypediv .= "<ul style='margin:1px'>";
112 112
                     foreach ($completeness as $missing_attrib) {
113
-                        $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
113
+                        $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>";
114 114
                     }
115 115
                     $buffer_eaptypediv .= "</ul>";
116 116
                 }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             foreach ($attribs as $attrib) {
123 123
                 if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) {
124 124
                     $justOnce = TRUE;
125
-                    $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
+                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='"._("Options on EAP Method/Device level are in effect.")."'>";
126 126
                 }
127 127
             }
128 128
             $buffer_eaptypediv .= "<br/>";
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         if ($theProfile->isRedirected()) {
149 149
             $iconData = $uiElements->iconData('PROFILES_REDIRECTED');
150 150
             $iconData['text'] = _("Profile redirected");
151
-            $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
151
+            $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
152 152
             
153 153
         } 
154 154
         
@@ -156,15 +156,15 @@  discard block
 block discarded – undo
156 156
         switch ($certStatus) {
157 157
             case core\AbstractProfile::CERT_STATUS_OK:
158 158
                 $iconData = $uiElements->iconData('CERT_STATUS_OK');
159
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
159
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
160 160
                 break;
161 161
             case core\AbstractProfile::CERT_STATUS_WARN:
162 162
                 $iconData = $uiElements->iconData('CERT_STATUS_WARN');
163
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));                
163
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));                
164 164
                 break;
165 165
             case core\AbstractProfile::CERT_STATUS_ERROR:
166 166
                 $iconData = $uiElements->iconData('CERT_STATUS_ERROR');
167
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
167
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
168 168
                 break;            
169 169
         }
170 170
         $buffer_headline .= "</div>";
@@ -190,11 +190,11 @@  discard block
 block discarded – undo
190 190
                 if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") {
191 191
                     $diagUrl = "../diag/";
192 192
                 } else {
193
-                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/";
193
+                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/";
194 194
                 }
195 195
                 ?>
196
-                <form action='<?php echo $diagUrl . "action_realmcheck.php?inst_id=" . $theProfile->institution . "&profile_id=" . $theProfile->identifier ?>' method='post' accept-charset='UTF-8'>
197
-                    <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link . $_SERVER['SCRIPT_NAME']); ?>'/>
196
+                <form action='<?php echo $diagUrl."action_realmcheck.php?inst_id=".$theProfile->institution."&profile_id=".$theProfile->identifier ?>' method='post' accept-charset='UTF-8'>
197
+                    <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link.$_SERVER['SCRIPT_NAME']); ?>'/>
198 198
                     <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!"); ?>'>
199 199
                         <?php echo _("Check realm reachability"); ?>
200 200
                     </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>";
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     $radius_status = array();
287 287
     $radius_status[0] = $deploymentObject->radius_status_1;
288 288
     $radius_status[1] = $deploymentObject->radius_status_2;
289
-    $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
289
+    $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem");
290 290
     $retry = $deploymentObject->checkRADIUSHostandConfigDaemon();
291 291
     if (is_array($retry)) {
292 292
         foreach ($retry as $id => $stat) {
@@ -297,11 +297,11 @@  discard block
 block discarded – undo
297 297
     }
298 298
     ?>
299 299
     <div style='display: table-row_id;'>
300
-        <div class='profilebox' id="profilebox_<?php echo $deploymentObject->identifier;?>" style='display: table-cell;'>
300
+        <div class='profilebox' id="profilebox_<?php echo $deploymentObject->identifier; ?>" style='display: table-cell;'>
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>
@@ -324,13 +324,13 @@  discard block
 block discarded – undo
324 324
                     <td><strong><?php echo _("Your primary RADIUS server") ?></strong><br/>
325 325
                         <?php
326 326
                         if ($deploymentObject->host1_v4 !== NULL) {
327
-                            echo _("IPv4") . ": " . $deploymentObject->host1_v4;
327
+                            echo _("IPv4").": ".$deploymentObject->host1_v4;
328 328
                         }
329 329
                         if ($deploymentObject->host1_v4 !== NULL && $deploymentObject->host1_v6 !== NULL) {
330 330
                             echo "<br/>";
331 331
                         }
332 332
                         if ($deploymentObject->host1_v6 !== NULL) {
333
-                            echo _("IPv6") . ": " . $deploymentObject->host1_v6;
333
+                            echo _("IPv6").": ".$deploymentObject->host1_v6;
334 334
                         }
335 335
                         ?>
336 336
                     </td>
@@ -338,9 +338,9 @@  discard block
 block discarded – undo
338 338
                     <td><?php echo $deploymentObject->port1; ?></td>
339 339
                     <td>
340 340
                         <?php
341
-                        echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] .
342
-                        "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] .
343
-                        "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>";
341
+                        echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon'].
342
+                        "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text'].
343
+                        "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>";
344 344
                         ?>
345 345
                     </td>
346 346
                 </tr>
@@ -348,22 +348,22 @@  discard block
 block discarded – undo
348 348
                     <td><strong><?php echo _("Your backup RADIUS server") ?><br/></strong>
349 349
                         <?php
350 350
                         if ($deploymentObject->host2_v4 !== NULL) {
351
-                            echo _("IPv4") . ": " . $deploymentObject->host2_v4;
351
+                            echo _("IPv4").": ".$deploymentObject->host2_v4;
352 352
                         }
353 353
                         if ($deploymentObject->host2_v4 !== NULL && $deploymentObject->host2_v6 !== NULL) {
354 354
                             echo "<br/>";
355 355
                         }
356 356
                         if ($deploymentObject->host2_v6 !== NULL) {
357
-                            echo _("IPv6") . ": " . $deploymentObject->host2_v6;
357
+                            echo _("IPv6").": ".$deploymentObject->host2_v6;
358 358
                         }
359 359
                         ?></td>
360 360
                     <td><?php echo _("RADIUS port number: ") ?></td>
361 361
                     <td><?php echo $deploymentObject->port2; ?></td>
362 362
                     <td>
363 363
                         <?php
364
-                        echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
365
-                        "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] .
366
-                        "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>";
364
+                        echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
365
+                        "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text'].
366
+                        "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>";
367 367
                         ?>
368 368
                     </td>
369 369
                 </tr>
@@ -376,12 +376,12 @@  discard block
 block discarded – undo
376 376
                 <tr>
377 377
                         <td><strong><?php echo _("RADSEC credentials"); ?></strong></td>
378 378
                         <td>
379
-                            <input type="hidden" id="priv_key_data_<?php echo $deploymentObject->identifier;?>" value="<?php echo $deploymentObject->radsec_priv;?>">
380
-                            <input type="hidden" id="cert_data_<?php echo $deploymentObject->identifier;?>" value="<?php echo $deploymentObject->radsec_cert;?>">
381
-                            <input type="hidden" id="ca_cert_data" value="<?php echo $cacert;?>">
382
-                            <button class="sp_priv_key" id="priv_key_<?php echo $deploymentObject->identifier;?>" name="showc" style="background-color: gray; color: white" type="submit"><?php echo _('private key');?></button>
383
-                            <button class="sp_cert" id="cert_<?php echo $deploymentObject->identifier;?>" name="showp" style="background-color: gray; color: white" type="submit"><?php echo _('certificate');?></button>
384
-                            <button class="ca_cert" name="showca" style="background-color: gray; color: white" type="submit"><?php echo _('CA certificate');?></button>
379
+                            <input type="hidden" id="priv_key_data_<?php echo $deploymentObject->identifier; ?>" value="<?php echo $deploymentObject->radsec_priv; ?>">
380
+                            <input type="hidden" id="cert_data_<?php echo $deploymentObject->identifier; ?>" value="<?php echo $deploymentObject->radsec_cert; ?>">
381
+                            <input type="hidden" id="ca_cert_data" value="<?php echo $cacert; ?>">
382
+                            <button class="sp_priv_key" id="priv_key_<?php echo $deploymentObject->identifier; ?>" name="showc" style="background-color: gray; color: white" type="submit"><?php echo _('private key'); ?></button>
383
+                            <button class="sp_cert" id="cert_<?php echo $deploymentObject->identifier; ?>" name="showp" style="background-color: gray; color: white" type="submit"><?php echo _('certificate'); ?></button>
384
+                            <button class="ca_cert" name="showca" style="background-color: gray; color: white" type="submit"><?php echo _('CA certificate'); ?></button>
385 385
                         </td>
386 386
                 </tr>
387 387
                 <?php 
@@ -390,14 +390,14 @@  discard block
 block discarded – undo
390 390
                 <tr>
391 391
                         <td><strong><?php echo _("TLS-PSK identity"); ?></strong></td>
392 392
                         <td>
393
-                           SP_<?php echo $deploymentObject->identifier . '-' . $deploymentObject->institution;?>
393
+                           SP_<?php echo $deploymentObject->identifier.'-'.$deploymentObject->institution; ?>
394 394
                         </td>
395 395
                 </tr>
396 396
                 
397 397
                 <tr>
398 398
                         <td><strong><?php echo _("TLS-PSK key"); ?></strong></td>
399 399
                         <td>
400
-                           <?php echo $deploymentObject->pskkey;?>
400
+                           <?php echo $deploymentObject->pskkey; ?>
401 401
                         </td>
402 402
                 </tr>
403 403
                 <?php } ?>
@@ -451,12 +451,12 @@  discard block
 block discarded – undo
451 451
                             if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) {
452 452
                                 echo '<br>';
453 453
                                 if ($res['FAILURE'] == 2) {
454
-                                    echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
454
+                                    echo ' <span style="color: red;">'._("Activation failure.").'</span>';
455 455
                                 } else {
456 456
                                     if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
457
-                                        echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>';
457
+                                        echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>';
458 458
                                     } else {
459
-                                        echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>';
459
+                                        echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>';
460 460
                                     }
461 461
                                 }
462 462
                             }
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
                                 if ($res['FAILURE'] > 0) {
492 492
                                     echo '<br>';
493 493
                                     if ($res['FAILURE'] == 2) {
494
-                                        echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>';
494
+                                        echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>';
495 495
                                     } else {
496 496
                                         if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
497
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>';
497
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>';
498 498
                                         } else {
499
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>';
499
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>';
500 500
                                         }
501 501
                                     }
502 502
                                 }
@@ -517,24 +517,24 @@  discard block
 block discarded – undo
517 517
         </div>
518 518
         <div style='width:20px;'></div> <!-- QR code space, reserved -->
519 519
         <div style='display: table-cell; min-width:200px;'>
520
-            <?php $tablecaption = _("Hotspot Usage Statistics");?>
520
+            <?php $tablecaption = _("Hotspot Usage Statistics"); ?>
521 521
             <h1><?php echo $tablecaption; ?></h1>
522
-            <h2><?php echo _("5 most recent authentications");?></h2>
523
-            <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)");?></p>
522
+            <h2><?php echo _("5 most recent authentications"); ?></h2>
523
+            <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)"); ?></p>
524 524
             <table class='authrecord'>
525
-    <caption><?php echo $tablecaption;?></caption>
525
+    <caption><?php echo $tablecaption; ?></caption>
526 526
     <tr style='text-align: left;'>
527
-        <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th>
528
-        <th scope="col"><strong><?php echo _("Realm");?></strong></th>
529
-        <th scope="col"><strong><?php echo _("MAC Address");?></strong></th>
530
-        <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th>
531
-        <th scope="col"><strong><?php echo _("Result");?></strong></th>
532
-        <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th>
527
+        <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th>
528
+        <th scope="col"><strong><?php echo _("Realm"); ?></strong></th>
529
+        <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th>
530
+        <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th>
531
+        <th scope="col"><strong><?php echo _("Result"); ?></strong></th>
532
+        <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th>
533 533
     </tr>
534 534
     <?php
535
-    $userAuthData = $deploymentObject->retrieveStatistics(0,5);
535
+    $userAuthData = $deploymentObject->retrieveStatistics(0, 5);
536 536
     foreach ($userAuthData as $oneRecord) {
537
-        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>"
537
+        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>"
538 538
                 . "<td>".$oneRecord['activity_time']."</td>"
539 539
                 . "<td>".$oneRecord['realm']."</td>"
540 540
                 . "<td>".$oneRecord['mac']."</td>"
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
             }
722 722
             ?>
723 723
         </h2>
724
-        <?php if(count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?>
724
+        <?php if (count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?>
725 725
                     <form method='post' action='sort_profiles.php?inst_id=<?php echo $my_inst->identifier; ?>' accept-charset='UTF-8'>
726 726
                         <div>
727 727
                             <button type='submit' name='profile_sorting'>
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
                         <div>
791 791
                             <input type="hidden" name="consortium" value="eduroam"/>
792 792
                             <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'>
793
-                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?>
793
+                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?>
794 794
                             </button>
795 795
                             <span style='color: red;'>
796 796
                             <?php if ($hasMail == 0) { 
Please login to merge, or discard this patch.
web/admin/action_req_certificate.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     /* Messages */
92 92
     $messages = [
93 93
     'WRONG_SUBJECT' => _('Submitted Certificate Signing Request contains subject field that does not start with') . ' ' .
94
-                       $subject_prefix  . '<br>' . _("See CSR generation rules below."),
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();
@@ -171,16 +171,16 @@  discard block
 block discarded – undo
171 171
                     $ou = $serverInfo["names"][$langInstance->getLang()];
172 172
                 }
173 173
                 print($ou);
174
-		$modou = 0;
175
-		if (str_contains($ou, ',')) {
176
-		    $modou = 1;
177
-		    $ou = str_replace(",", "/,", $ou);
178
-		}
179
-		$ou = preg_replace('/\s+/', ' ',  $ou);
180
-		if (strlen($ou) >= 64) {
181
-			$ou = substr($ou, 0, 64);
182
-			$modou += 2;
183
-		}
174
+        $modou = 0;
175
+        if (str_contains($ou, ',')) {
176
+            $modou = 1;
177
+            $ou = str_replace(",", "/,", $ou);
178
+        }
179
+        $ou = preg_replace('/\s+/', ' ',  $ou);
180
+        if (strlen($ou) >= 64) {
181
+            $ou = substr($ou, 0, 64);
182
+            $modou += 2;
183
+        }
184 184
                 $DN[] = "O=".iconv('UTF-8', 'ASCII//TRANSLIT', $ou);
185 185
                 $serverList = explode(",", $serverInfo["servers"]);
186 186
                 $DN[] = "CN=" . $serverList[0];
@@ -205,20 +205,20 @@  discard block
 block discarded – undo
205 205
         echo "<p style='font-size: large'>" . _("Requesting a certificate with the following properties");
206 206
         echo "<ul>";
207 207
         echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>";
208
-	echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN);
209
-	if ($modou > 0) {
210
-	    echo " (";
208
+    echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN);
209
+    if ($modou > 0) {
210
+        echo " (";
211 211
             echo _("Organization field adjusted"). ': ';
212
-	    $desc = array();
213
-	    if ($modou >= 2) {
214
-		$desc[] = _("truncated to 64 chars");
215
-	    }
216
-	    if ($modou == 1 || $modou == 3) {
217
-		$desc[] = _("commas escaped");
212
+        $desc = array();
213
+        if ($modou >= 2) {
214
+        $desc[] = _("truncated to 64 chars");
215
+        }
216
+        if ($modou == 1 || $modou == 3) {
217
+        $desc[] = _("commas escaped");
218 218
             }
219
-	    echo implode(', ', $desc);
220
-	    echo ")";
221
-	}
219
+        echo implode(', ', $desc);
220
+        echo ")";
221
+    }
222 222
         echo "</li>";
223 223
         echo "<li>" . _("subjectAltName:DNS : ") . implode(", ", $serverList) . "</li>";
224 224
         echo "<li>" . _("Requester Contact Details: ") . $firstName . " &lt;" . $firstMail . "&gt;" . "</li>";
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
         <?php if (empty($policies)) {?>
374 374
         eduroam IdP/SP
375 375
         <?php } else {
376
-           echo implode(', ', $policies); 
376
+            echo implode(', ', $policies); 
377 377
         }?>
378 378
         </span>
379 379
         </h3>
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 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; 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $dc = array();
123 123
         if (!empty($subject_keys) && $subject_keys[0] == 'DC' && $subject['DC']) {
124 124
             foreach ($subject['DC'] as $v) {
125
-                $dc[] = 'DC=' . $v;
125
+                $dc[] = 'DC='.$v;
126 126
             }
127 127
             if ($DN !== array_reverse($dc)) {
128 128
                 $dc = array();
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
                 }
143 143
                 $fed = $validator->existingFederation($_POST['NRO-list']);
144 144
                 $country = strtoupper($fed->tld);
145
-                $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country ;
145
+                $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country;
146 146
                 $DN[] = "C=$code";
147
-                $DN[] = "O=NRO of " . iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[$country]['name']);
147
+                $DN[] = "O=NRO of ".iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[$country]['name']);
148 148
                 $serverInfo = $externalDb->listExternalTlsServersFederation($fed->tld);
149 149
                 $serverList = explode(",", array_key_first($serverInfo));
150
-                $DN[] = "CN=" . $serverList[0];
150
+                $DN[] = "CN=".$serverList[0];
151 151
                 $policies[] = "eduroam IdP";
152 152
                 $policies[] = "eduroam SP";
153 153
                 $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
             }
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
             <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option>
349 349
 <?php
350 350
 foreach ($allIdPs as $id => $name) {
351
-    echo '<option value="' . $id . '"';
351
+    echo '<option value="'.$id.'"';
352 352
     if (isset($settings['INST-list']) && $settings['INST-list'] == $id) { echo ' selected'; }
353
-    echo '>' . $name . "</option>";
353
+    echo '>'.$name."</option>";
354 354
 }
355 355
 ?>
356 356
         </select>
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
             <?php 
365 365
             echo _('According to the above settings you will receive')
366 366
             ?>
367
-            <span id='certlevel'><?php echo _('NRO level certificate');?></span>
367
+            <span id='certlevel'><?php echo _('NRO level certificate'); ?></span>
368 368
             
369 369
         for server names:
370 370
         <span id='serversinfo'><?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?></span>
@@ -380,12 +380,12 @@  discard block
 block discarded – undo
380 380
         <?php
381 381
         } else {
382 382
             echo "<div>";
383
-            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);
383
+            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);
384 384
             echo "</div>";
385 385
         }
386 386
         ?>
387 387
         <?php
388
-        echo '<div id="ondb"><h4 style="margin: 0">' . _("Can't you find an institiutin on the select list above?") . '</h4>';
388
+        echo '<div id="ondb"><h4 style="margin: 0">'._("Can't you find an institiutin on the select list above?").'</h4>';
389 389
         echo _("Most likely we do not have required data on this institution in the eduroam database.");
390 390
         echo '<br/>';
391 391
         ?>
@@ -399,10 +399,10 @@  discard block
 block discarded – undo
399 399
         <h2><?php echo _("2. CSR generation"); ?></h2>
400 400
         <p>
401 401
         <?php 
402
-        echo _("The CSR subject field has to start with ") .'<b>' . $subject_prefix . '</b><br>';
402
+        echo _("The CSR subject field has to start with ").'<b>'.$subject_prefix.'</b><br>';
403 403
         echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p>
404 404
         <?php 
405
-        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>";
405
+        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>";
406 406
         ?>
407 407
         <h2><?php echo _("3. Submission"); ?></h2>
408 408
 <?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.
core/DeploymentManaged.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -348,19 +348,19 @@
 block discarded – undo
348 348
         );
349 349
         // Generate a new private (and public) key pair
350 350
         $privkey = openssl_pkey_new(array(
351
-                                          "private_key_bits" => 4096,
352
-                                          "private_key_type" => OPENSSL_KEYTYPE_RSA));
351
+                                            "private_key_bits" => 4096,
352
+                                            "private_key_type" => OPENSSL_KEYTYPE_RSA));
353 353
         // export private key to $clientprivateKey (as string)
354 354
         openssl_pkey_export($privkey, $this->radsec_priv);
355 355
         // Generate a certificate signing request
356 356
         $csr = openssl_csr_new($dn, $privkey,
357
-                               array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"));
357
+                                array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"));
358 358
         // get CA certificate and private key
359 359
         $caprivkey = array(file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"),
360 360
                             \config\Master::MANAGEDSP['capass']);
361 361
         $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
362 362
         $clientcert = openssl_csr_sign($csr, $cacert, $caprivkey, \config\Master::MANAGEDSP['daystoexpiry'],
363
-                          array('digest_alg'=>'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), rand());
363
+                            array('digest_alg'=>'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), rand());
364 364
         openssl_x509_export($clientcert, $this->radsec_cert);
365 365
     } 
366 366
     /**
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
                 $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id;
317 317
             }
318 318
             if ($clients > $maxSupportedClients * 0.9) {
319
-                $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!");
319
+                $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!");
320 320
             }
321 321
         }
322 322
         if (count($serverCandidates) == 0 && $federation != "DEFAULT") {
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     private function createTLScredentials()
342 342
     {
343
-        $clientName = "SP_" . $this->identifier . '-' . $this->institution;
343
+        $clientName = "SP_".$this->identifier.'-'.$this->institution;
344 344
         $dn = array(
345 345
                     "organizationName" => "eduroam",
346 346
                     "organizationalUnitName" => "eduroam Managed SP",
@@ -354,13 +354,13 @@  discard block
 block discarded – undo
354 354
         openssl_pkey_export($privkey, $this->radsec_priv);
355 355
         // Generate a certificate signing request
356 356
         $csr = openssl_csr_new($dn, $privkey,
357
-                               array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"));
357
+                               array('digest_alg' => 'sha256', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf"));
358 358
         // get CA certificate and private key
359
-        $caprivkey = array(file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"),
359
+        $caprivkey = array(file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.key"),
360 360
                             \config\Master::MANAGEDSP['capass']);
361
-        $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
361
+        $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem");
362 362
         $clientcert = openssl_csr_sign($csr, $cacert, $caprivkey, \config\Master::MANAGEDSP['daystoexpiry'],
363
-                          array('digest_alg'=>'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), rand());
363
+                          array('digest_alg'=>'sha256', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf"), rand());
364 364
         openssl_x509_export($clientcert, $this->radsec_cert);
365 365
     } 
366 366
     /**
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
             $conditional1 = "AND activity_time > DATE_SUB(NOW(), INTERVAL $backlog SECOND)";
386 386
             $conditional2 = "";
387 387
         }
388
-        $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id FROM activity WHERE operatorname = ? $conditional1 ORDER BY activity_time $conditional2", "s", $opName );
388
+        $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id FROM activity WHERE operatorname = ? $conditional1 ORDER BY activity_time $conditional2", "s", $opName);
389 389
         return mysqli_fetch_all($stats, \MYSQLI_ASSOC);
390 390
     }
391 391
         
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
     {
506 506
         $customAttrib = $this->getAttributes("managedsp:operatorname");
507 507
         if (count($customAttrib) == 0) {
508
-            return "1sp." . $this->identifier . "-" . $this->institution . \config\ConfAssistant::SILVERBULLET['realm_suffix'];
508
+            return "1sp.".$this->identifier."-".$this->institution.\config\ConfAssistant::SILVERBULLET['realm_suffix'];
509 509
         }
510 510
         return $customAttrib[0]["value"];
511 511
     }
@@ -520,13 +520,13 @@  discard block
 block discarded – undo
520 520
     private function sendToRADIUS(int $idx, $post)
521 521
     {
522 522
         $hostname = "radius_hostname_$idx";
523
-        $ch = curl_init("http://" . $this->$hostname . ':8080');
523
+        $ch = curl_init("http://".$this->$hostname.':8080');
524 524
         if ($ch === FALSE) {
525 525
             $res = 'FAILURE';
526 526
         } else {
527 527
             curl_setopt($ch, CURLOPT_POST, 1);
528 528
             curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
529
-            $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ":8080/$post\n");
529
+            $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.":8080/$post\n");
530 530
             curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
531 531
             curl_setopt($ch, CURLOPT_HEADER, 0);
532 532
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@@ -565,19 +565,19 @@  discard block
 block discarded – undo
565 565
         } else {
566 566
             $txt = $remove ? _('Profile deactivation failed') : _('Profile activation/modification failed');
567 567
         }
568
-        $txt = $txt . ' ';
568
+        $txt = $txt.' ';
569 569
         if (array_count_values($response)[$status] == 2) {
570
-            $txt = $txt . _('on both RADIUS servers: primary and backup') . '.';
570
+            $txt = $txt._('on both RADIUS servers: primary and backup').'.';
571 571
         } else {
572 572
             if ($response['res[1]'] == $status) {
573
-                $txt = $txt . _('on primary RADIUS server') . '.';
573
+                $txt = $txt._('on primary RADIUS server').'.';
574 574
             } else {
575
-                $txt = $txt . _('on backup RADIUS server') . '.';
575
+                $txt = $txt._('on backup RADIUS server').'.';
576 576
             }
577 577
         }
578 578
         $mail = \core\common\OutsideComm::mailHandle();
579 579
         $email = $this->getAttributes("support:email")[0]['value'];
580
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System";
580
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System";
581 581
         $mail->addAddress($email);
582 582
         if ($status == 'OK') {
583 583
             $mail->Subject = _('RADIUS profile update problem fixed');
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
             return NULL;
612 612
         }
613 613
         $timeout = 10;
614
-        curl_setopt($ch, CURLOPT_URL, 'http://' . $host);
614
+        curl_setopt($ch, CURLOPT_URL, 'http://'.$host);
615 615
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
616 616
         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
617 617
         curl_exec($ch);
@@ -703,41 +703,41 @@  discard block
 block discarded – undo
703 703
     {
704 704
         $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1;
705 705
         $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => ''));
706
-        $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . 
707
-                '&secret=' . $this->secret .
708
-                '&country=' . $this->getAttributes("internal:country")[0]['value'] .
709
-                '&pskkey=' . $this->pskkey . '&';
706
+        $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier. 
707
+                '&secret='.$this->secret.
708
+                '&country='.$this->getAttributes("internal:country")[0]['value'].
709
+                '&pskkey='.$this->pskkey.'&';
710 710
         if ($remove) {
711
-            $toPostTemplate = $toPostTemplate . 'remove=1&';
711
+            $toPostTemplate = $toPostTemplate.'remove=1&';
712 712
         } else {
713
-            $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getOperatorName() . '&'; 
713
+            $toPostTemplate = $toPostTemplate.'operatorname='.$this->getOperatorName().'&'; 
714 714
             if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) {
715 715
                 $allRealms = $this->getAllRealms();
716 716
                 if (!empty($allRealms)) {
717
-                    $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&';
718
-                    $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&';
717
+                    $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&';
718
+                    $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&';
719 719
                 }
720 720
             }
721 721
         }
722 722
         foreach (array_keys($toPost) as $key) {
723
-            $elem = 'port' . $key;
724
-            $toPost[$key] = $toPostTemplate . 'port=' . $this->$elem;
723
+            $elem = 'port'.$key;
724
+            $toPost[$key] = $toPostTemplate.'port='.$this->$elem;
725 725
         }
726 726
         $response = array();
727 727
         foreach ($toPost as $key => $value) {
728
-            $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n");
728
+            $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n");
729 729
             // temporarly one server $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]);
730 730
             if ($key == 2) {
731 731
                 $response['res[2]'] = 'OK'; 
732 732
             } else {
733
-                $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]);
733
+                $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]);
734 734
             }
735 735
         }
736 736
         if ($onlyone) {
737
-            $response['res[' . ($onlyone == 1) ? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK;
737
+            $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK;
738 738
         }
739 739
         foreach (array('OK', 'FAILURE') as $status) {
740
-            if ( ( ($status == 'OK' && $notify) || ($status == 'FAILURE') ) && ( in_array($status, $response) ) ) {
740
+            if ((($status == 'OK' && $notify) || ($status == 'FAILURE')) && (in_array($status, $response))) {
741 741
                 $this->sendMailtoAdmin($remove, $response, $status);
742 742
             }
743 743
         }
Please login to merge, or discard this patch.
core/ExternalEduroamDBData.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             return $this->counter;
127 127
         }
128 128
 
129
-        $cachedNumber = @file_get_contents(ROOT . "/var/tmp/cachedSPNumber.serialised");
129
+        $cachedNumber = @file_get_contents(ROOT."/var/tmp/cachedSPNumber.serialised");
130 130
         if ($cachedNumber !== FALSE) {
131 131
             $numberData = unserialize($cachedNumber);
132 132
             $now = new \DateTime();
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         } else { // data in cache is too old or doesn't exist. We really need to ask the database
140 140
             $list = $this->listAllServiceProviders();
141 141
             $this->counter = count($list);
142
-            file_put_contents(ROOT . "/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()]));
142
+            file_put_contents(ROOT."/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()]));
143 143
             return $this->counter;
144 144
         }
145 145
     }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         $returnarray = [];
189 189
         $query = "SELECT id_institution AS id, country, inst_realm as realmlist, name AS collapsed_name, contact AS collapsed_contact, type FROM view_active_institution WHERE country = ?";
190 190
         if ($eduroamDbType !== NULL) {
191
-            $query .= " AND ( type = '" . ExternalEduroamDBData::TYPE_IDPSP . "' OR type = '" . $eduroamDbType . "')";
191
+            $query .= " AND ( type = '".ExternalEduroamDBData::TYPE_IDPSP."' OR type = '".$eduroamDbType."')";
192 192
         }
193 193
         $externals = $this->db->exec($query, "s", $tld);
194 194
         // was a SELECT query, so a resource and not a boolean
@@ -284,19 +284,19 @@  discard block
 block discarded – undo
284 284
      * 
285 285
      * @return array
286 286
      */
287
-    public function listExternalTlsServersInstitution($tld, $include_not_ready=FALSE) {
287
+    public function listExternalTlsServersInstitution($tld, $include_not_ready = FALSE) {
288 288
         $retval = [];
289 289
         // this includes servers of type "staging", which is fine
290 290
         $query = "SELECT ROid, instid, type, inst_name, servers, contacts, ts FROM eduroamv2.view_tls_inst WHERE country = ?";
291 291
         if (!$include_not_ready) {
292
-            $query = $query . " AND servers IS NOT NULL AND contacts IS NOT NULL";
292
+            $query = $query." AND servers IS NOT NULL AND contacts IS NOT NULL";
293 293
         }
294 294
         $instServerTransaction = $this->db->exec($query, "s", $tld);
295 295
         while ($instServerResponses = mysqli_fetch_object(/** @scrutinizer ignore-type */ $instServerTransaction)) {
296 296
             $contactList = $this::dissectCollapsedContacts($instServerResponses->contacts);
297 297
             $names = $this->splitNames($instServerResponses->inst_name);
298 298
             $thelanguage = $names[$this->languageInstance->getLang()] ?? $names["en"] ?? array_shift($names);
299
-            $retval[$instServerResponses->ROid . "-". $instServerResponses->instid] = [
299
+            $retval[$instServerResponses->ROid."-".$instServerResponses->instid] = [
300 300
                 "names" => $names,
301 301
                 "name" => $thelanguage,
302 302
                 "type" => array_search($instServerResponses->type, self::TYPE_MAPPING),
Please login to merge, or discard this patch.
core/AbstractProfile.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
                     // for now (no OpenRoaming client certs available) only run server-side tests
333 333
                     foreach ($listOfIPs as $oneIP) {
334 334
                         $connectionResult = $connectionTests->cApathCheck($oneIP);
335
-                        if ($connectionResult != \core\diag\AbstractTest::RETVAL_OK || ( isset($connectionTests->TLS_CA_checks_result['cert_oddity']) && count($connectionTests->TLS_CA_checks_result['cert_oddity']) > 0)) {
335
+                        if ($connectionResult != \core\diag\AbstractTest::RETVAL_OK || (isset($connectionTests->TLS_CA_checks_result['cert_oddity']) && count($connectionTests->TLS_CA_checks_result['cert_oddity']) > 0)) {
336 336
                             $allHostsOkay = FALSE;
337 337
                         } else {
338 338
                             $oneHostOkay = TRUE;
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
             // which is different from the outer username we put into installers
487 487
             return $this->getAttributes("internal:checkuser_value")[0]['value']."@".$realm;
488 488
         }
489
-        if (count($this->getAttributes("internal:use_anon_outer")) > 0 && $this->getAttributes("internal:anon_local_value")[0]['value'] != NULL ) {
489
+        if (count($this->getAttributes("internal:use_anon_outer")) > 0 && $this->getAttributes("internal:anon_local_value")[0]['value'] != NULL) {
490 490
             // no special check username, but there is an anon outer ID for
491 491
             // installers - so let's use that one
492 492
             return $this->getAttributes("internal:anon_local_value")[0]['value']."@".$realm;
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
         }
643 643
 
644 644
         $monthlyList = [];
645
-        $monthly = $this->frontendHandle->exec("SELECT downloads_user,device_id FROM downloads_history WHERE profile_id=? AND stat_date=DATE_FORMAT(NOW(),'%Y-%m-01')", "i",  $this->identifier);
645
+        $monthly = $this->frontendHandle->exec("SELECT downloads_user,device_id FROM downloads_history WHERE profile_id=? AND stat_date=DATE_FORMAT(NOW(),'%Y-%m-01')", "i", $this->identifier);
646 646
         while ($statsQuery = mysqli_fetch_object(/** @scrutinizer ignore-type */ $monthly)) {
647 647
             $monthlyList[$statsQuery->device_id] = $statsQuery->downloads_user;
648 648
         }
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
         }        
655 655
         
656 656
         \core\common\Entity::intoThePotatoes();
657
-        ksort($finalarray, SORT_STRING|SORT_FLAG_CASE);
657
+        ksort($finalarray, SORT_STRING | SORT_FLAG_CASE);
658 658
         \core\common\Entity::outOfThePotatoes();
659 659
         return $finalarray;
660 660
     }
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
         $profileStatus = self::CERT_STATUS_NONE;
965 965
         foreach ($rows as $row) {
966 966
             $encodedCert = $row[0];
967
-            $tm = $x509->processCertificate(base64_decode($encodedCert))['full_details']['validTo_time_t']- time();
967
+            $tm = $x509->processCertificate(base64_decode($encodedCert))['full_details']['validTo_time_t'] - time();
968 968
             if ($tm < \config\ConfAssistant::CERT_WARNINGS['expiry_critical']) {
969 969
                 $certStatus = self::CERT_STATUS_ERROR;
970 970
             } elseif ($tm < \config\ConfAssistant::CERT_WARNINGS['expiry_warning']) {
Please login to merge, or discard this patch.