@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | parent::__construct(); |
59 | 59 | $Dev = \devices\Devices::listDevices(); |
60 | 60 | if (isset($Dev[$blueprint])) { |
61 | - $this->loggerInstance->debug(4, "loaded: devices/" . $Dev[$blueprint]['directory'] . "/" . $Dev[$blueprint]['module'] . ".php\n"); |
|
62 | - $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device_" . $Dev[$blueprint]['module']; |
|
61 | + $this->loggerInstance->debug(4, "loaded: devices/".$Dev[$blueprint]['directory']."/".$Dev[$blueprint]['module'].".php\n"); |
|
62 | + $class_name = "\devices\\".$Dev[$blueprint]['directory']."\Device_".$Dev[$blueprint]['module']; |
|
63 | 63 | $this->device = new $class_name(); |
64 | 64 | if (!$this->device) { |
65 | 65 | $this->loggerInstance->debug(2, "module loading failed"); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } else { |
69 | 69 | print("unknown devicename:$blueprint\n"); |
70 | 70 | } |
71 | - $this->device->module_path = ROOT . '/devices/' . $Dev[$blueprint]['directory']; |
|
71 | + $this->device->module_path = ROOT.'/devices/'.$Dev[$blueprint]['directory']; |
|
72 | 72 | $this->device->signer = isset($Dev[$blueprint]['signer']) ? $Dev[$blueprint]['signer'] : 0; |
73 | 73 | $this->device->device_id = $blueprint; |
74 | 74 | $options = \devices\Devices::$Options; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $this->installerPath = $cache['path']; |
83 | 83 | if ($this->installerPath !== NULL && $token === NULL && $password === NULL) { |
84 | 84 | $this->loggerInstance->debug(4, "Using cached installer for: $device\n"); |
85 | - $installerProperties['link'] = "API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=$profileId&device=$device&generatedfor=$generatedFor"; |
|
85 | + $installerProperties['link'] = "API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=$profileId&device=$device&generatedfor=$generatedFor"; |
|
86 | 86 | $installerProperties['mime'] = $cache['mime']; |
87 | 87 | } else { |
88 | 88 | $myInstaller = $this->generateNewInstaller($device, $profile, $generatedFor, $token, $password); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $this->loggerInstance->debug(5, "generateNewInstaller() - Device setup done"); |
165 | 165 | $installer = $dev->writeInstaller(); |
166 | 166 | $this->loggerInstance->debug(5, "generateNewInstaller() - writeInstaller complete"); |
167 | - $iPath = $dev->FPATH . '/tmp/' . $installer; |
|
167 | + $iPath = $dev->FPATH.'/tmp/'.$installer; |
|
168 | 168 | if ($iPath && is_file($iPath)) { |
169 | 169 | if (isset($dev->options['mime'])) { |
170 | 170 | $out['mime'] = $dev->options['mime']; |
@@ -172,17 +172,17 @@ discard block |
||
172 | 172 | $info = new \finfo(); |
173 | 173 | $out['mime'] = $info->file($iPath, FILEINFO_MIME_TYPE); |
174 | 174 | } |
175 | - $this->installerPath = $dev->FPATH . '/' . $installer; |
|
175 | + $this->installerPath = $dev->FPATH.'/'.$installer; |
|
176 | 176 | rename($iPath, $this->installerPath); |
177 | 177 | $integerEap = (new \core\common\EAP($dev->selectedEap))->getIntegerRep(); |
178 | 178 | $profile->updateCache($device, $this->installerPath, $out['mime'], $integerEap); |
179 | 179 | if (CONFIG['DEBUG_LEVEL'] < 4) { |
180 | - \core\common\Entity::rrmdir($dev->FPATH . '/tmp'); |
|
180 | + \core\common\Entity::rrmdir($dev->FPATH.'/tmp'); |
|
181 | 181 | } |
182 | - $this->loggerInstance->debug(4, "Generated installer: " . $this->installerPath . ": for: $device, EAP:" . $integerEap . "\n"); |
|
183 | - $out['link'] = "API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=" . $profile->identifier . "&device=$device&generatedfor=$generatedFor"; |
|
182 | + $this->loggerInstance->debug(4, "Generated installer: ".$this->installerPath.": for: $device, EAP:".$integerEap."\n"); |
|
183 | + $out['link'] = "API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=".$profile->identifier."&device=$device&generatedfor=$generatedFor"; |
|
184 | 184 | } else { |
185 | - $this->loggerInstance->debug(2, "Installer generation failed for: " . $profile->identifier . ":$device:" . $this->languageInstance->getLang() . "\n"); |
|
185 | + $this->loggerInstance->debug(2, "Installer generation failed for: ".$profile->identifier.":$device:".$this->languageInstance->getLang()."\n"); |
|
186 | 186 | $out['link'] = 0; |
187 | 187 | } |
188 | 188 | } |
@@ -294,9 +294,9 @@ discard block |
||
294 | 294 | $file = $this->installerPath; |
295 | 295 | $filetype = $output['mime']; |
296 | 296 | $this->loggerInstance->debug(4, "installer MIME type:$filetype\n"); |
297 | - header("Content-type: " . $filetype); |
|
298 | - header('Content-Disposition: inline; filename="' . basename($file) . '"'); |
|
299 | - header('Content-Length: ' . filesize($file)); |
|
297 | + header("Content-type: ".$filetype); |
|
298 | + header('Content-Disposition: inline; filename="'.basename($file).'"'); |
|
299 | + header('Content-Length: '.filesize($file)); |
|
300 | 300 | ob_clean(); |
301 | 301 | flush(); |
302 | 302 | readfile($file); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $filetype = $info->buffer($inputImage, FILEINFO_MIME_TYPE); |
318 | 318 | $offset = 60 * 60 * 24 * 30; |
319 | 319 | // gmdate cannot fail here - time() is its default argument (and integer), and we are adding an integer to it |
320 | - $expiresString = "Expires: " . /** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; |
|
320 | + $expiresString = "Expires: "./** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset)." GMT"; |
|
321 | 321 | $blob = $inputImage; |
322 | 322 | |
323 | 323 | if ($resize === TRUE) { |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $filetype = 'image/png'; // default, only one code path where it can become different |
372 | 372 | list($width, $height, $resize) = $this->testForResize($widthIn, $heightIn); |
373 | 373 | if ($resize) { |
374 | - $logoFile = ROOT . '/web/downloads/logos/' . $identifier . '_' . $width . '_' . $height . '.png'; |
|
374 | + $logoFile = ROOT.'/web/downloads/logos/'.$identifier.'_'.$width.'_'.$height.'.png'; |
|
375 | 375 | } |
376 | 376 | if (is_file($logoFile)) { // $logoFile could be an empty string but then we will get a FALSE |
377 | 377 | $this->loggerInstance->debug(4, "Using cached logo $logoFile for: $identifier\n"); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | if (count($logoAttribute) == 0) { |
382 | 382 | return NULL; |
383 | 383 | } |
384 | - $this->loggerInstance->debug(4,"RESIZE:$width:$height\n"); |
|
384 | + $this->loggerInstance->debug(4, "RESIZE:$width:$height\n"); |
|
385 | 385 | $meta = $this->processImage($logoAttribute[0]['value'], $logoFile, $width, $height, $resize); |
386 | 386 | $filetype = $meta['filetype']; |
387 | 387 | $expiresString = $meta['expires']; |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | if (!isset($device['match'])) { |
462 | 462 | continue; |
463 | 463 | } |
464 | - if (preg_match('/' . $device['match'] . '/', $browser)) { |
|
464 | + if (preg_match('/'.$device['match'].'/', $browser)) { |
|
465 | 465 | return $this->returnDevice($devId, $device); |
466 | 466 | } |
467 | 467 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | use \Exception; |
25 | 25 | |
26 | -require_once dirname(dirname(__DIR__)) . "/config/_config.php"; |
|
26 | +require_once dirname(dirname(__DIR__))."/config/_config.php"; |
|
27 | 27 | |
28 | 28 | class Logging { |
29 | 29 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @return void |
46 | 46 | */ |
47 | 47 | private function writeToFile($filename, $message) { |
48 | - file_put_contents(CONFIG['PATHS']['logdir'] . "/$filename", sprintf("%-015s", microtime(TRUE)) . $message, FILE_APPEND); |
|
48 | + file_put_contents(CONFIG['PATHS']['logdir']."/$filename", sprintf("%-015s", microtime(TRUE)).$message, FILE_APPEND); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } else { |
77 | 77 | $output .= var_export($stuff, TRUE); |
78 | 78 | } |
79 | - $output = $prefix . $output . $suffix; |
|
79 | + $output = $prefix.$output.$suffix; |
|
80 | 80 | $this->writeToFile("debug.log", $output); |
81 | 81 | |
82 | 82 | return; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $logTextStep1 = preg_replace("/[\n\r]/", "", $query); |
122 | 122 | $logTextStep2 = preg_replace("/ +/", " ", $logTextStep1); |
123 | 123 | $logTextStep3 = iconv("UTF-8", "UTF-8//IGNORE", $logTextStep2); |
124 | - $this->writeToFile("audit-SQL.log", " " . $logTextStep3 . "\n"); |
|
124 | + $this->writeToFile("audit-SQL.log", " ".$logTextStep3."\n"); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | } |
@@ -83,7 +83,7 @@ |
||
83 | 83 | */ |
84 | 84 | public function der2pem($derData) { |
85 | 85 | $pem = chunk_split(base64_encode($derData), 64, "\n"); |
86 | - $pem = "-----BEGIN CERTIFICATE-----\n" . $pem . "-----END CERTIFICATE-----\n"; |
|
86 | + $pem = "-----BEGIN CERTIFICATE-----\n".$pem."-----END CERTIFICATE-----\n"; |
|
87 | 87 | return $pem; |
88 | 88 | } |
89 | 89 |
@@ -165,8 +165,8 @@ |
||
165 | 165 | $key = array_search($eapType, EAP::EAPTYPES_CONVERSION); |
166 | 166 | if ($key !== FALSE) { |
167 | 167 | // add a type cast to int to make Scrutinizer realise that the key found is always an integer |
168 | - $this->intRep = (int)$key; // array index is always an integer |
|
169 | - $this->arrayRep = EAP::EAPTYPES_CONVERSION[(int)$key]; |
|
168 | + $this->intRep = (int) $key; // array index is always an integer |
|
169 | + $this->arrayRep = EAP::EAPTYPES_CONVERSION[(int) $key]; |
|
170 | 170 | return; |
171 | 171 | } |
172 | 172 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | namespace core\common; |
32 | 32 | |
33 | -require_once dirname(dirname(__DIR__)) . "/config/_config.php"; |
|
33 | +require_once dirname(dirname(__DIR__))."/config/_config.php"; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * This class maintains state of the selected language and can set the language. |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | $loggerInstance = new \core\common\Logging(); |
73 | 73 | $olddomain = textdomain(NULL); |
74 | 74 | $loggerInstance->debug(4, "set_locale($domain)\n"); |
75 | - $loggerInstance->debug(4, ROOT . "\n"); |
|
75 | + $loggerInstance->debug(4, ROOT."\n"); |
|
76 | 76 | textdomain($domain); |
77 | - bindtextdomain($domain, ROOT . "/translation/"); |
|
77 | + bindtextdomain($domain, ROOT."/translation/"); |
|
78 | 78 | return $olddomain; |
79 | 79 | } |
80 | 80 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $langConverted[] = $hardSetLang; |
97 | 97 | } |
98 | 98 | if (!empty($_REQUEST['lang'])) { |
99 | - $recoverLang = filter_input(INPUT_GET,'lang', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'lang', FILTER_SANITIZE_STRING); |
|
99 | + $recoverLang = filter_input(INPUT_GET, 'lang', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'lang', FILTER_SANITIZE_STRING); |
|
100 | 100 | $langConverted[] = $recoverLang; |
101 | 101 | } |
102 | 102 | CAT_session_start(); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $langConverted[] = $_SESSION['language']; |
105 | 105 | } |
106 | 106 | if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
107 | - $langs = explode(",", filter_input(INPUT_SERVER,"HTTP_ACCEPT_LANGUAGE", FILTER_SANITIZE_STRING)); |
|
107 | + $langs = explode(",", filter_input(INPUT_SERVER, "HTTP_ACCEPT_LANGUAGE", FILTER_SANITIZE_STRING)); |
|
108 | 108 | foreach ($langs as $lang) { |
109 | 109 | $result = []; |
110 | 110 | preg_match("/(.*);+.*/", $lang, $result); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | // check if this language is supported by the CAT config |
126 | 126 | foreach (CONFIG['LANGUAGES'] as $language => $value) { |
127 | - if (preg_match("/^" . $language . ".*/", $tryLang)) { |
|
127 | + if (preg_match("/^".$language.".*/", $tryLang)) { |
|
128 | 128 | $localeTmp = $value['locale']; |
129 | 129 | $langIndex = $language; // ??? |
130 | 130 | break; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | } |
140 | 140 | } |
141 | 141 | } |
142 | - putenv("LC_ALL=" . $theLocale); |
|
142 | + putenv("LC_ALL=".$theLocale); |
|
143 | 143 | $_SESSION['language'] = $langIndex; |
144 | 144 | $loggerInstance = new \core\common\Logging(); |
145 | 145 | $loggerInstance->debug(4, "selected lang:$langIndex:$theLocale\n"); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $returnArray = []; |
64 | 64 | $returnArray['status'] = $status; |
65 | 65 | $returnArray['data'] = $data; |
66 | - $returnArray['tou'] = "Please consult Terms of Use at: //" . $host . \core\CAT::getRootUrlPath() . "/tou.php"; |
|
66 | + $returnArray['tou'] = "Please consult Terms of Use at: //".$host.\core\CAT::getRootUrlPath()."/tou.php"; |
|
67 | 67 | if (!empty($otherData)) { |
68 | 68 | $returnArray['otherdata'] = $otherData; |
69 | 69 | } |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | */ |
270 | 270 | public function sendLogo($identifier, $type, $width = 0, $height = 0) { |
271 | 271 | $logo = $this->getLogo($identifier, $type, $width, $height); |
272 | - $blob = $logo === NULL ? file_get_contents(ROOT . '/web/resources/images/empty.png') : $logo['blob']; |
|
273 | - header("Content-type: " . $logo['filetype']); |
|
272 | + $blob = $logo === NULL ? file_get_contents(ROOT.'/web/resources/images/empty.png') : $logo['blob']; |
|
273 | + header("Content-type: ".$logo['filetype']); |
|
274 | 274 | header("Cache-Control:max-age=36000, must-revalidate"); |
275 | 275 | header($logo['expires']); |
276 | 276 | echo $blob; |
@@ -397,7 +397,6 @@ |
||
397 | 397 | * |
398 | 398 | * @param string $format only "der" and "pem" are currently allowed |
399 | 399 | * @return array an array of arrays or empty array on error |
400 | - |
|
401 | 400 | */ |
402 | 401 | final protected function saveCertificateFiles($format) { |
403 | 402 | switch ($format) { |
@@ -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 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | throw new Exception("No EAP type available."); |
127 | 127 | } |
128 | 128 | $this->attributes = $this->getProfileAttributes($profile); |
129 | - $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id); |
|
129 | + $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id); |
|
130 | 130 | |
131 | 131 | |
132 | 132 | // if we are instantiating a Silverbullet profile AND have been given |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | // create temporary directory, its full path will be saved in $this->FPATH; |
151 | 151 | $tempDir = $this->createTemporaryDirectory($purpose); |
152 | 152 | $this->FPATH = $tempDir['dir']; |
153 | - mkdir($tempDir['dir'] . '/tmp'); |
|
154 | - chdir($tempDir['dir'] . '/tmp'); |
|
153 | + mkdir($tempDir['dir'].'/tmp'); |
|
154 | + chdir($tempDir['dir'].'/tmp'); |
|
155 | 155 | $caList = []; |
156 | 156 | $x509 = new \core\common\X509(); |
157 | 157 | if (isset($this->attributes['eap:ca_file'])) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | if (isset($this->attributes['general:logo_file'])) { |
173 | 173 | $this->loggerInstance->debug(5, "saving IDP logo\n"); |
174 | - $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'],'idp'); |
|
174 | + $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'], 'idp'); |
|
175 | 175 | } |
176 | 176 | if (isset($this->attributes['fed:logo_file'])) { |
177 | 177 | $this->loggerInstance->debug(5, "saving FED logo\n"); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this->support_url_substitute = sprintf(_("your local %s support page"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
188 | 188 | |
189 | 189 | if ($this->signer && $this->options['sign']) { |
190 | - $this->sign = ROOT . '/signer/' . $this->signer; |
|
190 | + $this->sign = ROOT.'/signer/'.$this->signer; |
|
191 | 191 | } |
192 | 192 | $this->installerBasename = $this->getInstallerBasename(); |
193 | 193 | common\Entity::outOfThePotatoes(); |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | * @return string|boolean the filename as found, with path, or FALSE if it does not exist |
244 | 244 | */ |
245 | 245 | private function findSourceFile($file) { |
246 | - if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) { |
|
247 | - return $this->module_path . '/Files/' . $this->device_id . '/' . $file; |
|
248 | - } elseif (is_file($this->module_path . '/Files/' . $file)) { |
|
249 | - return $this->module_path . '/Files/' . $file; |
|
246 | + if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) { |
|
247 | + return $this->module_path.'/Files/'.$this->device_id.'/'.$file; |
|
248 | + } elseif (is_file($this->module_path.'/Files/'.$file)) { |
|
249 | + return $this->module_path.'/Files/'.$file; |
|
250 | 250 | } else { |
251 | 251 | $this->loggerInstance->debug(2, "requested file $file does not exist\n"); |
252 | 252 | return FALSE; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | |
323 | 323 | $this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n"); |
324 | 324 | ob_start(); |
325 | - $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n"); |
|
325 | + $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n"); |
|
326 | 326 | $source = $this->findSourceFile($source_name); |
327 | 327 | |
328 | 328 | if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | } |
331 | 331 | $output = ob_get_clean(); |
332 | 332 | if ($encoding) { |
333 | - $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output); |
|
333 | + $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output); |
|
334 | 334 | if ($outputClean) { |
335 | 335 | $output = $outputClean; |
336 | 336 | } |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | $encoding = 0; |
374 | 374 | } |
375 | 375 | if ($encoding) { |
376 | - $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $source_string); |
|
376 | + $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $source_string); |
|
377 | 377 | } else { |
378 | 378 | $output_c = $source_string; |
379 | 379 | } |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | */ |
468 | 468 | private function getInstallerBasename() { |
469 | 469 | |
470 | - $baseName = $this->customTranslit(CONFIG_CONFASSISTANT['CONSORTIUM']['name']) . "-" . $this->getDeviceId(); |
|
470 | + $baseName = $this->customTranslit(CONFIG_CONFASSISTANT['CONSORTIUM']['name'])."-".$this->getDeviceId(); |
|
471 | 471 | if (isset($this->attributes['profile:customsuffix'][1])) { |
472 | 472 | // this string will end up as a filename on a filesystem, so always |
473 | 473 | // take a latin-based language variant if available |
474 | 474 | // and then scrub non-ASCII just in case |
475 | - return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]); |
|
475 | + return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]); |
|
476 | 476 | } |
477 | 477 | // Okay, no custom suffix. |
478 | 478 | // Use the configured inst name and apply shortening heuristics |
479 | 479 | $lang_pointer = CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1; |
480 | - $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes['general:instname'][$lang_pointer] . "\n"); |
|
480 | + $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes['general:instname'][$lang_pointer]."\n"); |
|
481 | 481 | $inst = $this->customTranslit($this->attributes['general:instname'][$lang_pointer]); |
482 | 482 | $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n"); |
483 | 483 | $Inst_a = explode('_', $inst); |
@@ -492,10 +492,10 @@ discard block |
||
492 | 492 | if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) { |
493 | 493 | $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]); |
494 | 494 | $prof = preg_replace('/_+$/', '', $profTemp); |
495 | - return $baseName . $inst . '-' . $prof; |
|
495 | + return $baseName.$inst.'-'.$prof; |
|
496 | 496 | } |
497 | 497 | } |
498 | - return $baseName . $inst; |
|
498 | + return $baseName.$inst; |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | /** |
@@ -563,13 +563,13 @@ discard block |
||
563 | 563 | * @return array |
564 | 564 | */ |
565 | 565 | private function getConsortia() { |
566 | - if(!isset(CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi'])) { |
|
566 | + if (!isset(CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi'])) { |
|
567 | 567 | return ([]); |
568 | 568 | } |
569 | 569 | $consortia = CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']; |
570 | 570 | if (isset($this->attributes['media:consortium_OI'])) { |
571 | 571 | foreach ($this->attributes['media:consortium_OI'] as $new_oi) { |
572 | - if(!in_array($new_oi, $consortia)) { |
|
572 | + if (!in_array($new_oi, $consortia)) { |
|
573 | 573 | $consortia[] = $new_oi; |
574 | 574 | } |
575 | 575 | } |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | * @return array list of filenames and the mime types |
596 | 596 | * @throws Exception |
597 | 597 | */ |
598 | - private function saveLogoFile($logos,$type) { |
|
598 | + private function saveLogoFile($logos, $type) { |
|
599 | 599 | $iterator = 0; |
600 | 600 | $returnarray = []; |
601 | 601 | foreach ($logos as $blob) { |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | $ext = 'unsupported'; |
609 | 609 | } |
610 | 610 | $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n"); |
611 | - $fileName = 'logo-' . $type . $iterator . '.' . $ext; |
|
611 | + $fileName = 'logo-'.$type.$iterator.'.'.$ext; |
|
612 | 612 | $fileHandle = fopen($fileName, "w"); |
613 | 613 | if (!$fileHandle) { |
614 | 614 | $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n"); |
@@ -634,13 +634,13 @@ discard block |
||
634 | 634 | $mime = $finfo->buffer($blob); |
635 | 635 | $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported'; |
636 | 636 | $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n"); |
637 | - $fileHandle = fopen('local-info.' . $ext, "w"); |
|
637 | + $fileHandle = fopen('local-info.'.$ext, "w"); |
|
638 | 638 | if ($fileHandle === FALSE) { |
639 | 639 | throw new Exception("problem opening the file"); |
640 | 640 | } |
641 | 641 | fwrite($fileHandle, $blob); |
642 | 642 | fclose($fileHandle); |
643 | - return(['name' => 'local-info.' . $ext, 'mime' => $ext]); |
|
643 | + return(['name' => 'local-info.'.$ext, 'mime' => $ext]); |
|
644 | 644 | } |
645 | 645 | |
646 | 646 | /** |
@@ -691,9 +691,9 @@ discard block |
||
691 | 691 | protected function determineOuterIdString() { |
692 | 692 | $outerId = NULL; |
693 | 693 | if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) { |
694 | - $outerId = "@" . $this->attributes['internal:realm'][0]; |
|
694 | + $outerId = "@".$this->attributes['internal:realm'][0]; |
|
695 | 695 | if (isset($this->attributes['internal:anon_local_value'])) { |
696 | - $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId; |
|
696 | + $outerId = $this->attributes['internal:anon_local_value'][0].$outerId; |
|
697 | 697 | } |
698 | 698 | } |
699 | 699 | return $outerId; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | // realm is automatically calculated, then stored in DB |
91 | 91 | |
92 | - $this->realm = "opaquehash@$myInst->identifier-$this->identifier." . strtolower($myInst->federation) . CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']; |
|
92 | + $this->realm = "opaquehash@$myInst->identifier-$this->identifier.".strtolower($myInst->federation).CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']; |
|
93 | 93 | $localValueIfAny = ""; |
94 | 94 | |
95 | 95 | // but there's some common internal attributes populated directly |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | |
107 | 107 | // and we need to populate eap:server_name and eap:ca_file with the NRO-specific EAP information |
108 | 108 | $silverbulletAttributes = [ |
109 | - "eap:server_name" => "auth." . strtolower($myFed->tld) . CONFIG_CONFASSISTANT['SILVERBULLET']['server_suffix'], |
|
109 | + "eap:server_name" => "auth.".strtolower($myFed->tld).CONFIG_CONFASSISTANT['SILVERBULLET']['server_suffix'], |
|
110 | 110 | ]; |
111 | 111 | $x509 = new \core\common\X509(); |
112 | - $caHandle = fopen(dirname(__FILE__) . "/../config/SilverbulletServerCerts/" . strtoupper($myFed->tld) . "/root.pem", "r"); |
|
112 | + $caHandle = fopen(dirname(__FILE__)."/../config/SilverbulletServerCerts/".strtoupper($myFed->tld)."/root.pem", "r"); |
|
113 | 113 | if ($caHandle !== FALSE) { |
114 | 114 | $cAFile = fread($caHandle, 16000000); |
115 | 115 | $silverbulletAttributes["eap:ca_file"] = $x509->der2pem(($x509->pem2der($cAFile))); |
@@ -129,26 +129,26 @@ discard block |
||
129 | 129 | $this->loggerInstance->debug(3, "--- END Constructing new Profile object ... ---\n"); |
130 | 130 | |
131 | 131 | $this->termsAndConditions = "<h2>Product Definition</h2> |
132 | - <p>" . \core\ProfileSilverbullet::PRODUCTNAME . " outsources the technical setup of " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . " " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " functions to the " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . " Operations Team. The system includes</p> |
|
132 | + <p>" . \core\ProfileSilverbullet::PRODUCTNAME." outsources the technical setup of ".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']." ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." functions to the ".CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']." Operations Team. The system includes</p> |
|
133 | 133 | <ul> |
134 | 134 | <li>a web-based user management interface where user accounts and access credentials can be created and revoked (there is a limit to the number of active users)</li> |
135 | 135 | <li>a technical infrastructure ('CA') which issues and revokes credentials</li> |
136 | - <li>a technical infrastructure ('RADIUS') which verifies access credentials and subsequently grants access to " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . "</li> |
|
136 | + <li>a technical infrastructure ('RADIUS') which verifies access credentials and subsequently grants access to " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']."</li> |
|
137 | 137 | </ul> |
138 | 138 | <h2>User Account Liability</h2> |
139 | - <p>As an " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . " " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " administrator using this system, you are authorized to create user accounts according to your local " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " policy. You are fully responsible for the accounts you issue and are the data controller for all user information you deposit in this system; the system is a data processor.</p>"; |
|
139 | + <p>As an " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']." ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." administrator using this system, you are authorized to create user accounts according to your local ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." policy. You are fully responsible for the accounts you issue and are the data controller for all user information you deposit in this system; the system is a data processor.</p>"; |
|
140 | 140 | $this->termsAndConditions .= "<p>Your responsibilities include that you</p> |
141 | 141 | <ul> |
142 | - <li>only issue accounts to members of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . ", as defined by your local policy.</li> |
|
142 | + <li>only issue accounts to members of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'].", as defined by your local policy.</li> |
|
143 | 143 | <li>must make sure that all accounts that you issue can be linked by you to actual human end users</li> |
144 | - <li>have to immediately revoke accounts of users when they leave or otherwise stop being a member of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . "</li> |
|
144 | + <li>have to immediately revoke accounts of users when they leave or otherwise stop being a member of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']."</li> |
|
145 | 145 | <li>will act upon notifications about possible network abuse by your users and will appropriately sanction them</li> |
146 | 146 | </ul> |
147 | 147 | <p>"; |
148 | - $this->termsAndConditions .= "Failure to comply with these requirements may make your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation'] . " act on your behalf, which you authorise, and will ultimately lead to the deletion of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . " (and all the users you create inside) in this system."; |
|
148 | + $this->termsAndConditions .= "Failure to comply with these requirements may make your ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']." act on your behalf, which you authorise, and will ultimately lead to the deletion of your ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution']." (and all the users you create inside) in this system."; |
|
149 | 149 | $this->termsAndConditions .= "</p> |
150 | 150 | <h2>Privacy</h2> |
151 | - <p>With " . \core\ProfileSilverbullet::PRODUCTNAME . ", we are necessarily storing personally identifiable information about the end users you create. While the actual human is only identifiable with your help, we consider all the user data as relevant in terms of privacy jurisdiction. Please note that</p> |
|
151 | + <p>With " . \core\ProfileSilverbullet::PRODUCTNAME.", we are necessarily storing personally identifiable information about the end users you create. While the actual human is only identifiable with your help, we consider all the user data as relevant in terms of privacy jurisdiction. Please note that</p> |
|
152 | 152 | <ul> |
153 | 153 | <li>You are the only one who needs to be able to make a link to the human behind the usernames you create. The usernames you create in the system have to be rich enough to allow you to make that identification step. Also consider situations when you are unavailable or leave the organisation and someone else needs to perform the matching to an individual.</li> |
154 | 154 | <li>The identifiers we create in the credentials are not linked to the usernames you add to the system; they are randomly generated pseudonyms.</li> |