Passed
Push — release_2_1 ( 7e203f...634679 )
by Tomasz
10:41 queued 14s
created
web/admin/action_req_certificate.php 1 patch
Spacing   +23 added lines, -23 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();
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
                 $fed = $validator->existingFederation($_POST['NRO-list']);
106 106
                 $country = strtoupper($fed->tld);
107 107
                 $DN[] = "C=$country";
108
-                $DN[] = "O=NRO of " . iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[strtoupper($fed->tld)]);
108
+                $DN[] = "O=NRO of ".iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[strtoupper($fed->tld)]);
109 109
                 $serverInfo = $externalDb->listExternalTlsServersFederation($fed->tld);
110 110
                 $serverList = explode(",", array_key_first($serverInfo));
111
-                $DN[] = "CN=" . $serverList[0];
111
+                $DN[] = "CN=".$serverList[0];
112 112
                 $policies[] = "eduroam IdP";
113 113
                 $policies[] = "eduroam SP";
114 114
                 $firstName = $serverInfo[array_key_first($serverInfo)][0]["name"];
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                 }
133 133
                 $DN[] = "O=".iconv('UTF-8', 'ASCII//TRANSLIT', $ou);
134 134
                 $serverList = explode(",", $serverInfo["servers"]);
135
-                $DN[] = "CN=" . $serverList[0];
135
+                $DN[] = "CN=".$serverList[0];
136 136
                 switch ($serverInfo["type"]) {
137 137
                     case core\IdP::TYPE_IDPSP:
138 138
                         $policies[] = "eduroam IdP";
@@ -152,12 +152,12 @@  discard block
 block discarded – undo
152 152
             default:
153 153
                 throw new Exception("Sorry: Unknown level of issuance requested.");
154 154
         }
155
-        echo "<p style='font-size: large'>" . _("Requesting a certificate with the following properties");
155
+        echo "<p style='font-size: large'>"._("Requesting a certificate with the following properties");
156 156
         echo "<ul>";
157
-        echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>";
158
-        echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN) . "</li>";
159
-        echo "<li>" . _("subjectAltName:DNS : ") . implode(", ", $serverList) . "</li>";
160
-        echo "<li>" . _("Requester Contact Details: ") . $firstName . " &lt;" . $firstMail . "&gt;" . "</li>";
157
+        echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>";
158
+        echo "<li>"._("Distinguished Name: ").implode(", ", $DN)."</li>";
159
+        echo "<li>"._("subjectAltName:DNS : ").implode(", ", $serverList)."</li>";
160
+        echo "<li>"._("Requester Contact Details: ").$firstName." &lt;".$firstMail."&gt;"."</li>";
161 161
         echo "</ul></p>";
162 162
 
163 163
         $vettedCsr = $validator->string($_POST['CSR'], true);
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         $loggerInstance->debug(2, $DN, "CERT DN: ", "\n");
174 174
         // our certs can be good for max 5 years
175 175
         $fed->requestCertificate($user->identifier, $newCsrWithMeta, $expiryDays);
176
-        echo "<p>" . _("The certificate was requested.") . "</p>";
176
+        echo "<p>"._("The certificate was requested.")."</p>";
177 177
         ?>
178 178
         <form action="overview_certificates.php" method="GET">
179 179
             <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button>
@@ -191,23 +191,23 @@  discard block
 block discarded – undo
191 191
         switch (count($feds)) {
192 192
             case 0:
193 193
                 echo "<div>";
194
-                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."));
194
+                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."));
195 195
                 echo "</div>";
196 196
                 break;
197 197
             case 1:
198
-                echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>';
199
-                echo " <strong>" . $cat->knownFederations[$feds[0]->tld] . "</strong>";
200
-                echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $feds[0]->tld . '"/>';
198
+                echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>';
199
+                echo " <strong>".$cat->knownFederations[$feds[0]->tld]."</strong>";
200
+                echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$feds[0]->tld.'"/>';
201 201
                 break;
202 202
             default:
203
-                echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>';
203
+                echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>';
204 204
                 ?>
205 205
                 <select name="NRO-list" id="NRO-list">
206 206
                     <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option>
207 207
                     <?php
208 208
                     foreach ($feds as $oneFed) {
209 209
                         #echo '<option value="' . strtoupper($oneFed->tld) . '">' . $cat->knownFederations[$oneFed->tld] . "</option>";
210
-                        echo '<option value="AAA' . strtoupper($oneFed->tld) . '">' . $oneIdP["names"][$langObject->getLang()] . "</option>";
210
+                        echo '<option value="AAA'.strtoupper($oneFed->tld).'">'.$oneIdP["names"][$langObject->getLang()]."</option>";
211 211
                         
212 212
                     }
213 213
                     ?>
@@ -218,13 +218,13 @@  discard block
 block discarded – undo
218 218
         ?>
219 219
         <script>
220 220
             var instservers = [];
221
-            var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo));?>';
221
+            var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?>';
222 222
         <?php   
223 223
         $allIdPs = [];
224 224
         foreach ($allAuthorizedFeds as $oneFed) {
225 225
             foreach ($externalDb->listExternalTlsServersInstitution($oneFed['value']) as $id => $oneIdP) {
226
-                $allIdPs[$id] = '[' . substr($id, 0, 2) . '] ' . $oneIdP["names"][$langObject->getLang()];
227
-                echo "instservers['" . $id . "']='" . str_replace(",", ", ", $oneIdP["servers"]) . "';\n";
226
+                $allIdPs[$id] = '['.substr($id, 0, 2).'] '.$oneIdP["names"][$langObject->getLang()];
227
+                echo "instservers['".$id."']='".str_replace(",", ", ", $oneIdP["servers"])."';\n";
228 228
             }
229 229
         }
230 230
         ?>
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
             <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option>
253 253
 <?php
254 254
 foreach ($allIdPs as $id => $name) {
255
-    echo '<option value="' . $id . '">' . $name . "</option>";
255
+    echo '<option value="'.$id.'">'.$name."</option>";
256 256
 }
257 257
 ?>
258 258
         </select>
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
             <?php 
262 262
             echo _('According to the above settings you will receive')
263 263
             ?>
264
-            <span id='certlevel'><?php echo _('NRO level certificate');?></span>
264
+            <span id='certlevel'><?php echo _('NRO level certificate'); ?></span>
265 265
             
266 266
         </span>for server names:
267 267
         <span id='serversinfo'><?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?></span>
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         <?php
270 270
         } else {
271 271
             echo "<div>";
272
-            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);
272
+            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);
273 273
             echo "</div>";
274 274
         }
275 275
         ?>
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
         <h2><?php echo _("2. CSR generation"); ?></h2>
280 280
         <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p>
281 281
         <?php 
282
-        echo "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";
282
+        echo "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";
283 283
         ?>
284 284
         <h2><?php echo _("3. Submission"); ?></h2>
285 285
 <?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.