Test Setup Failed
Push — master ( c03094...53f4be )
by Stefan
13:14
created
core/CertificationAuthorityEmbeddedECDSA.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
 class CertificationAuthorityEmbeddedECDSA extends EntityWithDBProperties implements CertificationAuthorityInterface
17 17
 {
18 18
 
19
-    private const LOCATION_ROOT_CA = ROOT . "/config/SilverbulletClientCerts/rootca-ECDSA.pem";
20
-    private const LOCATION_ISSUING_CA = ROOT . "/config/SilverbulletClientCerts/real-ECDSA.pem";
21
-    private const LOCATION_ISSUING_KEY = ROOT . "/config/SilverbulletClientCerts/real-ECDSA.key";
22
-    private const LOCATION_CONFIG = ROOT . "/config/SilverbulletClientCerts/openssl-ECDSA.cnf";
19
+    private const LOCATION_ROOT_CA = ROOT."/config/SilverbulletClientCerts/rootca-ECDSA.pem";
20
+    private const LOCATION_ISSUING_CA = ROOT."/config/SilverbulletClientCerts/real-ECDSA.pem";
21
+    private const LOCATION_ISSUING_KEY = ROOT."/config/SilverbulletClientCerts/real-ECDSA.key";
22
+    private const LOCATION_CONFIG = ROOT."/config/SilverbulletClientCerts/openssl-ECDSA.cnf";
23 23
 
24 24
     /**
25 25
      * string with the PEM variant of the root CA
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
         parent::__construct();
67 67
         $this->rootPem = file_get_contents(CertificationAuthorityEmbeddedECDSA::LOCATION_ROOT_CA);
68 68
         if ($this->rootPem === FALSE) {
69
-            throw new Exception("Root CA PEM file not found: " . CertificationAuthorityEmbeddedECDSA::LOCATION_ROOT_CA);
69
+            throw new Exception("Root CA PEM file not found: ".CertificationAuthorityEmbeddedECDSA::LOCATION_ROOT_CA);
70 70
         }
71 71
         $this->issuingCertRaw = file_get_contents(CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA);
72 72
         if ($this->issuingCertRaw === FALSE) {
73
-            throw new Exception("Issuing CA PEM file not found: " . CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA);
73
+            throw new Exception("Issuing CA PEM file not found: ".CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA);
74 74
         }
75 75
         $rootParsed = openssl_x509_read($this->rootPem);
76 76
         $this->issuingCert = openssl_x509_read($this->issuingCertRaw);
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
             throw new Exception("At least one CA PEM file did not parse correctly!");
79 79
         }
80 80
         if (stat(CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY) === FALSE) {
81
-            throw new Exception("Private key not found: " . CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY);
81
+            throw new Exception("Private key not found: ".CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY);
82 82
         }
83
-        $issuingKeyTemp = openssl_pkey_get_private("file://" . CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY);
83
+        $issuingKeyTemp = openssl_pkey_get_private("file://".CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY);
84 84
         if ($issuingKeyTemp === FALSE) {
85 85
             throw new Exception("The private key did not parse correctly!");
86 86
         }
87 87
         $this->issuingKey = $issuingKeyTemp;
88 88
         if (stat(CertificationAuthorityEmbeddedECDSA::LOCATION_CONFIG) === FALSE) {
89
-            throw new Exception("openssl configuration not found: " . CertificationAuthorityEmbeddedECDSA::LOCATION_CONFIG);
89
+            throw new Exception("openssl configuration not found: ".CertificationAuthorityEmbeddedECDSA::LOCATION_CONFIG);
90 90
         }
91 91
         $this->conffile = CertificationAuthorityEmbeddedECDSA::LOCATION_CONFIG;
92 92
     }
@@ -129,27 +129,27 @@  discard block
 block discarded – undo
129 129
         // generate stub index.txt file
130 130
         $tempdirArray = \core\common\Entity::createTemporaryDirectory("test");
131 131
         $tempdir = $tempdirArray['dir'];
132
-        $nowIndexTxt = (new \DateTime())->format("ymdHis") . "Z";
133
-        $expiryIndexTxt = $originalExpiry->format("ymdHis") . "Z";
132
+        $nowIndexTxt = (new \DateTime())->format("ymdHis")."Z";
133
+        $expiryIndexTxt = $originalExpiry->format("ymdHis")."Z";
134 134
         // serials for our CA are always integers
135 135
         $serialHex = strtoupper(dechex((int) $cert->serial));
136 136
         if (strlen($serialHex) % 2 == 1) {
137
-            $serialHex = "0" . $serialHex;
137
+            $serialHex = "0".$serialHex;
138 138
         }
139 139
 
140
-        $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$federation/CN=$cert->username\n";
140
+        $indexStatement = "$certstatus\t$expiryIndexTxt\t".($certstatus == "R" ? "$nowIndexTxt,unspecified" : "")."\t$serialHex\tunknown\t/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$federation/CN=$cert->username\n";
141 141
         $this->loggerInstance->debug(4, "index.txt contents-to-be: $indexStatement");
142
-        if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) {
142
+        if (!file_put_contents($tempdir."/index.txt", $indexStatement)) {
143 143
             $this->loggerInstance->debug(1, "Unable to write openssl index.txt file for revocation handling!");
144 144
         }
145 145
         // index.txt.attr is dull but needs to exist
146
-        file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n");
146
+        file_put_contents($tempdir."/index.txt.attr", "unique_subject = yes\n");
147 147
         // call "openssl ocsp" to manufacture our own OCSP statement
148 148
         // adding "-rmd sha1" to the following command-line makes the
149 149
         // choice of signature algorithm for the response explicit
150 150
         // but it's only available from openssl-1.1.0 (which we do not
151 151
         // want to require just for that one thing).
152
-        $execCmd = \config\Master::PATHS['openssl'] . " ocsp -issuer " . CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA . " -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA " . CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA . " -rsigner " . CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA . " -rkey " . CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY . " -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der";
152
+        $execCmd = \config\Master::PATHS['openssl']." ocsp -issuer ".CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA." -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA ".CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA." -rsigner ".CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA." -rkey ".CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY." -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der";
153 153
         $this->loggerInstance->debug(2, "Calling openssl ocsp with following cmdline: $execCmd\n");
154 154
         $output = [];
155 155
         $return = 999;
@@ -157,11 +157,11 @@  discard block
 block discarded – undo
157 157
         if ($return !== 0) {
158 158
             throw new Exception("Non-zero return value from openssl ocsp!");
159 159
         }
160
-        $ocsp = file_get_contents($tempdir . "/$serialHex.response.der");
160
+        $ocsp = file_get_contents($tempdir."/$serialHex.response.der");
161 161
         // remove the temp dir!
162
-        unlink($tempdir . "/$serialHex.response.der");
163
-        unlink($tempdir . "/index.txt.attr");
164
-        unlink($tempdir . "/index.txt");
162
+        unlink($tempdir."/$serialHex.response.der");
163
+        unlink($tempdir."/index.txt.attr");
164
+        unlink($tempdir."/index.txt");
165 165
         rmdir($tempdir);
166 166
         $this->databaseHandle->exec("UPDATE silverbullet_certificate SET OCSP = ?, OCSP_timestamp = NOW() WHERE serial_number = ?", "si", $ocsp, $cert->serial);
167 167
         return $ocsp;
Please login to merge, or discard this patch.
core/EntityWithDBProperties.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             case "core\User":
140 140
                 return $this->userName;
141 141
             default:
142
-                throw new Exception("Operating on a class where we don't know the relevant identifier in the DB - " . get_class($this) . "!");
142
+                throw new Exception("Operating on a class where we don't know the relevant identifier in the DB - ".get_class($this)."!");
143 143
         }
144 144
     }
145 145
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     public function beginFlushAttributes($extracondition = "")
179 179
     {
180
-        $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "") . $this->getRelevantIdentifier() . (!is_int($this->getRelevantIdentifier()) ? "\"" : "");
180
+        $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "").$this->getRelevantIdentifier().(!is_int($this->getRelevantIdentifier()) ? "\"" : "");
181 181
         $this->databaseHandle->exec("DELETE FROM $this->entityOptionTable WHERE $this->entityIdColumn = $quotedIdentifier AND option_name NOT LIKE '%_file' $extracondition");
182 182
         $this->updateFreshness();
183 183
         $execFlush = $this->databaseHandle->exec("SELECT row FROM $this->entityOptionTable WHERE $this->entityIdColumn = $quotedIdentifier $extracondition");
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
      */
198 198
     public function commitFlushAttributes(array $tobedeleted)
199 199
     {
200
-        $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "") . $this->getRelevantIdentifier() . (!is_int($this->getRelevantIdentifier()) ? "\"" : "");
200
+        $quotedIdentifier = (!is_int($this->getRelevantIdentifier()) ? "\"" : "").$this->getRelevantIdentifier().(!is_int($this->getRelevantIdentifier()) ? "\"" : "");
201 201
         foreach (array_keys($tobedeleted) as $row) {
202 202
             $this->databaseHandle->exec("DELETE FROM $this->entityOptionTable WHERE $this->entityIdColumn = $quotedIdentifier AND row = $row");
203 203
             $this->updateFreshness();
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     {
227 227
         $relevantId = $this->getRelevantIdentifier();
228 228
         $identifierType = (is_int($relevantId) ? "i" : "s");
229
-        $this->databaseHandle->exec("INSERT INTO $this->entityOptionTable ($this->entityIdColumn, option_name, option_lang, option_value) VALUES(?,?,?,?)", $identifierType . "sss", $relevantId, $attrName, $attrLang, $attrValue);
229
+        $this->databaseHandle->exec("INSERT INTO $this->entityOptionTable ($this->entityIdColumn, option_name, option_lang, option_value) VALUES(?,?,?,?)", $identifierType."sss", $relevantId, $attrName, $attrLang, $attrValue);
230 230
         $this->updateFreshness();
231 231
     }
232 232
 
Please login to merge, or discard this patch.
core/DeviceConfig.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,6 @@
 block discarded – undo
109 109
      * ["my.server.name"] => "my.server.name"
110 110
      * ["foo.bar.de", "baz.bar.ge"] => "e"
111 111
      * ["server1.example.com", "server2.example.com", "serverN.example.com"] => ".example.com"
112
-
113 112
      * @return string
114 113
      */
115 114
     public function longestNameSuffix()
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     protected function setSupportedEapMethods($eapArray)
86 86
     {
87 87
         $this->supportedEapMethods = $eapArray;
88
-        $this->loggerInstance->debug(4, "This device (" . __CLASS__ . ") supports the following EAP methods: ");
88
+        $this->loggerInstance->debug(4, "This device (".__CLASS__.") supports the following EAP methods: ");
89 89
         $this->loggerInstance->debug(4, $this->supportedEapMethods);
90 90
     }
91 91
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                     break 2;
138 138
                 }
139 139
             }
140
-            $longestSuffix = $candidate . $longestSuffix;
140
+            $longestSuffix = $candidate.$longestSuffix;
141 141
         }
142 142
         return $longestSuffix;
143 143
     }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             throw new Exception("No EAP type available.");
176 176
         }
177 177
         $this->attributes = $this->getProfileAttributes($profile);
178
-        $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id);
178
+        $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id);
179 179
 
180 180
 
181 181
         // if we are instantiating a Silverbullet profile AND have been given
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
         // create temporary directory, its full path will be saved in $this->FPATH;
201 201
         $tempDir = \core\common\Entity::createTemporaryDirectory($purpose);
202 202
         $this->FPATH = $tempDir['dir'];
203
-        mkdir($tempDir['dir'] . '/tmp');
204
-        chdir($tempDir['dir'] . '/tmp');
203
+        mkdir($tempDir['dir'].'/tmp');
204
+        chdir($tempDir['dir'].'/tmp');
205 205
         $caList = [];
206 206
         $x509 = new \core\common\X509();
207 207
         if (isset($this->attributes['eap:ca_file'])) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         $this->support_url_substitute = sprintf(_("your local %s support page"), \config\ConfAssistant::CONSORTIUM['display_name']);
240 240
 
241 241
         if ($this->signer && $this->options['sign']) {
242
-            $this->sign = ROOT . '/signer/' . $this->signer;
242
+            $this->sign = ROOT.'/signer/'.$this->signer;
243 243
         }
244 244
         $this->installerBasename = $this->getInstallerBasename();
245 245
         common\Entity::outOfThePotatoes();
@@ -299,10 +299,10 @@  discard block
 block discarded – undo
299 299
      */
300 300
     protected function findSourceFile($file)
301 301
     {
302
-        if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) {
303
-            return $this->module_path . '/Files/' . $this->device_id . '/' . $file;
304
-        } elseif (is_file($this->module_path . '/Files/' . $file)) {
305
-            return $this->module_path . '/Files/' . $file;
302
+        if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) {
303
+            return $this->module_path.'/Files/'.$this->device_id.'/'.$file;
304
+        } elseif (is_file($this->module_path.'/Files/'.$file)) {
305
+            return $this->module_path.'/Files/'.$file;
306 306
         } else {
307 307
             $this->loggerInstance->debug(2, "requested file $file does not exist\n");
308 308
             return FALSE;
@@ -426,19 +426,19 @@  discard block
 block discarded – undo
426 426
      */
427 427
     private function getInstallerBasename()
428 428
     {
429
-        $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name']) . "-" . $this->getDeviceId();
429
+        $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name'])."-".$this->getDeviceId();
430 430
         if (isset($this->attributes['profile:customsuffix'][1])) {
431 431
             // this string will end up as a filename on a filesystem, so always
432 432
             // take a latin-based language variant if available
433 433
             // and then scrub non-ASCII just in case
434
-            return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]);
434
+            return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]);
435 435
         }
436 436
         // Okay, no custom suffix. 
437 437
         // Use the configured inst name and apply shortening heuristics
438 438
         // if an instshortname is set, base on that, otherwise, the normal instname
439 439
         $attribToUse = (isset($this->attributes['general:instshortname']) ? 'general:instshortname' : 'general:instname');
440 440
         $lang_pointer = \config\Master::LANGUAGES[$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1;
441
-        $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes[$attribToUse][$lang_pointer] . "\n");
441
+        $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes[$attribToUse][$lang_pointer]."\n");
442 442
         $inst = $this->customTranslit($this->attributes[$attribToUse][$lang_pointer]);
443 443
         $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n");
444 444
         $Inst_a = explode('_', $inst);
@@ -453,10 +453,10 @@  discard block
 block discarded – undo
453 453
             if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) {
454 454
                 $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]);
455 455
                 $prof = preg_replace('/_+$/', '', $profTemp);
456
-                return $baseName . $inst . '-' . $prof;
456
+                return $baseName.$inst.'-'.$prof;
457 457
             }
458 458
         }
459
-        return $baseName . $inst;
459
+        return $baseName.$inst;
460 460
     }
461 461
 
462 462
     /**
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
                 $ext = 'unsupported';
641 641
             }
642 642
             $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n");
643
-            $fileName = 'logo-' . $type . $iterator . '.' . $ext;
643
+            $fileName = 'logo-'.$type.$iterator.'.'.$ext;
644 644
             $fileHandle = fopen($fileName, "w");
645 645
             if (!$fileHandle) {
646 646
                 $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n");
@@ -667,13 +667,13 @@  discard block
 block discarded – undo
667 667
         $mime = $finfo->buffer($blob);
668 668
         $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported';
669 669
         $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n");
670
-        $fileHandle = fopen('local-info.' . $ext, "w");
670
+        $fileHandle = fopen('local-info.'.$ext, "w");
671 671
         if ($fileHandle === FALSE) {
672 672
             throw new Exception("problem opening the file");
673 673
         }
674 674
         fwrite($fileHandle, $blob);
675 675
         fclose($fileHandle);
676
-        return(['name' => 'local-info.' . $ext, 'mime' => $ext]);
676
+        return(['name' => 'local-info.'.$ext, 'mime' => $ext]);
677 677
     }
678 678
 
679 679
     /**
@@ -727,9 +727,9 @@  discard block
 block discarded – undo
727 727
     {
728 728
         $outerId = NULL;
729 729
         if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) {
730
-            $outerId = "@" . $this->attributes['internal:realm'][0];
730
+            $outerId = "@".$this->attributes['internal:realm'][0];
731 731
             if (isset($this->attributes['internal:anon_local_value'])) {
732
-                $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId;
732
+                $outerId = $this->attributes['internal:anon_local_value'][0].$outerId;
733 733
             }
734 734
         }
735 735
         return $outerId;
Please login to merge, or discard this patch.
web/lib/common/InputValidation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     private function inputValidationError($customtext)
41 41
     {
42 42
         \core\common\Entity::intoThePotatoes();
43
-        $retval = "<p>" . _("Input validation error: ") . $customtext . "</p>";
43
+        $retval = "<p>"._("Input validation error: ").$customtext."</p>";
44 44
         \core\common\Entity::outOfThePotatoes();
45 45
         return $retval;
46 46
     }
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
         try {
542 542
             $image->readImageBlob($binary);
543 543
         } catch (\ImagickException $exception) {
544
-            echo "Error" . $exception->getMessage();
544
+            echo "Error".$exception->getMessage();
545 545
             return FALSE;
546 546
         }
547 547
         // image survived the sanity check
Please login to merge, or discard this patch.
core/CertificationAuthorityEduPkiServer.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 class CertificationAuthorityEduPkiServer extends EntityWithDBProperties implements CertificationAuthorityInterface
18 18
 {
19 19
 
20
-    private const LOCATION_RA_CERT = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem";
21
-    private const LOCATION_RA_KEY = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey";
22
-    private const LOCATION_WEBROOT = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem";
20
+    private const LOCATION_RA_CERT = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem";
21
+    private const LOCATION_RA_KEY = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey";
22
+    private const LOCATION_WEBROOT = ROOT."/config/SilverbulletClientCerts/eduPKI-webserver-root.pem";
23 23
     private const EDUPKI_RA_ID = 700;
24 24
     private const EDUPKI_CERT_PROFILE = "Radius Server SOAP";
25 25
     private const EDUPKI_RA_PKEY_PASSPHRASE = "...";
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
35 35
         parent::__construct();
36 36
 
37 37
         if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_CERT) === FALSE) {
38
-            throw new Exception("RA operator PEM file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT);
38
+            throw new Exception("RA operator PEM file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT);
39 39
         }
40 40
         if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_KEY) === FALSE) {
41
-            throw new Exception("RA operator private key file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY);
41
+            throw new Exception("RA operator private key file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY);
42 42
         }
43 43
         if (stat(CertificationAuthorityEduPkiServer::LOCATION_WEBROOT) === FALSE) {
44
-            throw new Exception("CA website root CA file not found: " . CertificationAuthorityEduPkiServer::LOCATION_WEBROOT);
44
+            throw new Exception("CA website root CA file not found: ".CertificationAuthorityEduPkiServer::LOCATION_WEBROOT);
45 45
         }
46 46
     }
47 47
 
@@ -96,19 +96,19 @@  discard block
 block discarded – undo
96 96
         // initialise connection to eduPKI CA / eduroam RA and send the request to them
97 97
         try {
98 98
             $altArray = [# Array mit den Subject Alternative Names
99
-                "email:" . $csr["USERMAIL"]
99
+                "email:".$csr["USERMAIL"]
100 100
             ];
101 101
             $soapPub = $this->initEduPKISoapSession("PUBLIC");
102 102
             $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n");
103
-            $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPkiServer::EDUPKI_RA_ID . "\n");
104
-            $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR"] . "\n");
103
+            $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPkiServer::EDUPKI_RA_ID."\n");
104
+            $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR"]."\n");
105 105
             $this->loggerInstance->debug(5, "PARAM_3: ");
106 106
             $this->loggerInstance->debug(5, $altArray);
107
-            $this->loggerInstance->debug(5, "PARAM_4: " . CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE . "\n");
108
-            $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n");
109
-            $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n");
110
-            $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERMAIL"] . "\n");
111
-            $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n");
107
+            $this->loggerInstance->debug(5, "PARAM_4: ".CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE."\n");
108
+            $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n");
109
+            $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n");
110
+            $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERMAIL"]."\n");
111
+            $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n");
112 112
             $this->loggerInstance->debug(5, "PARAM_9: false\n");
113 113
             $soapNewRequest = $soapPub->newRequest(
114 114
                     CertificationAuthorityEduPkiServer::EDUPKI_RA_ID, # RA-ID
@@ -130,11 +130,11 @@  discard block
 block discarded – undo
130 130
         } catch (Exception $e) {
131 131
             // PHP 7.1 can do this much better
132 132
             if (is_soap_fault($e)) {
133
-                throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}:  {
133
+                throw new Exception("Error when sending SOAP request: "."{$e->faultcode}:  {
134 134
                     $e->faultstring
135 135
                 }\n");
136 136
             }
137
-            throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage());
137
+            throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage());
138 138
         }
139 139
         try {
140 140
             $soap = $this->initEduPKISoapSession("RA");
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file
169 169
             // rather than just using the string. Grr.
170 170
             $tempdir = \core\common\Entity::createTemporaryDirectory("test");
171
-            file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext);
171
+            file_put_contents($tempdir['dir']."/content.txt", $soapCleartext);
172 172
             // retrieve our RA cert from filesystem                    
173 173
             // the RA certificates are not needed right now because we
174 174
             // have resorted to S/MIME signatures with openssl command-line
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             // sign the data, using cmdline because openssl_pkcs7_sign produces strange results
181 181
             // -binary didn't help, nor switch -md to sha1 sha256 or sha512
182 182
             $this->loggerInstance->debug(5, "Actual content to be signed is this:\n  $soapCleartext\n");
183
-        $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer " . ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem";
183
+        $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey -signer ".ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem";
184 184
             $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline:   $execCmd\n");
185 185
             $output = [];
186 186
             $return = 999;
@@ -189,21 +189,21 @@  discard block
 block discarded – undo
189 189
                 throw new Exception("Non-zero return value from openssl smime!");
190 190
             }
191 191
             // and get the signature blob back from the filesystem
192
-            $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt"));
192
+            $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt"));
193 193
             $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n");
194
-            $this->loggerInstance->debug(5, $soapReqnum . "\n");
195
-            $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending!
196
-            $this->loggerInstance->debug(5, $detachedSig . "\n");
194
+            $this->loggerInstance->debug(5, $soapReqnum."\n");
195
+            $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending!
196
+            $this->loggerInstance->debug(5, $detachedSig."\n");
197 197
             $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig);
198
-            $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest());
199
-            $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse());
198
+            $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest());
199
+            $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse());
200 200
             if ($soapIssueCert === FALSE) {
201 201
                 throw new Exception("The locally approved request was NOT processed by the CA.");
202 202
             }
203 203
         } catch (SoapFault $e) {
204
-            throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
204
+            throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
205 205
         } catch (Exception $e) {
206
-            throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage());
206
+            throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage());
207 207
         }
208 208
         return $soapReqnum;
209 209
     }
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
                 throw new Exception("CAInfo has no root certificate for us!");
256 256
             }
257 257
         } catch (SoapFault $e) {
258
-            throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
258
+            throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
259 259
         } catch (Exception $e) {
260
-            throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage());
260
+            throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage());
261 261
         }
262 262
         return [
263 263
             "CERT" => openssl_x509_read($parsedCert['pem']),
@@ -290,12 +290,12 @@  discard block
 block discarded – undo
290 290
             // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file
291 291
             // rather than just using the string. Grr.
292 292
             $tempdir = \core\common\Entity::createTemporaryDirectory("test");
293
-            file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest);
293
+            file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest);
294 294
             // retrieve our RA cert from filesystem
295 295
             // sign the data, using cmdline because openssl_pkcs7_sign produces strange results
296 296
             // -binary didn't help, nor switch -md to sha1 sha256 or sha512
297 297
             $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n");
298
-        $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY . " -signer " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT;
298
+        $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY." -signer ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT;
299 299
             $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n");
300 300
             $output = [];
301 301
             $return = 999;
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
                 throw new Exception("Non-zero return value from openssl smime!");
305 305
             }
306 306
             // and get the signature blob back from the filesystem
307
-            $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt"));
307
+            $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt"));
308 308
             $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig);
309 309
             if ($soapIssueRev === FALSE) {
310 310
                 throw new Exception("The locally approved revocation request was NOT processed by the CA.");
@@ -312,9 +312,9 @@  discard block
 block discarded – undo
312 312
         } catch (Exception $e) {
313 313
             // PHP 7.1 can do this much better
314 314
             if (is_soap_fault($e)) {
315
-                throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n");
315
+                throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n");
316 316
             }
317
-            throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage());
317
+            throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage());
318 318
         }
319 319
     }
320 320
 
@@ -414,9 +414,9 @@  discard block
 block discarded – undo
414 414
      */
415 415
     public function soapToXmlInteger($x)
416 416
     {
417
-        return '<' . $x[0] . '>'
417
+        return '<'.$x[0].'>'
418 418
                 . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1)
419
-                . '</' . $x[0] . '>';
419
+                . '</'.$x[0].'>';
420 420
     }
421 421
 
422 422
     /**
@@ -435,9 +435,9 @@  discard block
 block discarded – undo
435 435
         // dump private key into directory
436 436
         $outstring = "";
437 437
         openssl_pkey_export($privateKey, $outstring);
438
-        file_put_contents($tempdir . "/pkey.pem", $outstring);
438
+        file_put_contents($tempdir."/pkey.pem", $outstring);
439 439
         // PHP can only do one DC in the Subject. But we need three.
440
-        $execCmd = \config\Master::PATHS['openssl'] . " req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$fed/CN=$username/emailAddress=$username";
440
+        $execCmd = \config\Master::PATHS['openssl']." req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$fed/CN=$username/emailAddress=$username";
441 441
         $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n");
442 442
         $output = [];
443 443
         $return = 999;
Please login to merge, or discard this patch.
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)) {
@@ -121,13 +121,13 @@  discard block
 block discarded – undo
121 121
             throw new Exception("Calling openssl in a fancy way did not work.");
122 122
         }
123 123
         echo "<p>"._("This is the new CSR (return code was $retval)")."<pre>$newCsr</pre></p>"; */
124
-        $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN) ,"FED" => $country];
124
+        $newCsrWithMeta = ["CSR" => /* $newCsr */ $_POST['CSR'], "USERNAME" => "Someone", "USERMAIL" => "[email protected]", "SUBJECT" => implode(",", $DN), "FED" => $country];
125 125
         // our certs can be good for max 5 years
126 126
         $fed->requestCertificate($newCsrWithMeta, 1825);
127 127
         echo "<p>"._("The certificate was requested.")."</p>";
128 128
         ?>
129 129
         <form action="overview_certificates.php" method="GET">
130
-            <button type="submit"><?php echo _("Back to Certificate Overview");?></button>
130
+            <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button>
131 131
         </form>
132 132
     <?php
133 133
     echo $deco->footer();
@@ -136,14 +136,14 @@  discard block
 block discarded – undo
136 136
 
137 137
     // if we did not get a SAVE button, display UI for a fresh request instead
138 138
     ?>
139
-    <h2><?php echo _("1. Certificate Holder Details");?></h2>
139
+    <h2><?php echo _("1. Certificate Holder Details"); ?></h2>
140 140
     <form action="action_req_certificate.php" method="POST">
141 141
         <input type="radio" name="LEVEL" id="NRO" value="NRO" checked><?php printf(_("Certificate for %s role"), $uiElements->nomenclatureFed); ?></input>
142 142
         <?php
143 143
         if (count($feds) == 1) {
144 144
             $fedObject = new \core\Federation($feds[0]['value']);
145
-            echo " <strong>" . $cat->knownFederations[$fedObject->tld] . "</strong>";
146
-            echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $fedObject->tld . '"/>';
145
+            echo " <strong>".$cat->knownFederations[$fedObject->tld]."</strong>";
146
+            echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$fedObject->tld.'"/>';
147 147
         } else {
148 148
             ?>
149 149
             <select name="NRO-list" id="NRO-list">
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 <?php
152 152
                 foreach ($feds as $oneFed) {
153 153
                     $fedObject = new \core\Federation($oneFed['value']);
154
-                    echo '<option value="' . strtoupper($fedObject->tld) . '">' . $cat->knownFederations[$fedObject->tld] . "</option>";
154
+                    echo '<option value="'.strtoupper($fedObject->tld).'">'.$cat->knownFederations[$fedObject->tld]."</option>";
155 155
                 }
156 156
                 ?>
157 157
             </select>
@@ -171,15 +171,15 @@  discard block
 block discarded – undo
171 171
                 }
172 172
             }
173 173
             foreach ($allIdPs as $id => $name) {
174
-                echo '<option value="' . $id . '">' . $name . "</option>";
174
+                echo '<option value="'.$id.'">'.$name."</option>";
175 175
             }
176 176
             ?>
177 177
         </select>
178 178
         <br/>
179
-        <h2><?php echo _("2. CSR generation");?></h2>
180
-        <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:");?></p>
179
+        <h2><?php echo _("2. CSR generation"); ?></h2>
180
+        <p><?php echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p>
181 181
         <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>
182
-        <h2><?php echo _("3. Submission");?></h2>
182
+        <h2><?php echo _("3. Submission"); ?></h2>
183 183
         <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/>
184 184
     <button type="submit" name="requestcert" id="requestcert" value="<?php echo \web\lib\common\FormElements::BUTTON_SAVE ?>"><?php echo _("Send request"); ?></button>
185 185
 </form>
Please login to merge, or discard this patch.
devices/ms/WindowsCommon.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
         $this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n");
108 108
         ob_start();
109
-        $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n");
109
+        $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n");
110 110
         $source = $this->findSourceFile($source_name);
111 111
 
112 112
         if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         }
115 115
         $output = ob_get_clean();
116 116
         if ($encoding != "NONE") {
117
-            $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output);
117
+            $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output);
118 118
             if ($outputClean) {
119 119
                 $output = $outputClean;
120 120
             }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             $encoding = "NONE";
159 159
         }
160 160
         if ($encoding != "NONE") {
161
-            $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $source_string);
161
+            $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $source_string);
162 162
         } else {
163 163
             $output_c = $source_string;
164 164
         }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         if (isset(WindowsCommon::LANGS[$this->languageInstance->getLang()])) {
236 236
             $language = WindowsCommon::LANGS[$this->languageInstance->getLang()];
237 237
             $this->lang = $language['nsis'];
238
-            $this->codePage = 'cp' . $language['cp'];
238
+            $this->codePage = 'cp'.$language['cp'];
239 239
         } else {
240 240
             $this->lang = 'English';
241 241
             $this->codePage = 'cp1252';
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
         $out .= sprintf(_("%s installer will be in the form of an EXE file. It will configure %s on your device, by creating wireless network profiles.<p>When you click the download button, the installer will be saved by your browser. Copy it to the machine you want to configure and execute."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::CONSORTIUM['display_name']);
258 258
         $out .= "<p>";
259 259
         if ($ssidCount > $configCount) {
260
-            $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList)) . " ";
261
-            $out .= '<strong>' . join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)) . '</strong>';
260
+            $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList))." ";
261
+            $out .= '<strong>'.join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)).'</strong>';
262 262
             $out .= "<p>";
263 263
         }
264 264
 // TODO - change this below
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
             $out .= _("When you are connecting to the network for the first time, Windows will pop up a login box, where you should enter your user name and password. This information will be saved so that you will reconnect to the network automatically each time you are in the range.");
275 275
             if ($ssidCount > 1) {
276 276
                 $out .= "<p>";
277
-                $out .= _("You will be required to enter the same credentials for each of the configured networks:") . " ";
278
-                $out .= '<strong>' . join('</strong>, <strong>', array_keys($ssids)) . '</strong>';
277
+                $out .= _("You will be required to enter the same credentials for each of the configured networks:")." ";
278
+                $out .= '<strong>'.join('</strong>, <strong>', array_keys($ssids)).'</strong>';
279 279
             }
280 280
         }
281 281
         return $out;
@@ -380,13 +380,13 @@  discard block
 block discarded – undo
380 380
      */
381 381
     protected function signInstaller()
382 382
     {
383
-        $fileName = $this->installerBasename . '.exe';
383
+        $fileName = $this->installerBasename.'.exe';
384 384
         if (!$this->sign) {
385 385
             rename("installer.exe", $fileName);
386 386
             return $fileName;
387 387
         }
388 388
         // are actually signing
389
-        $outputFromSigning = system($this->sign . " installer.exe '$fileName' > /dev/null");
389
+        $outputFromSigning = system($this->sign." installer.exe '$fileName' > /dev/null");
390 390
         if ($outputFromSigning === FALSE) {
391 391
             $this->loggerInstance->debug(2, "Signing the WindowsCommon installer $fileName FAILED!\n");
392 392
         }
@@ -400,15 +400,15 @@  discard block
 block discarded – undo
400 400
      */
401 401
     protected function compileNSIS() {
402 402
         if (\config\ConfAssistant::NSIS_VERSION >= 3) {
403
-            $makensis = \config\ConfAssistant::PATHS['makensis'] . " -INPUTCHARSET UTF8";
403
+            $makensis = \config\ConfAssistant::PATHS['makensis']." -INPUTCHARSET UTF8";
404 404
         } else {
405 405
             $makensis = \config\ConfAssistant::PATHS['makensis'];
406 406
         }
407 407
         $lcAll = getenv("LC_ALL");
408 408
         putenv("LC_ALL=en_US.UTF-8");
409
-        $command = $makensis . ' -V4 cat.NSI > nsis.log 2>&1';
409
+        $command = $makensis.' -V4 cat.NSI > nsis.log 2>&1';
410 410
         system($command);
411
-        putenv("LC_ALL=" . $lcAll);
411
+        putenv("LC_ALL=".$lcAll);
412 412
         $this->loggerInstance->debug(4, "compileNSIS:$command\n");
413 413
     }
414 414
 
@@ -425,10 +425,10 @@  discard block
 block discarded – undo
425 425
             'email' => 'SUPPORT',
426 426
             'url' => 'URL',
427 427
         ];
428
-        $s = "support_" . $type . "_substitute";
428
+        $s = "support_".$type."_substitute";
429 429
         $substitute = $this->translateString($this->$s, $this->codePage);
430
-        $returnValue = !empty($attr['support:' . $type][0]) ? $attr['support:' . $type][0] : $substitute;
431
-        return '!define ' . $supportString[$type] . ' "' . $returnValue . '"' . "\n";
430
+        $returnValue = !empty($attr['support:'.$type][0]) ? $attr['support:'.$type][0] : $substitute;
431
+        return '!define '.$supportString[$type].' "'.$returnValue.'"'."\n";
432 432
     }
433 433
 
434 434
     /**
@@ -438,20 +438,20 @@  discard block
 block discarded – undo
438 438
      * @return string
439 439
      */
440 440
     protected function writeNsisDefines($attr) {
441
-        $fcontents = "\n" . '!define NSIS_MAJOR_VERSION ' . \config\ConfAssistant::NSIS_VERSION;
441
+        $fcontents = "\n".'!define NSIS_MAJOR_VERSION '.\config\ConfAssistant::NSIS_VERSION;
442 442
         if ($attr['internal:profile_count'][0] > 1) {
443
-            $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '"
443
+            $fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage).'"
444 444
 ';
445 445
         }
446
-        $fcontents .=  '
447
-Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '"
448
-!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '"
449
-!define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '"
446
+        $fcontents .= '
447
+Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'"
448
+!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'"
449
+!define VERSION "' . \core\CAT::VERSION_MAJOR.'.'.\core\CAT::VERSION_MINOR.'"
450 450
 !define INSTALLER_NAME "installer.exe"
451
-!define LANG "' . $this->lang . '"
452
-!define LOCALE "' . preg_replace('/\..*$/', '', \config\Master::LANGUAGES[$this->languageInstance->getLang()]['locale']) . '"
451
+!define LANG "' . $this->lang.'"
452
+!define LOCALE "' . preg_replace('/\..*$/', '', \config\Master::LANGUAGES[$this->languageInstance->getLang()]['locale']).'"
453 453
 ;--------------------------------
454
-!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '"
454
+!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage).'"
455 455
 ';
456 456
         $fcontents .= $this->getSupport($attr, 'email');
457 457
         $fcontents .= $this->getSupport($attr, 'url');
@@ -459,18 +459,18 @@  discard block
 block discarded – undo
459 459
             $fcontents .= '!define WIRED
460 460
         ';
461 461
         }
462
-        $fcontents .= '!define PROVIDERID "urn:UUID:' . $this->deviceUUID . '"
462
+        $fcontents .= '!define PROVIDERID "urn:UUID:'.$this->deviceUUID.'"
463 463
 ';
464 464
         if (!empty($attr['internal:realm'][0])) {
465
-            $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '"
465
+            $fcontents .= '!define REALM "'.$attr['internal:realm'][0].'"
466 466
 ';
467 467
         }
468 468
         if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) {
469
-            $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '"
469
+            $fcontents .= '!define HINT_USER_INPUT "'.$attr['internal:hint_userinput_suffix'][0].'"
470 470
 ';
471 471
         }
472 472
         if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) {
473
-            $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '"
473
+            $fcontents .= '!define VERIFY_USER_REALM_INPUT "'.$attr['internal:verify_userinput_suffix'][0].'"
474 474
 ';
475 475
         }
476 476
         $fcontents .= $this->msInfoFile($attr);
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
             $out .= '!define EXTERNAL_INFO "';
492 492
 //  $this->loggerInstance->debug(4,"Info file type ".$attr['support:info_file'][0]['mime']."\n");
493 493
             if ($attr['internal:info_file'][0]['mime'] == 'rtf') {
494
-                $out = '!define LICENSE_FILE "' . $attr['internal:info_file'][0]['name'];
494
+                $out = '!define LICENSE_FILE "'.$attr['internal:info_file'][0]['name'];
495 495
             } elseif ($attr['internal:info_file'][0]['mime'] == 'txt') {
496 496
                 $infoFile = file_get_contents($attr['internal:info_file'][0]['name']);
497 497
                 if ($infoFile === FALSE) {
@@ -500,14 +500,14 @@  discard block
 block discarded – undo
500 500
                 if (\config\ConfAssistant::NSIS_VERSION >= 3) {
501 501
                     $infoFileConverted = $infoFile;
502 502
                 } else {
503
-                    $infoFileConverted = iconv('UTF-8', $this->codePage . '//TRANSLIT', $infoFile);
503
+                    $infoFileConverted = iconv('UTF-8', $this->codePage.'//TRANSLIT', $infoFile);
504 504
                 }
505 505
                 if ($infoFileConverted !== FALSE && strlen($infoFileConverted) > 0) {
506 506
                     file_put_contents('info_f.txt', $infoFileConverted);
507 507
                     $out = '!define LICENSE_FILE " info_f.txt';
508 508
                 }
509 509
             } else {
510
-                $out = '!define EXTERNAL_INFO "' . $attr['internal:info_file'][0]['name'];
510
+                $out = '!define EXTERNAL_INFO "'.$attr['internal:info_file'][0]['name'];
511 511
             }
512 512
 
513 513
             $out .= "\"\n";
Please login to merge, or discard this patch.
core/ExternalEduroamDBData.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             return $this->counter;
132 132
         }
133 133
 
134
-        $cachedNumber = @file_get_contents(ROOT . "/var/tmp/cachedSPNumber.serialised");
134
+        $cachedNumber = @file_get_contents(ROOT."/var/tmp/cachedSPNumber.serialised");
135 135
         if ($cachedNumber !== FALSE) {
136 136
             $numberData = unserialize($cachedNumber);
137 137
             $now = new \DateTime();
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         } else { // data in cache is too old or doesn't exist. We really need to ask the database
145 145
             $list = $this->listAllServiceProviders();
146 146
             $this->counter = count($list);
147
-            file_put_contents(ROOT . "/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()]));
147
+            file_put_contents(ROOT."/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()]));
148 148
             return $this->counter;
149 149
         }
150 150
     }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $returnarray = [];
176 176
         $query = "SELECT id_institution AS id, country, inst_realm as realmlist, name AS collapsed_name, contact AS collapsed_contact, type FROM view_active_institution WHERE country = ?";
177 177
         if ($eduroamDbType !== NULL) {
178
-            $query .= " AND ( type = '" . ExternalEduroamDBData::TYPE_IDPSP . "' OR type = '" . $eduroamDbType . "')";
178
+            $query .= " AND ( type = '".ExternalEduroamDBData::TYPE_IDPSP."' OR type = '".$eduroamDbType."')";
179 179
         }
180 180
         $externals = $this->db->exec($query, "s", $tld);
181 181
         // was a SELECT query, so a resource and not a boolean
Please login to merge, or discard this patch.
web/user/faq.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,11 +45,11 @@  discard block
 block discarded – undo
45 45
     ],
46 46
     [
47 47
         'title' => sprintf(_("Is it safe to use %s installers?"), \config\Master::APPEARANCE['productname']),
48
-        'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Master::APPEARANCE['productname']) . ' ' . ( isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Master::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""),
48
+        'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Master::APPEARANCE['productname']).' '.(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Master::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""),
49 49
     ],
50 50
     [
51 51
         'title' => _("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"),
52
-        'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.") . " " . (isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name']) . " " : "") . sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>")
52
+        'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.")." ".(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name'])." " : "").sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>")
53 53
     ],
54 54
     [
55 55
         'title' => sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"), \config\ConfAssistant::CONSORTIUM['display_name']),
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 $consortium = \config\ConfAssistant::CONSORTIUM['display_name'];
69 69
 array_push($Faq,
70 70
         [
71
-            'id' => 'what_is_' . \config\ConfAssistant::CONSORTIUM['name'],
71
+            'id' => 'what_is_'.\config\ConfAssistant::CONSORTIUM['name'],
72 72
             'title' => sprintf(_("What is this %s thing anyway?"), $consortium),
73 73
             'text' => sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than %d hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> or <a href='http://monitor.eduroam.org/map_service_loc.php'>the %s location map</a> for more details."), $consortium, $consortium, $consortium, $SPs, $consortium, $consortium)
74 74
 ]);
Please login to merge, or discard this patch.