Test Failed
Pull Request — master (#325)
by Dimitri
43:06 queued 24:12
created
web/admin/overview_org.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
  */
29 29
 ?>
30 30
 <?php
31
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
31
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
32 32
 
33 33
 function displaySilverbulletPropertyWidget(&$theProfile, $readonly, &$uiElements) {
34 34
     ?>
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
                 <ul style='margin:1px'>
46 46
                     <?php
47 47
                     foreach ($completeness as $missing_attrib) {
48
-                        echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
48
+                        echo "<li>".$uiElements->displayName($missing_attrib)."</li>";
49 49
                     }
50 50
                     ?>
51 51
                 </ul>
52 52
             </div>
53 53
             <?php
54 54
         } else {
55
-            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
+            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);
56 56
         }
57 57
         ?>
58 58
         <br/>
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         if ($readonly === FALSE) {
62 62
             ?>
63 63
             <form action='edit_silverbullet.php?inst_id=<?php echo $theProfile->institution; ?>&amp;profile_id=<?php echo $theProfile->identifier; ?>' method='POST'>
64
-                <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
64
+                <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
65 65
             </form>
66 66
             <?php
67 67
         }
@@ -97,21 +97,21 @@  discard block
 block discarded – undo
97 97
                 $has_overrides = TRUE;
98 98
             }
99 99
         }
100
-        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>";
100
+        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>";
101 101
         $typelist = $theProfile->getEapMethodsinOrderOfPreference();
102 102
         $allcomplete = TRUE;
103 103
         foreach ($typelist as $eaptype) {
104 104
             $buffer_eaptypediv .= $eaptype->getPrintableRep();
105 105
             $completeness = $theProfile->isEapTypeDefinitionComplete($eaptype);
106 106
             if ($completeness === true) {
107
-                $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>";
107
+                $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>";
108 108
             } else {
109 109
                 $buffer_eaptypediv .= " <div class='notacceptable'>";
110 110
                 $buffer_eaptypediv .= _("Information needed!");
111 111
                 if (is_array($completeness)) {
112 112
                     $buffer_eaptypediv .= "<ul style='margin:1px'>";
113 113
                     foreach ($completeness as $missing_attrib) {
114
-                        $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
114
+                        $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>";
115 115
                     }
116 116
                     $buffer_eaptypediv .= "</ul>";
117 117
                 }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             foreach ($attribs as $attrib) {
124 124
                 if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) {
125 125
                     $justOnce = TRUE;
126
-                    $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
+                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='"._("Options on EAP Method/Device level are in effect.")."'>";
127 127
                 }
128 128
             }
129 129
             $buffer_eaptypediv .= "<br/>";
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         if ($theProfile->isRedirected()) {
150 150
             $iconData = $uiElements->iconData('PROFILES_REDIRECTED');
151 151
             $iconData['text'] = _("Profile redirected");
152
-            $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
152
+            $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
153 153
             
154 154
         } 
155 155
         
@@ -157,15 +157,15 @@  discard block
 block discarded – undo
157 157
         switch ($certStatus) {
158 158
             case core\AbstractProfile::CERT_STATUS_OK:
159 159
                 $iconData = $uiElements->iconData('CERT_STATUS_OK');
160
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
160
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
161 161
                 break;
162 162
             case core\AbstractProfile::CERT_STATUS_WARN:
163 163
                 $iconData = $uiElements->iconData('CERT_STATUS_WARN');
164
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));                
164
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));                
165 165
                 break;
166 166
             case core\AbstractProfile::CERT_STATUS_ERROR:
167 167
                 $iconData = $uiElements->iconData('CERT_STATUS_ERROR');
168
-                $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData));
168
+                $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData));
169 169
                 break;            
170 170
         }
171 171
         $buffer_headline .= "</div>";
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
                 if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") {
192 192
                     $diagUrl = "../diag/";
193 193
                 } else {
194
-                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/";
194
+                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/";
195 195
                 }
196 196
                 ?>
197
-                <form action='<?php echo $diagUrl . "action_realmcheck.php?inst_id=" . $theProfile->institution . "&profile_id=" . $theProfile->identifier ?>' method='post' accept-charset='UTF-8'>
198
-                    <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link . $_SERVER['SCRIPT_NAME']); ?>'/>
197
+                <form action='<?php echo $diagUrl."action_realmcheck.php?inst_id=".$theProfile->institution."&profile_id=".$theProfile->identifier ?>' method='post' accept-charset='UTF-8'>
198
+                    <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link.$_SERVER['SCRIPT_NAME']); ?>'/>
199 199
                     <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!"); ?>'>
200 200
                         <?php echo _("Check realm reachability"); ?>
201 201
                     </button>
@@ -242,9 +242,9 @@  discard block
 block discarded – undo
242 242
                 ?>
243 243
                 <div style='display: flex;'>
244 244
                     <?php
245
-                    $idpLevelUrl = $link . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $theProfile->institution;
246
-                    $displayurl = $idpLevelUrl . "&amp;profile=" . $theProfile->identifier;
247
-                    $QRurl = $idpLevelUrl . "&profile=" . $theProfile->identifier;
245
+                    $idpLevelUrl = $link.dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$theProfile->institution;
246
+                    $displayurl = $idpLevelUrl."&amp;profile=".$theProfile->identifier;
247
+                    $QRurl = $idpLevelUrl."&profile=".$theProfile->identifier;
248 248
                     $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([
249 249
                                 'outputType' => \chillerlan\QRCode\QRCode::OUTPUT_IMAGE_PNG,
250 250
                                 'eccLevel' => \chillerlan\QRCode\QRCode::ECC_H,
@@ -256,9 +256,9 @@  discard block
 block discarded – undo
256 256
                     if (empty($rawQr)) {
257 257
                         throw new Exception("Something went seriously wrong during QR code generation!");
258 258
                     }
259
-                    $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
259
+                    $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
260 260
                     $size = getimagesize($uri);
261
-                    echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>";
261
+                    echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>";
262 262
 
263 263
                     //echo "<nobr>$displayurl</nobr></a>";
264 264
                     echo "<p>$displayurl</p></a>";
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
             }
424 424
             ?>
425 425
         </h2>
426
-        <?php if(count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?>
426
+        <?php if (count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?>
427 427
                     <form method='post' action='sort_profiles.php?inst_id=<?php echo $my_inst->identifier; ?>' accept-charset='UTF-8'>
428 428
                         <div>
429 429
                             <button type='submit' name='profile_sorting'>
Please login to merge, or discard this patch.
web/admin/edit_federation.php 1 patch
Spacing   +11 added lines, -11 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();
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
         ?>
80 80
     </h1>
81 81
     <div class='infobox'>
82
-        <h2><?php $tablecaption = sprintf(_("%s Properties"),$uiElements->nomenclatureFed); echo $tablecaption?></h2>
82
+        <h2><?php $tablecaption = sprintf(_("%s Properties"), $uiElements->nomenclatureFed); echo $tablecaption?></h2>
83 83
         <table>
84
-            <caption><?php echo $tablecaption;?></caption>
84
+            <caption><?php echo $tablecaption; ?></caption>
85 85
             <tr>
86
-                <th class="wai-invisible" scope="col"><?php echo _("Property Type");?></th>
87
-                <th class="wai-invisible" scope="col"><?php echo _("Language if applicable");?></th>
88
-                <th class="wai-invisible" scope="col"><?php echo _("Property Value");?></th>
86
+                <th class="wai-invisible" scope="col"><?php echo _("Property Type"); ?></th>
87
+                <th class="wai-invisible" scope="col"><?php echo _("Language if applicable"); ?></th>
88
+                <th class="wai-invisible" scope="col"><?php echo _("Property Value"); ?></th>
89 89
             </tr>
90 90
             <tr>
91 91
                 <td><?php echo _("Country:"); ?></td>
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
         </table>
97 97
     </div>
98 98
     <?php
99
-    echo "<form enctype='multipart/form-data' action='edit_federation_result.php?fed_id=$my_fed->tld" . "' method='post' accept-charset='UTF-8'>
100
-              <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
99
+    echo "<form enctype='multipart/form-data' action='edit_federation_result.php?fed_id=$my_fed->tld"."' method='post' accept-charset='UTF-8'>
100
+              <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE."'>";
101 101
     ?>
102 102
     <fieldset class="option_container">
103
-        <legend><strong><?php echo sprintf(_("%s Properties"),$uiElements->nomenclatureFed); ?></strong></legend>
103
+        <legend><strong><?php echo sprintf(_("%s Properties"), $uiElements->nomenclatureFed); ?></strong></legend>
104 104
         <?php
105 105
         $options = [
106 106
             'level' => 'fed',
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
     <?php
116 116
     echo "<div>";
117 117
     if ($editMode === 'fullaccess') {
118
-        echo "<button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button>";
118
+        echo "<button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button>";
119 119
         $discardLabel = _("Discard changes");
120 120
     } else {
121 121
         $discardLabel = _("Return");
122 122
     }
123
-    echo "<button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_federation.php?fed_id=$fedPost\"'>" . $discardLabel . "</button></div></form>";
123
+    echo "<button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_federation.php?fed_id=$fedPost\"'>".$discardLabel."</button></div></form>";
124 124
     echo $deco->footer();
Please login to merge, or discard this patch.
web/admin/inc/toggleRedirect.inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
23 23
 
24 24
 $auth = new \web\lib\admin\Authentication();
25 25
 $loggerInstance = new \core\common\Logging();
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $remaining_attribs = $my_profile->beginFlushMethodLevelAttributes($eaptype->getIntegerRep(), NULL);
91 91
         $optionParser->processSubmittedFields($my_profile, $_POST, $_FILES, $eaptype->getIntegerRep(), NULL);
92 92
     }
93
-    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $my_profile->identifier . " - device/EAP-Type settings changed");
93
+    $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$my_profile->identifier." - device/EAP-Type settings changed");
94 94
     header("Location: ../overview_installers.php?inst_id=$my_inst->identifier&profile_id=$my_profile->identifier");
95 95
     exit;
96 96
 }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     }
105 105
     $captiontext = sprintf(_("device <strong>%s</strong>"), $device['display']);
106 106
     $keyword = "device-specific";
107
-    $extrainput = "<input type='hidden' name='device' value='" . $device_key . "'/>";
107
+    $extrainput = "<input type='hidden' name='device' value='".$device_key."'/>";
108 108
     $dev = $device_key;
109 109
 } elseif ($eaptype !== NULL) {
110 110
     foreach ($my_profile->getAttributes() as $attrib) {
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
 
116 116
     $captiontext = sprintf(_("EAP-Type <strong>%s</strong>"), $eaptype->getPrintableRep());
117 117
     $keyword = "eap-specific";
118
-    $extrainput = "<input type='hidden' name='eaptype' value='" . $eaptype->getIntegerRep() . "'>";
118
+    $extrainput = "<input type='hidden' name='eaptype' value='".$eaptype->getIntegerRep()."'>";
119 119
     $dev = '';
120 120
 } else {
121 121
     throw new Exception("previous type checks make it impossible to reach this code path.");
122 122
 }
123 123
 ?>
124
-<p><?php echo _("Fine-tuning options for ") . $captiontext; ?></p>
124
+<p><?php echo _("Fine-tuning options for ").$captiontext; ?></p>
125 125
 <hr/>
126 126
 
127 127
 <form action='inc/toggleRedirect.inc.php?inst_id=<?php echo $my_inst->identifier; ?>&amp;profile_id=<?php echo $my_profile->identifier; ?>' method='post' accept-charset='UTF-8'><?php echo $extrainput; ?>
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 // see if we already have any attributes; if so, display these
130 130
     $interesting_attribs = [];
131 131
     foreach ($attribs as $attrib) {
132
-        if ($attrib['level'] == \core\Options::LEVEL_METHOD && preg_match('/^' . $keyword . ':/', $attrib['name'])) {
132
+        if ($attrib['level'] == \core\Options::LEVEL_METHOD && preg_match('/^'.$keyword.':/', $attrib['name'])) {
133 133
             $interesting_attribs[] = $attrib;
134 134
         }
135 135
     }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     if (\config\Master::DB['INST']['readonly'] === FALSE) {
139 139
         if ($editMode == 'fullaccess') {
140 140
         ?>
141
-        <button type='button' class='newoption' onclick='getXML("<?php echo $keyword;?>", "<?php echo $my_inst->federation;?>")'><?php echo _("Add new option"); ?></button>
141
+        <button type='button' class='newoption' onclick='getXML("<?php echo $keyword; ?>", "<?php echo $my_inst->federation; ?>")'><?php echo _("Add new option"); ?></button>
142 142
         <br/>
143 143
         <hr/>
144 144
         <button type='submit' name='submitbutton' id='submitbutton' value='<?php echo web\lib\common\FormElements::BUTTON_SAVE; ?>'><?php echo _("Save data"); ?></button>
Please login to merge, or discard this patch.
web/admin/inc/sendZip.inc.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  * */
22 22
  
23
- /**
24
- * This file is used to pack and send RADSEC credentials.
25
- * 
26
- * @author Maja Gorecka-Wolniewicz <[email protected]>
27
- */
23
+    /**
24
+     * This file is used to pack and send RADSEC credentials.
25
+     * 
26
+     * @author Maja Gorecka-Wolniewicz <[email protected]>
27
+     */
28 28
 ?>
29 29
 <?php
30 30
 
@@ -36,26 +36,26 @@  discard block
 block discarded – undo
36 36
 if ($editMode == 'fullaccess') {
37 37
     $hotspotProfiles = $my_inst->listDeployments();
38 38
     if (count($hotspotProfiles) > 0) { // no profiles yet.
39
-       foreach ($hotspotProfiles as $counter => $deploymentObject) {
40
-           if ($deploymentObject->institution == $_GET['inst_id'] && $deploymentObject->identifier == $_GET['dep_id']) {
41
-               $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
42
-               $zip = new ZipArchive;
43
-               $zip->open(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip', ZipArchive::CREATE);
44
-               if ($deploymentObject->radsec_priv != '') {
39
+        foreach ($hotspotProfiles as $counter => $deploymentObject) {
40
+            if ($deploymentObject->institution == $_GET['inst_id'] && $deploymentObject->identifier == $_GET['dep_id']) {
41
+                $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
42
+                $zip = new ZipArchive;
43
+                $zip->open(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip', ZipArchive::CREATE);
44
+                if ($deploymentObject->radsec_priv != '') {
45 45
                     $zip->addFromString('priv.key', $deploymentObject->radsec_priv);
46
-               }
47
-               $zip->addFromString('cert.pem', $deploymentObject->radsec_cert);
48
-               $zip->addFromString('ca.pem', $cacert);
49
-               $zip->close();
50
-               $data = file_get_contents(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
51
-               unlink(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
52
-               if ($data !== FALSE) {
46
+                }
47
+                $zip->addFromString('cert.pem', $deploymentObject->radsec_cert);
48
+                $zip->addFromString('ca.pem', $cacert);
49
+                $zip->close();
50
+                $data = file_get_contents(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
51
+                unlink(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
52
+                if ($data !== FALSE) {
53 53
                     header('Content-Type: application/zip');
54 54
                     header("Content-Disposition: attachment; filename=\"full_".$deploymentObject->identifier.".zip\"");
55 55
                     header("Content-Transfer-Encoding: binary");
56 56
                     echo $data;
57
-               }
58
-           }
59
-       }
57
+                }
58
+            }
59
+        }
60 60
     }
61 61
 }
62 62
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 ?>
29 29
 <?php
30 30
 
31
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
31
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
32 32
 $auth = new \web\lib\admin\Authentication();
33 33
 $auth->authenticate();
34 34
 $validator = new \web\lib\common\InputValidation();
@@ -38,17 +38,17 @@  discard block
 block discarded – undo
38 38
     if (count($hotspotProfiles) > 0) { // no profiles yet.
39 39
        foreach ($hotspotProfiles as $counter => $deploymentObject) {
40 40
            if ($deploymentObject->institution == $_GET['inst_id'] && $deploymentObject->identifier == $_GET['dep_id']) {
41
-               $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
41
+               $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem");
42 42
                $zip = new ZipArchive;
43
-               $zip->open(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip', ZipArchive::CREATE);
43
+               $zip->open(ROOT.'/var/tmp/'.$deploymentObject->identifier.'.zip', ZipArchive::CREATE);
44 44
                if ($deploymentObject->radsec_priv != '') {
45 45
                     $zip->addFromString('priv.key', $deploymentObject->radsec_priv);
46 46
                }
47 47
                $zip->addFromString('cert.pem', $deploymentObject->radsec_cert);
48 48
                $zip->addFromString('ca.pem', $cacert);
49 49
                $zip->close();
50
-               $data = file_get_contents(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
51
-               unlink(ROOT . '/var/tmp/' . $deploymentObject->identifier.'.zip');
50
+               $data = file_get_contents(ROOT.'/var/tmp/'.$deploymentObject->identifier.'.zip');
51
+               unlink(ROOT.'/var/tmp/'.$deploymentObject->identifier.'.zip');
52 52
                if ($data !== FALSE) {
53 53
                     header('Content-Type: application/zip');
54 54
                     header("Content-Disposition: attachment; filename=\"full_".$deploymentObject->identifier.".zip\"");
Please login to merge, or discard this patch.
web/admin/inc/manageNewInst.inc.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  */
21 21
 ?>
22 22
 <?php
23
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $uiElements = new \web\lib\admin\UIElements();
@@ -57,30 +57,30 @@  discard block
 block discarded – undo
57 57
 <?php
58 58
 echo sprintf(_("On this page, you can add a new %s to your %s. Please fill out the form below to send out an email invitation to the new %s administrator."), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant);
59 59
 if (\config\Master::DB['enforce-external-sync']) {
60
-    echo "<p>" . sprintf(_("You can either register a known %s (as defined in the %s database) or create a totally new %s."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name'], $uiElements->nomenclatureParticipant) . "</p>";
61
-    echo "<p>" . sprintf(_("The latter one is typically for an %s which is yet in a testing phase and therefore doesn't appear in the %s database yet."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name']) . "</p>";    
60
+    echo "<p>".sprintf(_("You can either register a known %s (as defined in the %s database) or create a totally new %s."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name'], $uiElements->nomenclatureParticipant)."</p>";
61
+    echo "<p>".sprintf(_("The latter one is typically for an %s which is yet in a testing phase and therefore doesn't appear in the %s database yet."), $uiElements->nomenclatureParticipant, \config\ConfAssistant::CONSORTIUM['display_name'])."</p>";    
62 62
 }
63 63
 ?>
64 64
 <hr/>
65 65
 <img alt='Loading ...' src='../resources/images/icons/loading51.gif' id='spin' style='position:absolute;left: 50%; top: 50%; transform: translate(-100px, -50px); display:none;'>
66 66
 <form name='sendinvite' action='inc/sendinvite.inc.php' method='post' accept-charset='UTF-8'>
67 67
     <table>
68
-            <caption><?php echo _("Invitation Details");?></caption>
68
+            <caption><?php echo _("Invitation Details"); ?></caption>
69 69
             <tr>
70
-                <th class="wai-invisible" scope="col"><?php echo _("From database or ad-hoc?");?></th>
71
-                <th class="wai-invisible" scope="col"><?php echo _("Name");?></th>
72
-                <th class="wai-invisible" scope="col"><?php echo _("Type");?></th>
73
-                <th class="wai-invisible" scope="col"><?php echo _("Country");?></th>
70
+                <th class="wai-invisible" scope="col"><?php echo _("From database or ad-hoc?"); ?></th>
71
+                <th class="wai-invisible" scope="col"><?php echo _("Name"); ?></th>
72
+                <th class="wai-invisible" scope="col"><?php echo _("Type"); ?></th>
73
+                <th class="wai-invisible" scope="col"><?php echo _("Country"); ?></th>
74 74
             </tr>
75 75
         <?php
76 76
         if (\config\Master::DB['enforce-external-sync']) {
77 77
             echo "<tr><td>
78
-                <input type='radio' name='creation' value='existing'>" . sprintf(_("Existing %s:"), $uiElements->nomenclatureParticipant) . "</input>
78
+                <input type='radio' name='creation' value='existing'>" . sprintf(_("Existing %s:"), $uiElements->nomenclatureParticipant)."</input>
79 79
                      </td>";
80 80
 
81 81
             echo "<td colspan='3'>
82 82
                 <select id='externals' name='externals' onchange='document.sendinvite.creation[0].checked=true; document.sendinvite.mailaddr.value=this.options[this.selectedIndex].id;'>
83
-                    <option value='FREETEXT'>" . sprintf(_("--- select %s here ---"),$uiElements->nomenclatureParticipant) . "</option>";
83
+                    <option value='FREETEXT'>" . sprintf(_("--- select %s here ---"), $uiElements->nomenclatureParticipant)."</option>";
84 84
 
85 85
             foreach ($feds as $fed_value) {
86 86
                 $thefed = new \core\Federation(strtoupper($fed_value['value']));
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                 $entities = $thefed->listExternalEntities(TRUE, NULL);
90 90
 
91 91
                 foreach ($entities as $v) {
92
-                    echo "<option id='" . $v['contactlist'] . "' value='" . $fed_value['value']. '-' . $v['ID'] . "'>[" . $fed_value['value'] . "] " . $v['name'] . "</option>";
92
+                    echo "<option id='".$v['contactlist']."' value='".$fed_value['value'].'-'.$v['ID']."'>[".$fed_value['value']."] ".$v['name']."</option>";
93 93
                 }
94 94
             }
95 95
 
@@ -98,19 +98,19 @@  discard block
 block discarded – undo
98 98
         ?>
99 99
         <tr>
100 100
             <td>
101
-                <input type='radio' name='creation' value='new'><?php echo sprintf(_("New %s"),$uiElements->nomenclatureParticipant); ?></input>
101
+                <input type='radio' name='creation' value='new'><?php echo sprintf(_("New %s"), $uiElements->nomenclatureParticipant); ?></input>
102 102
             </td>
103 103
             <td>
104 104
                 <?php echo _("Name"); ?> <input type='text' size='30' id='name' name='name' onchange='document.sendinvite.creation[1].checked = true'/>
105 105
             </td>
106 106
             <td>
107
-                <?php if(\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { ?>
107
+                <?php if (\config\Master::FUNCTIONALITY_FLAGS['SINGLE_SERVICE'] === 'MSP') { ?>
108 108
                 &nbsp; <input type='hidden' name='participant_type' value='SP'>
109 109
                 <?php } else { ?>
110 110
                 <select name="participant_type">
111
-                    <option value="IdPSP" selected><?php printf(_("%s and %s"),$uiElements->nomenclatureIdP, $uiElements->nomenclatureHotspot)?></option>
112
-                    <option value="IdP"><?php printf(_("%s"),$uiElements->nomenclatureIdP)?></option>
113
-                    <option value="SP"><?php printf(_("%s"),$uiElements->nomenclatureHotspot)?></option>
111
+                    <option value="IdPSP" selected><?php printf(_("%s and %s"), $uiElements->nomenclatureIdP, $uiElements->nomenclatureHotspot)?></option>
112
+                    <option value="IdP"><?php printf(_("%s"), $uiElements->nomenclatureIdP)?></option>
113
+                    <option value="SP"><?php printf(_("%s"), $uiElements->nomenclatureHotspot)?></option>
114 114
                 </select>
115 115
                 <?php } ?>
116 116
             </td>
Please login to merge, or discard this patch.
web/admin/inc/manageAdmins.inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  */
21 21
 ?>
22 22
 <?php
23
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
23
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
24 24
 
25 25
 $auth = new \web\lib\admin\Authentication();
26 26
 $languageInstance = new \core\common\Language();
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                 default:
121 121
                     throw new Exception("Error: unknown encryption status of invitation!?!");
122 122
             }
123
-            echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter) . " " . $cryptText, _("Sent successfully."));
123
+            echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter)." ".$cryptText, _("Sent successfully."));
124 124
             break;
125 125
         case "FAILURE":
126 126
             echo $uiElements->boxError(_("No invitation email could be sent!"), _("Sending failure!"));
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                 default:
141 141
                     throw new Exception("Error: unknown encryption status of invitation!?!");
142 142
             }
143
-            echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter) . " " . $cryptText, _("Partial success."));
143
+            echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter)." ".$cryptText, _("Partial success."));
144 144
             break;
145 145
         case "INVALIDSYNTAX":
146 146
             echo $uiElements->boxError(_("The invitation email address was malformed, no invitation was sent!"), _("The invitation email address was malformed, no invitation was sent!"));
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
                 <?php echo $invite; ?>
193 193
             </td>
194 194
             <td>
195
-                <form action='inc/manageAdmins.inc.php?inst_id=<?php echo $my_inst->identifier ?>' method='post' <?php echo ( $oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "" ); ?> accept-charset='UTF-8'>
195
+                <form action='inc/manageAdmins.inc.php?inst_id=<?php echo $my_inst->identifier ?>' method='post' <?php echo ($oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : ""); ?> accept-charset='UTF-8'>
196 196
                     <input type='hidden' name='admin_id' value='<?php echo $oneowner['ID']; ?>'></input>
197 197
                     <button type='submit' name='submitbutton' class='delete' value='<?php echo web\lib\common\FormElements::BUTTON_DELETE; ?>'><?php echo _("Delete Administrator") ?></button>
198 198
                 </form>
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
 $pending_invites = $mgmt->listPendingInvitations($my_inst->identifier);
217 217
 $loggerInstance->debug(4, "Displaying pending invitations for $my_inst->identifier.\n");
218 218
 if (count($pending_invites) > 0) {
219
-    echo "<strong>" . _("Pending invitations for this IdP") . "</strong>";
219
+    echo "<strong>"._("Pending invitations for this IdP")."</strong>";
220 220
     echo "<table>";
221 221
     foreach ($pending_invites as $invitee) {
222
-        echo "<tr><td>" . $invitee['mail'] . "</td><td>" . sprintf(_("(expires %s)"), $invitee['expiry']) . "</td></tr>";
222
+        echo "<tr><td>".$invitee['mail']."</td><td>".sprintf(_("(expires %s)"), $invitee['expiry'])."</td></tr>";
223 223
     }
224 224
     echo "</table>";
225 225
 }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 
242 242
     if (!$is_admin_himself) {
243 243
         echo "<form action='inc/manageAdmins.inc.php?inst_id=$my_inst->identifier' method='post' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'>
244
-    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_TAKECONTROL . "'>" . sprintf(_("Take control of this %s"), $uiElements->nomenclatureParticipant) . "</button>
244
+    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_TAKECONTROL."'>".sprintf(_("Take control of this %s"), $uiElements->nomenclatureParticipant)."</button>
245 245
 </form>";
246 246
     }
247 247
 }
Please login to merge, or discard this patch.
web/admin/inc/deploymentStats.inc.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     $deployment = $validator->existingDeploymentManaged($_GET['deployment_id'], $inst);
21 21
     $format = '';
22 22
     if (isset($_GET['as']) && $_GET['as']=='csv') {
23
-    	$format = 'csv';
23
+        $format = 'csv';
24 24
     }
25 25
     if (!isset($_POST['stats'])) {
26 26
         $backlog = $_GET['backlog'];
@@ -47,25 +47,25 @@  discard block
 block discarded – undo
47 47
     
48 48
     $userAuthData = $deployment->retrieveStatistics($backlogTime);
49 49
     if ($format == 'csv') {
50
-	    header('Content-Type: text/csv');
50
+        header('Content-Type: text/csv');
51 51
             header('Content-Disposition: attachment; filename="backlog_'.$deployment->identifier.'_'.$backlog.'"');
52
-	    $fp = fopen('php://output', 'w');
53
-	    fputcsv($fp, [_("Timestamp (UTC)"), _("Outer-Identity"), _("Result"), _("MAC Address"),
54
-		          _("Chargeable-User-Identity"), _("AP Identifier"), _("Protocol")], ';', '"', '');
55
-	    foreach ($userAuthData as $oneRecord) {
56
-		    fputcsv($fp, [$oneRecord['activity_time'], $oneRecord['outer_user'],
57
-			    ($oneRecord['result'] == "OK" ? _("Success") : _("Failure")),
58
-			    $oneRecord['mac'], $oneRecord['cui'],
59
-			    $oneRecord['ap_id'], $oneRecord['prot']], ';', '"', '');
52
+        $fp = fopen('php://output', 'w');
53
+        fputcsv($fp, [_("Timestamp (UTC)"), _("Outer-Identity"), _("Result"), _("MAC Address"),
54
+                    _("Chargeable-User-Identity"), _("AP Identifier"), _("Protocol")], ';', '"', '');
55
+        foreach ($userAuthData as $oneRecord) {
56
+            fputcsv($fp, [$oneRecord['activity_time'], $oneRecord['outer_user'],
57
+                ($oneRecord['result'] == "OK" ? _("Success") : _("Failure")),
58
+                $oneRecord['mac'], $oneRecord['cui'],
59
+                $oneRecord['ap_id'], $oneRecord['prot']], ';', '"', '');
60 60
             }
61
-	    fclose($fp);
61
+        fclose($fp);
62 62
     } else {
63 63
     ?>
64 64
     
65 65
     <h1><?php $tablecaption = _("Deployment Usage Records"); echo $tablecaption; ?></h1>
66 66
     <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)");
67
-             echo _("Protocol is a protocol used between a client and RADIUS server, for TLS it is a / separated tuple TLS/TLS-Client-Cert-Serial");
68
-       ?></p>
67
+                echo _("Protocol is a protocol used between a client and RADIUS server, for TLS it is a / separated tuple TLS/TLS-Client-Cert-Serial");
68
+        ?></p>
69 69
     <table class='authrecord'>
70 70
         <caption><?php echo $tablecaption;?></caption>
71 71
         <tr>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * ******************************************************************************
10 10
  */
11 11
 
12
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
12
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
13 13
 $auth = new \web\lib\admin\Authentication();
14 14
 $auth->authenticate();
15 15
 $languageInstance = new \core\common\Language();
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 if ($editMode == 'fullaccess') {
20 20
     $deployment = $validator->existingDeploymentManaged($_GET['deployment_id'], $inst);
21 21
     $format = '';
22
-    if (isset($_GET['as']) && $_GET['as']=='csv') {
22
+    if (isset($_GET['as']) && $_GET['as'] == 'csv') {
23 23
     	$format = 'csv';
24 24
     }
25 25
     if (!isset($_POST['stats'])) {
@@ -67,19 +67,19 @@  discard block
 block discarded – undo
67 67
              echo _("Protocol is a protocol used between a client and RADIUS server, for TLS it is a / separated tuple TLS/TLS-Client-Cert-Serial");
68 68
        ?></p>
69 69
     <table class='authrecord'>
70
-        <caption><?php echo $tablecaption;?></caption>
70
+        <caption><?php echo $tablecaption; ?></caption>
71 71
         <tr>
72
-            <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th>
73
-            <th scope="col"><strong><?php echo _("Outer-Identity");?></strong></th>
74
-            <th scope="col"><strong><?php echo _("Result");?></strong></th>
75
-            <th scope="col"><strong><?php echo _("MAC Address");?></strong></th>
76
-            <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th>    
77
-            <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th>
78
-            <th scope="col"><strong><?php echo _("Protocol");?></strong></th>
72
+            <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th>
73
+            <th scope="col"><strong><?php echo _("Outer-Identity"); ?></strong></th>
74
+            <th scope="col"><strong><?php echo _("Result"); ?></strong></th>
75
+            <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th>
76
+            <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th>    
77
+            <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th>
78
+            <th scope="col"><strong><?php echo _("Protocol"); ?></strong></th>
79 79
         </tr>
80 80
         <?php
81 81
         foreach ($userAuthData as $oneRecord) {    
82
-            echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>"
82
+            echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>"
83 83
                     . "<td>".$oneRecord['activity_time']."</td>"
84 84
                     // $oneRecord['CN'] is a simple string, not an array, so disable Scrutinizer type check here
85 85
                     . "<td>".$oneRecord['outer_user']."</td>"
Please login to merge, or discard this patch.
web/admin/inc/option_xhr.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
23 23
 
24 24
 \core\CAT::sessionStart();
25 25
 $validator = new \web\lib\common\InputValidation();
26 26
 
27
-if (!isset($_GET["class"] )) {
27
+if (!isset($_GET["class"])) {
28 28
     throw new Exception("Unknown type of option!");
29 29
 }
30 30
 
@@ -42,6 +42,6 @@  discard block
 block discarded – undo
42 42
 
43 43
 // add one option of the specified class
44 44
 
45
-$list = \web\lib\admin\OptionDisplay::enumerateOptionsToDisplay($_GET["class"], $_GET['fedid'], (isset($_GET["device"])?$_GET["device"]:NULL));
45
+$list = \web\lib\admin\OptionDisplay::enumerateOptionsToDisplay($_GET["class"], $_GET['fedid'], (isset($_GET["device"]) ? $_GET["device"] : NULL));
46 46
 $optionDisplay = new \web\lib\admin\OptionDisplay($list);
47 47
 echo $optionDisplay->optiontext(array_values($list));
Please login to merge, or discard this patch.
web/admin/action_req_certificate.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
                     $dc[] = 'DC=' . $v;
150 150
                 }
151 151
                 if ($DN !== array_reverse($dc)) {
152
-                   $dc = array();
153
-                   $_SESSION['CSR_ERRORS'] = 'WRONG_SUBJECT';
154
-                   $_SESSION['FORM_SETTINGS'] = $settings;
155
-                   $_SESSION['csr_subject'] = $dn;
152
+                    $dc = array();
153
+                    $_SESSION['CSR_ERRORS'] = 'WRONG_SUBJECT';
154
+                    $_SESSION['FORM_SETTINGS'] = $settings;
155
+                    $_SESSION['csr_subject'] = $dn;
156 156
                 }
157 157
             } else {
158 158
                 $_SESSION['CSR_ERRORS'] = 'WRONG_SUBJECT';
@@ -201,15 +201,15 @@  discard block
 block discarded – undo
201 201
                 } else {
202 202
                     $ou = $serverInfo["names"][$langInstance->getLang()];
203 203
                 }
204
-		if (str_contains($ou, ',')) {
205
-		    $modou = 1;
206
-		    $ou = str_replace(",", "/,", $ou);
207
-		}
208
-		$ou = preg_replace('/\s+/', ' ',  $ou);
209
-		if (strlen($ou) >= 64) {
210
-			$ou = substr($ou, 0, 64);
211
-			$modou += 2;
212
-		}
204
+        if (str_contains($ou, ',')) {
205
+            $modou = 1;
206
+            $ou = str_replace(",", "/,", $ou);
207
+        }
208
+        $ou = preg_replace('/\s+/', ' ',  $ou);
209
+        if (strlen($ou) >= 64) {
210
+            $ou = substr($ou, 0, 64);
211
+            $modou += 2;
212
+        }
213 213
                 $DN[] = "O=".iconv('UTF-8', 'ASCII//TRANSLIT', $ou);
214 214
                 $serverList = explode(",", $serverInfo["servers"]);
215 215
                 $DN[] = "CN=" . $serverList[0];
@@ -234,20 +234,20 @@  discard block
 block discarded – undo
234 234
         echo "<p style='font-size: large'>" . _("Requesting a certificate with the following properties");
235 235
         echo "<ul>";
236 236
         echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>";
237
-	echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN);
238
-	if ($modou > 0) {
239
-	    echo " (";
237
+    echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN);
238
+    if ($modou > 0) {
239
+        echo " (";
240 240
             echo _("Organization field adjusted"). ': ';
241
-	    $desc = array();
242
-	    if ($modou >= 2) {
243
-		$desc[] = _("truncated to 64 chars");
244
-	    }
245
-	    if ($modou == 1 || $modou == 3) {
246
-		$desc[] = _("commas escaped");
241
+        $desc = array();
242
+        if ($modou >= 2) {
243
+        $desc[] = _("truncated to 64 chars");
244
+        }
245
+        if ($modou == 1 || $modou == 3) {
246
+        $desc[] = _("commas escaped");
247 247
             }
248
-	    echo implode(', ', $desc);
249
-	    echo ")";
250
-	}
248
+        echo implode(', ', $desc);
249
+        echo ")";
250
+    }
251 251
         echo "</li>";
252 252
         echo "<li>" . _("subjectAltName:DNS : ") . implode(", ", $serverList) . "</li>";
253 253
         echo "<li>" . _("Requester Contact Details: ") . $firstName . " &lt;" . $firstMail . "&gt;" . "</li>";
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 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();
@@ -96,29 +96,29 @@  discard block
 block discarded – undo
96 96
     'HINT' =>  _("See CSR generation rules below."),
97 97
     ];
98 98
     $settings = array();
99
-    if  (isset($_SESSION['CSR_ERRORS']) && $_SESSION['CSR_ERRORS'] != '') {
100
-        print '<h3 id="errorbox"><font color="red">'. $messages[$_SESSION['CSR_ERRORS']];
99
+    if (isset($_SESSION['CSR_ERRORS']) && $_SESSION['CSR_ERRORS'] != '') {
100
+        print '<h3 id="errorbox"><font color="red">'.$messages[$_SESSION['CSR_ERRORS']];
101 101
         if ($_SESSION['CSR_ERRORS'] == 'SOAP_ERROR' && isset($_SESSION['csr_faultcode'])) {
102
-            print '<br>'. _('Reason') . ': '. $_SESSION['csr_faultcode'];
102
+            print '<br>'._('Reason').': '.$_SESSION['csr_faultcode'];
103 103
             unset($_SESSION['csr_faultcode']);
104 104
         } else {
105 105
             if ($_SESSION['CSR_ERRORS'] == 'WRONG_SUBJECT' && isset($_SESSION['csr_subject'])) {
106
-                print '<br>'. _('Your subject is:') . ' '. $_SESSION['csr_subject'];
106
+                print '<br>'._('Your subject is:').' '.$_SESSION['csr_subject'];
107 107
                 unset($_SESSION['csr_subject']);
108 108
             }
109
-            print '<br>' . $messages['HINT'];
109
+            print '<br>'.$messages['HINT'];
110 110
         }
111 111
         print '</font></h3>';
112 112
         unset($_SESSION['CSR_ERRORS']);
113 113
     }
114
-    if  (isset($_SESSION['FORM_SETTINGS']) && $_SESSION['FORM_SETTINGS'] != '') {
114
+    if (isset($_SESSION['FORM_SETTINGS']) && $_SESSION['FORM_SETTINGS'] != '') {
115 115
         $settings = $_SESSION['FORM_SETTINGS'];
116 116
         unset($_SESSION['FORM_SETTINGS']);
117 117
     }
118 118
     if (empty($settings) && isset($_POST['LEVEL'])) {
119 119
         $settings = array('LEVEL' => $_POST['LEVEL'], 'NRO-list' => $_POST['NRO-list'], 'INST-list' => $_POST['INST-list']);
120 120
     }
121
-    if  ( isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) {
121
+    if (isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) {
122 122
         // basic sanity checks before we hand this over to openssl
123 123
         $sanitisedCsr = $validator->string($_POST['CSR'] ?? "", TRUE);
124 124
         
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
                     $dn .= ', ';
140 140
                 }
141 141
                 if (is_array($subject[$sk])) {
142
-                    $dn .= $sk . '=' . implode(', ' . $sk . '=', $subject[$sk]);
142
+                    $dn .= $sk.'='.implode(', '.$sk.'=', $subject[$sk]);
143 143
                 } else {
144
-                    $dn .= $sk . '=' . $subject[$sk];
144
+                    $dn .= $sk.'='.$subject[$sk];
145 145
                 }
146 146
             }
147 147
             if ($subject_keys[0] == 'DC' && $subject['DC']) {
148 148
                 foreach ($subject['DC'] as $v) {
149
-                    $dc[] = 'DC=' . $v;
149
+                    $dc[] = 'DC='.$v;
150 150
                 }
151 151
                 if ($DN !== array_reverse($dc)) {
152 152
                    $dc = array();
@@ -174,11 +174,11 @@  discard block
 block discarded – undo
174 174
                 }
175 175
                 $fed = $validator->existingFederation($_POST['NRO-list']);
176 176
                 $country = strtoupper($fed->tld);
177
-                $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country ;
177
+                $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country;
178 178
                 $DN[] = "C=$code";
179
-                $DN[] = "O=NRO of " . iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[$country]['name']);
179
+                $DN[] = "O=NRO of ".iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[$country]['name']);
180 180
                 $serverInfo = $externalDb->listExternalTlsServersFederation($fed->tld);
181
-                $DN[] = "CN=" . $serverList[0];
181
+                $DN[] = "CN=".$serverList[0];
182 182
                 $policies[] = "eduroam IdP";
183 183
                 $policies[] = "eduroam SP";
184 184
                 $firstName = $serverInfo[array_key_first($serverInfo)][0]["name"];
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                     throw new Exception(sprintf("Sorry: you are not %s admin for the %s requested in the form.", $uiElements->nomenclatureFed, $uiElements->nomenclatureFed));
194 194
                 }
195 195
                 $country = strtoupper($matches[1]);
196
-                $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country ;
196
+                $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country;
197 197
                 $DN[] = "C=$code";
198 198
                 $serverInfo = $extInsts[$_POST['INST-list']];
199 199
                 if (isset($serverInfo["names"]["en"])) {
@@ -205,14 +205,14 @@  discard block
 block discarded – undo
205 205
 		    $modou = 1;
206 206
 		    $ou = str_replace(",", "/,", $ou);
207 207
 		}
208
-		$ou = preg_replace('/\s+/', ' ',  $ou);
208
+		$ou = preg_replace('/\s+/', ' ', $ou);
209 209
 		if (strlen($ou) >= 64) {
210 210
 			$ou = substr($ou, 0, 64);
211 211
 			$modou += 2;
212 212
 		}
213 213
                 $DN[] = "O=".iconv('UTF-8', 'ASCII//TRANSLIT', $ou);
214 214
                 $serverList = explode(",", $serverInfo["servers"]);
215
-                $DN[] = "CN=" . $serverList[0];
215
+                $DN[] = "CN=".$serverList[0];
216 216
                 switch ($serverInfo["type"]) {
217 217
                     case core\IdP::TYPE_IDPSP:
218 218
                         $policies[] = "eduroam IdP";
@@ -231,13 +231,13 @@  discard block
 block discarded – undo
231 231
             default:
232 232
                 throw new Exception("Sorry: Unknown level of issuance requested.");
233 233
         }
234
-        echo "<p style='font-size: large'>" . _("Requesting a certificate with the following properties");
234
+        echo "<p style='font-size: large'>"._("Requesting a certificate with the following properties");
235 235
         echo "<ul>";
236
-        echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>";
237
-	echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN);
236
+        echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>";
237
+	echo "<li>"._("Distinguished Name: ").implode(", ", $DN);
238 238
 	if ($modou > 0) {
239 239
 	    echo " (";
240
-            echo _("Organization field adjusted"). ': ';
240
+            echo _("Organization field adjusted").': ';
241 241
 	    $desc = array();
242 242
 	    if ($modou >= 2) {
243 243
 		$desc[] = _("truncated to 64 chars");
@@ -249,8 +249,8 @@  discard block
 block discarded – undo
249 249
 	    echo ")";
250 250
 	}
251 251
         echo "</li>";
252
-        echo "<li>" . _("subjectAltName:DNS : ") . implode(", ", $serverList) . "</li>";
253
-        echo "<li>" . _("Requester Contact Details: ") . $firstName . " &lt;" . $firstMail . "&gt;" . "</li>";
252
+        echo "<li>"._("subjectAltName:DNS : ").implode(", ", $serverList)."</li>";
253
+        echo "<li>"._("Requester Contact Details: ").$firstName." &lt;".$firstMail."&gt;"."</li>";
254 254
         echo "</ul></p>";
255 255
         $vettedCsr = $validator->string($_POST['CSR'], true);
256 256
         $newCsrWithMeta = [
@@ -265,11 +265,11 @@  discard block
 block discarded – undo
265 265
         $loggerInstance->debug(2, $DN, "CERT DN: ", "\n");
266 266
         // our certs can be good for max 5 years
267 267
         $fed->requestCertificate($user->identifier, $newCsrWithMeta, $expiryDays);
268
-        echo "<p>" . _("The certificate was requested.") . "</p>";
268
+        echo "<p>"._("The certificate was requested.")."</p>";
269 269
         if (isset($_SESSION['CSR_ERRORS']) && $_SESSION['CSR_ERRORS'] == 'SOAP_ERROR') {
270
-            print '<h3 id="errorbox"><font color="red">'. $messages[$_SESSION['CSR_ERRORS']];
270
+            print '<h3 id="errorbox"><font color="red">'.$messages[$_SESSION['CSR_ERRORS']];
271 271
             if (isset($_SESSION['csr_faultcode'])) {
272
-                print '<br>'. _('Reason') . ': '. $_SESSION['csr_faultcode'];
272
+                print '<br>'._('Reason').': '.$_SESSION['csr_faultcode'];
273 273
                 unset($_SESSION['csr_faultcode']);
274 274
             }
275 275
             unset($_SESSION['CSR_ERRORS']);
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
         switch (count($feds)) {
294 294
             case 0:
295 295
                 echo "<div>";
296
-                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."));
296
+                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."));
297 297
                 echo "</div>";
298 298
                 break;
299 299
             case 1:
@@ -301,22 +301,22 @@  discard block
 block discarded – undo
301 301
                 if (empty($settings) || (isset($settings['LEVEL']) && $settings['LEVEL'] == 'NRO')) {
302 302
                     echo ' checked';
303 303
                 }
304
-                echo '>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>';
305
-                echo " <strong>" . $cat->knownFederations[$feds[0]->tld]['name'] . "</strong>";
306
-                echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $feds[0]->tld . '"/>';
304
+                echo '>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>';
305
+                echo " <strong>".$cat->knownFederations[$feds[0]->tld]['name']."</strong>";
306
+                echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$feds[0]->tld.'"/>';
307 307
                 break;
308 308
             default:
309 309
                 echo '<input type="radio" name="LEVEL" id="NRO" value="NRO"';
310 310
                 if (empty($settings) || isset($settings['LEVEL']) && $settings['LEVEL'] == 'NRO') {
311 311
                     echo ' checked';
312 312
                 }
313
-                echo '>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>';
313
+                echo '>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>';
314 314
                 ?>
315 315
                 <select name="NRO-list" id="NRO-list">
316 316
                     <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option>
317 317
                     <?php
318 318
                     foreach ($feds as $oneFed) {
319
-                        echo '<option value="' . strtoupper($oneFed->tld) . '">' . $cat->knownFederations[$oneFed->tld]['name'] . "</option>";
319
+                        echo '<option value="'.strtoupper($oneFed->tld).'">'.$cat->knownFederations[$oneFed->tld]['name']."</option>";
320 320
                         #echo '<option value="AAA' . strtoupper($oneFed->tld) . '">' . $oneIdP["names"][$langObject->getLang()] . "</option>";
321 321
                         
322 322
                     }
@@ -329,21 +329,21 @@  discard block
 block discarded – undo
329 329
         <script>
330 330
             var instservers = [];
331 331
             var instpolicies = [];
332
-            var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo));?>';
332
+            var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?>';
333 333
         <?php 
334 334
         $allIdPs = [];
335 335
         foreach ($allAuthorizedFeds as $oneFed) {
336 336
             foreach ($externalDb->listExternalTlsServersInstitution($oneFed['value']) as $id => $oneIdP) {
337
-                if (count($oneIdP['contacts']) ==0) {
337
+                if (count($oneIdP['contacts']) == 0) {
338 338
                     continue;
339 339
                 }
340
-                $allIdPs[$id] = '[' . substr($id, 0, 2) . '] ' . $oneIdP["name"];            
341
-                echo "instservers['" . $id . "']='" . str_replace(",", ", ", $oneIdP["servers"]) . "';\n";
342
-                echo "instpolicies['" . $id . "']='";
340
+                $allIdPs[$id] = '['.substr($id, 0, 2).'] '.$oneIdP["name"];            
341
+                echo "instservers['".$id."']='".str_replace(",", ", ", $oneIdP["servers"])."';\n";
342
+                echo "instpolicies['".$id."']='";
343 343
                 if ($oneIdP["type"] == 'IdPSP') {
344 344
                     echo "eduroam IdP/SP";
345 345
                 } else {
346
-                    echo "eduroam " . $oneIdP["type"];
346
+                    echo "eduroam ".$oneIdP["type"];
347 347
                 }
348 348
                 echo "';\n";
349 349
             }
@@ -391,9 +391,9 @@  discard block
 block discarded – undo
391 391
             <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option>
392 392
 <?php
393 393
 foreach ($allIdPs as $id => $name) {
394
-    echo '<option value="' . $id . '"';
394
+    echo '<option value="'.$id.'"';
395 395
     if (isset($settings['INST-list']) && $settings['INST-list'] == $id) { echo ' selected'; }
396
-    echo '>' . $name . "</option>";
396
+    echo '>'.$name."</option>";
397 397
 }
398 398
 ?>
399 399
         </select>
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
             <?php
408 408
             echo _('According to the above settings you will receive')
409 409
             ?>
410
-            <span id='certlevel'><?php echo _('NRO level certificate');?></span>
410
+            <span id='certlevel'><?php echo _('NRO level certificate'); ?></span>
411 411
             
412 412
         for server names:
413 413
         <span id='serversinfo'><?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?></span>
@@ -424,12 +424,12 @@  discard block
 block discarded – undo
424 424
         <?php
425 425
         } else {
426 426
             echo "<div>";
427
-            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);
427
+            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);
428 428
             echo "</div>";
429 429
         }
430 430
         ?>
431 431
         <?php
432
-        echo '<div id="ondb"><h4 style="margin: 0">' . _("Can't you find an institution on the select list above?") . '</h4>';
432
+        echo '<div id="ondb"><h4 style="margin: 0">'._("Can't you find an institution on the select list above?").'</h4>';
433 433
         echo _("Most likely we do not have required data on this institution in the eduroam database.");
434 434
         echo '<br/>';
435 435
         ?>
@@ -437,16 +437,16 @@  discard block
 block discarded – undo
437 437
         <?php
438 438
         echo _('On this page');
439 439
         echo '</a> ';
440
-        echo _('you can check what information is in the datatabase') . '.';
440
+        echo _('you can check what information is in the datatabase').'.';
441 441
         echo '</div>';
442 442
         if (count($feds) > 0 || count($allIdPs) > 0) {?>
443 443
         <h2><?php echo _("2. CSR generation"); ?></h2>
444 444
         <p>
445 445
         <?php 
446
-        echo _("The CSR subject field has to start with ") .'<b>' . $subject_prefix . '</b> and follow the pattern given in the example.<br>';
446
+        echo _("The CSR subject field has to start with ").'<b>'.$subject_prefix.'</b> and follow the pattern given in the example.<br>';
447 447
         echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p>
448 448
         <?php 
449
-        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>";
449
+        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>";
450 450
         ?>
451 451
         <h2><?php echo _("3. Submission"); ?></h2>
452 452
 <?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.