Test Failed
Push — release_2_1 ( adef88...954e67 )
by Stefan
09:51
created
web/admin/action_req_certificate.php 1 patch
Spacing   +17 added lines, -17 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();
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     // also send user back to the overview page
73 73
     if (isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) {
74 74
         // basic sanity checks before we hand this over to openssl
75
-        $sanitisedCsr = $validator->string($_POST['CSR'] ?? "" , TRUE);
75
+        $sanitisedCsr = $validator->string($_POST['CSR'] ?? "", TRUE);
76 76
         if (openssl_csr_get_public_key($sanitisedCsr) === FALSE) {
77 77
             throw new Exception("Sorry: Unable to parse the submitted public key - no public key inside?");
78 78
         }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 $fed = $validator->existingFederation($_POST['NRO-list']);
87 87
                 $country = strtoupper($fed->tld);
88 88
                 $DN[] = "C=$country";
89
-                $DN[] = "O=NRO of " . $cat->knownFederations[strtoupper($fed->tld)];
89
+                $DN[] = "O=NRO of ".$cat->knownFederations[strtoupper($fed->tld)];
90 90
                 $DN[] = "CN=comes.from.eduroam.db";
91 91
                 $policies[] = "eduroam IdP";
92 92
                 $policies[] = "eduroam SP";
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
             default:
105 105
                 throw new Exception("Sorry: Unknown level of issuance requested.");
106 106
         }
107
-        echo "<p>" . _("Requesting a certificate with the following properties");
107
+        echo "<p>"._("Requesting a certificate with the following properties");
108 108
         echo "<ul>";
109
-        echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>";
110
-        echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN) . "</li>";
111
-        echo "<li>" . _("Requester Contact Details: will come from eduroam DB (using stub 'Someone, &lt;[email protected]&gt;').") . "</li>";
109
+        echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>";
110
+        echo "<li>"._("Distinguished Name: ").implode(", ", $DN)."</li>";
111
+        echo "<li>"._("Requester Contact Details: will come from eduroam DB (using stub 'Someone, &lt;[email protected]&gt;').")."</li>";
112 112
         echo "</ul></p>";
113 113
         /* $ossl = proc_open("openssl req -subj '/".implode("/", $DN)."'", [ 0 => ["pipe", "r"], 1 => ["pipe", "w"], 2 => [ "file", "/tmp/voodoo-error", "a"] ], $pipes);
114 114
         if (is_resource($ossl)) {
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
         }
123 123
         echo "<p>"._("This is the new CSR (return code was $retval)")."<pre>$newCsr</pre></p>"; */
124 124
         $vettedCsr = $validator->string($_POST['CSR'], true);
125
-        $newCsrWithMeta = ["CSR" => /* $newCsr */ $vettedCsr, "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN) ,"FED" => $country];
125
+        $newCsrWithMeta = ["CSR" => /* $newCsr */ $vettedCsr, "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN), "FED" => $country];
126 126
         // our certs can be good for max 5 years
127 127
         $fed->requestCertificate($newCsrWithMeta, 1825);
128 128
         echo "<p>"._("The certificate was requested.")."</p>";
129 129
         ?>
130 130
         <form action="overview_certificates.php" method="GET">
131
-            <button type="submit"><?php echo _("Back to Certificate Overview");?></button>
131
+            <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button>
132 132
         </form>
133 133
     <?php
134 134
     echo $deco->footer();
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
 
138 138
     // if we did not get a SAVE button, display UI for a fresh request instead
139 139
     ?>
140
-    <h2><?php echo _("1. Certificate Holder Details");?></h2>
140
+    <h2><?php echo _("1. Certificate Holder Details"); ?></h2>
141 141
     <form action="action_req_certificate.php" method="POST">
142 142
         <input type="radio" name="LEVEL" id="NRO" value="NRO" checked><?php printf(_("Certificate for %s role"), $uiElements->nomenclatureFed); ?></input>
143 143
         <?php
144 144
         if (count($feds) == 1) {
145 145
             $fedObject = new \core\Federation($feds[0]['value']);
146
-            echo " <strong>" . $cat->knownFederations[$fedObject->tld] . "</strong>";
147
-            echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $fedObject->tld . '"/>';
146
+            echo " <strong>".$cat->knownFederations[$fedObject->tld]."</strong>";
147
+            echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$fedObject->tld.'"/>';
148 148
         } else {
149 149
             ?>
150 150
             <select name="NRO-list" id="NRO-list">
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                 <?php
153 153
                 foreach ($feds as $oneFed) {
154 154
                     $fedObject = new \core\Federation($oneFed['value']);
155
-                    echo '<option value="' . strtoupper($fedObject->tld) . '">' . $cat->knownFederations[$fedObject->tld] . "</option>";
155
+                    echo '<option value="'.strtoupper($fedObject->tld).'">'.$cat->knownFederations[$fedObject->tld]."</option>";
156 156
                 }
157 157
                 ?>
158 158
             </select>
@@ -172,15 +172,15 @@  discard block
 block discarded – undo
172 172
                 }
173 173
             }
174 174
             foreach ($allIdPs as $id => $name) {
175
-                echo '<option value="' . $id . '">' . $name . "</option>";
175
+                echo '<option value="'.$id.'">'.$name."</option>";
176 176
             }
177 177
             ?>
178 178
         </select>
179 179
         <br/>
180
-        <h2><?php echo _("2. CSR generation");?></h2>
181
-        <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:");?></p>
180
+        <h2><?php echo _("2. CSR generation"); ?></h2>
181
+        <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p>
182 182
         <p>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /DC=test/DC=test/DC=eduroam/C=XY/O=WillBeReplaced/CN=will.be.replaced</p>
183
-        <h2><?php echo _("3. Submission");?></h2>
183
+        <h2><?php echo _("3. Submission"); ?></h2>
184 184
         <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/>
185 185
     <button type="submit" name="requestcert" id="requestcert" value="<?php echo \web\lib\common\FormElements::BUTTON_SAVE ?>"><?php echo _("Send request"); ?></button>
186 186
 </form>
Please login to merge, or discard this patch.