@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | protected function setSupportedEapMethods($eapArray) { |
| 84 | 84 | $this->supportedEapMethods = $eapArray; |
| 85 | - $this->loggerInstance->debug(4, "This device (" . __CLASS__ . ") supports the following EAP methods: "); |
|
| 85 | + $this->loggerInstance->debug(4, "This device (".__CLASS__.") supports the following EAP methods: "); |
|
| 86 | 86 | $this->loggerInstance->debug(4, $this->supportedEapMethods); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | throw new Exception("No EAP type available."); |
| 128 | 128 | } |
| 129 | 129 | $this->attributes = $this->getProfileAttributes($profile); |
| 130 | - $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id); |
|
| 130 | + $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id); |
|
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | // if we are instantiating a Silverbullet profile AND have been given |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | // create temporary directory, its full path will be saved in $this->FPATH; |
| 152 | 152 | $tempDir = \core\common\Entity::createTemporaryDirectory($purpose); |
| 153 | 153 | $this->FPATH = $tempDir['dir']; |
| 154 | - mkdir($tempDir['dir'] . '/tmp'); |
|
| 155 | - chdir($tempDir['dir'] . '/tmp'); |
|
| 154 | + mkdir($tempDir['dir'].'/tmp'); |
|
| 155 | + chdir($tempDir['dir'].'/tmp'); |
|
| 156 | 156 | $caList = []; |
| 157 | 157 | $x509 = new \core\common\X509(); |
| 158 | 158 | if (isset($this->attributes['eap:ca_file'])) { |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | if (isset($this->attributes['general:logo_file'])) { |
| 174 | 174 | $this->loggerInstance->debug(5, "saving IDP logo\n"); |
| 175 | - $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'],'idp'); |
|
| 175 | + $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'], 'idp'); |
|
| 176 | 176 | } |
| 177 | 177 | if (isset($this->attributes['fed:logo_file'])) { |
| 178 | 178 | $this->loggerInstance->debug(5, "saving FED logo\n"); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $this->support_url_substitute = sprintf(_("your local %s support page"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
| 189 | 189 | |
| 190 | 190 | if ($this->signer && $this->options['sign']) { |
| 191 | - $this->sign = ROOT . '/signer/' . $this->signer; |
|
| 191 | + $this->sign = ROOT.'/signer/'.$this->signer; |
|
| 192 | 192 | } |
| 193 | 193 | $this->installerBasename = $this->getInstallerBasename(); |
| 194 | 194 | common\Entity::outOfThePotatoes(); |
@@ -244,10 +244,10 @@ discard block |
||
| 244 | 244 | * @return string|boolean the filename as found, with path, or FALSE if it does not exist |
| 245 | 245 | */ |
| 246 | 246 | private function findSourceFile($file) { |
| 247 | - if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) { |
|
| 248 | - return $this->module_path . '/Files/' . $this->device_id . '/' . $file; |
|
| 249 | - } elseif (is_file($this->module_path . '/Files/' . $file)) { |
|
| 250 | - return $this->module_path . '/Files/' . $file; |
|
| 247 | + if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) { |
|
| 248 | + return $this->module_path.'/Files/'.$this->device_id.'/'.$file; |
|
| 249 | + } elseif (is_file($this->module_path.'/Files/'.$file)) { |
|
| 250 | + return $this->module_path.'/Files/'.$file; |
|
| 251 | 251 | } else { |
| 252 | 252 | $this->loggerInstance->debug(2, "requested file $file does not exist\n"); |
| 253 | 253 | return FALSE; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | |
| 321 | 321 | $this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n"); |
| 322 | 322 | ob_start(); |
| 323 | - $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n"); |
|
| 323 | + $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n"); |
|
| 324 | 324 | $source = $this->findSourceFile($source_name); |
| 325 | 325 | |
| 326 | 326 | if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | } |
| 329 | 329 | $output = ob_get_clean(); |
| 330 | 330 | if ($encoding !== 0) { |
| 331 | - $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output); |
|
| 331 | + $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output); |
|
| 332 | 332 | if ($outputClean) { |
| 333 | 333 | $output = $outputClean; |
| 334 | 334 | } |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | return $sourceString; |
| 369 | 369 | } |
| 370 | 370 | if (CONFIG_CONFASSISTANT['NSIS_VERSION'] < 3) { |
| 371 | - $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $sourceString); |
|
| 371 | + $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $sourceString); |
|
| 372 | 372 | } else { |
| 373 | 373 | $output_c = $sourceString; |
| 374 | 374 | } |
@@ -462,17 +462,17 @@ discard block |
||
| 462 | 462 | */ |
| 463 | 463 | private function getInstallerBasename() { |
| 464 | 464 | |
| 465 | - $baseName = $this->customTranslit(CONFIG_CONFASSISTANT['CONSORTIUM']['name']) . "-" . $this->getDeviceId(); |
|
| 465 | + $baseName = $this->customTranslit(CONFIG_CONFASSISTANT['CONSORTIUM']['name'])."-".$this->getDeviceId(); |
|
| 466 | 466 | if (isset($this->attributes['profile:customsuffix'][1])) { |
| 467 | 467 | // this string will end up as a filename on a filesystem, so always |
| 468 | 468 | // take a latin-based language variant if available |
| 469 | 469 | // and then scrub non-ASCII just in case |
| 470 | - return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]); |
|
| 470 | + return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]); |
|
| 471 | 471 | } |
| 472 | 472 | // Okay, no custom suffix. |
| 473 | 473 | // Use the configured inst name and apply shortening heuristics |
| 474 | 474 | $lang_pointer = CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1; |
| 475 | - $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes['general:instname'][$lang_pointer] . "\n"); |
|
| 475 | + $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes['general:instname'][$lang_pointer]."\n"); |
|
| 476 | 476 | $inst = $this->customTranslit($this->attributes['general:instname'][$lang_pointer]); |
| 477 | 477 | $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n"); |
| 478 | 478 | $Inst_a = explode('_', $inst); |
@@ -487,10 +487,10 @@ discard block |
||
| 487 | 487 | if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) { |
| 488 | 488 | $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]); |
| 489 | 489 | $prof = preg_replace('/_+$/', '', $profTemp); |
| 490 | - return $baseName . $inst . '-' . $prof; |
|
| 490 | + return $baseName.$inst.'-'.$prof; |
|
| 491 | 491 | } |
| 492 | 492 | } |
| 493 | - return $baseName . $inst; |
|
| 493 | + return $baseName.$inst; |
|
| 494 | 494 | } |
| 495 | 495 | |
| 496 | 496 | /** |
@@ -558,13 +558,13 @@ discard block |
||
| 558 | 558 | * @return array |
| 559 | 559 | */ |
| 560 | 560 | private function getConsortia() { |
| 561 | - if(!isset(CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi'])) { |
|
| 561 | + if (!isset(CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi'])) { |
|
| 562 | 562 | return ([]); |
| 563 | 563 | } |
| 564 | 564 | $consortia = CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']; |
| 565 | 565 | if (isset($this->attributes['media:consortium_OI'])) { |
| 566 | 566 | foreach ($this->attributes['media:consortium_OI'] as $new_oi) { |
| 567 | - if(!in_array($new_oi, $consortia)) { |
|
| 567 | + if (!in_array($new_oi, $consortia)) { |
|
| 568 | 568 | $consortia[] = $new_oi; |
| 569 | 569 | } |
| 570 | 570 | } |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | * @return array list of filenames and the mime types |
| 591 | 591 | * @throws Exception |
| 592 | 592 | */ |
| 593 | - private function saveLogoFile($logos,$type) { |
|
| 593 | + private function saveLogoFile($logos, $type) { |
|
| 594 | 594 | $iterator = 0; |
| 595 | 595 | $returnarray = []; |
| 596 | 596 | foreach ($logos as $blob) { |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | $ext = 'unsupported'; |
| 604 | 604 | } |
| 605 | 605 | $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n"); |
| 606 | - $fileName = 'logo-' . $type . $iterator . '.' . $ext; |
|
| 606 | + $fileName = 'logo-'.$type.$iterator.'.'.$ext; |
|
| 607 | 607 | $fileHandle = fopen($fileName, "w"); |
| 608 | 608 | if (!$fileHandle) { |
| 609 | 609 | $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n"); |
@@ -629,13 +629,13 @@ discard block |
||
| 629 | 629 | $mime = $finfo->buffer($blob); |
| 630 | 630 | $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported'; |
| 631 | 631 | $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n"); |
| 632 | - $fileHandle = fopen('local-info.' . $ext, "w"); |
|
| 632 | + $fileHandle = fopen('local-info.'.$ext, "w"); |
|
| 633 | 633 | if ($fileHandle === FALSE) { |
| 634 | 634 | throw new Exception("problem opening the file"); |
| 635 | 635 | } |
| 636 | 636 | fwrite($fileHandle, $blob); |
| 637 | 637 | fclose($fileHandle); |
| 638 | - return(['name' => 'local-info.' . $ext, 'mime' => $ext]); |
|
| 638 | + return(['name' => 'local-info.'.$ext, 'mime' => $ext]); |
|
| 639 | 639 | } |
| 640 | 640 | |
| 641 | 641 | /** |
@@ -686,9 +686,9 @@ discard block |
||
| 686 | 686 | protected function determineOuterIdString() { |
| 687 | 687 | $outerId = NULL; |
| 688 | 688 | if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) { |
| 689 | - $outerId = "@" . $this->attributes['internal:realm'][0]; |
|
| 689 | + $outerId = "@".$this->attributes['internal:realm'][0]; |
|
| 690 | 690 | if (isset($this->attributes['internal:anon_local_value'])) { |
| 691 | - $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId; |
|
| 691 | + $outerId = $this->attributes['internal:anon_local_value'][0].$outerId; |
|
| 692 | 692 | } |
| 693 | 693 | } |
| 694 | 694 | return $outerId; |