|  | @@ -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 |  $auth = new \web\lib\admin\Authentication(); | 
                                                                                                            
                                                            | 31 | 31 |  $deco = new \web\lib\admin\PageDecoration(); | 
                                                                                                            
                                                            | 32 | 32 |  $validator = new \web\lib\common\InputValidation(); | 
                                                                                                                                                        
                                                        |  | @@ -103,10 +103,10 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 103 | 103 |                  $fed = $validator->existingFederation($_POST['NRO-list']); | 
                                                                                                            
                                                            | 104 | 104 |                  $country = strtoupper($fed->tld); | 
                                                                                                            
                                                            | 105 | 105 |                  $DN[] = "C=$country"; | 
                                                                                                            
                                                            | 106 |  | -                $DN[] = "O=NRO of " . $cat->knownFederations[strtoupper($fed->tld)]; | 
                                                                                                            
                                                            |  | 106 | +                $DN[] = "O=NRO of ".$cat->knownFederations[strtoupper($fed->tld)]; | 
                                                                                                            
                                                            | 107 | 107 |                  $serverInfo = $externalDb->listExternalTlsServersFederation($fed->tld); | 
                                                                                                            
                                                            | 108 | 108 |                  $serverList = explode(",", array_key_first($serverInfo)); | 
                                                                                                            
                                                            | 109 |  | -                $DN[] = "CN=" . $serverList[0]; | 
                                                                                                            
                                                            |  | 109 | +                $DN[] = "CN=".$serverList[0]; | 
                                                                                                            
                                                            | 110 | 110 |                  $policies[] = "eduroam IdP"; | 
                                                                                                            
                                                            | 111 | 111 |                  $policies[] = "eduroam SP"; | 
                                                                                                            
                                                            | 112 | 112 |                  $firstName = $serverInfo[array_key_first($serverInfo)][0]["name"]; | 
                                                                                                                                                        
                                                        |  | @@ -130,7 +130,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 130 | 130 |                  } | 
                                                                                                            
                                                            | 131 | 131 |                  $DN[] = "O=$ou"; | 
                                                                                                            
                                                            | 132 | 132 |                  $serverList = explode(",", $serverInfo["servers"]); | 
                                                                                                            
                                                            | 133 |  | -                $DN[] = "CN=" . $serverList[0]; | 
                                                                                                            
                                                            |  | 133 | +                $DN[] = "CN=".$serverList[0]; | 
                                                                                                            
                                                            | 134 | 134 |                  switch ($serverInfo["type"]) { | 
                                                                                                            
                                                            | 135 | 135 |                      case core\IdP::TYPE_IDPSP: | 
                                                                                                            
                                                            | 136 | 136 |                          $policies[] = "eduroam IdP"; | 
                                                                                                                                                        
                                                        |  | @@ -150,12 +150,12 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 150 | 150 |              default: | 
                                                                                                            
                                                            | 151 | 151 |                  throw new Exception("Sorry: Unknown level of issuance requested."); | 
                                                                                                            
                                                            | 152 | 152 |          } | 
                                                                                                            
                                                            | 153 |  | -        echo "<p style='font-size: large'>" . _("Requesting a certificate with the following properties"); | 
                                                                                                            
                                                            |  | 153 | +        echo "<p style='font-size: large'>"._("Requesting a certificate with the following properties"); | 
                                                                                                            
                                                            | 154 | 154 |          echo "<ul>"; | 
                                                                                                            
                                                            | 155 |  | -        echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>"; | 
                                                                                                            
                                                            | 156 |  | -        echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN) . "</li>"; | 
                                                                                                            
                                                            | 157 |  | -        echo "<li>" . _("subjectAltName:DNS : ") . implode(", ", $serverList) . "</li>"; | 
                                                                                                            
                                                            | 158 |  | -        echo "<li>" . _("Requester Contact Details: ") . $firstName . " <" . $firstMail . ">" . "</li>"; | 
                                                                                                            
                                                            |  | 155 | +        echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>"; | 
                                                                                                            
                                                            |  | 156 | +        echo "<li>"._("Distinguished Name: ").implode(", ", $DN)."</li>"; | 
                                                                                                            
                                                            |  | 157 | +        echo "<li>"._("subjectAltName:DNS : ").implode(", ", $serverList)."</li>"; | 
                                                                                                            
                                                            |  | 158 | +        echo "<li>"._("Requester Contact Details: ").$firstName." <".$firstMail.">"."</li>"; | 
                                                                                                            
                                                            | 159 | 159 |          echo "</ul></p>"; | 
                                                                                                            
                                                            | 160 | 160 |   | 
                                                                                                            
                                                            | 161 | 161 |          $vettedCsr = $validator->string($_POST['CSR'], true); | 
                                                                                                                                                        
                                                        |  | @@ -169,7 +169,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 169 | 169 |              "FED" => $country]; | 
                                                                                                            
                                                            | 170 | 170 |          // our certs can be good for max 5 years | 
                                                                                                            
                                                            | 171 | 171 |          $fed->requestCertificate($user->identifier, $newCsrWithMeta, 1825); | 
                                                                                                            
                                                            | 172 |  | -        echo "<p>" . _("The certificate was requested.") . "</p>"; | 
                                                                                                            
                                                            |  | 172 | +        echo "<p>"._("The certificate was requested.")."</p>"; | 
                                                                                                            
                                                            | 173 | 173 |          ?> | 
                                                                                                            
                                                            | 174 | 174 |          <form action="overview_certificates.php" method="GET"> | 
                                                                                                            
                                                            | 175 | 175 |              <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button> | 
                                                                                                                                                        
                                                        |  | @@ -187,23 +187,23 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 187 | 187 |          switch (count($feds)) { | 
                                                                                                            
                                                            | 188 | 188 |              case 0: | 
                                                                                                            
                                                            | 189 | 189 |                  echo "<div>"; | 
                                                                                                            
                                                            | 190 |  | -                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.")); | 
                                                                                                            
                                                            |  | 190 | +                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.")); | 
                                                                                                            
                                                            | 191 | 191 |                  echo "</div>"; | 
                                                                                                            
                                                            | 192 | 192 |                  break; | 
                                                                                                            
                                                            | 193 | 193 |              case 1: | 
                                                                                                            
                                                            | 194 |  | -                echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>'; | 
                                                                                                            
                                                            | 195 |  | -                echo " <strong>" . $cat->knownFederations[$feds[0]->tld] . "</strong>"; | 
                                                                                                            
                                                            | 196 |  | -                echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $feds[0]->tld . '"/>'; | 
                                                                                                            
                                                            |  | 194 | +                echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>'; | 
                                                                                                            
                                                            |  | 195 | +                echo " <strong>".$cat->knownFederations[$feds[0]->tld]."</strong>"; | 
                                                                                                            
                                                            |  | 196 | +                echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$feds[0]->tld.'"/>'; | 
                                                                                                            
                                                            | 197 | 197 |                  break; | 
                                                                                                            
                                                            | 198 | 198 |              default: | 
                                                                                                            
                                                            | 199 |  | -                echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>'; | 
                                                                                                            
                                                            |  | 199 | +                echo '<input type="radio" name="LEVEL" id="NRO" value="NRO" checked>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>'; | 
                                                                                                            
                                                            | 200 | 200 |                  ?> | 
                                                                                                            
                                                            | 201 | 201 |                  <select name="NRO-list" id="NRO-list"> | 
                                                                                                            
                                                            | 202 | 202 |                      <option value="notset"><?php echo _("---PPPLEASE CHOOSE---"); ?></option> | 
                                                                                                            
                                                            | 203 | 203 |                      <?php | 
                                                                                                            
                                                            | 204 | 204 |                      foreach ($feds as $oneFed) { | 
                                                                                                            
                                                            | 205 | 205 |                          #echo '<option value="' . strtoupper($oneFed->tld) . '">' . $cat->knownFederations[$oneFed->tld] . "</option>"; | 
                                                                                                            
                                                            | 206 |  | -                        echo '<option value="AAA' . strtoupper($oneFed->tld) . '">' . $oneIdP["names"][$langObject->getLang()] . "</option>"; | 
                                                                                                            
                                                            |  | 206 | +                        echo '<option value="AAA'.strtoupper($oneFed->tld).'">'.$oneIdP["names"][$langObject->getLang()]."</option>"; | 
                                                                                                            
                                                            | 207 | 207 |                           | 
                                                                                                            
                                                            | 208 | 208 |                      } | 
                                                                                                            
                                                            | 209 | 209 |                      ?> | 
                                                                                                                                                        
                                                        |  | @@ -213,7 +213,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 213 | 213 |          $allIdPs = []; | 
                                                                                                            
                                                            | 214 | 214 |          foreach ($allAuthorizedFeds as $oneFed) { | 
                                                                                                            
                                                            | 215 | 215 |              foreach ($externalDb->listExternalTlsServersInstitution($oneFed['value']) as $id => $oneIdP) { | 
                                                                                                            
                                                            | 216 |  | -                $allIdPs[$id] = '[' . substr($id, 0, 2) . '] ' . $oneIdP["names"][$langObject->getLang()]; | 
                                                                                                            
                                                            |  | 216 | +                $allIdPs[$id] = '['.substr($id, 0, 2).'] '.$oneIdP["names"][$langObject->getLang()]; | 
                                                                                                            
                                                            | 217 | 217 |              } | 
                                                                                                            
                                                            | 218 | 218 |          } | 
                                                                                                            
                                                            | 219 | 219 |          if (count($allIdPs) > 0) { | 
                                                                                                                                                        
                                                        |  | @@ -224,14 +224,14 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 224 | 224 |              <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option> | 
                                                                                                            
                                                            | 225 | 225 |  <?php | 
                                                                                                            
                                                            | 226 | 226 |  foreach ($allIdPs as $id => $name) { | 
                                                                                                            
                                                            | 227 |  | -    echo '<option value="' . $id . '">' . $name . "</option>"; | 
                                                                                                            
                                                            |  | 227 | +    echo '<option value="'.$id.'">'.$name."</option>"; | 
                                                                                                            
                                                            | 228 | 228 |  } | 
                                                                                                            
                                                            | 229 | 229 |  ?> | 
                                                                                                            
                                                            | 230 | 230 |          </select> | 
                                                                                                            
                                                            | 231 | 231 |          <?php | 
                                                                                                            
                                                            | 232 | 232 |          } else { | 
                                                                                                            
                                                            | 233 | 233 |              echo "<div>"; | 
                                                                                                            
                                                            | 234 |  | -            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); | 
                                                                                                            
                                                            |  | 234 | +            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); | 
                                                                                                            
                                                            | 235 | 235 |              echo "</div>"; | 
                                                                                                            
                                                            | 236 | 236 |          } | 
                                                                                                            
                                                            | 237 | 237 |          ?> | 
                                                                                                                                                        
                                                        |  | @@ -241,7 +241,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 241 | 241 |          <h2><?php echo _("2. CSR generation"); ?></h2> | 
                                                                                                            
                                                            | 242 | 242 |          <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p> | 
                                                                                                            
                                                            | 243 | 243 |          <?php  | 
                                                                                                            
                                                            | 244 |  | -        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"; | 
                                                                                                            
                                                            |  | 244 | +        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"; | 
                                                                                                            
                                                            | 245 | 245 |          ?> | 
                                                                                                            
                                                            | 246 | 246 |          <h2><?php echo _("3. Submission"); ?></h2> | 
                                                                                                            
                                                            | 247 | 247 |  <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/> |