@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | protected function setSupportedEapMethods($eapArray) |
87 | 87 | { |
88 | 88 | $this->supportedEapMethods = $eapArray; |
89 | - $this->loggerInstance->debug(4, "This device (" . __CLASS__ . ") supports the following EAP methods: "); |
|
89 | + $this->loggerInstance->debug(4, "This device (".__CLASS__.") supports the following EAP methods: "); |
|
90 | 90 | $this->loggerInstance->debug(4, $this->supportedEapMethods); |
91 | 91 | } |
92 | 92 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | break 2; |
139 | 139 | } |
140 | 140 | } |
141 | - $longestSuffix = $candidate . $longestSuffix; |
|
141 | + $longestSuffix = $candidate.$longestSuffix; |
|
142 | 142 | } |
143 | 143 | return $longestSuffix; |
144 | 144 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | throw new Exception("No EAP type available."); |
177 | 177 | } |
178 | 178 | $this->attributes = $this->getProfileAttributes($profile); |
179 | - $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id); |
|
179 | + $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id); |
|
180 | 180 | |
181 | 181 | |
182 | 182 | // if we are instantiating a Silverbullet profile AND have been given |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | // create temporary directory, its full path will be saved in $this->FPATH; |
202 | 202 | $tempDir = \core\common\Entity::createTemporaryDirectory($purpose); |
203 | 203 | $this->FPATH = $tempDir['dir']; |
204 | - mkdir($tempDir['dir'] . '/tmp'); |
|
205 | - chdir($tempDir['dir'] . '/tmp'); |
|
204 | + mkdir($tempDir['dir'].'/tmp'); |
|
205 | + chdir($tempDir['dir'].'/tmp'); |
|
206 | 206 | $caList = []; |
207 | 207 | $x509 = new \core\common\X509(); |
208 | 208 | if (isset($this->attributes['eap:ca_file'])) { |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $this->support_url_substitute = sprintf(_("your local %s support page"), \config\ConfAssistant::CONSORTIUM['display_name']); |
244 | 244 | |
245 | 245 | if ($this->signer && $this->options['sign']) { |
246 | - $this->sign = ROOT . '/signer/' . $this->signer; |
|
246 | + $this->sign = ROOT.'/signer/'.$this->signer; |
|
247 | 247 | } |
248 | 248 | $this->installerBasename = $this->getInstallerBasename(); |
249 | 249 | common\Entity::outOfThePotatoes(); |
@@ -303,10 +303,10 @@ discard block |
||
303 | 303 | */ |
304 | 304 | protected function findSourceFile($file) |
305 | 305 | { |
306 | - if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) { |
|
307 | - return $this->module_path . '/Files/' . $this->device_id . '/' . $file; |
|
308 | - } elseif (is_file($this->module_path . '/Files/' . $file)) { |
|
309 | - return $this->module_path . '/Files/' . $file; |
|
306 | + if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) { |
|
307 | + return $this->module_path.'/Files/'.$this->device_id.'/'.$file; |
|
308 | + } elseif (is_file($this->module_path.'/Files/'.$file)) { |
|
309 | + return $this->module_path.'/Files/'.$file; |
|
310 | 310 | } else { |
311 | 311 | $this->loggerInstance->debug(2, "requested file $file does not exist\n"); |
312 | 312 | return FALSE; |
@@ -430,19 +430,19 @@ discard block |
||
430 | 430 | */ |
431 | 431 | private function getInstallerBasename() |
432 | 432 | { |
433 | - $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name']) . "-" . $this->getDeviceId(); |
|
433 | + $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name'])."-".$this->getDeviceId(); |
|
434 | 434 | if (isset($this->attributes['profile:customsuffix'][1])) { |
435 | 435 | // this string will end up as a filename on a filesystem, so always |
436 | 436 | // take a latin-based language variant if available |
437 | 437 | // and then scrub non-ASCII just in case |
438 | - return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]); |
|
438 | + return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]); |
|
439 | 439 | } |
440 | 440 | // Okay, no custom suffix. |
441 | 441 | // Use the configured inst name and apply shortening heuristics |
442 | 442 | // if an instshortname is set, base on that, otherwise, the normal instname |
443 | 443 | $attribToUse = (isset($this->attributes['general:instshortname']) ? 'general:instshortname' : 'general:instname'); |
444 | 444 | $lang_pointer = \config\Master::LANGUAGES[$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1; |
445 | - $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes[$attribToUse][$lang_pointer] . "\n"); |
|
445 | + $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes[$attribToUse][$lang_pointer]."\n"); |
|
446 | 446 | $inst = $this->customTranslit($this->attributes[$attribToUse][$lang_pointer]); |
447 | 447 | $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n"); |
448 | 448 | $Inst_a = explode('_', $inst); |
@@ -457,10 +457,10 @@ discard block |
||
457 | 457 | if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) { |
458 | 458 | $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]); |
459 | 459 | $prof = preg_replace('/_+$/', '', $profTemp); |
460 | - return $baseName . $inst . '-' . $prof; |
|
460 | + return $baseName.$inst.'-'.$prof; |
|
461 | 461 | } |
462 | 462 | } |
463 | - return $baseName . $inst; |
|
463 | + return $baseName.$inst; |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | /** |
@@ -590,7 +590,7 @@ discard block |
||
590 | 590 | // only add network blocks if their respective condition is met in this profile |
591 | 591 | if ($netDetails['condition'] === TRUE || (isset($this->attributes[$netDetails['condition']]) && $this->attributes[$netDetails['condition']] === TRUE)) { |
592 | 592 | $networks[$netName] = $netDetails; |
593 | - $this->loggerInstance->debug(5,$netName, "\nAdding network: "); |
|
593 | + $this->loggerInstance->debug(5, $netName, "\nAdding network: "); |
|
594 | 594 | } |
595 | 595 | } |
596 | 596 | // add locally defined SSIDs |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | $ext = 'unsupported'; |
648 | 648 | } |
649 | 649 | $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n"); |
650 | - $fileName = 'logo-' . $type . $iterator . '.' . $ext; |
|
650 | + $fileName = 'logo-'.$type.$iterator.'.'.$ext; |
|
651 | 651 | $fileHandle = fopen($fileName, "w"); |
652 | 652 | if (!$fileHandle) { |
653 | 653 | $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n"); |
@@ -674,13 +674,13 @@ discard block |
||
674 | 674 | $mime = $finfo->buffer($blob); |
675 | 675 | $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported'; |
676 | 676 | $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n"); |
677 | - $fileHandle = fopen('local-info.' . $ext, "w"); |
|
677 | + $fileHandle = fopen('local-info.'.$ext, "w"); |
|
678 | 678 | if ($fileHandle === FALSE) { |
679 | 679 | throw new Exception("problem opening the file"); |
680 | 680 | } |
681 | 681 | fwrite($fileHandle, $blob); |
682 | 682 | fclose($fileHandle); |
683 | - return(['name' => 'local-info.' . $ext, 'mime' => $ext]); |
|
683 | + return(['name' => 'local-info.'.$ext, 'mime' => $ext]); |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | /** |
@@ -734,9 +734,9 @@ discard block |
||
734 | 734 | { |
735 | 735 | $outerId = NULL; |
736 | 736 | if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) { |
737 | - $outerId = "@" . $this->attributes['internal:realm'][0]; |
|
737 | + $outerId = "@".$this->attributes['internal:realm'][0]; |
|
738 | 738 | if (isset($this->attributes['internal:anon_local_value'])) { |
739 | - $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId; |
|
739 | + $outerId = $this->attributes['internal:anon_local_value'][0].$outerId; |
|
740 | 740 | } |
741 | 741 | } |
742 | 742 | return $outerId; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $this->installerPath = $cache['path']; |
87 | 87 | if ($this->installerPath !== NULL && $token === NULL && $password === NULL) { |
88 | 88 | $this->loggerInstance->debug(4, "Using cached installer for: $device\n"); |
89 | - $installerProperties['link'] = "user/API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=$profileId&device=$device&generatedfor=$generatedFor&openroaming=$openRoaming"; |
|
89 | + $installerProperties['link'] = "user/API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=$profileId&device=$device&generatedfor=$generatedFor&openroaming=$openRoaming"; |
|
90 | 90 | $installerProperties['mime'] = $cache['mime']; |
91 | 91 | } else { |
92 | 92 | $myInstaller = $this->generateNewInstaller($device, $profile, $generatedFor, $openRoaming, $token, $password); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $this->loggerInstance->debug(5, "generateNewInstaller() - Device setup done"); |
180 | 180 | $installer = $dev->writeInstaller(); |
181 | 181 | $this->loggerInstance->debug(5, "generateNewInstaller() - writeInstaller complete"); |
182 | - $iPath = $dev->FPATH . '/tmp/' . $installer; |
|
182 | + $iPath = $dev->FPATH.'/tmp/'.$installer; |
|
183 | 183 | if ($iPath && is_file($iPath)) { |
184 | 184 | if (isset($dev->options['mime'])) { |
185 | 185 | $out['mime'] = $dev->options['mime']; |
@@ -187,17 +187,17 @@ discard block |
||
187 | 187 | $info = new \finfo(); |
188 | 188 | $out['mime'] = $info->file($iPath, FILEINFO_MIME_TYPE); |
189 | 189 | } |
190 | - $this->installerPath = $dev->FPATH . '/' . $installer; |
|
190 | + $this->installerPath = $dev->FPATH.'/'.$installer; |
|
191 | 191 | rename($iPath, $this->installerPath); |
192 | 192 | $integerEap = (new \core\common\EAP($dev->selectedEap))->getIntegerRep(); |
193 | 193 | $profile->updateCache($device, $this->installerPath, $out['mime'], $integerEap, $openRoaming); |
194 | 194 | if (\config\Master::DEBUG_LEVEL < 4) { |
195 | - \core\common\Entity::rrmdir($dev->FPATH . '/tmp'); |
|
195 | + \core\common\Entity::rrmdir($dev->FPATH.'/tmp'); |
|
196 | 196 | } |
197 | - $this->loggerInstance->debug(4, "Generated installer: " . $this->installerPath . ": for: $device, EAP:" . $integerEap . ", openRoaming: $openRoaming\n"); |
|
198 | - $out['link'] = "user/API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=" . $profile->identifier . "&device=$device&generatedfor=$generatedFor&openroaming=$openRoaming"; |
|
197 | + $this->loggerInstance->debug(4, "Generated installer: ".$this->installerPath.": for: $device, EAP:".$integerEap.", openRoaming: $openRoaming\n"); |
|
198 | + $out['link'] = "user/API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=".$profile->identifier."&device=$device&generatedfor=$generatedFor&openroaming=$openRoaming"; |
|
199 | 199 | } else { |
200 | - $this->loggerInstance->debug(2, "Installer generation failed for: " . $profile->identifier . ":$device:" . $this->languageInstance->getLang() . "openRoaming: $openRoaming\n"); |
|
200 | + $this->loggerInstance->debug(2, "Installer generation failed for: ".$profile->identifier.":$device:".$this->languageInstance->getLang()."openRoaming: $openRoaming\n"); |
|
201 | 201 | $out['link'] = 0; |
202 | 202 | } |
203 | 203 | } |
@@ -321,13 +321,13 @@ discard block |
||
321 | 321 | $file = $this->installerPath; |
322 | 322 | $filetype = $output['mime']; |
323 | 323 | $this->loggerInstance->debug(4, "installer MIME type:$filetype\n"); |
324 | - header("Content-type: " . $filetype); |
|
324 | + header("Content-type: ".$filetype); |
|
325 | 325 | if ($filetype !== "application/x-wifi-config") { // for those installers to work on Android, Content-Disposition MUST NOT be set |
326 | - header('Content-Disposition: inline; filename="' . basename($file) . '"'); |
|
326 | + header('Content-Disposition: inline; filename="'.basename($file).'"'); |
|
327 | 327 | } else { |
328 | 328 | header('Content-Transfer-Encoding: base64'); |
329 | 329 | } |
330 | - header('Content-Length: ' . filesize($file)); |
|
330 | + header('Content-Length: '.filesize($file)); |
|
331 | 331 | ob_clean(); |
332 | 332 | flush(); |
333 | 333 | readfile($file); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | $filetype = $info->buffer($inputImage, FILEINFO_MIME_TYPE); |
350 | 350 | $offset = 60 * 60 * 24 * 30; |
351 | 351 | // gmdate cannot fail here - time() is its default argument (and integer), and we are adding an integer to it |
352 | - $expiresString = "Expires: " . /** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; |
|
352 | + $expiresString = "Expires: "./** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset)." GMT"; |
|
353 | 353 | $blob = $inputImage; |
354 | 354 | |
355 | 355 | if ($resize === TRUE) { |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $filetype = 'image/png'; // default, only one code path where it can become different |
406 | 406 | list($width, $height, $resize) = $this->testForResize($widthIn, $heightIn); |
407 | 407 | if ($resize) { |
408 | - $logoFile = ROOT . '/web/downloads/logos/' . $identifier . '_' . $width . '_' . $height . '.png'; |
|
408 | + $logoFile = ROOT.'/web/downloads/logos/'.$identifier.'_'.$width.'_'.$height.'.png'; |
|
409 | 409 | } |
410 | 410 | if (is_file($logoFile)) { // $logoFile could be an empty string but then we will get a FALSE |
411 | 411 | $this->loggerInstance->debug(4, "Using cached logo $logoFile for: $identifier\n"); |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | if (!isset($device['match'])) { |
518 | 518 | continue; |
519 | 519 | } |
520 | - if (preg_match('/' . $device['match'] . '/', $browser)) { |
|
520 | + if (preg_match('/'.$device['match'].'/', $browser)) { |
|
521 | 521 | return $this->returnDevice($devId, $device); |
522 | 522 | } |
523 | 523 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | protected function saveDownloadDetails($idpIdentifier, $profileId, $deviceId, $area, $lang, $eapType, $openRoaming) |
144 | 144 | { |
145 | 145 | if (\config\Master::PATHS['logdir']) { |
146 | - $file = fopen(\config\Master::PATHS['logdir'] . "/download_details.log", "a"); |
|
146 | + $file = fopen(\config\Master::PATHS['logdir']."/download_details.log", "a"); |
|
147 | 147 | if ($file === FALSE) { |
148 | 148 | throw new Exception("Unable to open file for append: $file"); |
149 | 149 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | foreach ($new->getAttributes("eap:server_name") as $newName) { |
199 | 199 | if (!in_array($newName['value'], $baselineNames)) { |
200 | - $retval[AbstractProfile::SERVERNAME_ADDED] .= "#New server name '" . $newName['value'] . "' added"; |
|
200 | + $retval[AbstractProfile::SERVERNAME_ADDED] .= "#New server name '".$newName['value']."' added"; |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 | return $retval; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $eaptype = new common\EAP($eapQuery->eap_method_id); |
233 | 233 | $eapTypeArray[] = $eaptype; |
234 | 234 | } |
235 | - $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n" . /** @scrutinizer ignore-type */ print_r($eapTypeArray, true)); |
|
235 | + $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n"./** @scrutinizer ignore-type */ print_r($eapTypeArray, true)); |
|
236 | 236 | return $eapTypeArray; |
237 | 237 | } |
238 | 238 | |
@@ -314,16 +314,16 @@ discard block |
||
314 | 314 | if (count($this->getAttributes("internal:checkuser_outer")) > 0) { |
315 | 315 | // we are supposed to use a specific outer username for checks, |
316 | 316 | // which is different from the outer username we put into installers |
317 | - return $this->getAttributes("internal:checkuser_value")[0]['value'] . "@" . $realm; |
|
317 | + return $this->getAttributes("internal:checkuser_value")[0]['value']."@".$realm; |
|
318 | 318 | } |
319 | 319 | if (count($this->getAttributes("internal:use_anon_outer")) > 0) { |
320 | 320 | // no special check username, but there is an anon outer ID for |
321 | 321 | // installers - so let's use that one |
322 | - return $this->getAttributes("internal:anon_local_value")[0]['value'] . "@" . $realm; |
|
322 | + return $this->getAttributes("internal:anon_local_value")[0]['value']."@".$realm; |
|
323 | 323 | } |
324 | 324 | // okay, no guidance on outer IDs at all - but we need *something* to |
325 | 325 | // test with for the RealmChecks. So: |
326 | - return "@" . $realm; |
|
326 | + return "@".$realm; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | /** |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | public function prepShowtime() |
779 | 779 | { |
780 | 780 | $properConfig = $this->readyForShowtime(); |
781 | - $this->databaseHandle->exec("UPDATE profile SET sufficient_config = " . ($properConfig ? "TRUE" : "FALSE") . " WHERE profile_id = " . $this->identifier); |
|
781 | + $this->databaseHandle->exec("UPDATE profile SET sufficient_config = ".($properConfig ? "TRUE" : "FALSE")." WHERE profile_id = ".$this->identifier); |
|
782 | 782 | |
783 | 783 | $attribs = $this->getCollapsedAttributes(); |
784 | 784 | // if not enough info to go live, set FALSE |