Passed
Push — master ( b32147...6275ed )
by Maja
06:20
created
core/common/Language.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
         $loggerInstance = new \core\common\Logging();
71 71
         $olddomain = textdomain(NULL);
72 72
         $loggerInstance->debug(4, "set_locale($domain)\n");
73
-        $loggerInstance->debug(4, ROOT . "\n");
73
+        $loggerInstance->debug(4, ROOT."\n");
74 74
         textdomain($domain);
75
-        bindtextdomain($domain, ROOT . "/translation/");
75
+        bindtextdomain($domain, ROOT."/translation/");
76 76
         return $olddomain;
77 77
     }
78 78
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             $langConverted[] = $hardSetLang;
95 95
         }
96 96
         if (!empty($_REQUEST['lang'])) {
97
-            $recoverLang = filter_input(INPUT_GET,'lang', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'lang', FILTER_SANITIZE_STRING);
97
+            $recoverLang = filter_input(INPUT_GET, 'lang', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'lang', FILTER_SANITIZE_STRING);
98 98
             $langConverted[] = $recoverLang;
99 99
         }
100 100
         \core\CAT::sessionStart();
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             $langConverted[] = $_SESSION['language'];
103 103
         }
104 104
         if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
105
-            $langs = explode(",", filter_input(INPUT_SERVER,"HTTP_ACCEPT_LANGUAGE", FILTER_SANITIZE_STRING));
105
+            $langs = explode(",", filter_input(INPUT_SERVER, "HTTP_ACCEPT_LANGUAGE", FILTER_SANITIZE_STRING));
106 106
             foreach ($langs as $lang) {
107 107
                 $result = [];
108 108
                 preg_match("/(.*);+.*/", $lang, $result);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
             // check if this language is supported by the CAT config
124 124
             foreach (\config\Master::LANGUAGES as $language => $value) {
125
-                if (preg_match("/^" . $language . ".*/", $tryLang)) {
125
+                if (preg_match("/^".$language.".*/", $tryLang)) {
126 126
                     $localeTmp = $value['locale'];
127 127
                     $langIndex = $language; // ???
128 128
                     break;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                 }
138 138
             }
139 139
         }
140
-        putenv("LC_ALL=" . $theLocale);
140
+        putenv("LC_ALL=".$theLocale);
141 141
         $_SESSION['language'] = $langIndex;
142 142
         $loggerInstance = new \core\common\Logging();
143 143
         $loggerInstance->debug(4, "selected lang:$langIndex:$theLocale\n");
Please login to merge, or discard this patch.
core/DeviceConfig.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     protected function setSupportedEapMethods($eapArray) {
84 84
         $this->supportedEapMethods = $eapArray;
85
-        $this->loggerInstance->debug(4, "This device (" . __CLASS__ . ") supports the following EAP methods: ");
85
+        $this->loggerInstance->debug(4, "This device (".__CLASS__.") supports the following EAP methods: ");
86 86
         $this->loggerInstance->debug(4, $this->supportedEapMethods);
87 87
     }
88 88
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             throw new Exception("No EAP type available.");
128 128
         }
129 129
         $this->attributes = $this->getProfileAttributes($profile);
130
-        $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id);
130
+        $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id);
131 131
 
132 132
 
133 133
         // if we are instantiating a Silverbullet profile AND have been given
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
         // create temporary directory, its full path will be saved in $this->FPATH;
152 152
         $tempDir = \core\common\Entity::createTemporaryDirectory($purpose);
153 153
         $this->FPATH = $tempDir['dir'];
154
-        mkdir($tempDir['dir'] . '/tmp');
155
-        chdir($tempDir['dir'] . '/tmp');
154
+        mkdir($tempDir['dir'].'/tmp');
155
+        chdir($tempDir['dir'].'/tmp');
156 156
         $caList = [];
157 157
         $x509 = new \core\common\X509();
158 158
         if (isset($this->attributes['eap:ca_file'])) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         }
173 173
         if (isset($this->attributes['general:logo_file'])) {
174 174
             $this->loggerInstance->debug(5, "saving IDP logo\n");
175
-            $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'],'idp');
175
+            $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'], 'idp');
176 176
         }
177 177
         if (isset($this->attributes['fed:logo_file'])) {
178 178
             $this->loggerInstance->debug(5, "saving FED logo\n");
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         $this->support_url_substitute = sprintf(_("your local %s support page"), \config\ConfAssistant::CONSORTIUM['display_name']);
189 189
 
190 190
         if ($this->signer && $this->options['sign']) {
191
-            $this->sign = ROOT . '/signer/' . $this->signer;
191
+            $this->sign = ROOT.'/signer/'.$this->signer;
192 192
         }
193 193
         $this->installerBasename = $this->getInstallerBasename();
194 194
         common\Entity::outOfThePotatoes();
@@ -244,10 +244,10 @@  discard block
 block discarded – undo
244 244
      * @return string|boolean the filename as found, with path, or FALSE if it does not exist
245 245
      */
246 246
     private function findSourceFile($file) {
247
-        if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) {
248
-            return $this->module_path . '/Files/' . $this->device_id . '/' . $file;
249
-        } elseif (is_file($this->module_path . '/Files/' . $file)) {
250
-            return $this->module_path . '/Files/' . $file;
247
+        if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) {
248
+            return $this->module_path.'/Files/'.$this->device_id.'/'.$file;
249
+        } elseif (is_file($this->module_path.'/Files/'.$file)) {
250
+            return $this->module_path.'/Files/'.$file;
251 251
         } else {
252 252
             $this->loggerInstance->debug(2, "requested file $file does not exist\n");
253 253
             return FALSE;
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
         
321 321
         $this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n");
322 322
         ob_start();
323
-        $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n");
323
+        $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n");
324 324
         $source = $this->findSourceFile($source_name);
325 325
         
326 326
         if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         }
329 329
         $output = ob_get_clean();
330 330
         if ($encoding !== 0) {
331
-            $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output);
331
+            $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output);
332 332
             if ($outputClean) {
333 333
                 $output = $outputClean;
334 334
             }
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
             return $sourceString;
369 369
         }
370 370
         if (\config\ConfAssistant::NSIS_VERSION < 3) {
371
-            $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $sourceString);
371
+            $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $sourceString);
372 372
         } else {
373 373
             $output_c = $sourceString;
374 374
         }
@@ -462,17 +462,17 @@  discard block
 block discarded – undo
462 462
      */
463 463
     private function getInstallerBasename() {
464 464
         
465
-        $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name']) . "-" . $this->getDeviceId();
465
+        $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name'])."-".$this->getDeviceId();
466 466
         if (isset($this->attributes['profile:customsuffix'][1])) { 
467 467
             // this string will end up as a filename on a filesystem, so always
468 468
             // take a latin-based language variant if available
469 469
             // and then scrub non-ASCII just in case
470
-            return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]);
470
+            return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]);
471 471
         }
472 472
         // Okay, no custom suffix. 
473 473
         // Use the configured inst name and apply shortening heuristics
474 474
         $lang_pointer = \config\Master::LANGUAGES[$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1;
475
-        $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes['general:instname'][$lang_pointer] . "\n");
475
+        $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes['general:instname'][$lang_pointer]."\n");
476 476
         $inst = $this->customTranslit($this->attributes['general:instname'][$lang_pointer]);
477 477
         $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n");
478 478
         $Inst_a = explode('_', $inst);
@@ -487,10 +487,10 @@  discard block
 block discarded – undo
487 487
             if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) {
488 488
                 $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]);
489 489
                 $prof = preg_replace('/_+$/', '', $profTemp);
490
-                return $baseName . $inst . '-' . $prof;
490
+                return $baseName.$inst.'-'.$prof;
491 491
             }
492 492
         }
493
-        return $baseName . $inst;
493
+        return $baseName.$inst;
494 494
     }
495 495
 
496 496
     /**
@@ -558,13 +558,13 @@  discard block
 block discarded – undo
558 558
      * @return array
559 559
      */
560 560
     private function getConsortia() {
561
-        if(!isset(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'])) {
561
+        if (!isset(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'])) {
562 562
             return ([]);
563 563
         }
564 564
         $consortia = \config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'];
565 565
         if (isset($this->attributes['media:consortium_OI'])) {
566 566
             foreach ($this->attributes['media:consortium_OI'] as $new_oi) {
567
-                if(!in_array($new_oi, $consortia)) {
567
+                if (!in_array($new_oi, $consortia)) {
568 568
                     $consortia[] = $new_oi;
569 569
                 }
570 570
             }
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
      * @return array list of filenames and the mime types
591 591
      * @throws Exception
592 592
      */
593
-    private function saveLogoFile($logos,$type) {
593
+    private function saveLogoFile($logos, $type) {
594 594
         $iterator = 0;
595 595
         $returnarray = [];
596 596
         foreach ($logos as $blob) {
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
                 $ext = 'unsupported';
604 604
             }
605 605
             $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n");
606
-            $fileName = 'logo-' . $type . $iterator . '.' . $ext;
606
+            $fileName = 'logo-'.$type.$iterator.'.'.$ext;
607 607
             $fileHandle = fopen($fileName, "w");
608 608
             if (!$fileHandle) {
609 609
                 $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n");
@@ -629,13 +629,13 @@  discard block
 block discarded – undo
629 629
         $mime = $finfo->buffer($blob);
630 630
         $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported';
631 631
         $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n");
632
-        $fileHandle = fopen('local-info.' . $ext, "w");
632
+        $fileHandle = fopen('local-info.'.$ext, "w");
633 633
         if ($fileHandle === FALSE) {
634 634
             throw new Exception("problem opening the file");
635 635
         }
636 636
         fwrite($fileHandle, $blob);
637 637
         fclose($fileHandle);
638
-        return(['name' => 'local-info.' . $ext, 'mime' => $ext]);
638
+        return(['name' => 'local-info.'.$ext, 'mime' => $ext]);
639 639
     }
640 640
 
641 641
     /**
@@ -686,9 +686,9 @@  discard block
 block discarded – undo
686 686
     protected function determineOuterIdString() {
687 687
         $outerId = NULL;
688 688
         if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) {
689
-            $outerId = "@" . $this->attributes['internal:realm'][0];
689
+            $outerId = "@".$this->attributes['internal:realm'][0];
690 690
             if (isset($this->attributes['internal:anon_local_value'])) {
691
-                $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId;
691
+                $outerId = $this->attributes['internal:anon_local_value'][0].$outerId;
692 692
             }
693 693
         }
694 694
         return $outerId;
Please login to merge, or discard this patch.
core/CertficationAuthorityEmbeddedRSA.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
 
16 16
 class CertificationAuthorityEmbeddedRSA extends EntityWithDBProperties implements CertificationAuthorityInterface {
17 17
 
18
-    private const LOCATION_ROOT_CA = ROOT . "/config/SilverbulletClientCerts/rootca-RSA.pem";
19
-    private const LOCATION_ISSUING_CA = ROOT . "/config/SilverbulletClientCerts/real-RSA.pem";
20
-    private const LOCATION_ISSUING_KEY = ROOT . "/config/SilverbulletClientCerts/real-RSA.key";
21
-    private const LOCATION_CONFIG = ROOT . "/config/SilverbulletClientCerts/openssl-RSA.cnf";
18
+    private const LOCATION_ROOT_CA = ROOT."/config/SilverbulletClientCerts/rootca-RSA.pem";
19
+    private const LOCATION_ISSUING_CA = ROOT."/config/SilverbulletClientCerts/real-RSA.pem";
20
+    private const LOCATION_ISSUING_KEY = ROOT."/config/SilverbulletClientCerts/real-RSA.key";
21
+    private const LOCATION_CONFIG = ROOT."/config/SilverbulletClientCerts/openssl-RSA.cnf";
22 22
 
23 23
     /**
24 24
      * string with the PEM variant of the root CA
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
         parent::__construct();
65 65
         $this->rootPem = file_get_contents(CertificationAuthorityEmbeddedRSA::LOCATION_ROOT_CA);
66 66
         if ($this->rootPem === FALSE) {
67
-            throw new Exception("Root CA PEM file not found: " . CertificationAuthorityEmbeddedRSA::LOCATION_ROOT_CA);
67
+            throw new Exception("Root CA PEM file not found: ".CertificationAuthorityEmbeddedRSA::LOCATION_ROOT_CA);
68 68
         }
69 69
         $this->issuingCertRaw = file_get_contents(CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA);
70 70
         if ($this->issuingCertRaw === FALSE) {
71
-            throw new Exception("Issuing CA PEM file not found: " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA);
71
+            throw new Exception("Issuing CA PEM file not found: ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA);
72 72
         }
73 73
         $rootParsed = openssl_x509_read($this->rootPem);
74 74
         $this->issuingCert = openssl_x509_read($this->issuingCertRaw);
@@ -76,15 +76,15 @@  discard block
 block discarded – undo
76 76
             throw new Exception("At least one CA PEM file did not parse correctly!");
77 77
         }
78 78
         if (stat(CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY) === FALSE) {
79
-            throw new Exception("Private key not found: " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY);
79
+            throw new Exception("Private key not found: ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY);
80 80
         }
81
-        $issuingKeyTemp = openssl_pkey_get_private("file://" . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY);
81
+        $issuingKeyTemp = openssl_pkey_get_private("file://".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY);
82 82
         if ($issuingKeyTemp === FALSE) {
83 83
             throw new Exception("The private key did not parse correctly!");
84 84
         }
85 85
         $this->issuingKey = $issuingKeyTemp;
86 86
         if (stat(CertificationAuthorityEmbeddedRSA::LOCATION_CONFIG) === FALSE) {
87
-            throw new Exception("openssl configuration not found: " . CertificationAuthorityEmbeddedRSA::LOCATION_CONFIG);
87
+            throw new Exception("openssl configuration not found: ".CertificationAuthorityEmbeddedRSA::LOCATION_CONFIG);
88 88
         }
89 89
         $this->conffile = CertificationAuthorityEmbeddedRSA::LOCATION_CONFIG;
90 90
     }
@@ -126,27 +126,27 @@  discard block
 block discarded – undo
126 126
         // generate stub index.txt file
127 127
         $tempdirArray = \core\common\Entity::createTemporaryDirectory("test");
128 128
         $tempdir = $tempdirArray['dir'];
129
-        $nowIndexTxt = (new \DateTime())->format("ymdHis") . "Z";
130
-        $expiryIndexTxt = $originalExpiry->format("ymdHis") . "Z";
129
+        $nowIndexTxt = (new \DateTime())->format("ymdHis")."Z";
130
+        $expiryIndexTxt = $originalExpiry->format("ymdHis")."Z";
131 131
         // serials for our CA are always integers
132
-        $serialHex = strtoupper(dechex((int)$cert->serial));
132
+        $serialHex = strtoupper(dechex((int) $cert->serial));
133 133
         if (strlen($serialHex) % 2 == 1) {
134
-            $serialHex = "0" . $serialHex;
134
+            $serialHex = "0".$serialHex;
135 135
         }
136 136
 
137
-        $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$federation/CN=$cert->username\n";
137
+        $indexStatement = "$certstatus\t$expiryIndexTxt\t".($certstatus == "R" ? "$nowIndexTxt,unspecified" : "")."\t$serialHex\tunknown\t/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$federation/CN=$cert->username\n";
138 138
         $this->loggerInstance->debug(4, "index.txt contents-to-be: $indexStatement");
139
-        if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) {
139
+        if (!file_put_contents($tempdir."/index.txt", $indexStatement)) {
140 140
             $this->loggerInstance->debug(1, "Unable to write openssl index.txt file for revocation handling!");
141 141
         }
142 142
         // index.txt.attr is dull but needs to exist
143
-        file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n");
143
+        file_put_contents($tempdir."/index.txt.attr", "unique_subject = yes\n");
144 144
         // call "openssl ocsp" to manufacture our own OCSP statement
145 145
         // adding "-rmd sha1" to the following command-line makes the
146 146
         // choice of signature algorithm for the response explicit
147 147
         // but it's only available from openssl-1.1.0 (which we do not
148 148
         // want to require just for that one thing).
149
-        $execCmd = \config\Master::PATHS['openssl'] . " ocsp -issuer " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA . " -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA . " -rsigner " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA . " -rkey " . CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY . " -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der";
149
+        $execCmd = \config\Master::PATHS['openssl']." ocsp -issuer ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA." -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA." -rsigner ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_CA." -rkey ".CertificationAuthorityEmbeddedRSA::LOCATION_ISSUING_KEY." -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der";
150 150
         $this->loggerInstance->debug(2, "Calling openssl ocsp with following cmdline: $execCmd\n");
151 151
         $output = [];
152 152
         $return = 999;
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
         if ($return !== 0) {
155 155
             throw new Exception("Non-zero return value from openssl ocsp!");
156 156
         }
157
-        $ocsp = file_get_contents($tempdir . "/$serialHex.response.der");
157
+        $ocsp = file_get_contents($tempdir."/$serialHex.response.der");
158 158
         // remove the temp dir!
159
-        unlink($tempdir . "/$serialHex.response.der");
160
-        unlink($tempdir . "/index.txt.attr");
161
-        unlink($tempdir . "/index.txt");
159
+        unlink($tempdir."/$serialHex.response.der");
160
+        unlink($tempdir."/index.txt.attr");
161
+        unlink($tempdir."/index.txt");
162 162
         rmdir($tempdir);
163 163
         $this->databaseHandle->exec("UPDATE silverbullet_certificate SET OCSP = ?, OCSP_timestamp = NOW() WHERE serial_number = ?", "si", $ocsp, $cert->serial);
164 164
         return $ocsp;
Please login to merge, or discard this patch.
core/CertficationAuthorityEmbeddedECDSA.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
 
16 16
 class CertificationAuthorityEmbeddedECDSA extends EntityWithDBProperties implements CertificationAuthorityInterface {
17 17
 
18
-    private const LOCATION_ROOT_CA = ROOT . "/config/SilverbulletClientCerts/rootca-ECDSA.pem";
19
-    private const LOCATION_ISSUING_CA = ROOT . "/config/SilverbulletClientCerts/real-ECDSA.pem";
20
-    private const LOCATION_ISSUING_KEY = ROOT . "/config/SilverbulletClientCerts/real-ECDSA.key";
21
-    private const LOCATION_CONFIG = ROOT . "/config/SilverbulletClientCerts/openssl-ECDSA.cnf";
18
+    private const LOCATION_ROOT_CA = ROOT."/config/SilverbulletClientCerts/rootca-ECDSA.pem";
19
+    private const LOCATION_ISSUING_CA = ROOT."/config/SilverbulletClientCerts/real-ECDSA.pem";
20
+    private const LOCATION_ISSUING_KEY = ROOT."/config/SilverbulletClientCerts/real-ECDSA.key";
21
+    private const LOCATION_CONFIG = ROOT."/config/SilverbulletClientCerts/openssl-ECDSA.cnf";
22 22
 
23 23
     /**
24 24
      * string with the PEM variant of the root CA
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
         parent::__construct();
65 65
         $this->rootPem = file_get_contents(CertificationAuthorityEmbeddedECDSA::LOCATION_ROOT_CA);
66 66
         if ($this->rootPem === FALSE) {
67
-            throw new Exception("Root CA PEM file not found: " . CertificationAuthorityEmbeddedECDSA::LOCATION_ROOT_CA);
67
+            throw new Exception("Root CA PEM file not found: ".CertificationAuthorityEmbeddedECDSA::LOCATION_ROOT_CA);
68 68
         }
69 69
         $this->issuingCertRaw = file_get_contents(CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA);
70 70
         if ($this->issuingCertRaw === FALSE) {
71
-            throw new Exception("Issuing CA PEM file not found: " . CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA);
71
+            throw new Exception("Issuing CA PEM file not found: ".CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_CA);
72 72
         }
73 73
         $rootParsed = openssl_x509_read($this->rootPem);
74 74
         $this->issuingCert = openssl_x509_read($this->issuingCertRaw);
@@ -76,15 +76,15 @@  discard block
 block discarded – undo
76 76
             throw new Exception("At least one CA PEM file did not parse correctly!");
77 77
         }
78 78
         if (stat(CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY) === FALSE) {
79
-            throw new Exception("Private key not found: " . CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY);
79
+            throw new Exception("Private key not found: ".CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY);
80 80
         }
81
-        $issuingKeyTemp = openssl_pkey_get_private("file://" . CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY);
81
+        $issuingKeyTemp = openssl_pkey_get_private("file://".CertificationAuthorityEmbeddedECDSA::LOCATION_ISSUING_KEY);
82 82
         if ($issuingKeyTemp === FALSE) {
83 83
             throw new Exception("The private key did not parse correctly!");
84 84
         }
85 85
         $this->issuingKey = $issuingKeyTemp;
86 86
         if (stat(CertificationAuthorityEmbeddedECDSA::LOCATION_CONFIG) === FALSE) {
87
-            throw new Exception("openssl configuration not found: " . CertificationAuthorityEmbeddedECDSA::LOCATION_CONFIG);
87
+            throw new Exception("openssl configuration not found: ".CertificationAuthorityEmbeddedECDSA::LOCATION_CONFIG);
88 88
         }
89 89
         $this->conffile = CertificationAuthorityEmbeddedECDSA::LOCATION_CONFIG;
90 90
     }
@@ -126,27 +126,27 @@  discard block
 block discarded – undo
126 126
         // generate stub index.txt file
127 127
         $tempdirArray = \core\common\Entity::createTemporaryDirectory("test");
128 128
         $tempdir = $tempdirArray['dir'];
129
-        $nowIndexTxt = (new \DateTime())->format("ymdHis") . "Z";
130
-        $expiryIndexTxt = $originalExpiry->format("ymdHis") . "Z";
129
+        $nowIndexTxt = (new \DateTime())->format("ymdHis")."Z";
130
+        $expiryIndexTxt = $originalExpiry->format("ymdHis")."Z";
131 131
         // serials for our CA are always integers
132
-        $serialHex = strtoupper(dechex((int)$cert->serial));
132
+        $serialHex = strtoupper(dechex((int) $cert->serial));
133 133
         if (strlen($serialHex) % 2 == 1) {
134
-            $serialHex = "0" . $serialHex;
134
+            $serialHex = "0".$serialHex;
135 135
         }
136 136
 
137
-        $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$federation/CN=$cert->username\n";
137
+        $indexStatement = "$certstatus\t$expiryIndexTxt\t".($certstatus == "R" ? "$nowIndexTxt,unspecified" : "")."\t$serialHex\tunknown\t/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$federation/CN=$cert->username\n";
138 138
         $this->loggerInstance->debug(4, "index.txt contents-to-be: $indexStatement");
139
-        if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) {
139
+        if (!file_put_contents($tempdir."/index.txt", $indexStatement)) {
140 140
             $this->loggerInstance->debug(1, "Unable to write openssl index.txt file for revocation handling!");
141 141
         }
142 142
         // index.txt.attr is dull but needs to exist
143
-        file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n");
143
+        file_put_contents($tempdir."/index.txt.attr", "unique_subject = yes\n");
144 144
         // call "openssl ocsp" to manufacture our own OCSP statement
145 145
         // adding "-rmd sha1" to the following command-line makes the
146 146
         // choice of signature algorithm for the response explicit
147 147
         // but it's only available from openssl-1.1.0 (which we do not
148 148
         // want to require just for that one thing).
149
-        $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";
149
+        $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";
150 150
         $this->loggerInstance->debug(2, "Calling openssl ocsp with following cmdline: $execCmd\n");
151 151
         $output = [];
152 152
         $return = 999;
@@ -154,11 +154,11 @@  discard block
 block discarded – undo
154 154
         if ($return !== 0) {
155 155
             throw new Exception("Non-zero return value from openssl ocsp!");
156 156
         }
157
-        $ocsp = file_get_contents($tempdir . "/$serialHex.response.der");
157
+        $ocsp = file_get_contents($tempdir."/$serialHex.response.der");
158 158
         // remove the temp dir!
159
-        unlink($tempdir . "/$serialHex.response.der");
160
-        unlink($tempdir . "/index.txt.attr");
161
-        unlink($tempdir . "/index.txt");
159
+        unlink($tempdir."/$serialHex.response.der");
160
+        unlink($tempdir."/index.txt.attr");
161
+        unlink($tempdir."/index.txt");
162 162
         rmdir($tempdir);
163 163
         $this->databaseHandle->exec("UPDATE silverbullet_certificate SET OCSP = ?, OCSP_timestamp = NOW() WHERE serial_number = ?", "si", $ocsp, $cert->serial);
164 164
         return $ocsp;
Please login to merge, or discard this patch.
web/user/faq.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,19 +50,19 @@  discard block
 block discarded – undo
50 50
 
51 51
 array_push($FAQ, [
52 52
     'title' => sprintf(_("Is it safe to use %s installers?"), \config\Master::APPEARANCE['productname']),
53
-    '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']) : ""),
53
+    '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']) : ""),
54 54
 ]);
55 55
 
56 56
 array_push($FAQ, [
57 57
     'title' => _("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"),
58
-    '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>")
58
+    '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>")
59 59
 ]);
60 60
 
61 61
 if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == NULL) {
62 62
     $text = sprintf(_("There can be a number of different reasons. The network you see may not be a genuine %s one and your device silently drops the connection attempt; there may be something wrong with the configuration of the network; your account may have expired; there may be a connection problem with your home authentication server; you may have broken the regulations of the network you are using and have been refused access as a consequence. You should contact your organisation and report the problem, the administrators should be able to trace your connections."), \config\ConfAssistant::CONSORTIUM['display_name']);
63 63
 } else {
64 64
     if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == 'LOCAL') {
65
-        $diagUrl = \config\Master::PATHS['cat_base_url'] . "diag/";
65
+        $diagUrl = \config\Master::PATHS['cat_base_url']."diag/";
66 66
     } else {
67 67
         $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'];
68 68
     }
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
     $tocText = "";
100 100
     $fullText = "";
101 101
     foreach ($FAQ as $faq) {
102
-        $tocText .= '<a href="#toc' . $counter . '">' . $faq['title'] . "</a><br>\n";
103
-        $fullText .= "<dt><a name=toc$counter>" . $faq['title'] . "</a></dt>\n<dd>" . $faq['text'] . "</dd>\n";
102
+        $tocText .= '<a href="#toc'.$counter.'">'.$faq['title']."</a><br>\n";
103
+        $fullText .= "<dt><a name=toc$counter>".$faq['title']."</a></dt>\n<dd>".$faq['text']."</dd>\n";
104 104
         $counter++;
105 105
     }
106 106
     ?>
Please login to merge, or discard this patch.
web/admin/edit_federation.php 1 patch
Spacing   +6 added lines, -6 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();
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         ?>
62 62
     </h1>
63 63
     <div class='infobox'>
64
-        <h2><?php echo sprintf(_("%s Properties"),$uiElements->nomenclatureFed); ?></h2>
64
+        <h2><?php echo sprintf(_("%s Properties"), $uiElements->nomenclatureFed); ?></h2>
65 65
         <table>
66 66
             <tr>
67 67
                 <td><?php echo _("Country:"); ?></td>
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
         </table>
73 73
     </div>
74 74
     <?php
75
-    echo "<form enctype='multipart/form-data' action='edit_federation_result.php?fed_id=$my_fed->tld" . "' method='post' accept-charset='UTF-8'>
76
-              <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
75
+    echo "<form enctype='multipart/form-data' action='edit_federation_result.php?fed_id=$my_fed->tld"."' method='post' accept-charset='UTF-8'>
76
+              <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE."'>";
77 77
     ?>
78 78
     <fieldset class="option_container">
79
-        <legend><strong><?php echo sprintf(_("%s Properties"),$uiElements->nomenclatureFed); ?></strong></legend>
79
+        <legend><strong><?php echo sprintf(_("%s Properties"), $uiElements->nomenclatureFed); ?></strong></legend>
80 80
         <?php
81 81
         $optionDisplay = new \web\lib\admin\OptionDisplay($fed_options, "FED");
82 82
         echo $optionDisplay->prefilledOptionTable("fed");
@@ -84,5 +84,5 @@  discard block
 block discarded – undo
84 84
         <button type='button' class='newoption' onclick='getXML("fed")'><?php echo _("Add new option"); ?></button>
85 85
     </fieldset>
86 86
     <?php
87
-    echo "<div><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button> <button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_federation.php\"'>" . _("Discard changes") . "</button></div></form>";
87
+    echo "<div><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button> <button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_federation.php\"'>"._("Discard changes")."</button></div></form>";
88 88
     echo $deco->footer();
Please login to merge, or discard this patch.
web/admin/edit_participant.php 1 patch
Spacing   +31 added lines, -31 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(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 $auth = new \web\lib\admin\Authentication();
25 25
 $deco = new \web\lib\admin\PageDecoration();
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 $inst_name = $my_inst->name;
40 40
 
41 41
 if ($wizardStyle) {
42
-    echo $deco->defaultPagePrelude(sprintf(_("%s: %s enrollment wizard (step 2)"), \config\Master::APPEARANCE['productname'],  $uiElements->nomenclatureParticipant));
42
+    echo $deco->defaultPagePrelude(sprintf(_("%s: %s enrollment wizard (step 2)"), \config\Master::APPEARANCE['productname'], $uiElements->nomenclatureParticipant));
43 43
 } else {
44 44
     echo $deco->defaultPagePrelude(sprintf(_("%s: Editing %s '%s'"), \config\Master::APPEARANCE['productname'], $uiElements->nomenclatureParticipant, $inst_name));
45 45
 }
@@ -94,12 +94,12 @@  discard block
 block discarded – undo
94 94
         </table>
95 95
     </div>
96 96
     <?php
97
-    echo "<form enctype='multipart/form-data' action='edit_participant_result.php?inst_id=$my_inst->identifier" . ($wizardStyle ? "&wizard=true" : "") . "' method='post' accept-charset='UTF-8'>
98
-              <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
97
+    echo "<form enctype='multipart/form-data' action='edit_participant_result.php?inst_id=$my_inst->identifier".($wizardStyle ? "&wizard=true" : "")."' method='post' accept-charset='UTF-8'>
98
+              <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE."'>";
99 99
 
100 100
     if ($wizardStyle) {
101
-        echo "<p>" .
102
-        sprintf(_("Hello, newcomer. The %s is new to us. This wizard will ask you several questions about it, so that we can generate beautiful profiles for you in the end. All of the information below is optional, but it is important to fill out as many fields as possible for the benefit of your end users."), $uiElements->nomenclatureParticipant) . "</p>";
101
+        echo "<p>".
102
+        sprintf(_("Hello, newcomer. The %s is new to us. This wizard will ask you several questions about it, so that we can generate beautiful profiles for you in the end. All of the information below is optional, but it is important to fill out as many fields as possible for the benefit of your end users."), $uiElements->nomenclatureParticipant)."</p>";
103 103
     }
104 104
     $optionDisplay = new web\lib\admin\OptionDisplay($idpoptions, "IdP");
105 105
     ?>
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
         <legend><strong><?php echo _("General Information"); ?></strong></legend>
108 108
         <?php
109 109
         if ($wizardStyle) {
110
-            echo "<p>" .
111
-            _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:") . "</p>
110
+            echo "<p>".
111
+            _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:")."</p>
112 112
                       <ul>
113
-                         <li>" . _("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).") . "</li>
114
-                         <li>" . sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."),$uiElements->nomenclatureParticipant) . "</li>";
113
+                         <li>" . _("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).")."</li>
114
+                         <li>" . sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."), $uiElements->nomenclatureParticipant)."</li>";
115 115
             echo "</ul>";
116 116
         }
117 117
         echo $optionDisplay->prefilledOptionTable("general");
@@ -125,47 +125,47 @@  discard block
 block discarded – undo
125 125
         <legend><strong><?php echo _("Media Properties"); ?></strong></legend>
126 126
         <?php
127 127
         if ($wizardStyle) {
128
-            echo "<p>" .
129
-            sprintf(_("In this section, you define on which media %s should be configured on user devices."), \config\ConfAssistant::CONSORTIUM['display_name']) . "</p>
128
+            echo "<p>".
129
+            sprintf(_("In this section, you define on which media %s should be configured on user devices."), \config\ConfAssistant::CONSORTIUM['display_name'])."</p>
130 130
           <ul>";
131 131
             echo "<li>";
132
-            echo "<strong>" . ( count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:")) . " </strong>";
132
+            echo "<strong>".(count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:"))." </strong>";
133 133
             if (count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0) {
134 134
                 $ssidlist = "";
135 135
                 foreach (\config\ConfAssistant::CONSORTIUM['ssid'] as $ssid) {
136
-                    $ssidlist .= ", '<strong>" . $ssid . "</strong>'";
136
+                    $ssidlist .= ", '<strong>".$ssid."</strong>'";
137 137
                 }
138 138
                 $ssidlist = substr($ssidlist, 2);
139 139
                 echo sprintf(ngettext("We will always configure this SSID for WPA2/AES: %s.", "We will always configure these SSIDs for WPA2/AES: %s.", count(\config\ConfAssistant::CONSORTIUM['ssid'])), $ssidlist);
140 140
                 if (\config\ConfAssistant::CONSORTIUM['tkipsupport']) {
141
-                    echo " " . _("They will also be configured for WPA/TKIP if the device supports multiple encryption types.");
141
+                    echo " "._("They will also be configured for WPA/TKIP if the device supports multiple encryption types.");
142 142
                 }
143
-                echo "<br/>" . sprintf(_("It is also possible to define custom additional SSIDs with the options '%s' and '%s' below."), $uiElements->displayName("media:SSID"), $uiElements->displayName("media:SSID_with_legacy"));
143
+                echo "<br/>".sprintf(_("It is also possible to define custom additional SSIDs with the options '%s' and '%s' below."), $uiElements->displayName("media:SSID"), $uiElements->displayName("media:SSID_with_legacy"));
144 144
             } else {
145 145
                 echo _("Please configure which SSIDs should be configured in the installers.");
146 146
             }
147
-            echo " " . _("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible.");
147
+            echo " "._("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible.");
148 148
             echo "</li>";
149 149
 
150 150
             echo "<li>";
151
-            echo "<strong>" . ( count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:")) . " </strong>";
151
+            echo "<strong>".(count(\config\ConfAssistant::CONSORTIUM['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:"))." </strong>";
152 152
             if (count(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi']) > 0) {
153 153
                 $consortiumlist = "";
154 154
                 foreach (\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'] as $oi) {
155
-                    $consortiumlist .= ", '<strong>" . $oi . "</strong>'";
155
+                    $consortiumlist .= ", '<strong>".$oi."</strong>'";
156 156
                 }
157 157
                 $consortiumlist = substr($consortiumlist, 2);
158 158
                 echo sprintf(ngettext("We will always configure this Consortium OI: %s.", "We will always configure these Consortium OIs: %s.", count(\config\ConfAssistant::CONSORTIUM['interworking-consortium-oi'])), $consortiumlist);
159 159
 
160
-                echo "<br/>" . sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $uiElements->displayName("media:consortium_OI"));
160
+                echo "<br/>".sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $uiElements->displayName("media:consortium_OI"));
161 161
             } else {
162 162
                 echo _("Please configure which Consortium OIs should be configured in the installers.");
163 163
             }
164 164
             echo "</li>";
165
-            echo "<li><strong>" . _("Support for wired IEEE 802.1X:") . " </strong>"
166
-            . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail).") .
165
+            echo "<li><strong>"._("Support for wired IEEE 802.1X:")." </strong>"
166
+            . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail).").
167 167
             "</li>";
168
-            echo "<li><strong>" . _("Removal of bootstrap/onboarding SSIDs:") . " </strong>"
168
+            echo "<li><strong>"._("Removal of bootstrap/onboarding SSIDs:")." </strong>"
169 169
             . _("If you use a captive portal to distribute configurations, you may want to unconfigure/disable that SSID after the bootstrap process. With this option, the SSID will either be removed, or be defined as 'Only connect manually'.")
170 170
             . "</li>";
171 171
             echo "</ul>";
@@ -181,16 +181,16 @@  discard block
 block discarded – undo
181 181
             echo "<p>"._("This section can be used to upload specific Terms of Use for your users and to display details of how your users can reach your local helpdesk.")."</p>";
182 182
             
183 183
             if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == "LOCAL") {
184
-                echo "<p>" .
184
+                echo "<p>".
185 185
                         
186
-                sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."),$uiElements->nomenclatureParticipant)  . "</p>" .
187
-                "<p>" .
188
-                _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.") . "</p>";
186
+                sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."), $uiElements->nomenclatureParticipant)."</p>".
187
+                "<p>".
188
+                _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.")."</p>";
189 189
                 if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
190
-                echo "<p>" . sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), core\ProfileSilverbullet::PRODUCTNAME) ." " . _("This is the contact point for your end users' level 1 support.") . "</p>";
190
+                echo "<p>".sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), core\ProfileSilverbullet::PRODUCTNAME)." "._("This is the contact point for your end users' level 1 support.")."</p>";
191 191
                 }
192 192
             } elseif (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL") {
193
-                echo "<p>". _("Providing at least a local support e-mail contact is required.")." "._("This is the contact point for your end users' level 1 support.")."</p>";
193
+                echo "<p>"._("Providing at least a local support e-mail contact is required.")." "._("This is the contact point for your end users' level 1 support.")."</p>";
194 194
             }
195 195
             
196 196
         }
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
         <button type='button' class='newoption' onclick='getXML("support")'><?php echo _("Add new option"); ?></button></fieldset>
201 201
     <?php
202 202
     if ($wizardStyle) {
203
-        echo "<p>" . sprintf(_("When you are sure that everything is correct, please click on %sContinue ...%s"), "<button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CONTINUE . "'>", "</button>") . "</p></form>";
203
+        echo "<p>".sprintf(_("When you are sure that everything is correct, please click on %sContinue ...%s"), "<button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CONTINUE."'>", "</button>")."</p></form>";
204 204
     } else {
205
-        echo "<div><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button> <button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_user.php\"'>" . _("Discard changes") . "</button></div></form>";
205
+        echo "<div><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button> <button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_user.php\"'>"._("Discard changes")."</button></div></form>";
206 206
     }
207 207
     echo $deco->footer();
Please login to merge, or discard this patch.
web/admin/sanity_tests.php 1 patch
Spacing   +2 added lines, -2 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(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 $Tests = [
25 25
     'CatBaseUrl',
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 $uiElements = new \web\lib\admin\UIElements();
44 44
 
45
-if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || \config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == "LOCAL" ) {
45
+if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || \config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == "LOCAL") {
46 46
     $Tests[] = 'Makensis';
47 47
     $Tests[] = 'Makensis=>NSISmodules';
48 48
 }
Please login to merge, or discard this patch.
web/admin/overview_idp.php 1 patch
Spacing   +27 added lines, -27 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
 $deco = new \web\lib\admin\PageDecoration();
32 32
 $validator = new \web\lib\common\InputValidation();
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 } else {
39 39
     $link = 'http://';
40 40
 }
41
-$link .= $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'];
41
+$link .= $_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
42 42
 $link = htmlspecialchars($link);
43 43
 
44 44
 echo $deco->defaultPagePrelude(sprintf(_("%s: %s Dashboard"), \config\Master::APPEARANCE['productname'], $uiElements->nomenclatureInst));
@@ -84,10 +84,10 @@  discard block
 block discarded – undo
84 84
     $readonly = \config\Master::DB['INST']['readonly'];
85 85
     $profiles_for_this_idp = $my_inst->listProfiles();
86 86
     if (count($profiles_for_this_idp) == 0) { // no profiles yet.
87
-        echo "<h2>" . sprintf(_("There are not yet any profiles for your %s."), $uiElements->nomenclatureInst) . "</h2>";
87
+        echo "<h2>".sprintf(_("There are not yet any profiles for your %s."), $uiElements->nomenclatureInst)."</h2>";
88 88
     }
89 89
     if (count($profiles_for_this_idp) > 0) { // no profiles yet.
90
-        echo "<h2>" . sprintf(_("Profiles for this %s"), $uiElements->nomenclatureInst) . "</h2>";
90
+        echo "<h2>".sprintf(_("Profiles for this %s"), $uiElements->nomenclatureInst)."</h2>";
91 91
     }
92 92
 // if there is one profile and it is of type Silver Bullet, display a very
93 93
 // simple widget with just a "Manage" button
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                             echo _("Information needed!");
114 114
                             echo "<ul style='margin:1px'>";
115 115
                             foreach ($completeness as $missing_attrib) {
116
-                                echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
116
+                                echo "<li>".$uiElements->displayName($missing_attrib)."</li>";
117 117
                             }
118 118
                             echo "</ul>";
119 119
                             echo "</div>";
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                         if ($readonly === FALSE) {
128 128
                             ?>
129 129
                             <form action='edit_silverbullet.php?inst_id=<?php echo $my_inst->identifier; ?>&amp;profile_id=<?php echo $profile_list->identifier; ?>' method='POST'>
130
-                                <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
130
+                                <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
131 131
                             </form>
132 132
                             <?php
133 133
                         }
@@ -159,21 +159,21 @@  discard block
 block discarded – undo
159 159
                         $has_overrides = TRUE;
160 160
                     }
161 161
                 }
162
-                $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>";
162
+                $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>";
163 163
                 $typelist = $profile_list->getEapMethodsinOrderOfPreference();
164 164
                 $allcomplete = TRUE;
165 165
                 foreach ($typelist as $eaptype) {
166 166
                     $buffer_eaptypediv .= $eaptype->getPrintableRep();
167 167
                     $completeness = $profile_list->isEapTypeDefinitionComplete($eaptype);
168 168
                     if ($completeness === true) {
169
-                        $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>";
169
+                        $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>";
170 170
                     } else {
171 171
                         $buffer_eaptypediv .= " <div class='notacceptable'>";
172 172
                         $buffer_eaptypediv .= _("Information needed!");
173 173
                         if (is_array($completeness)) {
174 174
                             $buffer_eaptypediv .= "<ul style='margin:1px'>";
175 175
                             foreach ($completeness as $missing_attrib) {
176
-                                $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
176
+                                $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>";
177 177
                             }
178 178
                             $buffer_eaptypediv .= "</ul>";
179 179
                         }
@@ -185,12 +185,12 @@  discard block
 block discarded – undo
185 185
                     foreach ($attribs as $attrib) {
186 186
                         if ($attrib['level'] == "Method" && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) {
187 187
                             $justOnce = TRUE;
188
-                            $buffer_eaptypediv .= "<img src='../resources/images/icons/Letter-E-blue-icon.png' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>";
188
+                            $buffer_eaptypediv .= "<img src='../resources/images/icons/Letter-E-blue-icon.png' alt='"._("Options on EAP Method/Device level are in effect.")."'>";
189 189
                         }
190 190
                     }
191 191
                     $buffer_eaptypediv .= "<br/>";
192 192
                 }
193
-                $buffer_headline = "<div style='padding-bottom:20px;'><h2 style='overflow:auto; display:inline; padding-bottom: 10px;'>" . sprintf(_("Profile: %s"), $profile_name) . "</h2>";
193
+                $buffer_headline = "<div style='padding-bottom:20px;'><h2 style='overflow:auto; display:inline; padding-bottom: 10px;'>".sprintf(_("Profile: %s"), $profile_name)."</h2>";
194 194
 
195 195
                 $buffer_headline .= "<span style='float:right;'>";
196 196
                 $readiness = $profile_list->readinessLevel();
@@ -222,18 +222,18 @@  discard block
 block discarded – undo
222 222
                     if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") {
223 223
                         $diagUrl = "../diag/";
224 224
                     } else {
225
-                        $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/";
225
+                        $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/";
226 226
                     }
227
-                    echo "<form action='" . $diagUrl . "action_realmcheck.php?inst_id=$my_inst->identifier&amp;profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'>
227
+                    echo "<form action='".$diagUrl."action_realmcheck.php?inst_id=$my_inst->identifier&amp;profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'>
228 228
                               <input type='hidden' name='comefrom' id='comefrom-$profilecount' value='$link'/>
229
-                              <button type='submit' name='profile_action' value='check' " . ($has_realm ? "" : "disabled='disabled' title='" . _("The realm can only be checked if you configure the realm!") . "'") . ">
230
-                                  " . _("Check realm reachability") . "
229
+                              <button type='submit' name='profile_action' value='check' ".($has_realm ? "" : "disabled='disabled' title='"._("The realm can only be checked if you configure the realm!")."'").">
230
+                                  " . _("Check realm reachability")."
231 231
                               </button>
232 232
                           </form>";
233 233
                 }
234 234
                 echo "<form action='overview_installers.php?inst_id=$my_inst->identifier&amp;profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'>
235
-                              <button type='submit' name='profile_action' value='check' " . ($has_eaptypes ? "" : "disabled='disabled'  title='" . _("You have not fully configured any supported EAP types!") . "'") . ">
236
-                                  " . _("Installer Fine-Tuning and Download") . "
235
+                              <button type='submit' name='profile_action' value='check' ".($has_eaptypes ? "" : "disabled='disabled'  title='"._("You have not fully configured any supported EAP types!")."'").">
236
+                                  " . _("Installer Fine-Tuning and Download")."
237 237
                               </button>
238 238
                  </form>
239 239
                    </div>";
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
                     echo "        <div class='buttongroupprofilebox' style='clear:both;'>
243 243
                           <form action='edit_profile.php?inst_id=$my_inst->identifier&amp;profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'>
244 244
                                <hr/>
245
-                               <button type='submit' name='profile_action' value='edit'>" . _("Edit") . "</button>
245
+                               <button type='submit' name='profile_action' value='edit'>"._("Edit")."</button>
246 246
                           </form>
247 247
                           <form action='edit_profile_result.php?inst_id=$my_inst->identifier&amp;profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'>
248
-                               <button class='delete' type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_DELETE . "' onclick=\"return confirm('" . sprintf(_("Do you really want to delete the profile %s?"), $profile_name) . "')\">
249
-                                   " . _("Delete") . "
248
+                               <button class='delete' type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_DELETE."' onclick=\"return confirm('".sprintf(_("Do you really want to delete the profile %s?"), $profile_name)."')\">
249
+                                   " . _("Delete")."
250 250
                                </button>
251 251
                            </form>
252 252
                       </div>";
@@ -255,10 +255,10 @@  discard block
 block discarded – undo
255 255
 // dummy width to keep a little distance
256 256
                 echo "<div style='width:20px;'></div>";
257 257
                 if ($readiness == core\AbstractProfile::READINESS_LEVEL_SHOWTIME) {
258
-                    $idpLevelUrl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier;
259
-                    echo "<div style='display: table-cell; text-align:center;'><p><strong>" . _("User Download Link") . "</strong></p>";
260
-                    $displayurl = $idpLevelUrl . "&amp;profile=" . $profile_list->identifier;
261
-                    $QRurl = $idpLevelUrl . "&profile=" . $profile_list->identifier;
258
+                    $idpLevelUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$my_inst->identifier;
259
+                    echo "<div style='display: table-cell; text-align:center;'><p><strong>"._("User Download Link")."</strong></p>";
260
+                    $displayurl = $idpLevelUrl."&amp;profile=".$profile_list->identifier;
261
+                    $QRurl = $idpLevelUrl."&profile=".$profile_list->identifier;
262 262
                     $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([
263 263
                                 'outputType' => \chillerlan\QRCode\QRCode::OUTPUT_IMAGE_PNG,
264 264
                                 'eccLevel' => \chillerlan\QRCode\QRCode::ECC_H,
@@ -270,16 +270,16 @@  discard block
 block discarded – undo
270 270
                     if ($rawQr === NULL) {
271 271
                         throw new Exception("Something went seriously wrong during QR code generation!");
272 272
                     }
273
-                    $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
273
+                    $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
274 274
                     $size = getimagesize($uri);
275
-                    echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>";
275
+                    echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>";
276 276
 
277 277
                     //echo "<nobr>$displayurl</nobr></a>";
278 278
                     echo "<p>$displayurl</p></a>";
279 279
                     echo "</div>";
280 280
                     // dummy width to keep a little distance
281 281
                     echo "<div style='width:20px;'></div>";
282
-                    echo "<div style='display: table-cell; min-width:200px;'><p><strong>" . _("User Downloads") . "</strong></p><table>";
282
+                    echo "<div style='display: table-cell; min-width:200px;'><p><strong>"._("User Downloads")."</strong></p><table>";
283 283
                     $stats = $profile_list->getUserDownloadStats();
284 284
                     foreach ($stats as $dev => $count) {
285 285
                         echo "<tr><td><strong>$dev</strong></td><td>$count</td></tr>";
Please login to merge, or discard this patch.