@@ -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; |
@@ -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; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | protected function saveDownloadDetails($idpIdentifier, $profileId, $deviceId, $area, $lang, $eapType) { |
| 131 | 131 | if (CONFIG['PATHS']['logdir']) { |
| 132 | - $file = fopen(CONFIG['PATHS']['logdir'] . "/download_details.log", "a"); |
|
| 132 | + $file = fopen(CONFIG['PATHS']['logdir']."/download_details.log", "a"); |
|
| 133 | 133 | if ($file === FALSE) { |
| 134 | 134 | throw new Exception("Unable to open file for append: $file"); |
| 135 | 135 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $eaptype = new common\EAP($eapQuery->eap_method_id); |
| 156 | 156 | $eapTypeArray[] = $eaptype; |
| 157 | 157 | } |
| 158 | - $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n" . print_r($eapTypeArray, true)); |
|
| 158 | + $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n".print_r($eapTypeArray, true)); |
|
| 159 | 159 | return $eapTypeArray; |
| 160 | 160 | } |
| 161 | 161 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | foreach ($new as $attrib) { |
| 211 | 211 | $ignore = ""; |
| 212 | 212 | foreach ($existing as $approvedAttrib) { |
| 213 | - if (($attrib["name"] == $approvedAttrib["name"] && $approvedAttrib["level"] != $newlevel) && ($approvedAttrib["name"] != "device-specific:redirect") ){ |
|
| 213 | + if (($attrib["name"] == $approvedAttrib["name"] && $approvedAttrib["level"] != $newlevel) && ($approvedAttrib["name"] != "device-specific:redirect")) { |
|
| 214 | 214 | $ignore = "YES"; |
| 215 | 215 | } |
| 216 | 216 | } |
@@ -253,16 +253,16 @@ discard block |
||
| 253 | 253 | if (count($this->getAttributes("internal:checkuser_outer")) > 0) { |
| 254 | 254 | // we are supposed to use a specific outer username for checks, |
| 255 | 255 | // which is different from the outer username we put into installers |
| 256 | - return $this->getAttributes("internal:checkuser_value")[0]['value'] . "@" . $realm; |
|
| 256 | + return $this->getAttributes("internal:checkuser_value")[0]['value']."@".$realm; |
|
| 257 | 257 | } |
| 258 | 258 | if (count($this->getAttributes("internal:use_anon_outer")) > 0) { |
| 259 | 259 | // no special check username, but there is an anon outer ID for |
| 260 | 260 | // installers - so let's use that one |
| 261 | - return $this->getAttributes("internal:anon_local_value")[0]['value'] . "@" . $realm; |
|
| 261 | + return $this->getAttributes("internal:anon_local_value")[0]['value']."@".$realm; |
|
| 262 | 262 | } |
| 263 | 263 | // okay, no guidance on outer IDs at all - but we need *something* to |
| 264 | 264 | // test with for the RealmChecks. So: |
| 265 | - return "@" . $realm; |
|
| 265 | + return "@".$realm; |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /** |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | * @param boolean $shallwe TRUE to enable outer identities (needs valid $realm), FALSE to disable |
| 343 | 343 | * @return void |
| 344 | 344 | */ |
| 345 | - abstract public function setAnonymousIDSupport($shallwe) ; |
|
| 345 | + abstract public function setAnonymousIDSupport($shallwe); |
|
| 346 | 346 | |
| 347 | 347 | /** |
| 348 | 348 | * Log a new download for our stats |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | */ |
| 697 | 697 | public function prepShowtime() { |
| 698 | 698 | $properConfig = $this->readyForShowtime(); |
| 699 | - $this->databaseHandle->exec("UPDATE profile SET sufficient_config = " . ($properConfig ? "TRUE" : "FALSE") . " WHERE profile_id = " . $this->identifier); |
|
| 699 | + $this->databaseHandle->exec("UPDATE profile SET sufficient_config = ".($properConfig ? "TRUE" : "FALSE")." WHERE profile_id = ".$this->identifier); |
|
| 700 | 700 | |
| 701 | 701 | $attribs = $this->getCollapsedAttributes(); |
| 702 | 702 | // if not enough info to go live, set FALSE |
@@ -126,20 +126,20 @@ discard block |
||
| 126 | 126 | if ($device == "TOTAL") { |
| 127 | 127 | continue; |
| 128 | 128 | } |
| 129 | - $retstring .= "<tr><td>$device</td><td>" . $numbers['ADMIN'] . "</td><td>" . $numbers['SILVERBULLET'] . "</td><td>" . $numbers['USER'] . "</td></tr>"; |
|
| 129 | + $retstring .= "<tr><td>$device</td><td>".$numbers['ADMIN']."</td><td>".$numbers['SILVERBULLET']."</td><td>".$numbers['USER']."</td></tr>"; |
|
| 130 | 130 | } |
| 131 | - $retstring .= "<tr><td><strong>TOTAL</strong></td><td><strong>" . $data['TOTAL']['ADMIN'] . "</strong></td><td><strong>" . $data['TOTAL']['SILVERBULLET'] . "</strong></td><td><strong>" . $data['TOTAL']['USER'] . "</strong></td></tr>"; |
|
| 131 | + $retstring .= "<tr><td><strong>TOTAL</strong></td><td><strong>".$data['TOTAL']['ADMIN']."</strong></td><td><strong>".$data['TOTAL']['SILVERBULLET']."</strong></td><td><strong>".$data['TOTAL']['USER']."</strong></td></tr>"; |
|
| 132 | 132 | break; |
| 133 | 133 | case "XML": |
| 134 | 134 | // the calls to date() operate on current date, so there is no chance for a FALSE to be returned. Silencing scrutinizer. |
| 135 | - $retstring .= "<federation id='$this->tld' ts='" . /** @scrutinizer ignore-type */ date("Y-m-d") . "T" . /** @scrutinizer ignore-type */ date("H:i:s") . "'>\n"; |
|
| 135 | + $retstring .= "<federation id='$this->tld' ts='"./** @scrutinizer ignore-type */ date("Y-m-d")."T"./** @scrutinizer ignore-type */ date("H:i:s")."'>\n"; |
|
| 136 | 136 | foreach ($data as $device => $numbers) { |
| 137 | 137 | if ($device == "TOTAL") { |
| 138 | 138 | continue; |
| 139 | 139 | } |
| 140 | - $retstring .= " <device name='" . $device . "'>\n <downloads group='admin'>" . $numbers['ADMIN'] . "</downloads>\n <downloads group='managed_idp'>" . $numbers['SILVERBULLET'] . "</downloads>\n <downloads group='user'>" . $numbers['USER'] . "</downloads>\n </device>"; |
|
| 140 | + $retstring .= " <device name='".$device."'>\n <downloads group='admin'>".$numbers['ADMIN']."</downloads>\n <downloads group='managed_idp'>".$numbers['SILVERBULLET']."</downloads>\n <downloads group='user'>".$numbers['USER']."</downloads>\n </device>"; |
|
| 141 | 141 | } |
| 142 | - $retstring .= "<total>\n <downloads group='admin'>" . $data['TOTAL']['ADMIN'] . "</downloads>\n <downloads group='managed_idp'>" . $data['TOTAL']['SILVERBULLET'] . "</downloads>\n <downloads group='user'>" . $data['TOTAL']['USER'] . "</downloads>\n</total>\n"; |
|
| 142 | + $retstring .= "<total>\n <downloads group='admin'>".$data['TOTAL']['ADMIN']."</downloads>\n <downloads group='managed_idp'>".$data['TOTAL']['SILVERBULLET']."</downloads>\n <downloads group='user'>".$data['TOTAL']['USER']."</downloads>\n</total>\n"; |
|
| 143 | 143 | $retstring .= "</federation>"; |
| 144 | 144 | break; |
| 145 | 145 | case "array": |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | $identifier = $this->databaseHandle->lastID(); |
| 222 | 222 | |
| 223 | 223 | if ($identifier == 0 || !$this->loggerInstance->writeAudit($ownerId, "NEW", "IdP $identifier")) { |
| 224 | - $text = "<p>Could not create a new " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_inst'] . "!</p>"; |
|
| 224 | + $text = "<p>Could not create a new ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_inst']."!</p>"; |
|
| 225 | 225 | echo $text; |
| 226 | 226 | throw new Exception($text); |
| 227 | 227 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | foreach ($idps as $idp) { |
| 38 | 38 | $idpTitle[$idp['entityID']] = $idp['title']; |
| 39 | 39 | $d = self::getIdpDistance($idp, $here); |
| 40 | - $resultSet[$idp['entityID']] = $d . " " . $idp['title']; |
|
| 40 | + $resultSet[$idp['entityID']] = $d." ".$idp['title']; |
|
| 41 | 41 | } |
| 42 | 42 | asort($resultSet); |
| 43 | 43 | $outarray = []; |