Passed
Push — master ( b56199...1b89e6 )
by Tomasz
14:34
created
core/User.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
             return false;
174 174
         }
175 175
         $entityId = $matches[1];
176
-        $url = \config\Diagnostics::EDUGAINRESOLVER['url'] . "?action=get_entity_name&type=idp&opt=2&e_id=$entityId";
177
-        \core\common\Logging::debug_s(4, $url, "URL: ","\n");
176
+        $url = \config\Diagnostics::EDUGAINRESOLVER['url']."?action=get_entity_name&type=idp&opt=2&e_id=$entityId";
177
+        \core\common\Logging::debug_s(4, $url, "URL: ", "\n");
178 178
         $ch = curl_init($url);
179 179
         if ($ch === false) {
180 180
             $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!");
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
             return false;            
201 201
         }
202 202
         if ($responseDetails['name'] === null) {
203
-            \core\common\Logging::debug_s(4,"User not in eduGAIN\n");
203
+            \core\common\Logging::debug_s(4, "User not in eduGAIN\n");
204 204
             return false;            
205 205
         }
206
-        \core\common\Logging::debug_s(4,"User in eduGAIN\n");
206
+        \core\common\Logging::debug_s(4, "User in eduGAIN\n");
207 207
         $_SESSION['eduGAIN'] = $responseDetails['regauth'];
208 208
         return true;
209 209
     }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
      * @return boolean did it work?
244 244
      */
245 245
     public static function sendMailToCATadmins($subject, $content) {
246
-        if (!isset(\config\Master::APPEARANCE['cat-admin-mail']) ||  \config\Master::APPEARANCE['cat-admin-mail'] === []) {
246
+        if (!isset(\config\Master::APPEARANCE['cat-admin-mail']) || \config\Master::APPEARANCE['cat-admin-mail'] === []) {
247 247
             return;
248 248
         }
249 249
         foreach (\config\Master::APPEARANCE['cat-admin-mail'] as $mailaddr) {
@@ -266,8 +266,8 @@  discard block
 block discarded – undo
266 266
         common\Entity::intoThePotatoes();
267 267
         $mail = \core\common\OutsideComm::mailHandle();
268 268
 // who to whom?
269
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System";
270
-        $mail->addReplyTo(\config\Master::APPEARANCE['support-contact']['developer-mail'], \config\Master::APPEARANCE['productname'] . " " . _("Feedback"));
269
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System";
270
+        $mail->addReplyTo(\config\Master::APPEARANCE['support-contact']['developer-mail'], \config\Master::APPEARANCE['productname']." "._("Feedback"));
271 271
         $mail->addAddress($mailaddr);
272 272
 // what do we want to say?
273 273
         $mail->Subject = $subject;
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                 }
334 334
                 $lookFor .= "$name";
335 335
             }
336
-            $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches);
336
+            $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches);
337 337
             if ($finding === 0 || $finding === false) {
338 338
                 return false;
339 339
             }
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
                         $matchedProviders[] = $idp;
353 353
                         $name = $idp;
354 354
                         if ($skipCurl == 0) {
355
-                            $url = \config\Diagnostics::EDUGAINRESOLVER['url'] . "?action=get_entity_name&type=idp&e_id=$idp&lang=$lang";
355
+                            $url = \config\Diagnostics::EDUGAINRESOLVER['url']."?action=get_entity_name&type=idp&e_id=$idp&lang=$lang";
356 356
                             $ch = curl_init($url);
357 357
                             if ($ch === false) {
358 358
                                 $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!");
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
                             }
378 378
                             curl_close($ch);
379 379
                         }
380
-                        $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]] . " - IdP: " . $name;
380
+                        $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]]." - IdP: ".$name;
381 381
                     }
382 382
                     break;
383 383
                 case $providerStrings[2]:
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                     return false;
394 394
             }
395 395
         }
396
-        \core\common\Logging::debug_s(4,$listOfProviders, "PROVIDERS:\n", "\n");
396
+        \core\common\Logging::debug_s(4, $listOfProviders, "PROVIDERS:\n", "\n");
397 397
         return $listOfProviders;
398 398
     }
399 399
 }
400 400
\ No newline at end of file
Please login to merge, or discard this patch.
core/CertificationAuthorityEduPki.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 class CertificationAuthorityEduPki 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 = "User 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(CertificationAuthorityEduPki::LOCATION_RA_CERT) === FALSE) {
38
-            throw new Exception("RA operator PEM file not found: " . CertificationAuthorityEduPki::LOCATION_RA_CERT);
38
+            throw new Exception("RA operator PEM file not found: ".CertificationAuthorityEduPki::LOCATION_RA_CERT);
39 39
         }
40 40
         if (stat(CertificationAuthorityEduPki::LOCATION_RA_KEY) === FALSE) {
41
-            throw new Exception("RA operator private key file not found: " . CertificationAuthorityEduPki::LOCATION_RA_KEY);
41
+            throw new Exception("RA operator private key file not found: ".CertificationAuthorityEduPki::LOCATION_RA_KEY);
42 42
         }
43 43
         if (stat(CertificationAuthorityEduPki::LOCATION_WEBROOT) === FALSE) {
44
-            throw new Exception("CA website root CA file not found: " . CertificationAuthorityEduPki::LOCATION_WEBROOT);
44
+            throw new Exception("CA website root CA file not found: ".CertificationAuthorityEduPki::LOCATION_WEBROOT);
45 45
         }
46 46
     }
47 47
 
@@ -75,19 +75,19 @@  discard block
 block discarded – undo
75 75
         // initialise connection to eduPKI CA / eduroam RA and send the request to them
76 76
         try {
77 77
             $altArray = [# Array mit den Subject Alternative Names
78
-                "email:" . $csr["USERNAME"]
78
+                "email:".$csr["USERNAME"]
79 79
             ];
80 80
             $soapPub = $this->initEduPKISoapSession("PUBLIC");
81 81
             $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n");
82
-            $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPki::EDUPKI_RA_ID . "\n");
83
-            $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR_STRING"] . "\n");
82
+            $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPki::EDUPKI_RA_ID."\n");
83
+            $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR_STRING"]."\n");
84 84
             $this->loggerInstance->debug(5, "PARAM_3: ");
85 85
             $this->loggerInstance->debug(5, $altArray);
86
-            $this->loggerInstance->debug(5, "PARAM_4: " . CertificationAuthorityEduPki::EDUPKI_CERT_PROFILE . "\n");
87
-            $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n");
88
-            $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n");
89
-            $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERNAME"] . "\n");
90
-            $this->loggerInstance->debug(5, "PARAM_8: " . \config\ConfAssistant::SILVERBULLET['product_name'] . "\n");
86
+            $this->loggerInstance->debug(5, "PARAM_4: ".CertificationAuthorityEduPki::EDUPKI_CERT_PROFILE."\n");
87
+            $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n");
88
+            $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n");
89
+            $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERNAME"]."\n");
90
+            $this->loggerInstance->debug(5, "PARAM_8: ".\config\ConfAssistant::SILVERBULLET['product_name']."\n");
91 91
             $this->loggerInstance->debug(5, "PARAM_9: false\n");
92 92
             $soapNewRequest = $soapPub->newRequest(
93 93
                     CertificationAuthorityEduPki::EDUPKI_RA_ID, # RA-ID
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
         } catch (Exception $e) {
110 110
             // PHP 7.1 can do this much better
111 111
             if (is_soap_fault($e)) {
112
-                throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}:  {
112
+                throw new Exception("Error when sending SOAP request: "."{$e->faultcode}:  {
113 113
                     $e->faultstring
114 114
                 }\n");
115 115
             }
116
-            throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage());
116
+            throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage());
117 117
         }
118 118
         try {
119 119
             $soap = $this->initEduPKISoapSession("RA");
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
                     $soapReqnum, [
126 126
                 "RaID" => CertificationAuthorityEduPki::EDUPKI_RA_ID,
127 127
                 "Role" => CertificationAuthorityEduPki::EDUPKI_CERT_PROFILE,
128
-                "Subject" => "DC=eduroam,DC=test,DC=test,C=" . $csr["FED"] . ",O=" . \config\ConfAssistant::CONSORTIUM['name'] . ",OU=" . $csr["FED"] . ",CN=" . $csr['USERNAME'] . ",emailAddress=" . $csr['USERNAME'],
129
-                "SubjectAltNames" => ["email:" . $csr["USERNAME"]],
128
+                "Subject" => "DC=eduroam,DC=test,DC=test,C=".$csr["FED"].",O=".\config\ConfAssistant::CONSORTIUM['name'].",OU=".$csr["FED"].",CN=".$csr['USERNAME'].",emailAddress=".$csr['USERNAME'],
129
+                "SubjectAltNames" => ["email:".$csr["USERNAME"]],
130 130
                 "NotBefore" => (new \DateTime())->format('c'),
131 131
                 "NotAfter" => $expiry->format('c'),
132 132
                     ]
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
             // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file
146 146
             // rather than just using the string. Grr.
147 147
             $tempdir = \core\common\Entity::createTemporaryDirectory("test");
148
-            file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext);
148
+            file_put_contents($tempdir['dir']."/content.txt", $soapCleartext);
149 149
             // retrieve our RA cert from filesystem                    
150 150
             // the RA certificates are not needed right now because we
151 151
             // have resorted to S/MIME signatures with openssl command-line
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             // sign the data, using cmdline because openssl_pkcs7_sign produces strange results
158 158
             // -binary didn't help, nor switch -md to sha1 sha256 or sha512
159 159
             $this->loggerInstance->debug(5, "Actual content to be signed is this:\n  $soapCleartext\n");
160
-            $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";
160
+            $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";
161 161
             $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline:   $execCmd\n");
162 162
             $output = [];
163 163
             $return = 999;
@@ -166,14 +166,14 @@  discard block
 block discarded – undo
166 166
                 throw new Exception("Non-zero return value from openssl smime!");
167 167
             }
168 168
             // and get the signature blob back from the filesystem
169
-            $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt"));
169
+            $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt"));
170 170
             $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n");
171
-            $this->loggerInstance->debug(5, $soapReqnum . "\n");
172
-            $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending!
173
-            $this->loggerInstance->debug(5, $detachedSig . "\n");
171
+            $this->loggerInstance->debug(5, $soapReqnum."\n");
172
+            $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending!
173
+            $this->loggerInstance->debug(5, $detachedSig."\n");
174 174
             $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig);
175
-            $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest());
176
-            $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse());
175
+            $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest());
176
+            $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse());
177 177
             if ($soapIssueCert === FALSE) {
178 178
                 throw new Exception("The locally approved request was NOT processed by the CA.");
179 179
             }
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
                 throw new Exception("CAInfo has no root certificate for us!");
211 211
             }
212 212
         } catch (SoapFault $e) {
213
-            throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
213
+            throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n");
214 214
         } catch (Exception $e) {
215
-            throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage());
215
+            throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage());
216 216
         }
217 217
         return [
218 218
             "CERT" => openssl_x509_read($parsedCert['pem']),
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
             // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file
246 246
             // rather than just using the string. Grr.
247 247
             $tempdir = \core\common\Entity::createTemporaryDirectory("test");
248
-            file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest);
248
+            file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest);
249 249
             // retrieve our RA cert from filesystem
250 250
             // sign the data, using cmdline because openssl_pkcs7_sign produces strange results
251 251
             // -binary didn't help, nor switch -md to sha1 sha256 or sha512
252 252
             $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n");
253
-            $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . CertificationAuthorityEduPki::LOCATION_RA_KEY . " -signer " . CertificationAuthorityEduPki::LOCATION_RA_CERT;
253
+            $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".CertificationAuthorityEduPki::LOCATION_RA_KEY." -signer ".CertificationAuthorityEduPki::LOCATION_RA_CERT;
254 254
             $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n");
255 255
             $output = [];
256 256
             $return = 999;
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                 throw new Exception("Non-zero return value from openssl smime!");
260 260
             }
261 261
             // and get the signature blob back from the filesystem
262
-            $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt"));
262
+            $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt"));
263 263
             $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig);
264 264
             if ($soapIssueRev === FALSE) {
265 265
                 throw new Exception("The locally approved revocation request was NOT processed by the CA.");
@@ -267,9 +267,9 @@  discard block
 block discarded – undo
267 267
         } catch (Exception $e) {
268 268
             // PHP 7.1 can do this much better
269 269
             if (is_soap_fault($e)) {
270
-                throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n");
270
+                throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n");
271 271
             }
272
-            throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage());
272
+            throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage());
273 273
         }
274 274
     }
275 275
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
             'http' => [
290 290
                 'timeout' => 60,
291 291
                 'user_agent' => 'Stefan',
292
-                'header'=> array( "Accept-language: en" ),
292
+                'header'=> array("Accept-language: en"),
293 293
                 'protocol_version' => 1.1
294 294
             ],
295 295
             'ssl' => [
@@ -370,9 +370,9 @@  discard block
 block discarded – undo
370 370
      */
371 371
     public function soapToXmlInteger($x)
372 372
     {
373
-        return '<' . $x[0] . '>'
373
+        return '<'.$x[0].'>'
374 374
                 . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1)
375
-                . '</' . $x[0] . '>';
375
+                . '</'.$x[0].'>';
376 376
     }
377 377
 
378 378
     /**
@@ -391,9 +391,9 @@  discard block
 block discarded – undo
391 391
         // dump private key into directory
392 392
         $outstring = "";
393 393
         openssl_pkey_export($privateKey, $outstring);
394
-        file_put_contents($tempdir . "/pkey.pem", $outstring);
394
+        file_put_contents($tempdir."/pkey.pem", $outstring);
395 395
         // PHP can only do one DC in the Subject. But we need three.
396
-        $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";
396
+        $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";
397 397
         $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n");
398 398
         $output = [];
399 399
         $return = 999;
Please login to merge, or discard this patch.
web/admin/edit_hotspot.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                 $deployment->deactivate();
110 110
             }
111 111
             header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . 
112
-                   $deployment->identifier);
112
+                    $deployment->identifier);
113 113
             exit(0);
114 114
         case web\lib\common\FormElements::BUTTON_REMOVESP:
115 115
             $deployment->remove();
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
                     // valid signature
141 141
                     $data = openssl_x509_parse($deployment->radsec_cert);
142 142
                     $certdata = array(
143
-                              $data['serialNumberHex'],
144
-                              date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('YmdHis')
145
-                             );
143
+                                $data['serialNumberHex'],
144
+                                date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('YmdHis')
145
+                                );
146 146
                     $torevoke = implode('#', $certdata);
147 147
                     $response = $deployment->setRADIUSconfig(0, 0, $torevoke);
148 148
                     $deployment->tlsfromcsr($csr);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
             }
195 195
             header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier);
196 196
             exit(0);
197
-          default:
197
+            default:
198 198
                 throw new Exception("Unknown button action requested!");
199 199
     }
200 200
 }
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  */
28 28
 ?>
29 29
 <?php
30
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
31 31
 
32 32
 
33 33
 $deco = new \web\lib\admin\PageDecoration();
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
             ( $_POST['consortium'] == "OpenRoaming" && count($myfed->getAttributes("fed:openroaming")) > 0 )
42 42
             )
43 43
     ) {*/
44
-    if (isset($_POST['consortium']) &&  $_POST['consortium'] == "eduroam")
44
+    if (isset($_POST['consortium']) && $_POST['consortium'] == "eduroam")
45 45
     {
46 46
         $deployment = $my_inst->newDeployment(\core\AbstractDeployment::DEPLOYMENTTYPE_MANAGED, $_POST['consortium']);
47
-        header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
47
+        header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
48 48
         exit(0);
49 49
     } else {
50 50
         throw new Exception("Desired consortium for Managed SP needs to be specified, and allowed!");
@@ -101,19 +101,19 @@  discard block
 block discarded – undo
101 101
             if (isset($_POST['agreement']) && $_POST['agreement'] == "true") {
102 102
                 $deployment->addAttribute("hiddenmanagedsp:tou_accepted", NULL, 1);
103 103
             }
104
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
104
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
105 105
             exit(0);
106 106
         case web\lib\common\FormElements::BUTTON_DELETE:
107 107
             $response = $deployment->setRADIUSconfig();
108 108
             if (in_array('OK', $response)) {
109 109
                 $deployment->deactivate();
110 110
             }
111
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . 
111
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'. 
112 112
                    $deployment->identifier);
113 113
             exit(0);
114 114
         case web\lib\common\FormElements::BUTTON_REMOVESP:
115 115
             $deployment->remove();
116
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier);
116
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier);
117 117
             exit(0);
118 118
         case web\lib\common\FormElements::BUTTON_RENEWTLS:
119 119
             $data = openssl_x509_parse($deployment->radsec_cert);
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
             $torevoke = implode('#', $certdata);
125 125
             $response = $deployment->setRADIUSconfig(0, 0, $torevoke);
126 126
             $deployment->renewtls();
127
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
127
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
128 128
             exit(0);
129 129
         case web\lib\common\FormElements::BUTTON_USECSR:
130 130
             if (isset($_FILES['upload']) && $_FILES['upload']['size'] > 0) {
131 131
                 $csrpem = file_get_contents($_FILES['upload']['tmp_name']);
132 132
                 if ($csrpem === FALSE) {
133 133
                     // seems we can't work with this file for some reason. Ignore.
134
-                    header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&errormsg=NOCSR_' . $deployment->identifier . '#profilebox_' . $deployment->identifier);
134
+                    header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&errormsg=NOCSR_'.$deployment->identifier.'#profilebox_'.$deployment->identifier);
135 135
                     exit(0);
136 136
                 }
137 137
                 $csr = new \phpseclib3\File\X509();
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
                     $torevoke = implode('#', $certdata);
147 147
                     $response = $deployment->setRADIUSconfig(0, 0, $torevoke);
148 148
                     $deployment->tlsfromcsr($csr);
149
-                    header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
149
+                    header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
150 150
                     exit(0);
151 151
                 } else {
152
-                    header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&errormsg=WRONGCSR_' . $deployment->identifier . '#profilebox_' . $deployment->identifier);
152
+                    header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&errormsg=WRONGCSR_'.$deployment->identifier.'#profilebox_'.$deployment->identifier);
153 153
                     exit(0);
154 154
                 }
155 155
             }
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                 if (in_array('OK', $response)) {
160 160
                     $deployment->activate();
161 161
                 }
162
-                header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier);
162
+                header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'.$deployment->identifier);
163 163
                 exit(0);
164 164
             } else {
165 165
                 throw new Exception("Activate button pushed without acknowledged ToUs!");
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             } else {
193 193
                 $response = ['NOOP', 'NOOP'];
194 194
             }
195
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier);
195
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'.$deployment->identifier);
196 196
             exit(0);
197 197
           default:
198 198
                 throw new Exception("Unknown button action requested!");
@@ -201,10 +201,10 @@  discard block
 block discarded – undo
201 201
 if (isset($_POST['command'])) {
202 202
     switch ($_POST['command']) {
203 203
         case web\lib\common\FormElements::BUTTON_CLOSE:
204
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier) . '#profilebox_' . $deployment->identifier;
204
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier).'#profilebox_'.$deployment->identifier;
205 205
             exit(0);
206 206
         default:
207
-            header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier);
207
+            header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier);
208 208
             exit(0);
209 209
         }
210 210
 }
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     echo $uiElements->instLevelInfoBoxes($my_inst);
231 231
     $deploymentOptions = $deployment->getAttributes();
232 232
     echo "<form enctype='multipart/form-data' action='edit_hotspot.php?inst_id=$my_inst->identifier&amp;deployment_id=$deployment->identifier' method='post' accept-charset='UTF-8'>
233
-                <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
233
+                <input type='hidden' name='MAX_FILE_SIZE' value='".\config\Master::MAX_UPLOAD_SIZE."'>";
234 234
     $optionDisplay = new \web\lib\admin\OptionDisplay($deploymentOptions, \core\Options::LEVEL_PROFILE);
235 235
     ?>
236 236
     <fieldset class='option_container' id='managedsp_override'>
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                 <!-- input for VLAN identifier for guests-->
265 265
                 <td>
266 266
                     <span id='guest_vlan_label'>
267
-                        <?php echo sprintf(_("VLAN tag for guests:"), ($guest_vlan === NULL ? "" : " " . _("(unset with '0')"))); ?>
267
+                        <?php echo sprintf(_("VLAN tag for guests:"), ($guest_vlan === NULL ? "" : " "._("(unset with '0')"))); ?>
268 268
                     </span>
269 269
                 </td>
270 270
                 <td>
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
                 <!-- input for VLAN identifier for home users-->
281 281
                 <td>
282 282
                     <span id='vlan_label'>
283
-                        <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " " . _("(unset with '0')"))); ?>
283
+                        <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " "._("(unset with '0')"))); ?>
284 284
                     </span>
285 285
                 </td>
286 286
                 <td>
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
     </fieldset>
301 301
 
302 302
     <?php
303
-    echo "<p><button type='submit' name='submitbutton' class='deploymentopts' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>";
303
+    echo "<p><button type='submit' name='submitbutton' class='deploymentopts' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>";
304 304
     echo $deco->footer();
305 305
     ?>
306 306
     <script>
Please login to merge, or discard this patch.
utils/test_openroaming.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * License: see the web/copyright.php file in the file structure
9 9
  * ******************************************************************************
10 10
  */
11
-require_once dirname(dirname(__FILE__)) . "/config/_config.php";
11
+require_once dirname(dirname(__FILE__))."/config/_config.php";
12 12
 
13 13
 /**
14 14
  * The sctipt will be called from crontab
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 }
29 29
 
30 30
 
31
-while ( $row = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allOpenRoamingProfiles)) {
31
+while ($row = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allOpenRoamingProfiles)) {
32 32
     $profileId = $row->profile_id;
33 33
     $profile = \core\ProfileFactory::instantiate($profileId);
34 34
     $res = $profile->openroamingReadinessTest();
Please login to merge, or discard this patch.
web/admin/overview_radsec_readiness.php 1 patch
Spacing   +22 added lines, -22 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();
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
         echo '<br/>';
83 83
         echo _("In the 'Timestamp' column we show last update time.");
84 84
         echo '<p/>';
85
-        echo _('To check eduroam database specification see') . 
86
-                ' <a target="_blank" href="https://monitor.eduroam.org/eduroam-database/v2/docs/eduroam-database-ver30112021.pdf">' .
87
-                _('this document') . '</a>.<p/>';
85
+        echo _('To check eduroam database specification see'). 
86
+                ' <a target="_blank" href="https://monitor.eduroam.org/eduroam-database/v2/docs/eduroam-database-ver30112021.pdf">'.
87
+                _('this document').'</a>.<p/>';
88 88
         echo _('If you cannot find your institution on this list it means that this institution is not present in your upstream data.');        
89 89
         echo '<p/>';
90 90
         $allAuthorizedFeds = $user->getAttributes("user:fedadmin");
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
         ?>
94 94
         
95 95
     <select name="INST-list" id="INST-list">
96
-        <option value=""><?php echo _('---PLEASE CHOOSE---');?></option>
96
+        <option value=""><?php echo _('---PLEASE CHOOSE---'); ?></option>
97 97
         <?php 
98 98
         $instdata = array();
99 99
         foreach ($extInsts as $iid => $oneInst) {
100
-            print '<option value="' . $iid . '">' . $oneInst['name'] . '</option>';
100
+            print '<option value="'.$iid.'">'.$oneInst['name'].'</option>';
101 101
             $instdata[$iid] = array();
102 102
             $instdata[$iid]['name'] = $oneInst['name'];   
103 103
             $instdata[$iid]['type'] = _('no data');
@@ -111,22 +111,22 @@  discard block
 block discarded – undo
111 111
             $contactdata = '';
112 112
             foreach ($oneInst['contacts'] as $oneContact) {
113 113
                 if ($contactdata != '') {
114
-                    $contactdata = $contactdata . '<br>';
114
+                    $contactdata = $contactdata.'<br>';
115 115
                 }
116 116
                 if ($oneContact['name']) {
117
-                    $contactdata = $contactdata . $oneContact['name'];
117
+                    $contactdata = $contactdata.$oneContact['name'];
118 118
                 }
119 119
                 if ($contactdata != '') {
120
-                    $contactdata = $contactdata . '<br>';
120
+                    $contactdata = $contactdata.'<br>';
121 121
                 }
122 122
                 if ($oneContact['mail']) {
123
-                    $contactdata = $contactdata . $oneContact['mail'];
123
+                    $contactdata = $contactdata.$oneContact['mail'];
124 124
                 }
125 125
                 if ($contactdata != '') {
126
-                    $contactdata = $contactdata . '<br>';
126
+                    $contactdata = $contactdata.'<br>';
127 127
                 }
128 128
                 if ($oneContact['phone']) {
129
-                    $contactdata = $contactdata . $oneContact['phone'];
129
+                    $contactdata = $contactdata.$oneContact['phone'];
130 130
                 }        
131 131
             }
132 132
             if ($contactdata == '') {
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
             var instts = [];
146 146
             <?php
147 147
             foreach (array_keys($instdata) as $iid) {
148
-                echo "instservers['" . $iid . "']='" . $instdata[$iid]['servers']. "';\n";
149
-                echo "instname['" . $iid . "']='" . $instdata[$iid]['name']. "';\n";
150
-                echo "insttype['" . $iid . "']='" . $instdata[$iid]['type']. "';\n";
151
-                echo "instcontact['" . $iid . "']='" . $instdata[$iid]['contacts']. "';\n";
152
-                echo "instts['" . $iid . "']='" . $instdata[$iid]['ts']. "';\n";
148
+                echo "instservers['".$iid."']='".$instdata[$iid]['servers']."';\n";
149
+                echo "instname['".$iid."']='".$instdata[$iid]['name']."';\n";
150
+                echo "insttype['".$iid."']='".$instdata[$iid]['type']."';\n";
151
+                echo "instcontact['".$iid."']='".$instdata[$iid]['contacts']."';\n";
152
+                echo "instts['".$iid."']='".$instdata[$iid]['ts']."';\n";
153 153
             }
154 154
             ?>
155 155
             $(document).ready(function(){
@@ -171,18 +171,18 @@  discard block
 block discarded – undo
171 171
     <div id="instdata_area">
172 172
         <table>
173 173
             <tr><th align="left" width="350">
174
-                    <?php echo _('Name');?>
174
+                    <?php echo _('Name'); ?>
175 175
                 </th><th align="left" width="100">
176
-                    <?php echo _('Type');?>
176
+                    <?php echo _('Type'); ?>
177 177
                 </th>
178 178
                 <th align="left" width="200">
179
-                    <?php echo _('Servers');?>
179
+                    <?php echo _('Servers'); ?>
180 180
                 </th>
181 181
                 <th align="left" width="200">
182
-                    <?php echo _('Contact data');?>
182
+                    <?php echo _('Contact data'); ?>
183 183
                 </th>
184 184
                 <th align="left" width="100">
185
-                    <?php echo _('Timestamp');?>
185
+                    <?php echo _('Timestamp'); ?>
186 186
                 </th>
187 187
             </tr>
188 188
             <tr id="toshow"></tr>
Please login to merge, or discard this patch.
web/lib/admin/MapGoogle.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public function htmlHeadCode() {
48 48
         $cat = new \core\CAT();
49 49
         \core\common\Entity::intoThePotatoes();
50
-        $retval = "<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=" . \config\Master::APPEARANCE['google_maps_api_key'] . "'></script>
50
+        $retval = "<script type='text/javascript' src='https://maps.googleapis.com/maps/api/js?key=".\config\Master::APPEARANCE['google_maps_api_key']."'></script>
51 51
     <script type='text/javascript'>
52 52
         // some global variables;
53 53
         var center_lat=49.6114885608729;
@@ -103,19 +103,19 @@  discard block
 block discarded – undo
103 103
          *
104 104
          */
105 105
         function locator_magic() {
106
-            geocoder.geocode({'address':\"" . preg_replace("/\"/", "&quot;", $this->instName) . "\", 'region':\"" . strtolower($this->fedName) . "\"},
106
+            geocoder.geocode({'address':\"" . preg_replace("/\"/", "&quot;", $this->instName)."\", 'region':\"".strtolower($this->fedName)."\"},
107 107
             function(r,status) {
108 108
                 if(status != google.maps.GeocoderStatus.OK) {
109
-                    locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name'] . "\");
109
+                    locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name']."\");
110 110
                 } else {
111 111
                     var i;
112 112
                     for(i = 0; i < r.length; i++) {
113 113
                         Addr = getAddressElements(r[i].address_components);
114
-                        if(Addr.country == \"" . strtoupper($this->fedName) . "\")
114
+                        if(Addr.country == \"" . strtoupper($this->fedName)."\")
115 115
                         break;
116 116
                     }
117
-                    if(Addr.country != \"" . strtoupper($this->fedName) . "\")
118
-                    locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name'] . "\");
117
+                    if(Addr.country != \"" . strtoupper($this->fedName)."\")
118
+                    locate_country(\"" . $cat->knownFederations[strtoupper($this->fedName)]['name']."\");
119 119
                     else {
120 120
                         addMarker(r[i].geometry.location,15,null);
121 121
                     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
          */
129 129
         function markerClicked(m) {
130 130
             info_window.close();
131
-            var t = \"" . _("This is location ") . "\"+m.info;
131
+            var t = \"" . _("This is location ")."\"+m.info;
132 132
             info_window.setContent(t);
133 133
             info_window.setPosition(m.getPosition());
134 134
             info_window.open(map,m);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         function getAddressLocation() {
208 208
             var city = $('#address').val();
209 209
             if(city == '') {
210
-                alert(\"" . _("nothing entered in the address field") . "\");
210
+                alert(\"" . _("nothing entered in the address field")."\");
211 211
                 return false;
212 212
             }
213 213
             geocoder.geocode( { 'address': city}, function(results, status) {
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
          * trigger geolocation
228 228
          */
229 229
         function locateMe() {
230
-            $('#address').val(\"" . _("locating") . "\");
230
+            $('#address').val(\"" . _("locating")."\");
231 231
             navigator.geolocation.getCurrentPosition(locate_success,locate_fail,{maximumAge:3600000, timeout:5000});
232 232
         }
233 233
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
         if ($this->readOnly) {
346 346
             return "<div id='map' class='googlemap'></div>";
347 347
         } else {
348
-            return $this->htmlPreEdit($wizard, $additional) . $this->findLocationHtml() . "<div id='map' class='googlemap'></div>" . $this->htmlPostEdit(FALSE);
348
+            return $this->htmlPreEdit($wizard, $additional).$this->findLocationHtml()."<div id='map' class='googlemap'></div>".$this->htmlPostEdit(FALSE);
349 349
         }
350 350
     }
351 351
 
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
      */
359 359
     public static function optionListDisplayCode($coords, $number) {
360 360
         // quiesce warnings about unused variable
361
-        if (strlen(sprintf("%s", $coords)) <0) {
361
+        if (strlen(sprintf("%s", $coords)) < 0) {
362 362
             throw new \Exception("A miracle! A string with negative length!");
363 363
         };
364 364
         \core\common\Entity::intoThePotatoes();
365
-        $retval = "<button id='location_b_" . $number . "' class='location_button'>" . _("Click to see location") . " $number</button>";
365
+        $retval = "<button id='location_b_".$number."' class='location_button'>"._("Click to see location")." $number</button>";
366 366
         \core\common\Entity::outOfThePotatoes();
367 367
         return $retval;
368 368
     }
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
      * @return string
374 374
      */
375 375
     public function bodyTagCode() {
376
-        return "onload='load(" . ($this->readOnly ? "0" : "1") . ")'";
376
+        return "onload='load(".($this->readOnly ? "0" : "1").")'";
377 377
     }
378 378
 
379 379
     /**
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
      */
384 384
     private function findLocationHtml() {
385 385
         \core\common\Entity::intoThePotatoes();
386
-        $retval = "<p>" . _("Address:") . " <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>" . _("Find address") . "</button> <button type='button' onclick='locateMe()'>" . _("Locate Me!") . "</button></p>";
386
+        $retval = "<p>"._("Address:")." <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>"._("Find address")."</button> <button type='button' onclick='locateMe()'>"._("Locate Me!")."</button></p>";
387 387
         \core\common\Entity::outOfThePotatoes();
388 388
         return $retval;
389 389
     }
Please login to merge, or discard this patch.
web/lib/admin/MapOpenLayers.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         
84 84
 // use HTML5 geolocation
85 85
         function locateMe() {
86
-            $('#address').val(\"" . _("locating") . "\");
86
+            $('#address').val(\"" . _("locating")."\");
87 87
             navigator.geolocation.getCurrentPosition(locate_success,locate_fail,{maximumAge:3600000, timeout:5000});
88 88
         }
89 89
         
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
                 view.fit(extent, {padding: [10, 0, 10, 0]});
206 206
             } else {
207 207
                 view.setCenter([0,0]);
208
-                locate_country('" . $cat->knownFederations[strtoupper($this->fedName)]['name'] . "'); // use the federation code to locate the country
208
+                locate_country('" . $cat->knownFederations[strtoupper($this->fedName)]['name']."'); // use the federation code to locate the country
209 209
                 map.setView(view);
210 210
             }
211 211
             view.setMaxZoom(20);
@@ -227,14 +227,14 @@  discard block
 block discarded – undo
227 227
         function getAddressLocation() {
228 228
             var city = $('#address').val();
229 229
             if(city == '') {
230
-                alert(\"" . _("nothing entered in the address field") . "\");
230
+                alert(\"" . _("nothing entered in the address field")."\");
231 231
                 return false;
232 232
             }
233 233
             city = city.replace(/\s*,\s*/g,',+');
234 234
             city = city.replace(/ +/,'+');
235 235
             $.get(addressService+'?format=json&addressdetails=0&q='+city, '',  function(data) {
236 236
                 if (data[0] === undefined) {
237
-                    alert('" . _("Address not found, perhaps try another form, like putting the street number to the front.") . "');
237
+                    alert('" . _("Address not found, perhaps try another form, like putting the street number to the front.")."');
238 238
                     return;
239 239
                 }
240 240
                 showTmpPointer(data[0].lon, data[0].lat);
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         if ($this->readOnly) {
286 286
             return "<div id='map' class='locationmap'></div><script>generateMap('map')</script>";
287 287
         } else {
288
-            return $this->htmlPreEdit($wizard, $additional) . $this->findLocationHtml() . "<span id='location-prompt'>You can drag the pointer to the final location before you save the results.</span><div id='map' class='locationmap'></div><script>generateMap('map')</script>" . $this->htmlPostEdit(FALSE);
288
+            return $this->htmlPreEdit($wizard, $additional).$this->findLocationHtml()."<span id='location-prompt'>You can drag the pointer to the final location before you save the results.</span><div id='map' class='locationmap'></div><script>generateMap('map')</script>".$this->htmlPostEdit(FALSE);
289 289
         }
290 290
     }
291 291
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
         // we don't need this parameter in this subclass
311 311
         unset($coords);
312 312
         \core\common\Entity::intoThePotatoes();
313
-        $retval = "<button id='location_b_" . $number . "' class='location_button'>" . _("Click to see location") . " $number</button>";
313
+        $retval = "<button id='location_b_".$number."' class='location_button'>"._("Click to see location")." $number</button>";
314 314
         \core\common\Entity::outOfThePotatoes();
315 315
         return $retval;
316 316
     }
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
      */
323 323
     private function findLocationHtml() {
324 324
         \core\common\Entity::intoThePotatoes();
325
-        $retval = "<p>" . _("Address:") . " <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>" . _("Find address") . "</button> <button type='button' onclick='locateMe()'>" . _("Locate Me!") . "</button></p>";
325
+        $retval = "<p>"._("Address:")." <input name='address' id='address' /><button type='button' onclick='getAddressLocation()'>"._("Find address")."</button> <button type='button' onclick='locateMe()'>"._("Locate Me!")."</button></p>";
326 326
         \core\common\Entity::outOfThePotatoes();
327 327
         return $retval;
328 328
     }
Please login to merge, or discard this patch.
web/skins/modern/accountstatus/accountstatus.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 $Gui->loggerInstance->debug(4, $operatingSystem);
48 48
 $uiElements = new web\lib\admin\UIElements();
49 49
 if ($operatingSystem) {
50
-    print "recognisedOS = '" . $operatingSystem['device'] . "';\n";
50
+    print "recognisedOS = '".$operatingSystem['device']."';\n";
51 51
 }
52
-require dirname(__DIR__) . '/user/js/cat_js.php';
52
+require dirname(__DIR__).'/user/js/cat_js.php';
53 53
 ?>
54 54
     var lang = "<?php echo($Gui->languageInstance->getLang()) ?>";
55 55
 </script>
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                         <?php
80 80
                         switch ($statusInfo['errorcode']) {
81 81
                             case "GENERATOR_CONSUMED":
82
-                                echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to reuse download link"), TRUE) . "<p>";
82
+                                echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to reuse download link"), TRUE)."<p>";
83 83
                                 break;
84 84
                             case NULL:
85 85
                             default:
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                                     echo " ";
103 103
                                     echo sprintf(ngettext("<strong>%d</strong> of your credentials is not valid any more.", "<strong>%d</strong> of your credentials are not valid any more.", $noGoodCerts), $noGoodCerts);
104 104
                                 }
105
-                                echo " <span id='detailtext'>" . _("I want to see the details.") . "</span>";
105
+                                echo " <span id='detailtext'>"._("I want to see the details.")."</span>";
106 106
                                 echo "<table id='cert_details'></table>";
107 107
                             }
108 108
                         }
@@ -111,60 +111,60 @@  discard block
 block discarded – undo
111 111
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_VALID: // treat both cases as equal
112 112
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED:
113 113
                                 if ($statusInfo['invitation_object']->activationsTotal > 1) { // only show this extra info in the non-trivial case.
114
-                                    echo "<h3>" . sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining) . "</h3>";
114
+                                    echo "<h3>".sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining)."</h3>";
115 115
                                 }
116 116
                                 if (!$statusInfo["OS"]) {
117
-                                    echo "<p>" . _("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.") . "</p>";
117
+                                    echo "<p>"._("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.")."</p>";
118 118
                                     break;
119 119
                                 }
120 120
 
121 121
                                 $dev = new \core\DeviceFactory($statusInfo['OS']['device']);
122 122
                                 $dev->device->calculatePreferredEapType([new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET)]);
123 123
                                 if ($dev->device->selectedEap == []) {
124
-                                    echo "<p>" . sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display']) . "</p>";
124
+                                    echo "<p>".sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display'])."</p>";
125 125
                                     break;
126 126
                                 }
127
-                                $message = $dev->device->options['message'] ?? '' ;
127
+                                $message = $dev->device->options['message'] ?? '';
128 128
 
129 129
                                 $sbMessage = $dev->device->options['sb_message'] ?? '';
130 130
                                 if ($message != '' && $sbMessage != '') {
131
-                                    $message = $message . "<p>" . $sbMessage;
131
+                                    $message = $message."<p>".$sbMessage;
132 132
                                 } else {
133
-                                    $message = $message . $sbMessage;
133
+                                    $message = $message.$sbMessage;
134 134
                                 }
135 135
                          
136
-                                echo "<div id='sb_download_message'><p>" . sprintf(_("You can now download a personalised  %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']);
136
+                                echo "<div id='sb_download_message'><p>".sprintf(_("You can now download a personalised  %s installation program."), \config\ConfAssistant::CONSORTIUM['display_name']);
137 137
 //                       echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']);
138 138
                                 echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']);
139
-                                echo "<p style='color:red;'>" . sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), \config\ConfAssistant::CONSORTIUM['display_name']) . "</p>";
140
-                                echo "<p>" . _("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.") . "</p></div>";
139
+                                echo "<p style='color:red;'>".sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), \config\ConfAssistant::CONSORTIUM['display_name'])."</p>";
140
+                                echo "<p>"._("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.")."</p></div>";
141 141
 
142 142
                                 $importPassword = \core\common\Entity::randomString(4, "0123456789");
143 143
                                 $profile = new \core\ProfileSilverbullet($statusInfo['profile']->identifier, NULL);
144 144
                                 
145
-                                echo "<h2>" . sprintf(_("Import PIN: %s"), $importPassword) . "</h2>";
145
+                                echo "<h2>".sprintf(_("Import PIN: %s"), $importPassword)."</h2>";
146 146
                                 $_SESSION['individualtoken'] = $cleanToken;
147 147
                                 $_SESSION['importpassword'] = $importPassword;
148
-                                echo "<input type='hidden' name='device' value='" . $statusInfo['OS']['device'] . "'/>";
148
+                                echo "<input type='hidden' name='device' value='".$statusInfo['OS']['device']."'/>";
149 149
                                 echo "<input type='hidden' name='generatedfor' value='silverbullet'/>";
150
-                                echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>" . sprintf(_("Click here to download your %s installer!"), \config\ConfAssistant::CONSORTIUM['display_name']) . "</span></button>";
150
+                                echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>".sprintf(_("Click here to download your %s installer!"), \config\ConfAssistant::CONSORTIUM['display_name'])."</span></button>";
151 151
                                 echo "<div class='device_info' id='info_g_sb'></div>";
152 152
                                 break;
153 153
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED:
154 154
                                 echo "<h2>Invitation link expired</h2>";
155
-                                echo "<p>" . sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), \config\ConfAssistant::CONSORTIUM['display_name'], $statusInfo['invitation_object']->expiry) . "</p>";
155
+                                echo "<p>".sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), \config\ConfAssistant::CONSORTIUM['display_name'], $statusInfo['invitation_object']->expiry)."</p>";
156 156
                                 echo "<p>Below is all the information about your account's other login details, if any.</p>";
157 157
 // do NOT break, display full account info instead (this was a previously valid token after all)
158 158
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_REDEEMED:
159 159
                                 // nothing to say really. User got the breakdown of certs above, and this link doesn't give him any new ones.
160 160
                                 break;
161 161
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_INVALID:
162
-                                echo "<h2>" . _("Account information not found") . "</h2>";
163
-                                echo "<p>" . sprintf(_("The invitation link you followed does not map to any invitation we have on file.") . "</p><p>" . _("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."),\config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::SILVERBULLET['realm_suffix']);
162
+                                echo "<h2>"._("Account information not found")."</h2>";
163
+                                echo "<p>".sprintf(_("The invitation link you followed does not map to any invitation we have on file.")."</p><p>"._("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::SILVERBULLET['realm_suffix']);
164 164
                         }
165 165
                         if (isset($statusInfo['profile_id']) && isset($statusInfo['idp_id'])) {
166
-                            echo "<input type='hidden' name='profile' id='profile_id' value='" . $statusInfo['profile_id'] . "'/>";
167
-                            echo "<input type='hidden' id='inst_id' name='idp' value='" . $statusInfo['idp_id'] . "'/>";
166
+                            echo "<input type='hidden' name='profile' id='profile_id' value='".$statusInfo['profile_id']."'/>";
167
+                            echo "<input type='hidden' id='inst_id' name='idp' value='".$statusInfo['idp_id']."'/>";
168 168
                         }
169 169
                         ?>
170 170
                     </div>
@@ -184,18 +184,18 @@  discard block
 block discarded – undo
184 184
     $attributes = $statusInfo['attributes'];
185 185
     $supportInfo = '';
186 186
     if (!empty($attributes['local_url'])) {
187
-        $supportInfo .= '<tr><td>' . ("WWW:") . '</td><td><a href="' . $attributes['local_url'] . '" target="_blank">' . $attributes['local_url'] . '</a></td></tr>';
187
+        $supportInfo .= '<tr><td>'.("WWW:").'</td><td><a href="'.$attributes['local_url'].'" target="_blank">'.$attributes['local_url'].'</a></td></tr>';
188 188
     }
189 189
     if (!empty($attributes['local_email'])) {
190
-        $supportInfo .= '<tr><td>' . ("email:") . '</td><td><a href="' . $attributes['local_email'] . '" target="_blank">' . $attributes['local_email'] . '</a></td></tr>';
190
+        $supportInfo .= '<tr><td>'.("email:").'</td><td><a href="'.$attributes['local_email'].'" target="_blank">'.$attributes['local_email'].'</a></td></tr>';
191 191
     }
192 192
     if (!empty($attributes['local_phone'])) {
193
-        $supportInfo .= '<tr><td>' . ("tel:") . '</td><td><a href="' . $attributes['local_phone'] . '" target="_blank">' . $attributes['local_phone'] . '</a></td></tr>';
193
+        $supportInfo .= '<tr><td>'.("tel:").'</td><td><a href="'.$attributes['local_phone'].'" target="_blank">'.$attributes['local_phone'].'</a></td></tr>';
194 194
     }
195 195
     if ($supportInfo != '') {
196
-        $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems, then you can obtain direct assistance from your organisation at:") . "</th></tr>$supportInfo</table>";
196
+        $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems, then you can obtain direct assistance from your organisation at:")."</th></tr>$supportInfo</table>";
197 197
     } else {
198
-        $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems you should ask those who gave you your account for help.") . "</th></tr></table>";
198
+        $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems you should ask those who gave you your account for help.")."</th></tr></table>";
199 199
     }
200 200
     ?>
201 201
     <script>
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             var logo = <?php echo $statusInfo['idp_logo']; ?>;
205 205
             var idpId = <?php echo $statusInfo['idp_id']; ?>;
206 206
             <?php
207
-                if($message != '') {
207
+                if ($message != '') {
208 208
                     echo "message = \"$message\";\n";
209 209
                 }
210 210
             ?>
Please login to merge, or discard this patch.
web/admin/overview_sp.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
  *          <base_url>/copyright.php after deploying the software
21 21
  * */
22 22
  
23
- /**
24
- * This file is used to display a deployment.
25
- * 
26
- * @author Maja Gorecka-Wolniewicz <[email protected]>
27
- */
23
+    /**
24
+     * This file is used to display a deployment.
25
+     * 
26
+     * @author Maja Gorecka-Wolniewicz <[email protected]>
27
+     */
28 28
 ?>
29 29
 <?php
30 30
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                         if ($deploymentObject->radsec_cert != NULL) {
343 343
                             echo "<i>";
344 344
                             echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials') . '<br>' .
345
-                                 _('click on "Renew RADIUS over TLS credentials" button') . '<br>';
345
+                                    _('click on "Renew RADIUS over TLS credentials" button') . '<br>';
346 346
                         
347 347
                             echo '<br/>' . _('You can upload your own CSR to replace default TLS credentials.') . '<br>' . 
348 348
                                 _('Click on "Upload CSR to sign my own TLS credentials"');
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
                         <td>
362 362
                             <?php printf(_("PSK Identity: %s"), "<span id='pskid_data_$depId'>SP".$depId.'-'.$deploymentObject->institution.'</span>');
363 363
                             echo copyIcon("pskid_icon_$depId");
364
-                           ?>
364
+                            ?>
365 365
                             <br>
366 366
                             <?php printf(_("PSK hexphrase: %s"), "<span id='pskkey_data_$depId'>".$deploymentObject->pskkey."</span>");
367 367
                             echo copyIcon("pskkey_icon_$depId");
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
             <h1><?php echo $tablecaption; ?></h1>
565 565
             <h2><?php echo _("5 most recent authentications");?></h2>
566 566
             <p><?php echo _("<b>AP Identifier</b> is a / separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id") .'<br>';
567
-                     echo _("<b>Protocol</b> is a protocol used between a client and RADIUS server, for TLS it is a / separated tuple TLS/<i>TLS-Client-Cert-Serial</i>"); ?></p>
567
+                        echo _("<b>Protocol</b> is a protocol used between a client and RADIUS server, for TLS it is a / separated tuple TLS/<i>TLS-Client-Cert-Serial</i>"); ?></p>
568 568
             <table class='authrecord'>
569 569
     <caption><?php echo $tablecaption;?></caption>
570 570
     <tr style='text-align: left;'>
@@ -585,9 +585,9 @@  discard block
 block discarded – undo
585 585
                 . "<td>".$oneRecord['outer_user']."</td>"
586 586
                 . "<td>".($oneRecord['result'] == "OK" ? _("Success") : _("Failure"))."</td>"
587 587
                 . "<td>".$oneRecord['mac']."</td>"
588
-		. "<td>".substr($oneRecord['cui'], 0, 18)
589
-		. ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
590
-	        . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>"
588
+        . "<td>".substr($oneRecord['cui'], 0, 18)
589
+        . ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
590
+            . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>"
591 591
                 . "<td>".$oneRecord['ap_id']."</td>"
592 592
                 . "<td>".$oneRecord['prot']."</td>"
593 593
                 . "</tr>";
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
             $query = 'inc/deploymentLogs.inc.php?inst_id='.$deploymentObject->institution."&deployment_id=$depId&backlog=";
628 628
             ?></h2>
629 629
             <?php echo _('You will receive zip file with logs from both RADIUS servers: primary (folder named radius-1) and secondary (folder named radius-2).') . '<br>' .
630
-                  _('If no logs are available an empty zip file is provided.');?>
630
+                    _('If no logs are available an empty zip file is provided.');?>
631 631
             <div style='height:3px'></div>
632 632
             <button name="logs" type="button" onclick="location.href='<?php echo $query;?>1';"><?php echo _('Today');?>
633 633
             </button>
@@ -659,9 +659,9 @@  discard block
 block discarded – undo
659 659
     foreach (array($dsp->host1_v4, $dsp->host2_v4) as $host) {
660 660
         $connection = @fsockopen($host, \config\Master::MANAGEDSP['radiusconfigport']);
661 661
         if (is_resource($connection)) {
662
-           fclose($connection);
662
+            fclose($connection);
663 663
         } else {
664
-           return false;
664
+            return false;
665 665
         }
666 666
     }
667 667
     return true;
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
                             </button>
684 684
                             <span style='color: red;'>
685 685
                             <?php if ($hasMail == 0) { 
686
-                              echo _("Helpdesk mail address is required but missing!");  
686
+                                echo _("Helpdesk mail address is required but missing!");  
687 687
                             }
688 688
                             ?>
689 689
                             </span>
Please login to merge, or discard this patch.
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 <?php
97 97
 function copyIcon($target) {
98
-    return '<img class="copy_link" id="'.$target.'" src="../resources/images/icons/Tabler/copy.svg" title="'. _("Copy to clipboard").'" >';
98
+    return '<img class="copy_link" id="'.$target.'" src="../resources/images/icons/Tabler/copy.svg" title="'._("Copy to clipboard").'" >';
99 99
 }
100 100
 
101 101
 /**
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
  * @param \core\DeploymentManaged $deploymentObject the deployment to work with
105 105
  * @throws Exception
106 106
  */
107
-function displayDeploymentPropertyWidget(&$deploymentObject, $errormsg=[]) {
107
+function displayDeploymentPropertyWidget(&$deploymentObject, $errormsg = []) {
108 108
     // RADIUS status icons
109 109
     $depId = $deploymentObject->identifier;
110 110
     $radiusMessages = [
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     $radius_status = array();
115 115
     $radius_status[0] = $deploymentObject->radius_status_1;
116 116
     $radius_status[1] = $deploymentObject->radius_status_2;
117
-    $cacert = file_get_contents(ROOT .  "/config/ManagedSPCerts/eduroamSP-CA.pem");
117
+    $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem");
118 118
     $retry = $deploymentObject->checkRADIUSHostandConfigDaemon();
119 119
     $isradiusready = radius_ready($deploymentObject);
120 120
     if (is_array($retry)) {
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
     }
127 127
     ?>
128 128
     <div style='display: table-row_id;'>
129
-        <div class='profilebox' id="profilebox_<?php echo $depId;?>" style='display: table-cell;'>
129
+        <div class='profilebox' id="profilebox_<?php echo $depId; ?>" style='display: table-cell;'>
130 130
             <h2><?php
131 131
                 switch ($deploymentObject->consortium) {
132 132
                     case "eduroam":
133
-                        $displayname = config\ConfAssistant::CONSORTIUM['name'] . " " . core\DeploymentManaged::PRODUCTNAME. ": SP$depId-".$deploymentObject->institution;
133
+                        $displayname = config\ConfAssistant::CONSORTIUM['name']." ".core\DeploymentManaged::PRODUCTNAME.": SP$depId-".$deploymentObject->institution;
134 134
                         break;
135 135
                     case "OpenRoaming":
136 136
                         $displayname = "OpenRoaming ANP";
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                     default:
139 139
                         throw new Exception("We are supposed to operate on a roaming consortium we don't know.");
140 140
                 }
141
-                echo $displayname . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)";
141
+                echo $displayname." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)";
142 142
                 ?></h2>
143 143
             <table class="deployments">
144 144
                 <caption><?php echo _("Deployment Details"); ?></caption>
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
                     <td>
172 172
                         <?php
173 173
                         if ($deploymentObject->status) {
174
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] .
175
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] .
176
-                                "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>";
174
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon'].
175
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text'].
176
+                                "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>";
177 177
                         }
178 178
                         ?>
179 179
                     </td>
@@ -203,9 +203,9 @@  discard block
 block discarded – undo
203 203
                     <td>
204 204
                         <?php
205 205
                         if ($deploymentObject->status) {
206
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
207
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] .
208
-                            "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>";
206
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
207
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text'].
208
+                            "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>";
209 209
                         }
210 210
                         ?>
211 211
                     </td>
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 <tr style="vertical-align:bottom">
214 214
                     <td><?php echo _("RADIUS shared secret for both servers"); ?></td>
215 215
                     <td>
216
-                        <span id="shared_data_<?php echo $deploymentObject->identifier;?>"><?php echo $deploymentObject->secret;?></span>
216
+                        <span id="shared_data_<?php echo $deploymentObject->identifier; ?>"><?php echo $deploymentObject->secret; ?></span>
217 217
                         <?php echo copyIcon("shared_icon_".$deploymentObject->identifier) ?>
218 218
                     </td>
219 219
                     <td></td>
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
                     <td>
250 250
                         <?php
251 251
                         if ($deploymentObject->status) {
252
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] .
253
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] .
254
-                                "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>";
252
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon'].
253
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text'].
254
+                                "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>";
255 255
                         }
256 256
                         ?>
257 257
                     </td>
@@ -281,9 +281,9 @@  discard block
 block discarded – undo
281 281
                     <td>
282 282
                         <?php
283 283
                         if ($deploymentObject->status) {
284
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
285
-                                "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] .
286
-                            "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>";
284
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
285
+                                "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text'].
286
+                            "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>";
287 287
                         }
288 288
                         ?>
289 289
                     </td>
@@ -299,27 +299,27 @@  discard block
 block discarded – undo
299 299
                     <td>
300 300
                     <?php
301 301
                     if ($deploymentObject->radsec_priv == '') {
302
-                        echo _('The client certificate was created using an uploaded CSR, the private key is not available') . '<br><br>';
302
+                        echo _('The client certificate was created using an uploaded CSR, the private key is not available').'<br><br>';
303 303
                     }
304
-                    echo _('Subject:') . ' ' . $data['name'] . '<br>';
305
-                    echo _('Serial number:') . ' ' . $data['serialNumberHex'] . '<br>';
306
-                    $dleft = floor(($data['validTo_time_t']-time())/(24*60*60));
304
+                    echo _('Subject:').' '.$data['name'].'<br>';
305
+                    echo _('Serial number:').' '.$data['serialNumberHex'].'<br>';
306
+                    $dleft = floor(($data['validTo_time_t'] - time()) / (24 * 60 * 60));
307 307
                     if ($dleft < 30) {
308 308
                         echo '<font color="red">';
309 309
                     }
310
-                    echo _('Not valid after:') . ' '. date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s') . ' UTC';
310
+                    echo _('Not valid after:').' '.date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s').' UTC';
311 311
                     if ($dleft > 2) {
312
-                        echo '<br>' . _('Number of days to expiry:') . ' ' . $dleft;
312
+                        echo '<br>'._('Number of days to expiry:').' '.$dleft;
313 313
                     } else {
314
-                        echo '<br>' . _('If you are using RADIUS over TLS you should urgently renew your credentisls') . '!';
314
+                        echo '<br>'._('If you are using RADIUS over TLS you should urgently renew your credentisls').'!';
315 315
                     }
316 316
                     if ($dleft < 30) { echo '</font>'; }
317 317
                     ?></td>
318 318
                 </tr><tr><td></td>
319 319
 
320 320
                     <td>
321
-                        <span style="display: none;" id="cert_data_<?php echo $depId;?>"><?php echo $deploymentObject->radsec_cert;?></span>
322
-                        <span style="display: none;" id="ca_cert_data_<?php echo $depId;?>"><?php echo $cacert;?></span>
321
+                        <span style="display: none;" id="cert_data_<?php echo $depId; ?>"><?php echo $deploymentObject->radsec_cert; ?></span>
322
+                        <span style="display: none;" id="ca_cert_data_<?php echo $depId; ?>"><?php echo $cacert; ?></span>
323 323
                         <?php if ($deploymentObject->radsec_priv != '') {
324 324
                             echo _("private key").copyIcon("priv_key_icon_$depId")."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
325 325
                             echo '<span style="display: none;" id="priv_key_data_'.$depId.'">'.$deploymentObject->radsec_priv.'</span>';
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
                             echo _("CA certificate").copyIcon("ca_cert_icon_$depId");
331 331
                         ?>
332 332
                         <br/>
333
-                        <button name="sendzip" onclick="location.href='inc/sendZip.inc.php?inst_id=<?php echo $deploymentObject->institution;?>&dep_id=<?php echo $depId?>'" type="button"><?php echo _('download ZIP-file with full data');?></button>
333
+                        <button name="sendzip" onclick="location.href='inc/sendZip.inc.php?inst_id=<?php echo $deploymentObject->institution; ?>&dep_id=<?php echo $depId?>'" type="button"><?php echo _('download ZIP-file with full data'); ?></button>
334 334
 
335 335
                     </td>
336 336
                     <td></td>
@@ -341,10 +341,10 @@  discard block
 block discarded – undo
341 341
                     <?php
342 342
                         if ($deploymentObject->radsec_cert != NULL) {
343 343
                             echo "<i>";
344
-                            echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials') . '<br>' .
345
-                                 _('click on "Renew RADIUS over TLS credentials" button') . '<br>';
344
+                            echo _('If your certificate is close to expiry or you need to create new RADIUS over TLS credentials').'<br>'.
345
+                                 _('click on "Renew RADIUS over TLS credentials" button').'<br>';
346 346
                         
347
-                            echo '<br/>' . _('You can upload your own CSR to replace default TLS credentials.') . '<br>' . 
347
+                            echo '<br/>'._('You can upload your own CSR to replace default TLS credentials.').'<br>'. 
348 348
                                 _('Click on "Upload CSR to sign my own TLS credentials"');
349 349
                             echo "</i>";
350 350
                     }
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                 
380 380
                 ?>
381 381
                 <tr></tr>
382
-                <tr><th colspan="2"><?php echo _('Additional deployment settings');?></th></tr>
382
+                <tr><th colspan="2"><?php echo _('Additional deployment settings'); ?></th></tr>
383 383
                     <tr>
384 384
                         <td>
385 385
                             <?php
@@ -459,12 +459,12 @@  discard block
 block discarded – undo
459 459
                             if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) {
460 460
                                 echo '<br>';
461 461
                                 if ($res['FAILURE'] == 2) {
462
-                                    echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
462
+                                    echo ' <span style="color: red;">'._("Activation failure.").'</span>';
463 463
                                 } else {
464 464
                                     if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
465
-                                        echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>';
465
+                                        echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>';
466 466
                                     } else {
467
-                                        echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>';
467
+                                        echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>';
468 468
                                     }
469 469
                                 }
470 470
                             }
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
                                 if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) {
492 492
                                     echo '<br>';
493 493
                                     if ($res['FAILURE'] == 2) {
494
-                                        echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>';
494
+                                        echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>';
495 495
                                     } else {
496 496
                                         if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
497
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>';
497
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>';
498 498
                                         } else {
499
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>';
499
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>';
500 500
                                         }
501 501
                                     }
502 502
                                 }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
             </div>
545 545
             <?php 
546 546
             if (!$isradiusready) { 
547
-                echo '<p>'. _("We are not able to handle a new configuration request requiring contact with RADIUS servers now.") . '<br>' . _("Check later.");
547
+                echo '<p>'._("We are not able to handle a new configuration request requiring contact with RADIUS servers now.").'<br>'._("Check later.");
548 548
                 
549 549
             } 
550 550
             if (count($errormsg) > 0 && array_key_exists($deploymentObject->identifier, $errormsg)) {
@@ -560,38 +560,38 @@  discard block
 block discarded – undo
560 560
         </div>
561 561
         <div style='width:20px;'></div> <!-- QR code space, reserved -->
562 562
         <div style='display: table-cell; min-width:200px;'>
563
-            <?php $tablecaption = _("Hotspot Usage Statistics");?>
563
+            <?php $tablecaption = _("Hotspot Usage Statistics"); ?>
564 564
             <h1><?php echo $tablecaption; ?></h1>
565
-            <h2><?php echo _("5 most recent authentications");?></h2>
566
-            <p><?php echo _("<b>AP Identifier</b> is a / separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id") .'<br>';
565
+            <h2><?php echo _("5 most recent authentications"); ?></h2>
566
+            <p><?php echo _("<b>AP Identifier</b> is a / separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id").'<br>';
567 567
                      echo _("<b>Protocol</b> is a protocol used between a client and RADIUS server, for TLS it is a / separated tuple TLS/<i>TLS-Client-Cert-Serial</i>"); ?></p>
568 568
             <table class='authrecord'>
569
-    <caption><?php echo $tablecaption;?></caption>
569
+    <caption><?php echo $tablecaption; ?></caption>
570 570
     <tr style='text-align: left;'>
571
-        <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th>
572
-        <th scope="col"><strong><?php echo _("Outer-Identity");?></strong></th>
573
-        <th scope="col"><strong><?php echo _("Result");?></strong></th>
574
-        <th scope="col"><strong><?php echo _("MAC Address");?></strong></th>
575
-        <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th> 
576
-        <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th>
577
-        <th scope="col"><strong><?php echo _("Protocol");?></strong></th>
571
+        <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th>
572
+        <th scope="col"><strong><?php echo _("Outer-Identity"); ?></strong></th>
573
+        <th scope="col"><strong><?php echo _("Result"); ?></strong></th>
574
+        <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th>
575
+        <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th> 
576
+        <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th>
577
+        <th scope="col"><strong><?php echo _("Protocol"); ?></strong></th>
578 578
     </tr>
579 579
     <?php
580
-    $userAuthData = $deploymentObject->retrieveStatistics(0,5);
580
+    $userAuthData = $deploymentObject->retrieveStatistics(0, 5);
581 581
     $i = 0;	   
582 582
     foreach ($userAuthData as $oneRecord) {
583
-        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>"
583
+        echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>"
584 584
                 . "<td>".$oneRecord['activity_time']."</td>"
585 585
                 . "<td>".$oneRecord['outer_user']."</td>"
586 586
                 . "<td>".($oneRecord['result'] == "OK" ? _("Success") : _("Failure"))."</td>"
587 587
                 . "<td>".$oneRecord['mac']."</td>"
588 588
 		. "<td>".substr($oneRecord['cui'], 0, 18)
589
-		. ($oneRecord['cui']=='' ? "" : "... " . copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
589
+		. ($oneRecord['cui'] == '' ? "" : "... ".copyIcon("cui_icon_".$deploymentObject->identifier."_$i") 
590 590
 	        . "<span style='display: none;' id='cui_data_".$deploymentObject->identifier."_$i'>".$oneRecord['cui'].'</span>')."</td>"
591 591
                 . "<td>".$oneRecord['ap_id']."</td>"
592 592
                 . "<td>".$oneRecord['prot']."</td>"
593 593
                 . "</tr>";
594
-        if ($oneRecord['cui']!='') {
594
+        if ($oneRecord['cui'] != '') {
595 595
             $i++;
596 596
         }
597 597
     }
@@ -613,11 +613,11 @@  discard block
 block discarded – undo
613 613
             echo _('Get statistics as CSV file:').' '; 
614 614
             $query = 'inc/deploymentStats.inc.php?inst_id='.$deploymentObject->institution."&deployment_id=$depId&as=csv&backlog=";
615 615
             ?>
616
-	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>WEEK';"><?php echo _('Last week');?>
616
+	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>WEEK';"><?php echo _('Last week'); ?>
617 617
             </button>
618
-	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>MONTH';"><?php echo _('Last 30 days');?>
618
+	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>MONTH';"><?php echo _('Last 30 days'); ?>
619 619
             </button>
620
-	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query;?>FULL';"><?php echo _('Last 6 months');?>
620
+	    <button name="sendcsv" type="button" onclick="location.href='<?php echo $query; ?>FULL';"><?php echo _('Last 6 months'); ?>
621 621
             </button>
622 622
         </div><!-- statistics space -->
623 623
         <div style='height:5px'></div>
@@ -626,12 +626,12 @@  discard block
 block discarded – undo
626 626
             <h2><?php echo _('To get detailed logs from RADIUS sites click a button bellow.'); 
627 627
             $query = 'inc/deploymentLogs.inc.php?inst_id='.$deploymentObject->institution."&deployment_id=$depId&backlog=";
628 628
             ?></h2>
629
-            <?php echo _('You will receive zip file with logs from both RADIUS servers: primary (folder named radius-1) and secondary (folder named radius-2).') . '<br>' .
630
-                  _('If no logs are available an empty zip file is provided.');?>
629
+            <?php echo _('You will receive zip file with logs from both RADIUS servers: primary (folder named radius-1) and secondary (folder named radius-2).').'<br>'.
630
+                  _('If no logs are available an empty zip file is provided.'); ?>
631 631
             <div style='height:3px'></div>
632
-            <button name="logs" type="button" onclick="location.href='<?php echo $query;?>1';"><?php echo _('Today');?>
632
+            <button name="logs" type="button" onclick="location.href='<?php echo $query; ?>1';"><?php echo _('Today'); ?>
633 633
             </button>
634
-            <button name="logs" type="button" onclick="location.href='<?php echo $query;?>7';"><?php echo _('Last 7 days');?>
634
+            <button name="logs" type="button" onclick="location.href='<?php echo $query; ?>7';"><?php echo _('Last 7 days'); ?>
635 635
             </button>
636 636
         </div>
637 637
     </div> 
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
                         <div>
680 680
                             <input type="hidden" name="consortium" value="eduroam"/>
681 681
                             <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'>
682
-                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?>
682
+                                <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?>
683 683
                             </button>
684 684
                             <span style='color: red;'>
685 685
                             <?php if ($hasMail == 0) { 
Please login to merge, or discard this patch.