@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | protected function setSupportedEapMethods($eapArray) |
| 86 | 86 | { |
| 87 | 87 | $this->supportedEapMethods = $eapArray; |
| 88 | - $this->loggerInstance->debug(4, "This device (" . __CLASS__ . ") supports the following EAP methods: "); |
|
| 88 | + $this->loggerInstance->debug(4, "This device (".__CLASS__.") supports the following EAP methods: "); |
|
| 89 | 89 | $this->loggerInstance->debug(4, $this->supportedEapMethods); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | break 2; |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | - $longestSuffix = $candidate . $longestSuffix; |
|
| 140 | + $longestSuffix = $candidate.$longestSuffix; |
|
| 141 | 141 | } |
| 142 | 142 | return $longestSuffix; |
| 143 | 143 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | throw new Exception("No EAP type available."); |
| 176 | 176 | } |
| 177 | 177 | $this->attributes = $this->getProfileAttributes($profile); |
| 178 | - $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id); |
|
| 178 | + $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id); |
|
| 179 | 179 | |
| 180 | 180 | |
| 181 | 181 | // if we are instantiating a Silverbullet profile AND have been given |
@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | // create temporary directory, its full path will be saved in $this->FPATH; |
| 200 | 200 | $tempDir = \core\common\Entity::createTemporaryDirectory($purpose); |
| 201 | 201 | $this->FPATH = $tempDir['dir']; |
| 202 | - mkdir($tempDir['dir'] . '/tmp'); |
|
| 203 | - chdir($tempDir['dir'] . '/tmp'); |
|
| 202 | + mkdir($tempDir['dir'].'/tmp'); |
|
| 203 | + chdir($tempDir['dir'].'/tmp'); |
|
| 204 | 204 | $caList = []; |
| 205 | 205 | $x509 = new \core\common\X509(); |
| 206 | 206 | if (isset($this->attributes['eap:ca_file'])) { |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $this->support_url_substitute = sprintf(_("your local %s support page"), \config\ConfAssistant::CONSORTIUM['display_name']); |
| 237 | 237 | |
| 238 | 238 | if ($this->signer && $this->options['sign']) { |
| 239 | - $this->sign = ROOT . '/signer/' . $this->signer; |
|
| 239 | + $this->sign = ROOT.'/signer/'.$this->signer; |
|
| 240 | 240 | } |
| 241 | 241 | $this->installerBasename = $this->getInstallerBasename(); |
| 242 | 242 | common\Entity::outOfThePotatoes(); |
@@ -296,10 +296,10 @@ discard block |
||
| 296 | 296 | */ |
| 297 | 297 | protected function findSourceFile($file) |
| 298 | 298 | { |
| 299 | - if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) { |
|
| 300 | - return $this->module_path . '/Files/' . $this->device_id . '/' . $file; |
|
| 301 | - } elseif (is_file($this->module_path . '/Files/' . $file)) { |
|
| 302 | - return $this->module_path . '/Files/' . $file; |
|
| 299 | + if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) { |
|
| 300 | + return $this->module_path.'/Files/'.$this->device_id.'/'.$file; |
|
| 301 | + } elseif (is_file($this->module_path.'/Files/'.$file)) { |
|
| 302 | + return $this->module_path.'/Files/'.$file; |
|
| 303 | 303 | } else { |
| 304 | 304 | $this->loggerInstance->debug(2, "requested file $file does not exist\n"); |
| 305 | 305 | return FALSE; |
@@ -423,17 +423,17 @@ discard block |
||
| 423 | 423 | */ |
| 424 | 424 | private function getInstallerBasename() |
| 425 | 425 | { |
| 426 | - $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name']) . "-" . $this->getDeviceId(); |
|
| 426 | + $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name'])."-".$this->getDeviceId(); |
|
| 427 | 427 | if (isset($this->attributes['profile:customsuffix'][1])) { |
| 428 | 428 | // this string will end up as a filename on a filesystem, so always |
| 429 | 429 | // take a latin-based language variant if available |
| 430 | 430 | // and then scrub non-ASCII just in case |
| 431 | - return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]); |
|
| 431 | + return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]); |
|
| 432 | 432 | } |
| 433 | 433 | // Okay, no custom suffix. |
| 434 | 434 | // Use the configured inst name and apply shortening heuristics |
| 435 | 435 | $lang_pointer = \config\Master::LANGUAGES[$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1; |
| 436 | - $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes['general:instname'][$lang_pointer] . "\n"); |
|
| 436 | + $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes['general:instname'][$lang_pointer]."\n"); |
|
| 437 | 437 | $inst = $this->customTranslit($this->attributes['general:instname'][$lang_pointer]); |
| 438 | 438 | $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n"); |
| 439 | 439 | $Inst_a = explode('_', $inst); |
@@ -448,10 +448,10 @@ discard block |
||
| 448 | 448 | if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) { |
| 449 | 449 | $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]); |
| 450 | 450 | $prof = preg_replace('/_+$/', '', $profTemp); |
| 451 | - return $baseName . $inst . '-' . $prof; |
|
| 451 | + return $baseName.$inst.'-'.$prof; |
|
| 452 | 452 | } |
| 453 | 453 | } |
| 454 | - return $baseName . $inst; |
|
| 454 | + return $baseName.$inst; |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | /** |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | $ext = 'unsupported'; |
| 570 | 570 | } |
| 571 | 571 | $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n"); |
| 572 | - $fileName = 'logo-' . $type . $iterator . '.' . $ext; |
|
| 572 | + $fileName = 'logo-'.$type.$iterator.'.'.$ext; |
|
| 573 | 573 | $fileHandle = fopen($fileName, "w"); |
| 574 | 574 | if (!$fileHandle) { |
| 575 | 575 | $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n"); |
@@ -596,13 +596,13 @@ discard block |
||
| 596 | 596 | $mime = $finfo->buffer($blob); |
| 597 | 597 | $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported'; |
| 598 | 598 | $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n"); |
| 599 | - $fileHandle = fopen('local-info.' . $ext, "w"); |
|
| 599 | + $fileHandle = fopen('local-info.'.$ext, "w"); |
|
| 600 | 600 | if ($fileHandle === FALSE) { |
| 601 | 601 | throw new Exception("problem opening the file"); |
| 602 | 602 | } |
| 603 | 603 | fwrite($fileHandle, $blob); |
| 604 | 604 | fclose($fileHandle); |
| 605 | - return(['name' => 'local-info.' . $ext, 'mime' => $ext]); |
|
| 605 | + return(['name' => 'local-info.'.$ext, 'mime' => $ext]); |
|
| 606 | 606 | } |
| 607 | 607 | |
| 608 | 608 | /** |
@@ -656,9 +656,9 @@ discard block |
||
| 656 | 656 | { |
| 657 | 657 | $outerId = NULL; |
| 658 | 658 | if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) { |
| 659 | - $outerId = "@" . $this->attributes['internal:realm'][0]; |
|
| 659 | + $outerId = "@".$this->attributes['internal:realm'][0]; |
|
| 660 | 660 | if (isset($this->attributes['internal:anon_local_value'])) { |
| 661 | - $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId; |
|
| 661 | + $outerId = $this->attributes['internal:anon_local_value'][0].$outerId; |
|
| 662 | 662 | } |
| 663 | 663 | } |
| 664 | 664 | return $outerId; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | protected function saveDownloadDetails($idpIdentifier, $profileId, $deviceId, $area, $lang, $eapType) |
| 135 | 135 | { |
| 136 | 136 | if (\config\Master::PATHS['logdir']) { |
| 137 | - $file = fopen(\config\Master::PATHS['logdir'] . "/download_details.log", "a"); |
|
| 137 | + $file = fopen(\config\Master::PATHS['logdir']."/download_details.log", "a"); |
|
| 138 | 138 | if ($file === FALSE) { |
| 139 | 139 | throw new Exception("Unable to open file for append: $file"); |
| 140 | 140 | } |
@@ -169,9 +169,9 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | // check if a CA with identical DN was added - alert NRO if so |
| 171 | 171 | if (array_search($ca['subject'], $baselineCA) !== FALSE) { |
| 172 | - $retval[AbstractProfile::CA_CLASH_ADDED] .= "#SHA1 for CA with DN '" . print_r($ca['subject'], TRUE) . "' has SHA1 fingerprints (pre-existing) " . /** @scrutinizer ignore-type */ array_search($ca['subject'], $baselineCA) . " and (added) " . $ca['sha1']; |
|
| 172 | + $retval[AbstractProfile::CA_CLASH_ADDED] .= "#SHA1 for CA with DN '".print_r($ca['subject'], TRUE)."' has SHA1 fingerprints (pre-existing) "./** @scrutinizer ignore-type */ array_search($ca['subject'], $baselineCA)." and (added) ".$ca['sha1']; |
|
| 173 | 173 | } else { |
| 174 | - $retval[AbstractProfile::CA_ADDED] .= "#CA with DN '" . print_r($ca['subject'], TRUE) . "' and SHA1 fingerprint " . $ca['sha1'] . " was added as trust anchor"; |
|
| 174 | + $retval[AbstractProfile::CA_ADDED] .= "#CA with DN '".print_r($ca['subject'], TRUE)."' and SHA1 fingerprint ".$ca['sha1']." was added as trust anchor"; |
|
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | // check if a servername was added |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | foreach ($new->getAttributes("eap:server_name") as $newName) { |
| 183 | 183 | if (!in_array($newName['value'], $baselineNames)) { |
| 184 | - $retval[AbstractProfile::SERVERNAME_ADDED] .= "#New server name '" . $newName['value'] . "' added"; |
|
| 184 | + $retval[AbstractProfile::SERVERNAME_ADDED] .= "#New server name '".$newName['value']."' added"; |
|
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | return $retval; |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $eaptype = new common\EAP($eapQuery->eap_method_id); |
| 206 | 206 | $eapTypeArray[] = $eaptype; |
| 207 | 207 | } |
| 208 | - $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n" . print_r($eapTypeArray, true)); |
|
| 208 | + $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n".print_r($eapTypeArray, true)); |
|
| 209 | 209 | return $eapTypeArray; |
| 210 | 210 | } |
| 211 | 211 | |
@@ -287,16 +287,16 @@ discard block |
||
| 287 | 287 | if (count($this->getAttributes("internal:checkuser_outer")) > 0) { |
| 288 | 288 | // we are supposed to use a specific outer username for checks, |
| 289 | 289 | // which is different from the outer username we put into installers |
| 290 | - return $this->getAttributes("internal:checkuser_value")[0]['value'] . "@" . $realm; |
|
| 290 | + return $this->getAttributes("internal:checkuser_value")[0]['value']."@".$realm; |
|
| 291 | 291 | } |
| 292 | 292 | if (count($this->getAttributes("internal:use_anon_outer")) > 0) { |
| 293 | 293 | // no special check username, but there is an anon outer ID for |
| 294 | 294 | // installers - so let's use that one |
| 295 | - return $this->getAttributes("internal:anon_local_value")[0]['value'] . "@" . $realm; |
|
| 295 | + return $this->getAttributes("internal:anon_local_value")[0]['value']."@".$realm; |
|
| 296 | 296 | } |
| 297 | 297 | // okay, no guidance on outer IDs at all - but we need *something* to |
| 298 | 298 | // test with for the RealmChecks. So: |
| 299 | - return "@" . $realm; |
|
| 299 | + return "@".$realm; |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | public function prepShowtime() |
| 745 | 745 | { |
| 746 | 746 | $properConfig = $this->readyForShowtime(); |
| 747 | - $this->databaseHandle->exec("UPDATE profile SET sufficient_config = " . ($properConfig ? "TRUE" : "FALSE") . " WHERE profile_id = " . $this->identifier); |
|
| 747 | + $this->databaseHandle->exec("UPDATE profile SET sufficient_config = ".($properConfig ? "TRUE" : "FALSE")." WHERE profile_id = ".$this->identifier); |
|
| 748 | 748 | |
| 749 | 749 | $attribs = $this->getCollapsedAttributes(); |
| 750 | 750 | // if not enough info to go live, set FALSE |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | otherdata = j.otherdata; |
| 84 | 84 | if(! result) { |
| 85 | 85 | alert("<?php $cat->javaScriptEscapedEcho(_("no matching data found"))?>"); |
| 86 | - document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/' ?>'; |
|
| 86 | + document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/' ?>'; |
|
| 87 | 87 | } |
| 88 | 88 | j = j.data; |
| 89 | 89 | n = j.length; |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | result = j1.status; |
| 221 | 221 | if(! result) { |
| 222 | 222 | alert("<?php $cat->javaScriptEscapedEcho(_("no matching data found")) ?>"); |
| 223 | - document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/' ?>'; |
|
| 223 | + document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/' ?>'; |
|
| 224 | 224 | } |
| 225 | 225 | j = j1.data; |
| 226 | 226 | if(j.description !== undefined && j.description) { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $("#profile_desc").hide(); |
| 232 | 232 | $("#profile_desc").text(''); |
| 233 | 233 | } |
| 234 | - updateTxt = '<span class="user_info"><?php $cat->javaScriptEscapedEcho(_("This entry was last updated at:"));?>'+' '+j.last_changed+'</span><br/>'; |
|
| 234 | + updateTxt = '<span class="user_info"><?php $cat->javaScriptEscapedEcho(_("This entry was last updated at:")); ?>'+' '+j.last_changed+'</span><br/>'; |
|
| 235 | 235 | if(j.local_url !== undefined && j.local_url) |
| 236 | 236 | txt = txt+'<span class="user_info"><?php $cat->javaScriptEscapedEcho(_("WWW:")); ?> <a href="'+j.local_url+'" target="_blank">'+j.local_url+'</a></span><br/>'; |
| 237 | 237 | if(j.local_email !== undefined && j.local_email) |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | private function inputValidationError($customtext) |
| 41 | 41 | { |
| 42 | 42 | \core\common\Entity::intoThePotatoes(); |
| 43 | - $retval = "<p>" . _("Input validation error: ") . $customtext . "</p>"; |
|
| 43 | + $retval = "<p>"._("Input validation error: ").$customtext."</p>"; |
|
| 44 | 44 | \core\common\Entity::outOfThePotatoes(); |
| 45 | 45 | return $retval; |
| 46 | 46 | } |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | try { |
| 542 | 542 | $image->readImageBlob($binary); |
| 543 | 543 | } catch (\ImagickException $exception) { |
| 544 | - echo "Error" . $exception->getMessage(); |
|
| 544 | + echo "Error".$exception->getMessage(); |
|
| 545 | 545 | return FALSE; |
| 546 | 546 | } |
| 547 | 547 | // image survived the sanity check |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | const ACTIONS = [ |
| 250 | 250 | // Inst-level actions. |
| 251 | 251 | API::ACTION_NEWINST_BY_REF => [ |
| 252 | - "REQ" => [API::AUXATTRIB_EXTERNALID,], |
|
| 252 | + "REQ" => [API::AUXATTRIB_EXTERNALID, ], |
|
| 253 | 253 | "OPT" => [ |
| 254 | 254 | 'general:geo_coordinates', |
| 255 | 255 | 'general:logo_file', |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | ], |
| 267 | 267 | ], |
| 268 | 268 | API::ACTION_NEWINST => [ |
| 269 | - "REQ" => [API::AUXATTRIB_INSTTYPE,], // "IdP", "SP" or "IdPSP" |
|
| 269 | + "REQ" => [API::AUXATTRIB_INSTTYPE, ], // "IdP", "SP" or "IdPSP" |
|
| 270 | 270 | "OPT" => [ |
| 271 | 271 | 'general:instname', |
| 272 | 272 | 'general:geo_coordinates', |
@@ -562,8 +562,8 @@ discard block |
||
| 562 | 562 | |
| 563 | 563 | case \core\Options::TYPECODE_COORDINATES: |
| 564 | 564 | $extension = \core\Options::TYPECODE_TEXT; |
| 565 | - $coercedInline["option"][$basename] = $oneAttrib['NAME'] . "#"; |
|
| 566 | - $coercedInline["value"][$basename . "-" . $extension] = $oneAttrib['VALUE']; |
|
| 565 | + $coercedInline["option"][$basename] = $oneAttrib['NAME']."#"; |
|
| 566 | + $coercedInline["value"][$basename."-".$extension] = $oneAttrib['VALUE']; |
|
| 567 | 567 | break; |
| 568 | 568 | case \core\Options::TYPECODE_TEXT: |
| 569 | 569 | // Fall-through: they all get the same treatment. |
@@ -573,18 +573,18 @@ discard block |
||
| 573 | 573 | // Fall-through: they all get the same treatment. |
| 574 | 574 | case \core\Options::TYPECODE_INTEGER: |
| 575 | 575 | $extension = $optionInfo['type']; |
| 576 | - $coercedInline["option"][$basename] = $oneAttrib['NAME'] . "#"; |
|
| 577 | - $coercedInline["value"][$basename . "-" . $extension] = $oneAttrib['VALUE']; |
|
| 576 | + $coercedInline["option"][$basename] = $oneAttrib['NAME']."#"; |
|
| 577 | + $coercedInline["value"][$basename."-".$extension] = $oneAttrib['VALUE']; |
|
| 578 | 578 | if ($optionInfo['flag'] == "ML") { |
| 579 | - $coercedInline["value"][$basename . "-lang"] = $oneAttrib['LANG']; |
|
| 579 | + $coercedInline["value"][$basename."-lang"] = $oneAttrib['LANG']; |
|
| 580 | 580 | } |
| 581 | 581 | break; |
| 582 | 582 | case \core\Options::TYPECODE_FILE: |
| 583 | 583 | // Binary data is expected in base64 encoding. This is true also for PEM files! |
| 584 | 584 | $extension = $optionInfo['type']; |
| 585 | - $coercedInline["option"][$basename] = $oneAttrib['NAME'] . "#"; |
|
| 586 | - file_put_contents($dir['dir'] . "/" . $basename . "-" . $extension, base64_decode($oneAttrib['VALUE'])); |
|
| 587 | - $coercedFile["value"]['tmp_name'][$basename . "-" . $extension] = $dir['dir'] . "/" . $basename . "-" . $extension; |
|
| 585 | + $coercedInline["option"][$basename] = $oneAttrib['NAME']."#"; |
|
| 586 | + file_put_contents($dir['dir']."/".$basename."-".$extension, base64_decode($oneAttrib['VALUE'])); |
|
| 587 | + $coercedFile["value"]['tmp_name'][$basename."-".$extension] = $dir['dir']."/".$basename."-".$extension; |
|
| 588 | 588 | break; |
| 589 | 589 | default: |
| 590 | 590 | throw new Exception("We don't seem to know this type code!"); |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | public function returnSuccess($details) { |
| 614 | 614 | $output = json_encode(["result" => "SUCCESS", "details" => $details], JSON_PRETTY_PRINT); |
| 615 | 615 | if ($output === FALSE) { |
| 616 | - $this->returnError(API::ERROR_INTERNAL_ERROR, "Unable to JSON encode return data: ". json_last_error(). " - ". json_last_error_msg()); |
|
| 616 | + $this->returnError(API::ERROR_INTERNAL_ERROR, "Unable to JSON encode return data: ".json_last_error()." - ".json_last_error_msg()); |
|
| 617 | 617 | } |
| 618 | 618 | else { |
| 619 | 619 | echo $output; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /* |
| 21 | 21 | * Class autoloader invocation, should be included prior to any other code at the entry points to the application |
| 22 | 22 | */ |
| 23 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 23 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 24 | 24 | |
| 25 | 25 | $auth = new \web\lib\admin\Authentication(); |
| 26 | 26 | $auth->authenticate(); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $fed = new \core\Federation($inst->federation); |
| 54 | 54 | $allowSb = $fed->getAttributes("fed:silverbullet"); |
| 55 | 55 | if (count($allowSb) == 0) { |
| 56 | - throw new Exception("We were told to create a new SB profile, but this " . \config\ConfAssistant::CONSORTIUM['nomenclature_federation'] . " does not allow SB at all!"); |
|
| 56 | + throw new Exception("We were told to create a new SB profile, but this ".\config\ConfAssistant::CONSORTIUM['nomenclature_federation']." does not allow SB at all!"); |
|
| 57 | 57 | } |
| 58 | 58 | // okay, new SB profiles are allowed. |
| 59 | 59 | // but is there a support:email attribute on inst level? |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | // Create one. |
| 65 | 65 | $newProfile = $inst->newProfile(core\AbstractProfile::PROFILETYPE_SILVERBULLET); |
| 66 | 66 | // and modify the REQUEST_URI to add the new profile ID |
| 67 | - $_SERVER['REQUEST_URI'] = $_SERVER['REQUEST_URI'] . "&profile_id=" . $newProfile->identifier; |
|
| 67 | + $_SERVER['REQUEST_URI'] = $_SERVER['REQUEST_URI']."&profile_id=".$newProfile->identifier; |
|
| 68 | 68 | $_GET['profile_id'] = $newProfile->identifier; |
| 69 | 69 | $profile = $newProfile; |
| 70 | 70 | } else { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | if (isset($_POST['command'])) { |
| 90 | 90 | switch ($_POST['command']) { |
| 91 | 91 | case \web\lib\common\FormElements::BUTTON_CLOSE: |
| 92 | - header("Location: overview_idp.php?inst_id=" . $inst->identifier); |
|
| 92 | + header("Location: overview_idp.php?inst_id=".$inst->identifier); |
|
| 93 | 93 | break; |
| 94 | 94 | case \web\lib\common\FormElements::BUTTON_TERMSOFUSE: |
| 95 | 95 | if (isset($_POST['agreement']) && $_POST['agreement'] == 'true') { |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | break; |
| 133 | 133 | } |
| 134 | 134 | $properName = $validator->syntaxConformUser($elements[0]); |
| 135 | - $properDate = new DateTime($elements[1] . " 00:00:00"); |
|
| 135 | + $properDate = new DateTime($elements[1]." 00:00:00"); |
|
| 136 | 136 | $numberOfActivations = $elements[2] ?? 5; |
| 137 | 137 | $number = $validator->integer($numberOfActivations); |
| 138 | 138 | if ($number === FALSE) { // invalid input received, default to sane |
@@ -235,18 +235,18 @@ discard block |
||
| 235 | 235 | // warn and ask for confirmation unless already confirmed |
| 236 | 236 | if (!isset($_POST['insecureconfirm']) || $_POST['insecureconfirm'] != "CONFIRM") { |
| 237 | 237 | echo $deco->pageheader(_("Insecure mail domain!"), "ADMIN-IDP-USERS"); |
| 238 | - echo "<p>" . sprintf(_("The mail domain of the mail address <strong>%s</strong> is not secure: some or all of the mail servers are not accepting encrypted connections (no consistent support for STARTTLS)."), $properEmail) . "</p>"; |
|
| 239 | - echo "<p>" . _("The invitation would need to be sent in cleartext across the internet, and can possibly be read and abused by anyone in transit.") . "</p>"; |
|
| 240 | - echo "<p>" . _("Do you want the system to send this mail anyway?") . "</p>"; |
|
| 238 | + echo "<p>".sprintf(_("The mail domain of the mail address <strong>%s</strong> is not secure: some or all of the mail servers are not accepting encrypted connections (no consistent support for STARTTLS)."), $properEmail)."</p>"; |
|
| 239 | + echo "<p>"._("The invitation would need to be sent in cleartext across the internet, and can possibly be read and abused by anyone in transit.")."</p>"; |
|
| 240 | + echo "<p>"._("Do you want the system to send this mail anyway?")."</p>"; |
|
| 241 | 241 | echo $formtext; |
| 242 | - echo "<button type='submit' class='delete'>" . _("DO NOT SEND") . "</button>"; |
|
| 242 | + echo "<button type='submit' class='delete'>"._("DO NOT SEND")."</button>"; |
|
| 243 | 243 | echo "</form>"; |
| 244 | 244 | echo $formtext; |
| 245 | - echo "<input type='hidden' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT . "'</>"; |
|
| 245 | + echo "<input type='hidden' name='command' value='".\web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT."'</>"; |
|
| 246 | 246 | echo "<input type='hidden' name='address' value='$properEmail'</>"; |
| 247 | - echo "<input type='hidden' name='token' value='" . $invitationObject->invitationTokenString . "'</>"; |
|
| 247 | + echo "<input type='hidden' name='token' value='".$invitationObject->invitationTokenString."'</>"; |
|
| 248 | 248 | echo "<input type='hidden' name='insecureconfirm' value='CONFIRM'/>"; |
| 249 | - echo "<button type='submit'>" . _("Send anyway.") . "</button>"; |
|
| 249 | + echo "<button type='submit'>"._("Send anyway.")."</button>"; |
|
| 250 | 250 | echo "</form>"; |
| 251 | 251 | echo $deco->footer(); |
| 252 | 252 | exit; |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | $activeUsers = $profile->listActiveUsers(); |
| 298 | 298 | |
| 299 | 299 | |
| 300 | -echo $deco->defaultPagePrelude(sprintf(_('Managing %s users'), \core\ProfileSilverbullet::PRODUCTNAME )); |
|
| 300 | +echo $deco->defaultPagePrelude(sprintf(_('Managing %s users'), \core\ProfileSilverbullet::PRODUCTNAME)); |
|
| 301 | 301 | |
| 302 | 302 | ?> |
| 303 | 303 | <script src='js/option_expand.js' type='text/javascript'></script> |
@@ -360,19 +360,19 @@ discard block |
||
| 360 | 360 | case "NOSTIPULATION": |
| 361 | 361 | break; |
| 362 | 362 | case "EMAIL-SENT": |
| 363 | - echo $boundaryPre . $uiElements->boxOkay(_("The e-mail was sent successfully."), _("E-mail OK."), FALSE) . $boundaryPost; |
|
| 363 | + echo $boundaryPre.$uiElements->boxOkay(_("The e-mail was sent successfully."), _("E-mail OK."), FALSE).$boundaryPost; |
|
| 364 | 364 | break; |
| 365 | 365 | case "EMAIL-NOTSENT": |
| 366 | - echo $boundaryPre . $uiElements->boxError(_("The e-mail was NOT sent."), _("E-mail not OK."), FALSE) . $boundaryPost; |
|
| 366 | + echo $boundaryPre.$uiElements->boxError(_("The e-mail was NOT sent."), _("E-mail not OK."), FALSE).$boundaryPost; |
|
| 367 | 367 | break; |
| 368 | 368 | case "SMS-SENT": |
| 369 | - echo $boundaryPre . $uiElements->boxOkay(_("The SMS was sent successfully."), _("SMS OK."), FALSE) . $boundaryPost; |
|
| 369 | + echo $boundaryPre.$uiElements->boxOkay(_("The SMS was sent successfully."), _("SMS OK."), FALSE).$boundaryPost; |
|
| 370 | 370 | break; |
| 371 | 371 | case "SMS-NOTSENT": |
| 372 | - echo $boundaryPre . $uiElements->boxOkay(_("The SMS was NOT sent."), _("SMS not OK."), FALSE) . $boundaryPost; |
|
| 372 | + echo $boundaryPre.$uiElements->boxOkay(_("The SMS was NOT sent."), _("SMS not OK."), FALSE).$boundaryPost; |
|
| 373 | 373 | break; |
| 374 | 374 | case "SMS-FRAGMENT": |
| 375 | - echo $boundaryPre . $uiElements->boxWarning(_("Only a fragment of the SMS was sent. You should re-send it."), _("SMS Fragment."), FALSE) . $boundaryPost; |
|
| 375 | + echo $boundaryPre.$uiElements->boxWarning(_("Only a fragment of the SMS was sent. You should re-send it."), _("SMS Fragment."), FALSE).$boundaryPost; |
|
| 376 | 376 | break; |
| 377 | 377 | } |
| 378 | 378 | ?> |
@@ -385,17 +385,17 @@ discard block |
||
| 385 | 385 | <?php |
| 386 | 386 | $bufferCurrentUsers = "<table class='sb-user-table' style='max-width:1920px;'> |
| 387 | 387 | <tr class='sb-title-row'> |
| 388 | - <td>" . _("User") . "</td> |
|
| 389 | - <td>" . _("Token/Certificate details") . "</td> |
|
| 390 | - <td>" . _("User/Token Expiry") . "</td> |
|
| 391 | - <td>" . _("Actions") . "</td> |
|
| 388 | + <td>" . _("User")."</td> |
|
| 389 | + <td>" . _("Token/Certificate details")."</td> |
|
| 390 | + <td>" . _("User/Token Expiry")."</td> |
|
| 391 | + <td>" . _("Actions")."</td> |
|
| 392 | 392 | </tr>"; |
| 393 | 393 | $bufferPreviousUsers = "<table class='sb-user-table' style='max-width:1920px;'> |
| 394 | 394 | <tr class='sb-title-row'> |
| 395 | - <td>" . _("User") . "</td> |
|
| 396 | - <td>" . _("Certificate details") . "</td> |
|
| 397 | - <td>" . _("User Expiry") . "</td> |
|
| 398 | - <td>" . _("Actions") . "</td> |
|
| 395 | + <td>" . _("User")."</td> |
|
| 396 | + <td>" . _("Certificate details")."</td> |
|
| 397 | + <td>" . _("User Expiry")."</td> |
|
| 398 | + <td>" . _("Actions")."</td> |
|
| 399 | 399 | </tr>"; |
| 400 | 400 | |
| 401 | 401 | natsort($allUsers); |
@@ -452,23 +452,23 @@ discard block |
||
| 452 | 452 | $display = empty(devices\Devices::listDevices()[$oneCert->device]['display']) ? $oneCert->device : devices\Devices::listDevices()[$oneCert->device]['display']; |
| 453 | 453 | |
| 454 | 454 | $bufferText = "<div class='sb-certificate-summary ca-summary' $style> |
| 455 | - <div class='sb-certificate-details'>" . _("Device:") . " " . $display . |
|
| 456 | - "<br>" . _("Serial Number:") . " " . dechex($oneCert->serial) . |
|
| 457 | - "<br>" . _("CN:") . " " . explode('@', $oneCert->username)[0] . "@…" . |
|
| 458 | - "<br>" . _("Expiry:") . " " . $oneCert->expiry . |
|
| 459 | - "<br>" . _("Issued:") . " " . $oneCert->issued . |
|
| 460 | - "</div>" . |
|
| 455 | + <div class='sb-certificate-details'>"._("Device:")." ".$display. |
|
| 456 | + "<br>"._("Serial Number:")." ".dechex($oneCert->serial). |
|
| 457 | + "<br>"._("CN:")." ".explode('@', $oneCert->username)[0]."@…". |
|
| 458 | + "<br>"._("Expiry:")." ".$oneCert->expiry. |
|
| 459 | + "<br>"._("Issued:")." ".$oneCert->issued. |
|
| 460 | + "</div>". |
|
| 461 | 461 | "<div style='text-align:right;padding-top: 5px; $buttonStyle'>"; |
| 462 | 462 | |
| 463 | 463 | if ($buttonText == "") { |
| 464 | 464 | $bufferText .= $formtext |
| 465 | - . "<input type='hidden' name='certSerial' value='" . $oneCert->serial . "'/>" |
|
| 466 | - . "<input type='hidden' name='certAlgo' value='" . $oneCert->ca_type . "'/>" |
|
| 465 | + . "<input type='hidden' name='certSerial' value='".$oneCert->serial."'/>" |
|
| 466 | + . "<input type='hidden' name='certAlgo' value='".$oneCert->ca_type."'/>" |
|
| 467 | 467 | . "<button type='submit' " |
| 468 | 468 | . "name='command' " |
| 469 | - . "value='" . \web\lib\common\FormElements::BUTTON_REVOKECREDENTIAL . "' " |
|
| 469 | + . "value='".\web\lib\common\FormElements::BUTTON_REVOKECREDENTIAL."' " |
|
| 470 | 470 | . "class='delete' " |
| 471 | - . "onclick='return confirm(\"" . sprintf(_("The device in question will stop functioning with %s. The revocation cannot be undone. Are you sure you want to do this?"), \config\ConfAssistant::CONSORTIUM['display_name']) . "\")'>" |
|
| 471 | + . "onclick='return confirm(\"".sprintf(_("The device in question will stop functioning with %s. The revocation cannot be undone. Are you sure you want to do this?"), \config\ConfAssistant::CONSORTIUM['display_name'])."\")'>" |
|
| 472 | 472 | . _("Revoke") |
| 473 | 473 | . "</button>" |
| 474 | 474 | . "</form>"; |
@@ -493,13 +493,13 @@ discard block |
||
| 493 | 493 | } |
| 494 | 494 | // wrap the revoked and expired certs in a div that is hidden by default |
| 495 | 495 | if ($textRevokedCerts !== "") { |
| 496 | - $textRevokedCerts = "<span style='text-decoration: underline;' id='$oneUserId-revoked-heading' onclick='document.getElementById(\"$oneUserId-revoked-certs\").style.display = \"block\"; document.getElementById(\"$oneUserId-revoked-heading\").style.display = \"none\";'>" . sprintf(ngettext("(show %d revoked certificate)", "(show %d revoked certificates)", $countRevoked), $countRevoked) . "</span><div id='$oneUserId-revoked-certs' style='display:none;'>" . $textRevokedCerts . "</div>"; |
|
| 496 | + $textRevokedCerts = "<span style='text-decoration: underline;' id='$oneUserId-revoked-heading' onclick='document.getElementById(\"$oneUserId-revoked-certs\").style.display = \"block\"; document.getElementById(\"$oneUserId-revoked-heading\").style.display = \"none\";'>".sprintf(ngettext("(show %d revoked certificate)", "(show %d revoked certificates)", $countRevoked), $countRevoked)."</span><div id='$oneUserId-revoked-certs' style='display:none;'>".$textRevokedCerts."</div>"; |
|
| 497 | 497 | } |
| 498 | 498 | if ($textExpiredCerts !== "") { |
| 499 | - $textExpiredCerts = "<span style='text-decoration: underline;' id='$oneUserId-expired-heading' onclick='document.getElementById(\"$oneUserId-expired-certs\").style.display = \"block\"; document.getElementById(\"$oneUserId-expired-heading\").style.display = \"none\";'>" . sprintf(ngettext("(show %d expired certificate)", "(show %d expired certificates)", $countExpired), $countExpired) . "</span><div id='$oneUserId-expired-certs' style='display:none;'>" . $textExpiredCerts . "</div>"; |
|
| 499 | + $textExpiredCerts = "<span style='text-decoration: underline;' id='$oneUserId-expired-heading' onclick='document.getElementById(\"$oneUserId-expired-certs\").style.display = \"block\"; document.getElementById(\"$oneUserId-expired-heading\").style.display = \"none\";'>".sprintf(ngettext("(show %d expired certificate)", "(show %d expired certificates)", $countExpired), $countExpired)."</span><div id='$oneUserId-expired-certs' style='display:none;'>".$textExpiredCerts."</div>"; |
|
| 500 | 500 | } |
| 501 | 501 | // and push out the HTML |
| 502 | - ${$outputBuffer} .= $textActiveCerts . "<br/>" . $textExpiredCerts . " " . $textRevokedCerts . "</td>"; |
|
| 502 | + ${$outputBuffer} .= $textActiveCerts."<br/>".$textExpiredCerts." ".$textRevokedCerts."</td>"; |
|
| 503 | 503 | $tokenHtmlBuffer = ""; |
| 504 | 504 | $hasOnePendingInvite = FALSE; |
| 505 | 505 | foreach ($tokensWithoutCerts as $invitationObject) { |
@@ -510,38 +510,38 @@ discard block |
||
| 510 | 510 | $tokenHtmlBuffer .= "<tr class='sb-certificate-row'><td></td>"; |
| 511 | 511 | $jsEncodedBody = str_replace('\n', '%0D%0A', str_replace('"', '', json_encode($invitationObject->invitationMailBody()))); |
| 512 | 512 | $tokenHtmlBuffer .= "<td>"; |
| 513 | - $tokenHtmlBuffer .= sprintf(_("The invitation token %s is ready for sending! Choose how to send it:"), "<input type='text' readonly='readonly' style='background-color:lightgrey;' size='60' value='" . $invitationObject->link() . "' name='token' class='identifiedtokenarea-" . $invitationObject->identifier . "'>(…)<br/>"); |
|
| 513 | + $tokenHtmlBuffer .= sprintf(_("The invitation token %s is ready for sending! Choose how to send it:"), "<input type='text' readonly='readonly' style='background-color:lightgrey;' size='60' value='".$invitationObject->link()."' name='token' class='identifiedtokenarea-".$invitationObject->identifier."'>(…)<br/>"); |
|
| 514 | 514 | $tokenHtmlBuffer .= "<table> |
| 515 | - <tr><td style='vertical-align:bottom;'>" . _("E-Mail:") . "</td><td> |
|
| 515 | + <tr><td style='vertical-align:bottom;'>" . _("E-Mail:")."</td><td> |
|
| 516 | 516 | $formtext |
| 517 | - <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/> |
|
| 517 | + <input type='hidden' value='".$invitationObject->invitationTokenString."' name='token'><br/> |
|
| 518 | 518 | <input type='text' name='address' id='address-$invitationObject->identifier'/> |
| 519 | - <button type='button' onclick='window.location=\"mailto:\"+document.getElementById(\"address-$invitationObject->identifier\").value+\"?subject=" . $invitationObject->invitationMailSubject() . "&body=$jsEncodedBody\"; return false;'>" . _("Local mail client") . "</button> |
|
| 520 | - <button type='submit' name='command' onclick='document.getElementById(\"spin\").style.display =\"block\"' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT . "'>" . _("Send with CAT") . "</button> |
|
| 519 | + <button type='button' onclick='window.location=\"mailto:\"+document.getElementById(\"address-$invitationObject->identifier\").value+\"?subject=".$invitationObject->invitationMailSubject()."&body=$jsEncodedBody\"; return false;'>"._("Local mail client")."</button> |
|
| 520 | + <button type='submit' name='command' onclick='document.getElementById(\"spin\").style.display =\"block\"' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT."'>"._("Send with CAT")."</button> |
|
| 521 | 521 | </form> |
| 522 | 522 | </td></tr> |
| 523 | - <tr><td style='vertical-align:bottom;'>" . _("SMS:") . "</td><td> |
|
| 523 | + <tr><td style='vertical-align:bottom;'>" . _("SMS:")."</td><td> |
|
| 524 | 524 | $formtext |
| 525 | - <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/> |
|
| 525 | + <input type='hidden' value='".$invitationObject->invitationTokenString."' name='token'><br/> |
|
| 526 | 526 | <input type='text' name='smsnumber' /> |
| 527 | - <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONSMS . "'>" . _("Send in SMS...") . "</button> |
|
| 527 | + <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONSMS."'>"._("Send in SMS...")."</button> |
|
| 528 | 528 | </form> |
| 529 | 529 | </td></tr> |
| 530 | - <tr><td style='vertical-align:bottom;'>" . _("Manual:") . "</td><td> |
|
| 531 | - <button type='button' class='clipboardButton' onclick='clipboardCopy(" . $invitationObject->identifier . ");'>" . _("Copy to Clipboard") . "</button> |
|
| 530 | + <tr><td style='vertical-align:bottom;'>" . _("Manual:")."</td><td> |
|
| 531 | + <button type='button' class='clipboardButton' onclick='clipboardCopy(" . $invitationObject->identifier.");'>"._("Copy to Clipboard")."</button> |
|
| 532 | 532 | <form style='display:inline-block;' method='post' action='inc/displayQRcode.inc.php' onsubmit='popupQRWindow(this); return false;' accept-charset='UTF-8'> |
| 533 | - <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/> |
|
| 534 | - <button type='submit'>" . _("Display QR code") . "</button> |
|
| 533 | + <input type='hidden' value='" . $invitationObject->invitationTokenString."' name='token'><br/> |
|
| 534 | + <button type='submit'>" . _("Display QR code")."</button> |
|
| 535 | 535 | </form> |
| 536 | 536 | </td></tr> |
| 537 | 537 | |
| 538 | 538 | </table> |
| 539 | 539 | </td>"; |
| 540 | - $tokenHtmlBuffer .= "<td>" . _("Expiry Date:") . " " . $invitationObject->expiry . " UTC<br>" . _("Activations remaining:") . " " . sprintf(_("%d of %d"), $invitationObject->activationsRemaining, $invitationObject->activationsTotal) . "</td>"; |
|
| 540 | + $tokenHtmlBuffer .= "<td>"._("Expiry Date:")." ".$invitationObject->expiry." UTC<br>"._("Activations remaining:")." ".sprintf(_("%d of %d"), $invitationObject->activationsRemaining, $invitationObject->activationsTotal)."</td>"; |
|
| 541 | 541 | $tokenHtmlBuffer .= "<td>" |
| 542 | 542 | . $formtext |
| 543 | - . "<input type='hidden' name='invitationtoken' value='" . $invitationObject->invitationTokenString . "'/>" |
|
| 544 | - . "<button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_REVOKEINVITATION . "' class='delete'>" . _("Revoke") . "</button></form>" |
|
| 543 | + . "<input type='hidden' name='invitationtoken' value='".$invitationObject->invitationTokenString."'/>" |
|
| 544 | + . "<button type='submit' name='command' value='".\web\lib\common\FormElements::BUTTON_REVOKEINVITATION."' class='delete'>"._("Revoke")."</button></form>" |
|
| 545 | 545 | . "</td></tr>"; |
| 546 | 546 | break; |
| 547 | 547 | case core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED: |
@@ -557,10 +557,10 @@ discard block |
||
| 557 | 557 | } |
| 558 | 558 | ${$outputBuffer} .= "<td>$formtext |
| 559 | 559 | <div class='sb-date-container' style='min-width: 200px;'> |
| 560 | - <span><input type='text' maxlength='19' class='sb-date-picker' name='userexpiry' value='" . $profile->getUserExpiryDate($oneUserId) . "'> (UTC)</span> |
|
| 560 | + <span><input type='text' maxlength='19' class='sb-date-picker' name='userexpiry' value='".$profile->getUserExpiryDate($oneUserId)."'> (UTC)</span> |
|
| 561 | 561 | </div> |
| 562 | 562 | <input type='hidden' name='userid' value='$oneUserId'/> |
| 563 | - <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_CHANGEUSEREXPIRY . "'>" . _("Update") . "</button> |
|
| 563 | + <button type='submit' name='command' value='".\web\lib\common\FormElements::BUTTON_CHANGEUSEREXPIRY."'>"._("Update")."</button> |
|
| 564 | 564 | </form> |
| 565 | 565 | </td> |
| 566 | 566 | <td> |
@@ -568,33 +568,33 @@ discard block |
||
| 568 | 568 | |
| 569 | 569 | if ($hasOnePendingInvite || count($validCerts) > 0) { |
| 570 | 570 | $deletionText = sprintf(_("All of the currently active devices will stop functioning with %s. This cannot be undone. While the user can be re-activated later, they will then need to be re-provisioned with new invitation tokens. Are you sure you want to do this?"), \config\ConfAssistant::CONSORTIUM['display_name']); |
| 571 | - ${$outputBuffer} .= $formtext . " |
|
| 571 | + ${$outputBuffer} .= $formtext." |
|
| 572 | 572 | <input type='hidden' name='userid' value='$oneUserId'/> |
| 573 | 573 | <button type='submit' " |
| 574 | 574 | . "name='command' " |
| 575 | - . "value='" . \web\lib\common\FormElements::BUTTON_DEACTIVATEUSER . "' " |
|
| 575 | + . "value='".\web\lib\common\FormElements::BUTTON_DEACTIVATEUSER."' " |
|
| 576 | 576 | . "class='delete' " |
| 577 | - . ( count($validCerts) > 0 ? "onclick='return confirm(\"" . $deletionText . "\")' " : "" ) |
|
| 577 | + . (count($validCerts) > 0 ? "onclick='return confirm(\"".$deletionText."\")' " : "") |
|
| 578 | 578 | . ">" |
| 579 | 579 | . _("Deactivate User") |
| 580 | 580 | . "</button> |
| 581 | 581 | </form>"; |
| 582 | 582 | } |
| 583 | - ${$outputBuffer} .= "<form method='post' action='inc/userStats.inc.php?inst_id=" . $profile->institution . "&profile_id=" . $profile->identifier . "&user_id=$oneUserId' onsubmit='popupStatsWindow(this); return false;' accept-charset='UTF-8'> |
|
| 584 | - <button type='submit'>" . _("Show Authentication Records") . "</button> |
|
| 583 | + ${$outputBuffer} .= "<form method='post' action='inc/userStats.inc.php?inst_id=".$profile->institution."&profile_id=".$profile->identifier."&user_id=$oneUserId' onsubmit='popupStatsWindow(this); return false;' accept-charset='UTF-8'> |
|
| 584 | + <button type='submit'>"._("Show Authentication Records")."</button> |
|
| 585 | 585 | </form>"; |
| 586 | 586 | if (new DateTime() < new DateTime($expiryDate)) { // current user, allow sending new token |
| 587 | - ${$outputBuffer} .= $formtext . " |
|
| 587 | + ${$outputBuffer} .= $formtext." |
|
| 588 | 588 | <input type='hidden' name='userid' value='$oneUserId'/> |
| 589 | - <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_NEWINVITATION . "'>" . _("New Invitation") . "</button> |
|
| 590 | - <label>" . _("Activations:") . " |
|
| 589 | + <button type='submit' name='command' value='".\web\lib\common\FormElements::BUTTON_NEWINVITATION."'>"._("New Invitation")."</button> |
|
| 590 | + <label>" . _("Activations:")." |
|
| 591 | 591 | <input type='text' name='invitationsquantity' value='5' maxlength='3' style='width: 30px;'/> |
| 592 | 592 | </label> |
| 593 | 593 | </form>"; |
| 594 | 594 | } elseif (count($profile->getUserAuthRecords($oneUserId)) == 0) { // previous user; if there are NO authentication records, allow full deletion - otherwise, need to keep user trace for abuse handling |
| 595 | - ${$outputBuffer} .= $formtext . " |
|
| 595 | + ${$outputBuffer} .= $formtext." |
|
| 596 | 596 | <input type='hidden' name='userid' value='$oneUserId'/> |
| 597 | - <button type='submit' class='delete' name='command' value='" . \web\lib\common\FormElements::BUTTON_DELETE . "'>" . _("Delete User") . "</button> |
|
| 597 | + <button type='submit' class='delete' name='command' value='".\web\lib\common\FormElements::BUTTON_DELETE."'>"._("Delete User")."</button> |
|
| 598 | 598 | </form>"; |
| 599 | 599 | } |
| 600 | 600 | ${$outputBuffer} .= "</div> |
@@ -626,13 +626,13 @@ discard block |
||
| 626 | 626 | . ' If all accounts shown as active above are indeed still valid, please check the box below and push "Save".' |
| 627 | 627 | . ' If any of the accounts are stale, please deactivate them by pushing the corresponding button before doing this.'), \config\ConfAssistant::SILVERBULLET['gracetime'] ?? core\ProfileSilverbullet::SB_ACKNOWLEDGEMENT_REQUIRED_DAYS); |
| 628 | 628 | |
| 629 | - echo $formtext . "<div style='padding-bottom: 20px;'>" |
|
| 629 | + echo $formtext."<div style='padding-bottom: 20px;'>" |
|
| 630 | 630 | . " |
| 631 | 631 | <p>$acknowledgeText</p> |
| 632 | 632 | <input type='checkbox' name='acknowledge' value='true'> |
| 633 | - <label>" . sprintf(_("I have verified that all configured users are still eligible for %s."),\config\ConfAssistant::CONSORTIUM['display_name']) . "</label> |
|
| 633 | + <label>".sprintf(_("I have verified that all configured users are still eligible for %s."), \config\ConfAssistant::CONSORTIUM['display_name'])."</label> |
|
| 634 | 634 | </div> |
| 635 | - <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_ACKUSERELIGIBILITY . "'>" . _("Save") . "</button></form>"; |
|
| 635 | + <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_ACKUSERELIGIBILITY."'>"._("Save")."</button></form>"; |
|
| 636 | 636 | } |
| 637 | 637 | ?> |
| 638 | 638 | </div> |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * <base_url>/copyright.php after deploying the software |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 22 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 23 | 23 | |
| 24 | 24 | $deco = new \web\lib\admin\PageDecoration(); |
| 25 | 25 | $uiElements = new web\lib\admin\UIElements(); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | <?php echo $uiElements->infoblock($user->getAttributes(), "user", "User"); ?> |
| 48 | 48 | <tr> |
| 49 | 49 | <td> |
| 50 | - <?php echo "" . _("Unique Identifier") ?> |
|
| 50 | + <?php echo ""._("Unique Identifier") ?> |
|
| 51 | 51 | </td> |
| 52 | 52 | <td> |
| 53 | 53 | </td> |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $mgmt = new \core\UserManagement(); |
| 63 | 63 | |
| 64 | 64 | if (!$user->isFederationAdmin()) { |
| 65 | - echo "<p>" . sprintf(_("You are not a %s manager."), $uiElements->nomenclatureFed) . "</p>"; |
|
| 65 | + echo "<p>".sprintf(_("You are not a %s manager."), $uiElements->nomenclatureFed)."</p>"; |
|
| 66 | 66 | echo $deco->footer(); |
| 67 | 67 | exit(0); |
| 68 | 68 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | <!-- fed properties --> |
| 80 | 80 | <tr> |
| 81 | 81 | <td> |
| 82 | - <?php echo "" . _("Country") ?> |
|
| 82 | + <?php echo ""._("Country") ?> |
|
| 83 | 83 | </td> |
| 84 | 84 | <td> |
| 85 | 85 | </td> |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | default: |
| 161 | 161 | throw new Exception("Error: unknown encryption status of invitation!?!"); |
| 162 | 162 | } |
| 163 | - echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter) . " " . $cryptText, _("Sent successfully.")); |
|
| 163 | + echo $uiElements->boxRemark(ngettext("The invitation email was sent successfully.", "All invitation emails were sent successfully.", $counter)." ".$cryptText, _("Sent successfully.")); |
|
| 164 | 164 | break; |
| 165 | 165 | case "FAILURE": |
| 166 | 166 | echo $uiElements->boxError(_("No invitation email could be sent!"), _("Sending failure!")); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | default: |
| 181 | 181 | throw new Exception("Error: unknown encryption status of invitation!?!"); |
| 182 | 182 | } |
| 183 | - echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter) . " " . $cryptText, _("Partial success.")); |
|
| 183 | + echo $uiElements->boxWarning(sprintf(_("Some invitation emails were sent successfully (%s in total), the others failed."), $counter)." ".$cryptText, _("Partial success.")); |
|
| 184 | 184 | break; |
| 185 | 185 | case "INVALIDSYNTAX": |
| 186 | 186 | echo $uiElements->boxError(_("The invitation email address was malformed, no invitation was sent!"), _("The invitation email address was malformed, no invitation was sent!")); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | if (\config\ConfAssistant::CONSORTIUM['name'] == 'eduroam') { |
| 195 | - $helptext = "<h3>" . sprintf(_("Need help? Refer to the <a href='%s'>%s manual</a>"), "https://wiki.geant.org/x/qJg7Bw", $uiElements->nomenclatureFed) . "</h3>"; |
|
| 195 | + $helptext = "<h3>".sprintf(_("Need help? Refer to the <a href='%s'>%s manual</a>"), "https://wiki.geant.org/x/qJg7Bw", $uiElements->nomenclatureFed)."</h3>"; |
|
| 196 | 196 | } else { |
| 197 | 197 | $helptext = ""; |
| 198 | 198 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $pending_invites = $mgmt->listPendingInvitations(); |
| 207 | 207 | |
| 208 | 208 | if (\config\Master::DB['enforce-external-sync']) { |
| 209 | - echo "<th>" . sprintf(_("%s Database Sync Status"), \config\ConfAssistant::CONSORTIUM['display_name']) . "</th>"; |
|
| 209 | + echo "<th>".sprintf(_("%s Database Sync Status"), \config\ConfAssistant::CONSORTIUM['display_name'])."</th>"; |
|
| 210 | 210 | } |
| 211 | 211 | ?> |
| 212 | 212 | <th> |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | foreach ($feds as $onefed) { |
| 222 | 222 | $thefed = new \core\Federation(strtoupper($onefed['value'])); |
| 223 | 223 | /// nomenclature for 'federation', federation name, nomenclature for 'inst' |
| 224 | - echo "<tr><td colspan='8'><strong>" . sprintf(_("The following %s are in your %s %s:"), $uiElements->nomenclatureInst, $uiElements->nomenclatureFed, '<span style="color:green">' . $thefed->name . '</span>') . "</strong></td></tr>"; |
|
| 224 | + echo "<tr><td colspan='8'><strong>".sprintf(_("The following %s are in your %s %s:"), $uiElements->nomenclatureInst, $uiElements->nomenclatureFed, '<span style="color:green">'.$thefed->name.'</span>')."</strong></td></tr>"; |
|
| 225 | 225 | |
| 226 | 226 | // extract only pending invitations for *this* fed |
| 227 | 227 | $display_pendings = FALSE; |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | // deployment status; need to dive into profiles for this |
| 247 | 247 | // show happy eyeballs if at least one profile is configured/showtime |
| 248 | 248 | echo "<td>"; |
| 249 | - echo ($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_CONFIGURED ? "C" : "" ) . " " . ($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_SHOWTIME ? "V" : "" ); |
|
| 249 | + echo ($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_CONFIGURED ? "C" : "")." ".($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_SHOWTIME ? "V" : ""); |
|
| 250 | 250 | echo "</td>"; |
| 251 | 251 | // name; and realm of silverbullet profiles if any |
| 252 | 252 | // instantiating all profiles is costly, so we only do this if |
@@ -260,23 +260,23 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | echo "<td style='vertical-align:top;'> |
| 263 | - <input type='hidden' name='inst' value='" . $index . "'>" . $idp_instance->name . (empty($listOfSilverbulletRealms) ? "" : "<ul><li>" ) . implode("</li><li>",$listOfSilverbulletRealms) . (empty($listOfSilverbulletRealms) ? "" : "</li><ul>" ) . " |
|
| 263 | + <input type='hidden' name='inst' value='" . $index."'>".$idp_instance->name.(empty($listOfSilverbulletRealms) ? "" : "<ul><li>").implode("</li><li>", $listOfSilverbulletRealms).(empty($listOfSilverbulletRealms) ? "" : "</li><ul>")." |
|
| 264 | 264 | </td>"; |
| 265 | 265 | // external DB sync, if configured as being necessary |
| 266 | 266 | if (\config\Master::DB['enforce-external-sync']) { |
| 267 | 267 | echo "<td style='display: ruby;'>"; |
| 268 | 268 | if ($readonly === FALSE) { |
| 269 | - echo "<form method='post' action='inc/manageDBLink.inc.php?inst_id=" . $idp_instance->identifier . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'> |
|
| 270 | - <button type='submit'>" . _("Manage DB Link") . "</button></form> "; |
|
| 269 | + echo "<form method='post' action='inc/manageDBLink.inc.php?inst_id=".$idp_instance->identifier."' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'> |
|
| 270 | + <button type='submit'>" . _("Manage DB Link")."</button></form> "; |
|
| 271 | 271 | } |
| 272 | 272 | switch ($idp_instance->getExternalDBSyncState()) { |
| 273 | 273 | case \core\IdP::EXTERNAL_DB_SYNCSTATE_NOTSUBJECTTOSYNCING: |
| 274 | 274 | break; |
| 275 | 275 | case \core\IdP::EXTERNAL_DB_SYNCSTATE_SYNCED: |
| 276 | - echo "<div class='acceptable'>" . _("Linked") . "</div>"; |
|
| 276 | + echo "<div class='acceptable'>"._("Linked")."</div>"; |
|
| 277 | 277 | break; |
| 278 | 278 | case \core\IdP::EXTERNAL_DB_SYNCSTATE_NOT_SYNCED: |
| 279 | - echo "<div class='notacceptable'>" . _("NOT linked") . "</div>"; |
|
| 279 | + echo "<div class='notacceptable'>"._("NOT linked")."</div>"; |
|
| 280 | 280 | |
| 281 | 281 | |
| 282 | 282 | break; |
@@ -289,9 +289,9 @@ discard block |
||
| 289 | 289 | echo "<td style='vertical-align: top;'>"; |
| 290 | 290 | if ($readonly === FALSE) { |
| 291 | 291 | echo "<div style='white-space: nowrap;'> |
| 292 | - <form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $index . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'> |
|
| 292 | + <form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $index."' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'> |
|
| 293 | 293 | <button type='submit'>" . |
| 294 | - _("Add/Remove Administrators") . " |
|
| 294 | + _("Add/Remove Administrators")." |
|
| 295 | 295 | </button> |
| 296 | 296 | </form> |
| 297 | 297 | </div>"; |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | echo "<tr> |
| 305 | 305 | <td colspan='2'> |
| 306 | 306 | <strong>" . |
| 307 | - sprintf(_("Pending invitations in the %s:"), $uiElements->nomenclatureFed) . " |
|
| 307 | + sprintf(_("Pending invitations in the %s:"), $uiElements->nomenclatureFed)." |
|
| 308 | 308 | </strong> |
| 309 | 309 | </td> |
| 310 | 310 | </tr>"; |
@@ -312,17 +312,17 @@ discard block |
||
| 312 | 312 | if (strtoupper($oneinvite['country']) == strtoupper($thefed->tld)) { |
| 313 | 313 | echo "<tr> |
| 314 | 314 | <td>" . |
| 315 | - $oneinvite['name'] . " |
|
| 315 | + $oneinvite['name']." |
|
| 316 | 316 | </td> |
| 317 | 317 | <td>" . |
| 318 | - $oneinvite['mail'] . " |
|
| 318 | + $oneinvite['mail']." |
|
| 319 | 319 | </td> |
| 320 | 320 | <td colspan=2>"; |
| 321 | 321 | if ($readonly === FALSE) { |
| 322 | 322 | echo "<form method='post' action='overview_federation.php' accept-charset='UTF-8'> |
| 323 | - <input type='hidden' name='invitation_id' value='" . $oneinvite['token'] . "'/> |
|
| 324 | - <button class='delete' type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_DELETE . "'>" . _("Revoke Invitation") . "</button> " |
|
| 325 | - . sprintf(_("(expires %s)"),$oneinvite['expiry']) |
|
| 323 | + <input type='hidden' name='invitation_id' value='" . $oneinvite['token']."'/> |
|
| 324 | + <button class='delete' type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_DELETE."'>"._("Revoke Invitation")."</button> " |
|
| 325 | + . sprintf(_("(expires %s)"), $oneinvite['expiry']) |
|
| 326 | 326 | . "</form>"; |
| 327 | 327 | } |
| 328 | 328 | echo " </td> |
@@ -26,7 +26,7 @@ discard block |
||
| 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 | $deco = new \web\lib\admin\PageDecoration(); |
| 32 | 32 | $validator = new \web\lib\common\InputValidation(); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | if (!isset($_GET['deployment_id'])) { |
| 38 | 38 | $my_inst->newDeployment(\core\AbstractDeployment::DEPLOYMENTTYPE_MANAGED); |
| 39 | - header("Location: overview_sp.php?inst_id=" . $my_inst->identifier); |
|
| 39 | + header("Location: overview_sp.php?inst_id=".$my_inst->identifier); |
|
| 40 | 40 | exit(0); |
| 41 | 41 | } |
| 42 | 42 | // if we have come this far, we are editing an existing deployment |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | if (in_array('OK', $response)) { |
| 49 | 49 | $deployment->deactivate(); |
| 50 | 50 | } |
| 51 | - header("Location: overview_sp.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response))); |
|
| 51 | + header("Location: overview_sp.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response))); |
|
| 52 | 52 | exit(0); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | if (in_array('OK', $response)) { |
| 58 | 58 | $deployment->activate(); |
| 59 | 59 | } |
| 60 | - header("Location: overview_sp.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response))); |
|
| 60 | + header("Location: overview_sp.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response))); |
|
| 61 | 61 | exit(0); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $deployment->status = core\DeploymentManaged::INACTIVE; |
| 79 | 79 | $response = $deployment->setRADIUSconfig(); |
| 80 | 80 | } |
| 81 | - header("Location: overview_sp.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response))); |
|
| 81 | + header("Location: overview_sp.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response))); |
|
| 82 | 82 | exit(0); |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -106,12 +106,12 @@ discard block |
||
| 106 | 106 | echo $uiElements->instLevelInfoBoxes($my_inst); |
| 107 | 107 | $deploymentOptions = $deployment->getAttributes(); |
| 108 | 108 | echo "<form enctype='multipart/form-data' action='edit_hotspot.php?inst_id=$my_inst->identifier&deployment_id=$deployment->identifier' method='post' accept-charset='UTF-8'> |
| 109 | - <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>"; |
|
| 109 | + <input type='hidden' name='MAX_FILE_SIZE' value='".\config\Master::MAX_UPLOAD_SIZE."'>"; |
|
| 110 | 110 | $optionDisplay = new \web\lib\admin\OptionDisplay($deploymentOptions, "Profile"); |
| 111 | 111 | ?> |
| 112 | 112 | <?php |
| 113 | 113 | echo "<fieldset class='option_container' id='managedsp_override'> |
| 114 | - <legend><strong>" . _("Options for this deployment") . "</strong></legend>"; |
|
| 114 | + <legend><strong>" . _("Options for this deployment")."</strong></legend>"; |
|
| 115 | 115 | ?> |
| 116 | 116 | <table> |
| 117 | 117 | <tr> |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | <!-- input for VLAN identifier for home users--> |
| 130 | 130 | <td> |
| 131 | 131 | <span id='vlan_label'> |
| 132 | - <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " " . _("(unset with '0')"))); ?> |
|
| 132 | + <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " "._("(unset with '0')"))); ?> |
|
| 133 | 133 | </span> |
| 134 | 134 | </td> |
| 135 | 135 | <td> |
@@ -144,10 +144,10 @@ discard block |
||
| 144 | 144 | </table> |
| 145 | 145 | <?php |
| 146 | 146 | echo $optionDisplay->prefilledOptionTable("managedsp"); |
| 147 | - echo "<button type='button' class='newoption' onclick='getXML(\"managedsp\")'>" . _("Add new option") . "</button>"; |
|
| 147 | + echo "<button type='button' class='newoption' onclick='getXML(\"managedsp\")'>"._("Add new option")."</button>"; |
|
| 148 | 148 | echo "</fieldset>"; |
| 149 | 149 | |
| 150 | 150 | |
| 151 | - echo "<p><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_sp.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>"; |
|
| 151 | + echo "<p><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_sp.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>"; |
|
| 152 | 152 | echo $deco->footer(); |
| 153 | 153 | |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | class CertificationAuthorityEduPkiServer 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 = "Radius Server SOAP"; |
| 25 | 25 | private const EDUPKI_RA_PKEY_PASSPHRASE = "..."; |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | parent::__construct(); |
| 36 | 36 | |
| 37 | 37 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_CERT) === FALSE) { |
| 38 | - throw new Exception("RA operator PEM file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT); |
|
| 38 | + throw new Exception("RA operator PEM file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT); |
|
| 39 | 39 | } |
| 40 | 40 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_RA_KEY) === FALSE) { |
| 41 | - throw new Exception("RA operator private key file not found: " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY); |
|
| 41 | + throw new Exception("RA operator private key file not found: ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY); |
|
| 42 | 42 | } |
| 43 | 43 | if (stat(CertificationAuthorityEduPkiServer::LOCATION_WEBROOT) === FALSE) { |
| 44 | - throw new Exception("CA website root CA file not found: " . CertificationAuthorityEduPkiServer::LOCATION_WEBROOT); |
|
| 44 | + throw new Exception("CA website root CA file not found: ".CertificationAuthorityEduPkiServer::LOCATION_WEBROOT); |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
@@ -96,19 +96,19 @@ discard block |
||
| 96 | 96 | // initialise connection to eduPKI CA / eduroam RA and send the request to them |
| 97 | 97 | try { |
| 98 | 98 | $altArray = [# Array mit den Subject Alternative Names |
| 99 | - "email:" . $csr["USERMAIL"] |
|
| 99 | + "email:".$csr["USERMAIL"] |
|
| 100 | 100 | ]; |
| 101 | 101 | $soapPub = $this->initEduPKISoapSession("PUBLIC"); |
| 102 | 102 | $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n"); |
| 103 | - $this->loggerInstance->debug(5, "PARAM_1: " . CertificationAuthorityEduPkiServer::EDUPKI_RA_ID . "\n"); |
|
| 104 | - $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR"] . "\n"); |
|
| 103 | + $this->loggerInstance->debug(5, "PARAM_1: ".CertificationAuthorityEduPkiServer::EDUPKI_RA_ID."\n"); |
|
| 104 | + $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR"]."\n"); |
|
| 105 | 105 | $this->loggerInstance->debug(5, "PARAM_3: "); |
| 106 | 106 | $this->loggerInstance->debug(5, $altArray); |
| 107 | - $this->loggerInstance->debug(5, "PARAM_4: " . CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE . "\n"); |
|
| 108 | - $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n"); |
|
| 109 | - $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n"); |
|
| 110 | - $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERMAIL"] . "\n"); |
|
| 111 | - $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n"); |
|
| 107 | + $this->loggerInstance->debug(5, "PARAM_4: ".CertificationAuthorityEduPkiServer::EDUPKI_CERT_PROFILE."\n"); |
|
| 108 | + $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n"); |
|
| 109 | + $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n"); |
|
| 110 | + $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERMAIL"]."\n"); |
|
| 111 | + $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n"); |
|
| 112 | 112 | $this->loggerInstance->debug(5, "PARAM_9: false\n"); |
| 113 | 113 | $soapNewRequest = $soapPub->newRequest( |
| 114 | 114 | CertificationAuthorityEduPkiServer::EDUPKI_RA_ID, # RA-ID |
@@ -130,11 +130,11 @@ discard block |
||
| 130 | 130 | } catch (Exception $e) { |
| 131 | 131 | // PHP 7.1 can do this much better |
| 132 | 132 | if (is_soap_fault($e)) { |
| 133 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: { |
|
| 133 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: { |
|
| 134 | 134 | $e->faultstring |
| 135 | 135 | }\n"); |
| 136 | 136 | } |
| 137 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
| 137 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
| 138 | 138 | } |
| 139 | 139 | try { |
| 140 | 140 | $soap = $this->initEduPKISoapSession("RA"); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
| 169 | 169 | // rather than just using the string. Grr. |
| 170 | 170 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
| 171 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext); |
|
| 171 | + file_put_contents($tempdir['dir']."/content.txt", $soapCleartext); |
|
| 172 | 172 | // retrieve our RA cert from filesystem |
| 173 | 173 | // the RA certificates are not needed right now because we |
| 174 | 174 | // have resorted to S/MIME signatures with openssl command-line |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
| 181 | 181 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
| 182 | 182 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n $soapCleartext\n"); |
| 183 | - $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"; |
|
| 183 | + $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"; |
|
| 184 | 184 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
| 185 | 185 | $output = []; |
| 186 | 186 | $return = 999; |
@@ -189,21 +189,21 @@ discard block |
||
| 189 | 189 | throw new Exception("Non-zero return value from openssl smime!"); |
| 190 | 190 | } |
| 191 | 191 | // and get the signature blob back from the filesystem |
| 192 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
| 192 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
| 193 | 193 | $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n"); |
| 194 | - $this->loggerInstance->debug(5, $soapReqnum . "\n"); |
|
| 195 | - $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending! |
|
| 196 | - $this->loggerInstance->debug(5, $detachedSig . "\n"); |
|
| 194 | + $this->loggerInstance->debug(5, $soapReqnum."\n"); |
|
| 195 | + $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending! |
|
| 196 | + $this->loggerInstance->debug(5, $detachedSig."\n"); |
|
| 197 | 197 | $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig); |
| 198 | - $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest()); |
|
| 199 | - $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse()); |
|
| 198 | + $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest()); |
|
| 199 | + $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse()); |
|
| 200 | 200 | if ($soapIssueCert === FALSE) { |
| 201 | 201 | throw new Exception("The locally approved request was NOT processed by the CA."); |
| 202 | 202 | } |
| 203 | 203 | } catch (SoapFault $e) { |
| 204 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
| 204 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
| 205 | 205 | } catch (Exception $e) { |
| 206 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
| 206 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
| 207 | 207 | } |
| 208 | 208 | return $soapReqnum; |
| 209 | 209 | } |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | throw new Exception("CAInfo has no root certificate for us!"); |
| 256 | 256 | } |
| 257 | 257 | } catch (SoapFault $e) { |
| 258 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
| 258 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
| 259 | 259 | } catch (Exception $e) { |
| 260 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
| 260 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
| 261 | 261 | } |
| 262 | 262 | return [ |
| 263 | 263 | "CERT" => openssl_x509_read($parsedCert['pem']), |
@@ -290,12 +290,12 @@ discard block |
||
| 290 | 290 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
| 291 | 291 | // rather than just using the string. Grr. |
| 292 | 292 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
| 293 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest); |
|
| 293 | + file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest); |
|
| 294 | 294 | // retrieve our RA cert from filesystem |
| 295 | 295 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
| 296 | 296 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
| 297 | 297 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n"); |
| 298 | - $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . CertificationAuthorityEduPkiServer::LOCATION_RA_KEY . " -signer " . CertificationAuthorityEduPkiServer::LOCATION_RA_CERT; |
|
| 298 | + $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".CertificationAuthorityEduPkiServer::LOCATION_RA_KEY." -signer ".CertificationAuthorityEduPkiServer::LOCATION_RA_CERT; |
|
| 299 | 299 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
| 300 | 300 | $output = []; |
| 301 | 301 | $return = 999; |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | throw new Exception("Non-zero return value from openssl smime!"); |
| 305 | 305 | } |
| 306 | 306 | // and get the signature blob back from the filesystem |
| 307 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
| 307 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
| 308 | 308 | $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig); |
| 309 | 309 | if ($soapIssueRev === FALSE) { |
| 310 | 310 | throw new Exception("The locally approved revocation request was NOT processed by the CA."); |
@@ -312,9 +312,9 @@ discard block |
||
| 312 | 312 | } catch (Exception $e) { |
| 313 | 313 | // PHP 7.1 can do this much better |
| 314 | 314 | if (is_soap_fault($e)) { |
| 315 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n"); |
|
| 315 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n"); |
|
| 316 | 316 | } |
| 317 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
| 317 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
| 318 | 318 | } |
| 319 | 319 | } |
| 320 | 320 | |
@@ -414,9 +414,9 @@ discard block |
||
| 414 | 414 | */ |
| 415 | 415 | public function soapToXmlInteger($x) |
| 416 | 416 | { |
| 417 | - return '<' . $x[0] . '>' |
|
| 417 | + return '<'.$x[0].'>' |
|
| 418 | 418 | . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1) |
| 419 | - . '</' . $x[0] . '>'; |
|
| 419 | + . '</'.$x[0].'>'; |
|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | /** |
@@ -435,9 +435,9 @@ discard block |
||
| 435 | 435 | // dump private key into directory |
| 436 | 436 | $outstring = ""; |
| 437 | 437 | openssl_pkey_export($privateKey, $outstring); |
| 438 | - file_put_contents($tempdir . "/pkey.pem", $outstring); |
|
| 438 | + file_put_contents($tempdir."/pkey.pem", $outstring); |
|
| 439 | 439 | // PHP can only do one DC in the Subject. But we need three. |
| 440 | - $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"; |
|
| 440 | + $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"; |
|
| 441 | 441 | $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n"); |
| 442 | 442 | $output = []; |
| 443 | 443 | $return = 999; |