@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | private function inputValidationError($customtext) { |
39 | 39 | \core\common\Entity::intoThePotatoes(); |
40 | - $retval = "<p>" . _("Input validation error: ") . $customtext . "</p>"; |
|
40 | + $retval = "<p>"._("Input validation error: ").$customtext."</p>"; |
|
41 | 41 | \core\common\Entity::outOfThePotatoes(); |
42 | 42 | return $retval; |
43 | 43 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function string($input, $allowWhitespace = FALSE) { |
151 | 151 | // always chop out invalid characters, and surrounding whitespace |
152 | - $retvalStep0 = iconv("UTF-8", "UTF-8//TRANSLIT", $input); |
|
152 | + $retvalStep0 = iconv("UTF-8", "UTF-8//TRANSLIT", $input); |
|
153 | 153 | if ($retvalStep0 === FALSE) { |
154 | 154 | throw new Exception("iconv failure for string sanitisation. With TRANSLIT, this should never happen!"); |
155 | 155 | } |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | try { |
458 | 458 | $image->readImageBlob($binary); |
459 | 459 | } catch (\ImagickException $exception) { |
460 | - echo "Error" . $exception->getMessage(); |
|
460 | + echo "Error".$exception->getMessage(); |
|
461 | 461 | return FALSE; |
462 | 462 | } |
463 | 463 | // image survived the sanity check |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | otherdata = j.otherdata; |
88 | 88 | if(! result) { |
89 | 89 | alert("<?php escaped_echo(_("no matching data found"))?>"); |
90 | - document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/' ?>'; |
|
90 | + document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/' ?>'; |
|
91 | 91 | } |
92 | 92 | j = j.data; |
93 | 93 | n = j.length; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | result = j1.status; |
225 | 225 | if(! result) { |
226 | 226 | alert("<?php escaped_echo(_("no matching data found")) ?>"); |
227 | - document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/') . '/' ?>'; |
|
227 | + document.location.href='<?php echo rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/' ?>'; |
|
228 | 228 | } |
229 | 229 | j = j1.data; |
230 | 230 | if(j.description !== undefined && j.description) { |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $("#profile_desc").hide(); |
236 | 236 | $("#profile_desc").text(''); |
237 | 237 | } |
238 | - updateTxt = '<span class="user_info"><?php escaped_echo(_("This entry was last updated at:"));?>'+' '+j.last_changed+'</span><br/>'; |
|
238 | + updateTxt = '<span class="user_info"><?php escaped_echo(_("This entry was last updated at:")); ?>'+' '+j.last_changed+'</span><br/>'; |
|
239 | 239 | if(j.local_url !== undefined && j.local_url) |
240 | 240 | txt = txt+'<span class="user_info"><?php escaped_echo(_("WWW:")); ?> <a href="'+j.local_url+'" target="_blank">'+j.local_url+'</a></span><br/>'; |
241 | 241 | if(j.local_email !== undefined && j.local_email) |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | // realm is automatically calculated, then stored in DB |
92 | 92 | |
93 | - $this->realm = "opaquehash@$myInst->identifier-$this->identifier." . strtolower($myInst->federation) . CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']; |
|
93 | + $this->realm = "opaquehash@$myInst->identifier-$this->identifier.".strtolower($myInst->federation).CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']; |
|
94 | 94 | $localValueIfAny = ""; |
95 | 95 | |
96 | 96 | // but there's some common internal attributes populated directly |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | |
108 | 108 | // and we need to populate eap:server_name and eap:ca_file with the NRO-specific EAP information |
109 | 109 | $silverbulletAttributes = [ |
110 | - "eap:server_name" => "auth." . strtolower($myFed->tld) . CONFIG_CONFASSISTANT['SILVERBULLET']['server_suffix'], |
|
110 | + "eap:server_name" => "auth.".strtolower($myFed->tld).CONFIG_CONFASSISTANT['SILVERBULLET']['server_suffix'], |
|
111 | 111 | ]; |
112 | 112 | $temp = array_merge($this->addInternalAttributes($internalAttributes), $this->addInternalAttributes($silverbulletAttributes)); |
113 | 113 | $x509 = new \core\common\X509(); |
114 | - $caHandle = fopen(dirname(__FILE__) . "/../config/SilverbulletServerCerts/" . strtoupper($myFed->tld) . "/root.pem", "r"); |
|
114 | + $caHandle = fopen(dirname(__FILE__)."/../config/SilverbulletServerCerts/".strtoupper($myFed->tld)."/root.pem", "r"); |
|
115 | 115 | if ($caHandle !== FALSE) { |
116 | 116 | $cAFile = fread($caHandle, 16000000); |
117 | 117 | foreach ($x509->splitCertificate($cAFile) as $oneCa) { |
@@ -132,26 +132,26 @@ discard block |
||
132 | 132 | $this->loggerInstance->debug(3, "--- END Constructing new Profile object ... ---\n"); |
133 | 133 | |
134 | 134 | $this->termsAndConditions = "<h2>Product Definition</h2> |
135 | - <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> |
|
135 | + <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> |
|
136 | 136 | <ul> |
137 | 137 | <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> |
138 | 138 | <li>a technical infrastructure ('CA') which issues and revokes credentials</li> |
139 | - <li>a technical infrastructure ('RADIUS') which verifies access credentials and subsequently grants access to " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'] . "</li> |
|
139 | + <li>a technical infrastructure ('RADIUS') which verifies access credentials and subsequently grants access to " . CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']."</li> |
|
140 | 140 | </ul> |
141 | 141 | <h2>User Account Liability</h2> |
142 | - <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>"; |
|
142 | + <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>"; |
|
143 | 143 | $this->termsAndConditions .= "<p>Your responsibilities include that you</p> |
144 | 144 | <ul> |
145 | - <li>only issue accounts to members of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'] . ", as defined by your local policy.</li> |
|
145 | + <li>only issue accounts to members of your " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_institution'].", as defined by your local policy.</li> |
|
146 | 146 | <li>must make sure that all accounts that you issue can be linked by you to actual human end users</li> |
147 | - <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> |
|
147 | + <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> |
|
148 | 148 | <li>will act upon notifications about possible network abuse by your users and will appropriately sanction them</li> |
149 | 149 | </ul> |
150 | 150 | <p>"; |
151 | - $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."; |
|
151 | + $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."; |
|
152 | 152 | $this->termsAndConditions .= "</p> |
153 | 153 | <h2>Privacy</h2> |
154 | - <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> |
|
154 | + <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> |
|
155 | 155 | <ul> |
156 | 156 | <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> |
157 | 157 | <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> |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | if (empty($certNames)) { |
255 | 255 | return []; |
256 | 256 | } |
257 | - $namesCondensed = "'" . implode("' OR username = '", $certNames) . "'"; |
|
257 | + $namesCondensed = "'".implode("' OR username = '", $certNames)."'"; |
|
258 | 258 | $serverHandles = DBConnection::handle("RADIUS"); |
259 | 259 | $returnarray = []; |
260 | 260 | foreach ($serverHandles as $oneDbServer) { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | protected function setSupportedEapMethods($eapArray) { |
85 | 85 | $this->supportedEapMethods = $eapArray; |
86 | - $this->loggerInstance->debug(4, "This device (" . __CLASS__ . ") supports the following EAP methods: "); |
|
86 | + $this->loggerInstance->debug(4, "This device (".__CLASS__.") supports the following EAP methods: "); |
|
87 | 87 | $this->loggerInstance->debug(4, $this->supportedEapMethods); |
88 | 88 | } |
89 | 89 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | break 2; |
134 | 134 | } |
135 | 135 | } |
136 | - $longestSuffix = $candidate . $longestSuffix; |
|
136 | + $longestSuffix = $candidate.$longestSuffix; |
|
137 | 137 | } |
138 | 138 | return $longestSuffix; |
139 | 139 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | throw new Exception("No EAP type available."); |
170 | 170 | } |
171 | 171 | $this->attributes = $this->getProfileAttributes($profile); |
172 | - $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id); |
|
172 | + $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id); |
|
173 | 173 | |
174 | 174 | |
175 | 175 | // if we are instantiating a Silverbullet profile AND have been given |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | // create temporary directory, its full path will be saved in $this->FPATH; |
194 | 194 | $tempDir = $this->createTemporaryDirectory($purpose); |
195 | 195 | $this->FPATH = $tempDir['dir']; |
196 | - mkdir($tempDir['dir'] . '/tmp'); |
|
197 | - chdir($tempDir['dir'] . '/tmp'); |
|
196 | + mkdir($tempDir['dir'].'/tmp'); |
|
197 | + chdir($tempDir['dir'].'/tmp'); |
|
198 | 198 | $caList = []; |
199 | 199 | $x509 = new \core\common\X509(); |
200 | 200 | if (isset($this->attributes['eap:ca_file'])) { |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $this->support_url_substitute = sprintf(_("your local %s support page"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
231 | 231 | |
232 | 232 | if ($this->signer && $this->options['sign']) { |
233 | - $this->sign = ROOT . '/signer/' . $this->signer; |
|
233 | + $this->sign = ROOT.'/signer/'.$this->signer; |
|
234 | 234 | } |
235 | 235 | $this->installerBasename = $this->getInstallerBasename(); |
236 | 236 | common\Entity::outOfThePotatoes(); |
@@ -286,10 +286,10 @@ discard block |
||
286 | 286 | * @return string|boolean the filename as found, with path, or FALSE if it does not exist |
287 | 287 | */ |
288 | 288 | protected function findSourceFile($file) { |
289 | - if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) { |
|
290 | - return $this->module_path . '/Files/' . $this->device_id . '/' . $file; |
|
291 | - } elseif (is_file($this->module_path . '/Files/' . $file)) { |
|
292 | - return $this->module_path . '/Files/' . $file; |
|
289 | + if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) { |
|
290 | + return $this->module_path.'/Files/'.$this->device_id.'/'.$file; |
|
291 | + } elseif (is_file($this->module_path.'/Files/'.$file)) { |
|
292 | + return $this->module_path.'/Files/'.$file; |
|
293 | 293 | } else { |
294 | 294 | $this->loggerInstance->debug(2, "requested file $file does not exist\n"); |
295 | 295 | return FALSE; |
@@ -410,17 +410,17 @@ discard block |
||
410 | 410 | */ |
411 | 411 | private function getInstallerBasename() { |
412 | 412 | |
413 | - $baseName = $this->customTranslit(CONFIG_CONFASSISTANT['CONSORTIUM']['name']) . "-" . $this->getDeviceId(); |
|
413 | + $baseName = $this->customTranslit(CONFIG_CONFASSISTANT['CONSORTIUM']['name'])."-".$this->getDeviceId(); |
|
414 | 414 | if (isset($this->attributes['profile:customsuffix'][1])) { |
415 | 415 | // this string will end up as a filename on a filesystem, so always |
416 | 416 | // take a latin-based language variant if available |
417 | 417 | // and then scrub non-ASCII just in case |
418 | - return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]); |
|
418 | + return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]); |
|
419 | 419 | } |
420 | 420 | // Okay, no custom suffix. |
421 | 421 | // Use the configured inst name and apply shortening heuristics |
422 | 422 | $lang_pointer = CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1; |
423 | - $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes['general:instname'][$lang_pointer] . "\n"); |
|
423 | + $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes['general:instname'][$lang_pointer]."\n"); |
|
424 | 424 | $inst = $this->customTranslit($this->attributes['general:instname'][$lang_pointer]); |
425 | 425 | $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n"); |
426 | 426 | $Inst_a = explode('_', $inst); |
@@ -435,10 +435,10 @@ discard block |
||
435 | 435 | if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) { |
436 | 436 | $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]); |
437 | 437 | $prof = preg_replace('/_+$/', '', $profTemp); |
438 | - return $baseName . $inst . '-' . $prof; |
|
438 | + return $baseName.$inst.'-'.$prof; |
|
439 | 439 | } |
440 | 440 | } |
441 | - return $baseName . $inst; |
|
441 | + return $baseName.$inst; |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | /** |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | $ext = 'unsupported'; |
552 | 552 | } |
553 | 553 | $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n"); |
554 | - $fileName = 'logo-' . $type . $iterator . '.' . $ext; |
|
554 | + $fileName = 'logo-'.$type.$iterator.'.'.$ext; |
|
555 | 555 | $fileHandle = fopen($fileName, "w"); |
556 | 556 | if (!$fileHandle) { |
557 | 557 | $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n"); |
@@ -577,13 +577,13 @@ discard block |
||
577 | 577 | $mime = $finfo->buffer($blob); |
578 | 578 | $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported'; |
579 | 579 | $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n"); |
580 | - $fileHandle = fopen('local-info.' . $ext, "w"); |
|
580 | + $fileHandle = fopen('local-info.'.$ext, "w"); |
|
581 | 581 | if ($fileHandle === FALSE) { |
582 | 582 | throw new Exception("problem opening the file"); |
583 | 583 | } |
584 | 584 | fwrite($fileHandle, $blob); |
585 | 585 | fclose($fileHandle); |
586 | - return(['name' => 'local-info.' . $ext, 'mime' => $ext]); |
|
586 | + return(['name' => 'local-info.'.$ext, 'mime' => $ext]); |
|
587 | 587 | } |
588 | 588 | |
589 | 589 | /** |
@@ -634,9 +634,9 @@ discard block |
||
634 | 634 | protected function determineOuterIdString() { |
635 | 635 | $outerId = NULL; |
636 | 636 | if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) { |
637 | - $outerId = "@" . $this->attributes['internal:realm'][0]; |
|
637 | + $outerId = "@".$this->attributes['internal:realm'][0]; |
|
638 | 638 | if (isset($this->attributes['internal:anon_local_value'])) { |
639 | - $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId; |
|
639 | + $outerId = $this->attributes['internal:anon_local_value'][0].$outerId; |
|
640 | 640 | } |
641 | 641 | } |
642 | 642 | return $outerId; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | namespace core; |
23 | 23 | |
24 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
24 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
25 | 25 | |
26 | 26 | $instMgmt = new \core\UserManagement(); |
27 | 27 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | <?php echo $uiElements->infoblock($user->getAttributes(), "user", "User"); ?> |
52 | 52 | <tr> |
53 | 53 | <td> |
54 | -<?php echo "" . _("Unique Identifier") ?> |
|
54 | +<?php echo ""._("Unique Identifier") ?> |
|
55 | 55 | </td> |
56 | 56 | <td> |
57 | 57 | </td> |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | <div> |
65 | 65 | <?php |
66 | 66 | if (CONFIG['DB']['USER']['readonly'] === FALSE) { |
67 | - echo "<a href='edit_user.php'><button>" . _("Edit User Details") . "</button></a>"; |
|
67 | + echo "<a href='edit_user.php'><button>"._("Edit User Details")."</button></a>"; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | if ($user->isFederationAdmin()) { |
71 | - echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . sprintf(_('Click here for %s management tasks'), $uiElements->nomenclatureFed) . "</button></form>"; |
|
71 | + echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>".sprintf(_('Click here for %s management tasks'), $uiElements->nomenclatureFed)."</button></form>"; |
|
72 | 72 | } |
73 | 73 | if ($user->isSuperadmin()) { |
74 | - echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . _('Click here to access the superadmin page') . "</button></form>"; |
|
74 | + echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>"._('Click here to access the superadmin page')."</button></form>"; |
|
75 | 75 | } |
76 | 76 | ?> |
77 | 77 | </div> |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL") { |
84 | 84 | $target = "https://wiki.geant.org/x/6Zg7Bw"; // Managed IdP manual |
85 | 85 | } |
86 | - $helptext = "<h3 style='display:inline;'>" . sprintf(_("(Need help? Refer to the <a href='%s'>%s administrator manual</a>)"), $target, $uiElements->nomenclatureInst) . "</h3>"; |
|
86 | + $helptext = "<h3 style='display:inline;'>".sprintf(_("(Need help? Refer to the <a href='%s'>%s administrator manual</a>)"), $target, $uiElements->nomenclatureInst)."</h3>"; |
|
87 | 87 | } else { |
88 | 88 | $helptext = ""; |
89 | 89 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // we need to run the Federation constructor |
93 | 93 | $cat = new \core\CAT; |
94 | 94 | /// first parameter: number of Identity Providers; second param is the literal configured term for 'Identity Provider' (you may or may not be able to add a plural suffix for your locale) |
95 | - echo "<h2>" . sprintf(ngettext("You are managing the following <span style='display:none'>%d </span>%s:", "You are managing the following <strong>%d</strong> %s:", sizeof($hasInst)), sizeof($hasInst), $uiElements->nomenclatureInst) . "</h2>"; |
|
95 | + echo "<h2>".sprintf(ngettext("You are managing the following <span style='display:none'>%d </span>%s:", "You are managing the following <strong>%d</strong> %s:", sizeof($hasInst)), sizeof($hasInst), $uiElements->nomenclatureInst)."</h2>"; |
|
96 | 96 | $instlist = []; |
97 | 97 | $my_idps = []; |
98 | 98 | $myFeds = []; |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | $country[$key] = $row['country']; |
115 | 115 | $name[$key] = $row['name']; |
116 | 116 | } |
117 | - echo "<tr><th>" . sprintf(_("%s Name"), $uiElements->nomenclatureInst) . "</th><th>" . sprintf(_("Other admins of this %s"), $uiElements->nomenclatureInst) . "</th><th>" . ( CONFIG['DB']['INST']['readonly'] === FALSE ? _("Administrator Management") : "") . "</th></tr>"; |
|
117 | + echo "<tr><th>".sprintf(_("%s Name"), $uiElements->nomenclatureInst)."</th><th>".sprintf(_("Other admins of this %s"), $uiElements->nomenclatureInst)."</th><th>".(CONFIG['DB']['INST']['readonly'] === FALSE ? _("Administrator Management") : "")."</th></tr>"; |
|
118 | 118 | foreach ($myFeds as $fed_id => $fed_name) { |
119 | 119 | /// nomenclature 'fed', fed name, nomenclature 'inst' |
120 | - echo "<tr><td colspan='3'><strong>" . sprintf(_("%s %s: %s list"), $uiElements->nomenclatureFed, $fed_name, $uiElements->nomenclatureInst) . "</strong></td></tr>"; |
|
120 | + echo "<tr><td colspan='3'><strong>".sprintf(_("%s %s: %s list"), $uiElements->nomenclatureFed, $fed_name, $uiElements->nomenclatureInst)."</strong></td></tr>"; |
|
121 | 121 | |
122 | 122 | $fed_idps = $my_idps[$fed_id]; |
123 | 123 | asort($fed_idps); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $oneinst = $instlist[$index]; |
126 | 126 | $the_inst = $oneinst['object']; |
127 | 127 | |
128 | - echo "<tr><td><a href='overview_idp.php?inst_id=$the_inst->identifier'>" . $oneinst['name'] . "</a></td><td>"; |
|
128 | + echo "<tr><td><a href='overview_idp.php?inst_id=$the_inst->identifier'>".$oneinst['name']."</a></td><td>"; |
|
129 | 129 | echo "<input type='hidden' name='inst' value='$the_inst->identifier'>"; |
130 | 130 | $admins = $the_inst->listOwners(); |
131 | 131 | $blessedUser = FALSE; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $coadmin = new \core\User($username['ID']); |
135 | 135 | $coadmin_name = $coadmin->getAttributes('user:realname'); |
136 | 136 | if (count($coadmin_name) > 0) { |
137 | - echo $coadmin_name[0]['value'] . "<br/>"; |
|
137 | + echo $coadmin_name[0]['value']."<br/>"; |
|
138 | 138 | unset($admins[$number]); |
139 | 139 | } |
140 | 140 | } else { // don't list self |
@@ -146,29 +146,29 @@ discard block |
||
146 | 146 | } |
147 | 147 | $otherAdminCount = count($admins); // only the unnamed remain |
148 | 148 | if ($otherAdminCount > 0) { |
149 | - echo sprintf(ngettext("%d other user", "%d other users", $otherAdminCount),$otherAdminCount); |
|
149 | + echo sprintf(ngettext("%d other user", "%d other users", $otherAdminCount), $otherAdminCount); |
|
150 | 150 | } |
151 | 151 | echo "</td><td>"; |
152 | 152 | if ($blessedUser && CONFIG['DB']['INST']['readonly'] === FALSE) { |
153 | - echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $the_inst->identifier . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>" . _("Add/Remove Administrators") . "</button></form></div>"; |
|
153 | + echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=".$the_inst->identifier."' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>"._("Add/Remove Administrators")."</button></form></div>"; |
|
154 | 154 | } |
155 | 155 | echo "</td></tr>"; |
156 | 156 | } |
157 | 157 | } |
158 | 158 | echo "</table>"; |
159 | 159 | } else { |
160 | - echo "<h2>" . sprintf(_("You are not managing any %s."), $uiElements->nomenclatureInst) . "</h2>"; |
|
160 | + echo "<h2>".sprintf(_("You are not managing any %s."), $uiElements->nomenclatureInst)."</h2>"; |
|
161 | 161 | } |
162 | 162 | if (CONFIG['DB']['INST']['readonly'] === FALSE) { |
163 | 163 | if (CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration'] === NULL) { |
164 | - echo "<p>" . sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureInst) . "</p>"; |
|
164 | + echo "<p>".sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureInst)."</p>"; |
|
165 | 165 | echo "<hr/> |
166 | 166 | <div style='white-space: nowrap;'> |
167 | 167 | <form action='action_enrollment.php' method='get' accept-charset='UTF-8'>" . |
168 | - sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureInst) . |
|
168 | + sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureInst). |
|
169 | 169 | " <input type='text' id='token' name='token'/> |
170 | 170 | <button type='submit'>" . |
171 | - _("Go!") . " |
|
171 | + _("Go!")." |
|
172 | 172 | </button> |
173 | 173 | </form> |
174 | 174 | </div>"; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | <div style='white-space: nowrap;'> |
178 | 178 | <form action='action_enrollment.php' method='get'><button type='submit' accept-charset='UTF-8'> |
179 | 179 | <input type='hidden' id='token' name='token' value='SELF-REGISTER'/>" . |
180 | - sprintf(_("New %s Registration"), $uiElements->nomenclatureInst) . " |
|
180 | + sprintf(_("New %s Registration"), $uiElements->nomenclatureInst)." |
|
181 | 181 | </button> |
182 | 182 | </form> |
183 | 183 | </div>"; |
@@ -40,16 +40,16 @@ discard block |
||
40 | 40 | |
41 | 41 | <?php |
42 | 42 | $profile_list_size = 1; |
43 | -require_once dirname(__DIR__) . '/Divs.php'; |
|
43 | +require_once dirname(__DIR__).'/Divs.php'; |
|
44 | 44 | $divs = new Divs($Gui); |
45 | 45 | $visibility = 'index'; |
46 | 46 | $operatingSystem = $Gui->detectOS(); |
47 | 47 | $Gui->loggerInstance->debug(4, $operatingSystem); |
48 | 48 | $uiElements = new web\lib\admin\UIElements(); |
49 | 49 | if ($operatingSystem) { |
50 | - print "recognisedOS = '" . $operatingSystem['device'] . "';\n"; |
|
50 | + print "recognisedOS = '".$operatingSystem['device']."';\n"; |
|
51 | 51 | } |
52 | -require dirname(__DIR__) . '/user/js/cat_js.php'; |
|
52 | +require dirname(__DIR__).'/user/js/cat_js.php'; |
|
53 | 53 | ?> |
54 | 54 | |
55 | 55 | </script> |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | </div> |
79 | 79 | <div id="main_body"> |
80 | 80 | <div id="user_page"> |
81 | - <?php echo $divs->divPagetitle(_("Diagnostics site") . " (<span style='color:red'>beta</span>)", ""); ?> |
|
81 | + <?php echo $divs->divPagetitle(_("Diagnostics site")." (<span style='color:red'>beta</span>)", ""); ?> |
|
82 | 82 | <div id="user_info" style='padding-top: 10px;'> |
83 | 83 | <div id='diagnostic_choice'> |
84 | - <?php echo _("The diagnostics system will do its best to identify and resolve your problems!") . ' ' . _("Please help the system by answering the questions as precisely as possible.") . "<br/>" . _("Are you a") . ' '; ?> |
|
85 | - <input type='radio' name='diagnostic_usertype' value='0'><?php echo _("end-user") . ' ' . _("or"); ?> |
|
86 | - <input type='radio' name='diagnostic_usertype' value='1' <?php if ($admin == 1) { echo " checked"; } ?> > <?php echo _("eduroam administrator") .'?'; ?> |
|
84 | + <?php echo _("The diagnostics system will do its best to identify and resolve your problems!").' '._("Please help the system by answering the questions as precisely as possible.")."<br/>"._("Are you a").' '; ?> |
|
85 | + <input type='radio' name='diagnostic_usertype' value='0'><?php echo _("end-user").' '._("or"); ?> |
|
86 | + <input type='radio' name='diagnostic_usertype' value='1' <?php if ($admin == 1) { echo " checked"; } ?> > <?php echo _("eduroam administrator").'?'; ?> |
|
87 | 87 | </div> |
88 | 88 | <div id='diagnostic_enduser' style='display: none;'> |
89 | 89 | <h2><?php echo _("Tools for End Users"); ?></h2> |
@@ -93,24 +93,24 @@ discard block |
||
93 | 93 | ?> |
94 | 94 | </p> |
95 | 95 | <?php |
96 | - echo '<div id="before_stage_1"><h3>' . _("The system needs some information on your home institution - issuer of your account") . '</h3>'; |
|
96 | + echo '<div id="before_stage_1"><h3>'._("The system needs some information on your home institution - issuer of your account").'</h3>'; |
|
97 | 97 | echo _("What is the realm part of your user account (the part behind the @ of 'your.username@<b>realm.tld</b>):"); |
98 | 98 | ?> |
99 | 99 | <input type='text' name='user_realm' id='user_realm' value=''> |
100 | 100 | <?php |
101 | - echo '<div id="realm_by_select"><br/>' . _("alternatively") . '<br/>'; |
|
102 | - echo _("You can select your home institution from the following list") . '<br/>'; |
|
101 | + echo '<div id="realm_by_select"><br/>'._("alternatively").'<br/>'; |
|
102 | + echo _("You can select your home institution from the following list").'<br/>'; |
|
103 | 103 | echo '<div id="select_idp_country"><a href="" id="idp_countries_list">'; |
104 | - echo '<span id="realmselect">' . _("Click to select your country/region and organisation") . '</span></a></div>'; |
|
104 | + echo '<span id="realmselect">'._("Click to select your country/region and organisation").'</span></a></div>'; |
|
105 | 105 | ?> |
106 | 106 | <div id="select_idp_area" style="display:none;"> |
107 | 107 | </div> |
108 | 108 | </div> |
109 | 109 | <div id="position_info"> |
110 | 110 | <?php |
111 | - echo '<h3>' . _("Optionally, to improve tests, you can provide information on your current location") . '</h3>'; |
|
111 | + echo '<h3>'._("Optionally, to improve tests, you can provide information on your current location").'</h3>'; |
|
112 | 112 | echo '<div id="select_sp_country"><a href="" id="sp_countries_list">'; |
113 | - echo '<span id="spselect">' . _("Click to select a location in which you have an eduroam problem") . '</span></a></div>'; |
|
113 | + echo '<span id="spselect">'._("Click to select a location in which you have an eduroam problem").'</span></a></div>'; |
|
114 | 114 | ?> |
115 | 115 | <div id="select_sp_area" style="display:none;"> |
116 | 116 | </div> |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | echo 'none'; |
144 | 144 | } |
145 | 145 | echo ";'>"; |
146 | - echo '<h3>' . _("Which problem are you reporting?") . '</h3>'; |
|
146 | + echo '<h3>'._("Which problem are you reporting?").'</h3>'; |
|
147 | 147 | echo '<input type="radio" name="problem_type" value="1">'; |
148 | - echo _("SP contacting IdP due to technical problems or abuse") . '<br>'; |
|
148 | + echo _("SP contacting IdP due to technical problems or abuse").'<br>'; |
|
149 | 149 | echo '<input type="radio" name="problem_type" value="2">'; |
150 | 150 | echo _("IdP contacting SP due to technical problems"); |
151 | 151 | echo "<div id='idp_contact_area'></div>"; |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | echo "</div>"; |
155 | 155 | } else { |
156 | 156 | echo "0\">"; |
157 | - echo _("This service is for authenticated admins only.") . '<br>'; |
|
158 | - echo "<a href=\"diag.php?admin=1\">" . |
|
159 | - _("eduroam® admin access is needed") . "</a>"; |
|
157 | + echo _("This service is for authenticated admins only.").'<br>'; |
|
158 | + echo "<a href=\"diag.php?admin=1\">". |
|
159 | + _("eduroam® admin access is needed")."</a>"; |
|
160 | 160 | } |
161 | 161 | ?> |
162 | 162 | </div> |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | if (type === 'idp' || type === 'sp') { |
181 | 181 | shtml = '<table><tbody><tr id="row_'+type+'_country"></tr>'; |
182 | 182 | shtml = shtml + '<tr id="row_'+type+'_institution" style="visibility: collapse;">'; |
183 | - shtml = shtml + '<td>' + <?php echo '"' . _("Select institiution:") . '"'; ?> + '</td><td></td></tr>'; |
|
183 | + shtml = shtml + '<td>' + <?php echo '"'._("Select institiution:").'"'; ?> + '</td><td></td></tr>'; |
|
184 | 184 | if (type === 'idp') { |
185 | 185 | shtml = shtml + '<tr id="row_idp_realm"></tr>'; |
186 | 186 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | var options = ''; |
207 | 207 | var selecthead = ''; |
208 | 208 | if (type1 === 'sp' || type1 === 'idp') { |
209 | - selecthead = <?php echo '"<td>' . _("Select country or region:") . ' </td>"'; ?>; |
|
209 | + selecthead = <?php echo '"<td>'._("Select country or region:").' </td>"'; ?>; |
|
210 | 210 | selecthead = selecthead + '<td>\n'; |
211 | 211 | } |
212 | 212 | var select = '<select id="' + type1 + '_country" name="' + type1 + '_country" style="margin-left:0px; width:400px;">'; |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | options = ($('#'+type2+'_country').html()); |
215 | 215 | countryAddSelect(selecthead, select + options + '</select>', type1); |
216 | 216 | } else { |
217 | - var comment = <?php echo '"<br><br>' . _("Fetching country/region list") . '..."'; ?>; |
|
217 | + var comment = <?php echo '"<br><br>'._("Fetching country/region list").'..."'; ?>; |
|
218 | 218 | inProgress(1, comment); |
219 | 219 | $.ajax({ |
220 | 220 | url: "findRealm.php", |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | return false; |
252 | 252 | } |
253 | 253 | function testSociopath(realm, answer) { |
254 | - var comment = <?php echo '"' . _("Testing realm") . '..."'; ?>; |
|
254 | + var comment = <?php echo '"'._("Testing realm").'..."'; ?>; |
|
255 | 255 | inProgress(1, comment); |
256 | 256 | if ($('#tested_realm').length == 0) { |
257 | 257 | $('<input>').attr({ |
@@ -275,9 +275,9 @@ discard block |
||
275 | 275 | query = '<input type="hidden" id="tested_realm" value="' + realm + '">'; |
276 | 276 | } |
277 | 277 | query = query + '<div id="current_query">'+data['TEXT']+'</div>'; |
278 | - query = query + '<div><button id="answer_yes">' + <?php echo '"' . _("Yes") . '"'; ?> + '</button>'; |
|
279 | - query = query + '<button style="margin-left:20px;" id="answer_no">' + <?php echo '"' . _("No") . '"'; ?> + '</button>'; |
|
280 | - query = query + '<button style="margin-left:20px;" id="answer_noidea">' + <?php echo '"' . _("I don't know") . '"'; ?> + '</button></div>'; |
|
278 | + query = query + '<div><button id="answer_yes">' + <?php echo '"'._("Yes").'"'; ?> + '</button>'; |
|
279 | + query = query + '<button style="margin-left:20px;" id="answer_no">' + <?php echo '"'._("No").'"'; ?> + '</button>'; |
|
280 | + query = query + '<button style="margin-left:20px;" id="answer_noidea">' + <?php echo '"'._("I don't know").'"'; ?> + '</button></div>'; |
|
281 | 281 | $('#sociopath_queries').html(query); |
282 | 282 | $('#sociopath_query_area').show(); |
283 | 283 | } |
@@ -308,55 +308,55 @@ discard block |
||
308 | 308 | }); |
309 | 309 | } |
310 | 310 | function finalVerdict(realm, verdict) { |
311 | - var title = <?php echo '"' . _("Diagnostic tests results for selected realm") . '"'; ?>; |
|
311 | + var title = <?php echo '"'._("Diagnostic tests results for selected realm").'"'; ?>; |
|
312 | 312 | result = '<div class="padding">'; |
313 | 313 | result = result + '<div><h3>'; |
314 | - result = result + <?php echo '"' . _("The result for tested realm:") . ' "'; ?> + realm; |
|
314 | + result = result + <?php echo '"'._("The result for tested realm:").' "'; ?> + realm; |
|
315 | 315 | result = result + '</h3></p><div style="padding: 5px;"><div style="padding: 0px;">'; |
316 | - result = result + <?php echo '"' . _("The system identified") . '" '; ?> + ' '; |
|
316 | + result = result + <?php echo '"'._("The system identified").'" '; ?> + ' '; |
|
317 | 317 | result = result + Object.keys(verdict).length + ' '; |
318 | - result = result + <?php echo '"' . _("suspected areas which potentially can cause a problem.") . '"'; ?> + '<br>'; |
|
319 | - result = result + <?php echo '"' . _("Next to the problem description we show a speculated probability of this event.") . '"'; ?>; |
|
318 | + result = result + <?php echo '"'._("suspected areas which potentially can cause a problem.").'"'; ?> + '<br>'; |
|
319 | + result = result + <?php echo '"'._("Next to the problem description we show a speculated probability of this event.").'"'; ?>; |
|
320 | 320 | result = result + '</div><div style="padding: 5px;"><table>'; |
321 | 321 | k = 1; |
322 | 322 | for (key in verdict) { |
323 | 323 | result = result + '<tr><td>' + k + '.</td>'; |
324 | 324 | k = k + 1; |
325 | 325 | if (key === 'INFRA_DEVICE') { |
326 | - result = result + '<td>' + <?php echo '"' . _("Your device configuration is broken") . '"'; ?> + '</td>'; |
|
326 | + result = result + '<td>' + <?php echo '"'._("Your device configuration is broken").'"'; ?> + '</td>'; |
|
327 | 327 | } |
328 | 328 | if (key === 'INFRA_SP_80211') { |
329 | - result = result + '<td>' + <?php echo '"' . _("The Wi-Fi network in your vicinity has quality issues") . '"'; ?> + '</td>'; |
|
329 | + result = result + '<td>' + <?php echo '"'._("The Wi-Fi network in your vicinity has quality issues").'"'; ?> + '</td>'; |
|
330 | 330 | } |
331 | 331 | if (key === 'INFRA_SP_LAN') { |
332 | - result = result + '<td>' + <?php echo '"' . _("The network environment around you is broken") . '"'; ?> + '</td>'; |
|
332 | + result = result + '<td>' + <?php echo '"'._("The network environment around you is broken").'"'; ?> + '</td>'; |
|
333 | 333 | } |
334 | 334 | if (key === 'INFRA_SP_RADIUS') { |
335 | - result = result + '<td>' + <?php echo '"' . _("The RADIUS server of your service provider is the source of the problem") . '"'; ?> + '</td>'; |
|
335 | + result = result + '<td>' + <?php echo '"'._("The RADIUS server of your service provider is the source of the problem").'"'; ?> + '</td>'; |
|
336 | 336 | } |
337 | 337 | if (key === 'INFRA_IDP_AUTHBACKEND') { |
338 | - result = result + '<td>' + <?php echo '"' . _("The RADIUS server in your home institution is currently unable to authenticate you") . '"'; ?> + '</td>'; |
|
338 | + result = result + '<td>' + <?php echo '"'._("The RADIUS server in your home institution is currently unable to authenticate you").'"'; ?> + '</td>'; |
|
339 | 339 | } |
340 | 340 | if (key === 'INFRA_NRO_SP') { |
341 | - result = result + '<td>' + <?php echo '"' . _("The national server in the country/region you are visiting is not functioning correctly") . '"'; ?> + '</td>'; |
|
341 | + result = result + '<td>' + <?php echo '"'._("The national server in the country/region you are visiting is not functioning correctly").'"'; ?> + '</td>'; |
|
342 | 342 | } |
343 | 343 | if (key === 'INFRA_LINK_ETLR_NRO_SP') { |
344 | - result = result + '<td>' + <?php echo '"' . _("The link between the national server of the country/region you are visiting and the top-level server is broken") . '"'; ?> + '</td>'; |
|
344 | + result = result + '<td>' + <?php echo '"'._("The link between the national server of the country/region you are visiting and the top-level server is broken").'"'; ?> + '</td>'; |
|
345 | 345 | } |
346 | 346 | if (key === 'INFRA_LINK_ETLR_NRO_IdP') { |
347 | - result = result + '<td>' + <?php echo '"' . _("The link between the national server of your home country/region and the top-level server is broken") . '"'; ?> + '</td>'; |
|
347 | + result = result + '<td>' + <?php echo '"'._("The link between the national server of your home country/region and the top-level server is broken").'"'; ?> + '</td>'; |
|
348 | 348 | } |
349 | 349 | if (key === 'INFRA_ETLR') { |
350 | - result = result + '<td>' + <?php echo '"' . _("The communication to the top-level server is down") . '"'; ?> + '</td>'; |
|
350 | + result = result + '<td>' + <?php echo '"'._("The communication to the top-level server is down").'"'; ?> + '</td>'; |
|
351 | 351 | } |
352 | 352 | if (key === 'INFRA_NRO_IdP') { |
353 | - result = result + '<td>' + <?php echo '"' . _("The national server in your home country/region is not functioning properly.") . '"'; ?> + '</td>'; |
|
353 | + result = result + '<td>' + <?php echo '"'._("The national server in your home country/region is not functioning properly.").'"'; ?> + '</td>'; |
|
354 | 354 | } |
355 | 355 | if (key === 'INFRA_IdP_RADIUS') { |
356 | - result = result + '<td>' + <?php echo '"' . _("The RADIUS server of your home institution is the source of the problem") . '"'; ?> + '</td>'; |
|
356 | + result = result + '<td>' + <?php echo '"'._("The RADIUS server of your home institution is the source of the problem").'"'; ?> + '</td>'; |
|
357 | 357 | } |
358 | 358 | if (key === 'INFRA_NONEXISTENTREALM') { |
359 | - result = result + '<td>' + <?php echo '"' . _("This realm does not exist") . '"'; ?> + '</td>'; |
|
359 | + result = result + '<td>' + <?php echo '"'._("This realm does not exist").'"'; ?> + '</td>'; |
|
360 | 360 | } |
361 | 361 | result = result + '<td style="padding-left: 5px;">' + (verdict[key] * 100).toFixed(2) + "%</td></tr>"; |
362 | 362 | } |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | return false; |
469 | 469 | }); |
470 | 470 | $(document).on('change', '#idp_country' , function() { |
471 | - var comment = <?php echo '"' . _("Fetching institutions list") . '..."'; ?>; |
|
471 | + var comment = <?php echo '"'._("Fetching institutions list").'..."'; ?>; |
|
472 | 472 | var id = $(this).attr('id'); |
473 | 473 | var k = id.indexOf('_'); |
474 | 474 | var type = id.substr(0,k); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | var shtml = ''; |
487 | 487 | var select = ''; |
488 | 488 | if (type !== 'asp') { |
489 | - shtml = <?php echo '"<td>' . _("Select institution:") . '</td><td>"'; ?>; |
|
489 | + shtml = <?php echo '"<td>'._("Select institution:").'</td><td>"'; ?>; |
|
490 | 490 | } |
491 | 491 | select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value=""></option>'; |
492 | 492 | for (var i in institutions) { |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | } else { |
508 | 508 | if (data.status === 0) { |
509 | 509 | inProgress(0); |
510 | - var msg = <?php echo '"' . _("The database does not contain the information needed to help you in realm selection for this country. You have to provide the realm you are interested in.") . '"'; ?>; |
|
510 | + var msg = <?php echo '"'._("The database does not contain the information needed to help you in realm selection for this country. You have to provide the realm you are interested in.").'"'; ?>; |
|
511 | 511 | alert(msg); |
512 | 512 | $('#select_idp_country').show(); |
513 | 513 | $('#select_idp_area').hide(); |
@@ -516,7 +516,7 @@ discard block |
||
516 | 516 | }, |
517 | 517 | error:function() { |
518 | 518 | inProgress(0); |
519 | - var msg = <?php echo '"' . _("Can not search in database. You have to provide the realm you are interested in.") . '"'; ?>; |
|
519 | + var msg = <?php echo '"'._("Can not search in database. You have to provide the realm you are interested in.").'"'; ?>; |
|
520 | 520 | alert(msg); |
521 | 521 | $('#select_idp_country').show(); |
522 | 522 | $('#select_idp_area').hide(); |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | return false; |
532 | 532 | }); |
533 | 533 | $(document).on('change', '#sp_country, #asp_country' , function() { |
534 | - var comment = <?php echo '"' . _("Fetching institutions list") . '..."'; ?>; |
|
534 | + var comment = <?php echo '"'._("Fetching institutions list").'..."'; ?>; |
|
535 | 535 | var id = $(this).attr('id'); |
536 | 536 | var k = id.indexOf('_'); |
537 | 537 | var type = id.substr(0,k); |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | var shtml = ''; |
550 | 550 | var select = ''; |
551 | 551 | if (type !== 'asp') { |
552 | - shtml = <?php echo '"<td>' . _("Select institution:") . '</td><td>"'; ?>; |
|
552 | + shtml = <?php echo '"<td>'._("Select institution:").'</td><td>"'; ?>; |
|
553 | 553 | } |
554 | 554 | select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value=""></option>'; |
555 | 555 | for (var i in hotspots) { |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | inProgress(0); |
573 | 573 | var select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value="">'; |
574 | 574 | var shtml = '<td></td><td>'; |
575 | - select = select + <?php echo '"' . _("Other location") . '"'; ?> + '</option></select></td>'; |
|
575 | + select = select + <?php echo '"'._("Other location").'"'; ?> + '</option></select></td>'; |
|
576 | 576 | if (type !== 'asp') { |
577 | 577 | $('#row_' + type + '_institution').html(''); |
578 | 578 | $('#row_' + type + '_institution').append(shtml + select); |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | $('#start_test_area').hide(); |
607 | 607 | return false; |
608 | 608 | } |
609 | - var comment = <?php echo '"' . _("Fetching realms list") . '..."'; ?>; |
|
609 | + var comment = <?php echo '"'._("Fetching realms list").'..."'; ?>; |
|
610 | 610 | inProgress(1, comment); |
611 | 611 | $.ajax({ |
612 | 612 | url: "findRealm.php", |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | var realms = data.realms; |
619 | 619 | var realmselect = ''; |
620 | 620 | if (realms.length > 1) { |
621 | - realmselect = <?php echo '"<td>' . _("Check realm(s):") . '</td>"'; ?>; |
|
621 | + realmselect = <?php echo '"<td>'._("Check realm(s):").'</td>"'; ?>; |
|
622 | 622 | realmselect = realmselect + '<td>' + "<span style='margin-left: 10px'>"; |
623 | 623 | for (var i in realms) { |
624 | 624 | realmselect = realmselect + '<input type="radio" name="realm" '; |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | } |
631 | 631 | realmselect = realmselect + '</span></td>'; |
632 | 632 | } else { |
633 | - realmselect = <?php echo '"<td>' . _("Realm:") . '</td>"'; ?>; |
|
633 | + realmselect = <?php echo '"<td>'._("Realm:").'</td>"'; ?>; |
|
634 | 634 | realmselect = realmselect + '<td>' + "<span style='margin-left: 10px'>"; |
635 | 635 | realmselect = realmselect + realms[0] + '</span>'; |
636 | 636 | realmselect = realmselect + '<input type="hidden" name="realm" value="' + realms[0] + '">'; |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | }); |
686 | 686 | t = 1; |
687 | 687 | } |
688 | - var comment = <?php echo '"' . _("Running realm tests") . '..."'; ?>; |
|
688 | + var comment = <?php echo '"'._("Running realm tests").'..."'; ?>; |
|
689 | 689 | inProgress(1, comment); |
690 | 690 | /*waiting(comment);*/ |
691 | 691 | $.ajax({ |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | } |
730 | 730 | }); |
731 | 731 | $('#sp_questions > tbody').append('<tr class="error_row"><td>' + |
732 | - <?php echo '"' . _("Realm is not registered with the eduroam database:") . '"'; ?> + |
|
732 | + <?php echo '"'._("Realm is not registered with the eduroam database:").'"'; ?> + |
|
733 | 733 | '</td><td>' + realm + '</td></tr>'); |
734 | 734 | $('#admin_realm').val(''); |
735 | 735 | } |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | testSociopath('', answer); |
754 | 754 | }); |
755 | 755 | $('#realmtest').click(function(event){ |
756 | - var comment = <?php echo '"<br><br>' . _("Running realm tests") . '..."'; ?>; |
|
756 | + var comment = <?php echo '"<br><br>'._("Running realm tests").'..."'; ?>; |
|
757 | 757 | inProgress(1, comment); |
758 | 758 | $('#start_test_area').hide(); |
759 | 759 | if ($('#select_sp_area').is(':hidden')) { |
@@ -801,13 +801,13 @@ discard block |
||
801 | 801 | reset_footer(); |
802 | 802 | testSociopath(realm, 0); |
803 | 803 | } else { |
804 | - var title = <?php echo '"' . _("Diagnostics results for selected realms") . '"'; ?>; |
|
805 | - result = '<div class="padding"><h3>' + <?php echo '"' . _("An unknown problem occured") . '"'; ?>; |
|
804 | + var title = <?php echo '"'._("Diagnostics results for selected realms").'"'; ?>; |
|
805 | + result = '<div class="padding"><h3>' + <?php echo '"'._("An unknown problem occured").'"'; ?>; |
|
806 | 806 | result = result + '</h3>' |
807 | 807 | if (r.length == 1) { |
808 | - result = result + <?php echo '"' . _("This test includes checking of the following realm") . '"'; ?>; |
|
808 | + result = result + <?php echo '"'._("This test includes checking of the following realm").'"'; ?>; |
|
809 | 809 | } else { |
810 | - result = result + <?php echo '"' . _("This test includes checking of the following realms") . '"'; ?>; |
|
810 | + result = result + <?php echo '"'._("This test includes checking of the following realms").'"'; ?>; |
|
811 | 811 | } |
812 | 812 | result = result + ': ' |
813 | 813 | for (var i=0; i < r.length; i++) { |
@@ -817,7 +817,7 @@ discard block |
||
817 | 817 | result = result + r[i]; |
818 | 818 | } |
819 | 819 | result = result + '.<br>'; |
820 | - result = result + <?php echo '"' . _("You should report this to") . '"'; ?> + ' <a href="mailto:[email protected]">[email protected]</a>'; |
|
820 | + result = result + <?php echo '"'._("You should report this to").'"'; ?> + ' <a href="mailto:[email protected]">[email protected]</a>'; |
|
821 | 821 | result = result + '</div>'; |
822 | 822 | $('#after_stage_1').hide(); |
823 | 823 | $('#before_stage_1').show(); |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | }); |
878 | 878 | }); |
879 | 879 | }); |
880 | - var comment = <?php echo '"' . _("Running realm tests") . '..."'; ?>; |
|
880 | + var comment = <?php echo '"'._("Running realm tests").'..."'; ?>; |
|
881 | 881 | inProgress(1, comment); |
882 | 882 | $.ajax({ |
883 | 883 | url: "findRealm.php", |
@@ -948,29 +948,29 @@ discard block |
||
948 | 948 | success:function(data) { |
949 | 949 | if (data.status === 1) { |
950 | 950 | var result = ''; |
951 | - var title = <?php echo '"' . _("eduroam admin report submission") . '"'; ?>; |
|
951 | + var title = <?php echo '"'._("eduroam admin report submission").'"'; ?>; |
|
952 | 952 | result = '<div class="padding">'; |
953 | 953 | if (type == 'idp_send') { |
954 | - result = result + '<h3>'+ <?php echo '"' . _("SP contacting IdP due to technical problems or abuse") . '"'; ?> + '</h3>'; |
|
954 | + result = result + '<h3>'+ <?php echo '"'._("SP contacting IdP due to technical problems or abuse").'"'; ?> + '</h3>'; |
|
955 | 955 | result = result + '<table>'; |
956 | - result = result + '<tr><td>' + <?php echo '"' . _("Reason") . '"'; ?> + '</td><td>' + data.reason + '</td></tr>'; |
|
957 | - result = result + '<tr><td>' + <?php echo '"' . _("SP email") . '"'; ?> + '</td><td>' + data.email + '</td></tr>'; |
|
958 | - result = result + '<tr><td>' + <?php echo '"' . _("IdP email(s)") . '"'; ?> + '</td><td>' + data.idpcontact + '</td></tr>'; |
|
959 | - result = result + '<tr><td>' + <?php echo '"' . _("Event's timestamp") . '"'; ?> + '</td><td>' + data.timestamp + '</td></tr>'; |
|
960 | - result = result + '<tr><td>' + <?php echo '"' . _("Calling-Station-Id") . '"'; ?> + '</td><td>' + data.mac + '</td></tr>'; |
|
961 | - result = result + '<tr><td>' + <?php echo '"' . _("Additional description") . '"'; ?> +'</td><td>' + data.freetext + '</td></tr>'; |
|
956 | + result = result + '<tr><td>' + <?php echo '"'._("Reason").'"'; ?> + '</td><td>' + data.reason + '</td></tr>'; |
|
957 | + result = result + '<tr><td>' + <?php echo '"'._("SP email").'"'; ?> + '</td><td>' + data.email + '</td></tr>'; |
|
958 | + result = result + '<tr><td>' + <?php echo '"'._("IdP email(s)").'"'; ?> + '</td><td>' + data.idpcontact + '</td></tr>'; |
|
959 | + result = result + '<tr><td>' + <?php echo '"'._("Event's timestamp").'"'; ?> + '</td><td>' + data.timestamp + '</td></tr>'; |
|
960 | + result = result + '<tr><td>' + <?php echo '"'._("Calling-Station-Id").'"'; ?> + '</td><td>' + data.mac + '</td></tr>'; |
|
961 | + result = result + '<tr><td>' + <?php echo '"'._("Additional description").'"'; ?> +'</td><td>' + data.freetext + '</td></tr>'; |
|
962 | 962 | } |
963 | 963 | if (type == 'sp_send') { |
964 | - result = result + '<h3>'+ <?php echo '"' . _("IdP contacting SP due to technical problems or abuse") . '"'; ?> + '</h3>'; |
|
964 | + result = result + '<h3>'+ <?php echo '"'._("IdP contacting SP due to technical problems or abuse").'"'; ?> + '</h3>'; |
|
965 | 965 | result = result + '<table>'; |
966 | - result = result + '<tr><td>' + <?php echo '"' . _("Reason") . '"'; ?> + '</td><td>' + data.reason + '</td></tr>'; |
|
967 | - result = result + '<tr><td>' + <?php echo '"' . _("SP's Operator-Name") . '"'; ?> + '</td><td>' + data.opname + '</td></tr>'; |
|
968 | - result = result + '<tr><td>' + <?php echo '"' . _("User's outer ID") . '"'; ?> + '</td><td>' + data.outerid + '</td></tr>'; |
|
969 | - result = result + '<tr><td>' + <?php echo '"' . _("IdP email") . '"'; ?> + '</td><td>' + data.email + '</td></tr>'; |
|
970 | - result = result + '<tr><td>' + <?php echo '"' . _("Event's timestamp") . '"'; ?> + '</td><td>' + data.timestamp + '</td></tr>'; |
|
971 | - result = result + '<tr><td>' + <?php echo '"' . _("Calling-Station-Id") . '"'; ?> + '</td><td>' + data.mac + '</td></tr>'; |
|
972 | - result = result + '<tr><td>' + <?php echo '"' . _("Additional description") . '"'; ?> +'</td><td>' + data.freetext + '</td></tr>'; |
|
973 | - result = result + '<tr><td>' + <?php echo '"' . _("How to contact the user") . '"'; ?> +'</td><td>' + data.cdetails + '</td></tr>'; |
|
966 | + result = result + '<tr><td>' + <?php echo '"'._("Reason").'"'; ?> + '</td><td>' + data.reason + '</td></tr>'; |
|
967 | + result = result + '<tr><td>' + <?php echo '"'._("SP's Operator-Name").'"'; ?> + '</td><td>' + data.opname + '</td></tr>'; |
|
968 | + result = result + '<tr><td>' + <?php echo '"'._("User's outer ID").'"'; ?> + '</td><td>' + data.outerid + '</td></tr>'; |
|
969 | + result = result + '<tr><td>' + <?php echo '"'._("IdP email").'"'; ?> + '</td><td>' + data.email + '</td></tr>'; |
|
970 | + result = result + '<tr><td>' + <?php echo '"'._("Event's timestamp").'"'; ?> + '</td><td>' + data.timestamp + '</td></tr>'; |
|
971 | + result = result + '<tr><td>' + <?php echo '"'._("Calling-Station-Id").'"'; ?> + '</td><td>' + data.mac + '</td></tr>'; |
|
972 | + result = result + '<tr><td>' + <?php echo '"'._("Additional description").'"'; ?> +'</td><td>' + data.freetext + '</td></tr>'; |
|
973 | + result = result + '<tr><td>' + <?php echo '"'._("How to contact the user").'"'; ?> +'</td><td>' + data.cdetails + '</td></tr>'; |
|
974 | 974 | } |
975 | 975 | result = result + '</div>'; |
976 | 976 | showInfo(result, title); |
@@ -987,7 +987,7 @@ discard block |
||
987 | 987 | if ($('#mac').val().length > 0) { |
988 | 988 | if ($('#mac').val().length != 17) { |
989 | 989 | $('#mac').addClass('error_input'); |
990 | - $('#mac').attr('title', <?php echo '"' . _("MAC address is incomplete") . '"'; ?>); |
|
990 | + $('#mac').attr('title', <?php echo '"'._("MAC address is incomplete").'"'; ?>); |
|
991 | 991 | } else { |
992 | 992 | $('#mac').removeClass('error_input'); |
993 | 993 | $('#mac').attr('title', ''); |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | if ($(this).attr('id') == 'email' && $(this).val().length > 0) { |
997 | 997 | if (!isEmail($(this).val())) { |
998 | 998 | $('#email').addClass('error_input'); |
999 | - $('#email').attr('title', <?php echo '"' . _("Wrong format of email") . '"'; ?>); |
|
999 | + $('#email').attr('title', <?php echo '"'._("Wrong format of email").'"'; ?>); |
|
1000 | 1000 | } else { |
1001 | 1001 | $('#email').removeClass('error_input'); |
1002 | 1002 | $('#email').attr('title', ''); |
@@ -1005,7 +1005,7 @@ discard block |
||
1005 | 1005 | if ($(this).attr('id') == 'outer_id' && $(this).val().length > 0) { |
1006 | 1006 | if (!isEmail($(this).val(), true)) { |
1007 | 1007 | $('#outer_id').addClass('error_input'); |
1008 | - $('#outer_id').attr('title', <?php echo '"' . _("Wrong format of outer ID") . '"'; ?>); |
|
1008 | + $('#outer_id').attr('title', <?php echo '"'._("Wrong format of outer ID").'"'; ?>); |
|
1009 | 1009 | } else { |
1010 | 1010 | $('#outer_id').removeClass('error_input'); |
1011 | 1011 | $('#outer_id').attr('title', ''); |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | if ($(this).attr('id') == 'opname' && $('#opname').val().length > 0) { |
1015 | 1015 | if (!isOperatorName($(this).val())) { |
1016 | 1016 | $('#opname').addClass('error_input'); |
1017 | - $('#opname').attr('title', <?php echo '"' . _("Wrong string given as OperatorName") . '"'; ?>); |
|
1017 | + $('#opname').attr('title', <?php echo '"'._("Wrong string given as OperatorName").'"'; ?>); |
|
1018 | 1018 | $('#spmanually').show(); |
1019 | 1019 | } else { |
1020 | 1020 | $('#opname').removeClass('error_input'); |
@@ -20,8 +20,8 @@ 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"; |
|
24 | -require_once dirname(dirname(dirname(__FILE__))) . "/core/phpqrcode.php"; |
|
23 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
24 | +require_once dirname(dirname(dirname(__FILE__)))."/core/phpqrcode.php"; |
|
25 | 25 | const QRCODE_PIXELS_PER_SYMBOL = 12; |
26 | 26 | |
27 | 27 | $auth = new \web\lib\admin\Authentication(); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $fed = new \core\Federation($inst->federation); |
56 | 56 | $allowSb = $fed->getAttributes("fed:silverbullet"); |
57 | 57 | if (count($allowSb) == 0) { |
58 | - 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!"); |
|
58 | + 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!"); |
|
59 | 59 | } |
60 | 60 | // okay, new SB profiles are allowed. |
61 | 61 | // but is there a support:email attribute on inst level? |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | // Create one. |
67 | 67 | $newProfile = $inst->newProfile(core\AbstractProfile::PROFILETYPE_SILVERBULLET); |
68 | 68 | // and modify the REQUEST_URI to add the new profile ID |
69 | - $_SERVER['REQUEST_URI'] = $_SERVER['REQUEST_URI'] . "&profile_id=" . $newProfile->identifier; |
|
69 | + $_SERVER['REQUEST_URI'] = $_SERVER['REQUEST_URI']."&profile_id=".$newProfile->identifier; |
|
70 | 70 | $_GET['profile_id'] = $newProfile->identifier; |
71 | 71 | $profile = $newProfile; |
72 | 72 | } else { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | if (isset($_POST['command'])) { |
92 | 92 | switch ($_POST['command']) { |
93 | 93 | case \web\lib\common\FormElements::BUTTON_CLOSE: |
94 | - header("Location: overview_idp.php?inst_id=" . $inst->identifier); |
|
94 | + header("Location: overview_idp.php?inst_id=".$inst->identifier); |
|
95 | 95 | break; |
96 | 96 | case \web\lib\common\FormElements::BUTTON_TERMSOFUSE: |
97 | 97 | if (isset($_POST['agreement']) && $_POST['agreement'] == 'true') { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | break; |
135 | 135 | } |
136 | 136 | $properName = $validator->User($elements[0]); |
137 | - $properDate = new DateTime($elements[1] . " 00:00:00"); |
|
137 | + $properDate = new DateTime($elements[1]." 00:00:00"); |
|
138 | 138 | $numberOfActivations = $elements[2] ?? 5; |
139 | 139 | $number = $validator->integer($numberOfActivations); |
140 | 140 | if ($number === FALSE) { // invalid input received, default to sane |
@@ -237,18 +237,18 @@ discard block |
||
237 | 237 | // warn and ask for confirmation unless already confirmed |
238 | 238 | if (!isset($_POST['insecureconfirm']) || $_POST['insecureconfirm'] != "CONFIRM") { |
239 | 239 | echo $deco->pageheader(_("Insecure mail domain!"), "ADMIN-IDP-USERS"); |
240 | - 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>"; |
|
241 | - 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>"; |
|
242 | - echo "<p>" . _("Do you want the system to send this mail anyway?") . "</p>"; |
|
240 | + 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>"; |
|
241 | + 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>"; |
|
242 | + echo "<p>"._("Do you want the system to send this mail anyway?")."</p>"; |
|
243 | 243 | echo $formtext; |
244 | - echo "<button type='submit' class='delete'>" . _("DO NOT SEND") . "</button>"; |
|
244 | + echo "<button type='submit' class='delete'>"._("DO NOT SEND")."</button>"; |
|
245 | 245 | echo "</form>"; |
246 | 246 | echo $formtext; |
247 | - echo "<input type='hidden' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT . "'</>"; |
|
247 | + echo "<input type='hidden' name='command' value='".\web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT."'</>"; |
|
248 | 248 | echo "<input type='hidden' name='address' value='$properEmail'</>"; |
249 | - echo "<input type='hidden' name='token' value='" . $invitationObject->invitationTokenString . "'</>"; |
|
249 | + echo "<input type='hidden' name='token' value='".$invitationObject->invitationTokenString."'</>"; |
|
250 | 250 | echo "<input type='hidden' name='insecureconfirm' value='CONFIRM'/>"; |
251 | - echo "<button type='submit'>" . _("Send anyway.") . "</button>"; |
|
251 | + echo "<button type='submit'>"._("Send anyway.")."</button>"; |
|
252 | 252 | echo "</form>"; |
253 | 253 | echo $deco->footer(); |
254 | 254 | exit; |
@@ -358,19 +358,19 @@ discard block |
||
358 | 358 | case "NOSTIPULATION": |
359 | 359 | break; |
360 | 360 | case "EMAIL-SENT": |
361 | - echo $boundaryPre . $uiElements->boxOkay(_("The e-mail was sent successfully."), _("E-mail OK."), FALSE) . $boundaryPost; |
|
361 | + echo $boundaryPre.$uiElements->boxOkay(_("The e-mail was sent successfully."), _("E-mail OK."), FALSE).$boundaryPost; |
|
362 | 362 | break; |
363 | 363 | case "EMAIL-NOTSENT": |
364 | - echo $boundaryPre . $uiElements->boxError(_("The e-mail was NOT sent."), _("E-mail not OK."), FALSE) . $boundaryPost; |
|
364 | + echo $boundaryPre.$uiElements->boxError(_("The e-mail was NOT sent."), _("E-mail not OK."), FALSE).$boundaryPost; |
|
365 | 365 | break; |
366 | 366 | case "SMS-SENT": |
367 | - echo $boundaryPre . $uiElements->boxOkay(_("The SMS was sent successfully."), _("SMS OK."), FALSE) . $boundaryPost; |
|
367 | + echo $boundaryPre.$uiElements->boxOkay(_("The SMS was sent successfully."), _("SMS OK."), FALSE).$boundaryPost; |
|
368 | 368 | break; |
369 | 369 | case "SMS-NOTSENT": |
370 | - echo $boundaryPre . $uiElements->boxOkay(_("The SMS was NOT sent."), _("SMS not OK."), FALSE) . $boundaryPost; |
|
370 | + echo $boundaryPre.$uiElements->boxOkay(_("The SMS was NOT sent."), _("SMS not OK."), FALSE).$boundaryPost; |
|
371 | 371 | break; |
372 | 372 | case "SMS-FRAGMENT": |
373 | - echo $boundaryPre . $uiElements->boxWarning(_("Only a fragment of the SMS was sent. You should re-send it."), _("SMS Fragment."), FALSE) . $boundaryPost; |
|
373 | + echo $boundaryPre.$uiElements->boxWarning(_("Only a fragment of the SMS was sent. You should re-send it."), _("SMS Fragment."), FALSE).$boundaryPost; |
|
374 | 374 | break; |
375 | 375 | } |
376 | 376 | ?> |
@@ -383,17 +383,17 @@ discard block |
||
383 | 383 | <?php |
384 | 384 | $bufferCurrentUsers = "<table class='sb-user-table' style='max-width:1920px;'> |
385 | 385 | <tr class='sb-title-row'> |
386 | - <td>" . _("User") . "</td> |
|
387 | - <td>" . _("Token/Certificate details") . "</td> |
|
388 | - <td>" . _("User/Token Expiry") . "</td> |
|
389 | - <td>" . _("Actions") . "</td> |
|
386 | + <td>" . _("User")."</td> |
|
387 | + <td>" . _("Token/Certificate details")."</td> |
|
388 | + <td>" . _("User/Token Expiry")."</td> |
|
389 | + <td>" . _("Actions")."</td> |
|
390 | 390 | </tr>"; |
391 | 391 | $bufferPreviousUsers = "<table class='sb-user-table' style='max-width:1920px;'> |
392 | 392 | <tr class='sb-title-row'> |
393 | - <td>" . _("User") . "</td> |
|
394 | - <td>" . _("Certificate details") . "</td> |
|
395 | - <td>" . _("User Expiry") . "</td> |
|
396 | - <td>" . _("Actions") . "</td> |
|
393 | + <td>" . _("User")."</td> |
|
394 | + <td>" . _("Certificate details")."</td> |
|
395 | + <td>" . _("User Expiry")."</td> |
|
396 | + <td>" . _("Actions")."</td> |
|
397 | 397 | </tr>"; |
398 | 398 | |
399 | 399 | natsort($allUsers); |
@@ -449,23 +449,23 @@ discard block |
||
449 | 449 | $display = empty(devices\Devices::listDevices()[$oneCert->device]['display']) ? $oneCert->device : devices\Devices::listDevices()[$oneCert->device]['display']; |
450 | 450 | |
451 | 451 | $bufferText = "<div class='sb-certificate-summary ca-summary' $style> |
452 | - <div class='sb-certificate-details'>" . _("Device:") . " " . $display . |
|
453 | - "<br>" . _("Serial Number:") . " " . dechex($oneCert->serial) . |
|
454 | - "<br>" . _("CN:") . " " . explode('@', $oneCert->username)[0] . "@…" . |
|
455 | - "<br>" . _("Expiry:") . " " . $oneCert->expiry . |
|
456 | - "<br>" . _("Issued:") . " " . $oneCert->issued . |
|
457 | - "</div>" . |
|
452 | + <div class='sb-certificate-details'>"._("Device:")." ".$display. |
|
453 | + "<br>"._("Serial Number:")." ".dechex($oneCert->serial). |
|
454 | + "<br>"._("CN:")." ".explode('@', $oneCert->username)[0]."@…". |
|
455 | + "<br>"._("Expiry:")." ".$oneCert->expiry. |
|
456 | + "<br>"._("Issued:")." ".$oneCert->issued. |
|
457 | + "</div>". |
|
458 | 458 | "<div style='text-align:right;padding-top: 5px; $buttonStyle'>"; |
459 | 459 | |
460 | 460 | if ($buttonText == "") { |
461 | 461 | $bufferText .= $formtext |
462 | - . "<input type='hidden' name='certSerial' value='" . $oneCert->serial . "'/>" |
|
463 | - . "<input type='hidden' name='certAlgo' value='" . $oneCert->ca_type . "'/>" |
|
462 | + . "<input type='hidden' name='certSerial' value='".$oneCert->serial."'/>" |
|
463 | + . "<input type='hidden' name='certAlgo' value='".$oneCert->ca_type."'/>" |
|
464 | 464 | . "<button type='submit' " |
465 | 465 | . "name='command' " |
466 | - . "value='" . \web\lib\common\FormElements::BUTTON_REVOKECREDENTIAL . "' " |
|
466 | + . "value='".\web\lib\common\FormElements::BUTTON_REVOKECREDENTIAL."' " |
|
467 | 467 | . "class='delete' " |
468 | - . "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']) . "\")'>" |
|
468 | + . "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'])."\")'>" |
|
469 | 469 | . _("Revoke") |
470 | 470 | . "</button>" |
471 | 471 | . "</form>"; |
@@ -490,13 +490,13 @@ discard block |
||
490 | 490 | } |
491 | 491 | // wrap the revoked and expired certs in a div that is hidden by default |
492 | 492 | if ($textRevokedCerts !== "") { |
493 | - $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>"; |
|
493 | + $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>"; |
|
494 | 494 | } |
495 | 495 | if ($textExpiredCerts !== "") { |
496 | - $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>"; |
|
496 | + $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>"; |
|
497 | 497 | } |
498 | 498 | // and push out the HTML |
499 | - ${$outputBuffer} .= $textActiveCerts . "<br/>" . $textExpiredCerts . " " . $textRevokedCerts . "</td>"; |
|
499 | + ${$outputBuffer} .= $textActiveCerts."<br/>".$textExpiredCerts." ".$textRevokedCerts."</td>"; |
|
500 | 500 | $tokenHtmlBuffer = ""; |
501 | 501 | $hasOnePendingInvite = FALSE; |
502 | 502 | foreach ($tokensWithoutCerts as $invitationObject) { |
@@ -507,38 +507,38 @@ discard block |
||
507 | 507 | $tokenHtmlBuffer .= "<tr class='sb-certificate-row'><td></td>"; |
508 | 508 | $jsEncodedBody = str_replace('\n', '%0D%0A', str_replace('"', '', json_encode($invitationObject->invitationMailBody()))); |
509 | 509 | $tokenHtmlBuffer .= "<td>"; |
510 | - $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/>"); |
|
510 | + $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/>"); |
|
511 | 511 | $tokenHtmlBuffer .= "<table> |
512 | - <tr><td style='vertical-align:bottom;'>" . _("E-Mail:") . "</td><td> |
|
512 | + <tr><td style='vertical-align:bottom;'>" . _("E-Mail:")."</td><td> |
|
513 | 513 | $formtext |
514 | - <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/> |
|
514 | + <input type='hidden' value='".$invitationObject->invitationTokenString."' name='token'><br/> |
|
515 | 515 | <input type='text' name='address' id='address-$invitationObject->identifier'/> |
516 | - <button type='button' onclick='window.location=\"mailto:\"+document.getElementById(\"address-$invitationObject->identifier\").value+\"?subject=" . $invitationObject->invitationMailSubject() . "&body=$jsEncodedBody\"; return false;'>" . _("Local mail client") . "</button> |
|
517 | - <button type='submit' name='command' onclick='document.getElementById(\"spin\").style.display =\"block\"' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT . "'>" . _("Send with CAT") . "</button> |
|
516 | + <button type='button' onclick='window.location=\"mailto:\"+document.getElementById(\"address-$invitationObject->identifier\").value+\"?subject=".$invitationObject->invitationMailSubject()."&body=$jsEncodedBody\"; return false;'>"._("Local mail client")."</button> |
|
517 | + <button type='submit' name='command' onclick='document.getElementById(\"spin\").style.display =\"block\"' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONMAILBYCAT."'>"._("Send with CAT")."</button> |
|
518 | 518 | </form> |
519 | 519 | </td></tr> |
520 | - <tr><td style='vertical-align:bottom;'>" . _("SMS:") . "</td><td> |
|
520 | + <tr><td style='vertical-align:bottom;'>" . _("SMS:")."</td><td> |
|
521 | 521 | $formtext |
522 | - <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/> |
|
522 | + <input type='hidden' value='".$invitationObject->invitationTokenString."' name='token'><br/> |
|
523 | 523 | <input type='text' name='smsnumber' /> |
524 | - <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONSMS . "'>" . _("Send in SMS...") . "</button> |
|
524 | + <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_SENDINVITATIONSMS."'>"._("Send in SMS...")."</button> |
|
525 | 525 | </form> |
526 | 526 | </td></tr> |
527 | - <tr><td style='vertical-align:bottom;'>" . _("Manual:") . "</td><td> |
|
528 | - <button type='button' class='clipboardButton' onclick='clipboardCopy(" . $invitationObject->identifier . ");'>" . _("Copy to Clipboard") . "</button> |
|
527 | + <tr><td style='vertical-align:bottom;'>" . _("Manual:")."</td><td> |
|
528 | + <button type='button' class='clipboardButton' onclick='clipboardCopy(" . $invitationObject->identifier.");'>"._("Copy to Clipboard")."</button> |
|
529 | 529 | <form style='display:inline-block;' method='post' action='inc/displayQRcode.inc.php' onsubmit='popupQRWindow(this); return false;' accept-charset='UTF-8'> |
530 | - <input type='hidden' value='" . $invitationObject->invitationTokenString . "' name='token'><br/> |
|
531 | - <button type='submit'>" . _("Display QR code") . "</button> |
|
530 | + <input type='hidden' value='" . $invitationObject->invitationTokenString."' name='token'><br/> |
|
531 | + <button type='submit'>" . _("Display QR code")."</button> |
|
532 | 532 | </form> |
533 | 533 | </td></tr> |
534 | 534 | |
535 | 535 | </table> |
536 | 536 | </td>"; |
537 | - $tokenHtmlBuffer .= "<td>" . _("Expiry Date:") . " " . $invitationObject->expiry . " UTC<br>" . _("Activations remaining:") . " " . sprintf(_("%d of %d"), $invitationObject->activationsRemaining, $invitationObject->activationsTotal) . "</td>"; |
|
537 | + $tokenHtmlBuffer .= "<td>"._("Expiry Date:")." ".$invitationObject->expiry." UTC<br>"._("Activations remaining:")." ".sprintf(_("%d of %d"), $invitationObject->activationsRemaining, $invitationObject->activationsTotal)."</td>"; |
|
538 | 538 | $tokenHtmlBuffer .= "<td>" |
539 | 539 | . $formtext |
540 | - . "<input type='hidden' name='invitationtoken' value='" . $invitationObject->invitationTokenString . "'/>" |
|
541 | - . "<button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_REVOKEINVITATION . "' class='delete'>" . _("Revoke") . "</button></form>" |
|
540 | + . "<input type='hidden' name='invitationtoken' value='".$invitationObject->invitationTokenString."'/>" |
|
541 | + . "<button type='submit' name='command' value='".\web\lib\common\FormElements::BUTTON_REVOKEINVITATION."' class='delete'>"._("Revoke")."</button></form>" |
|
542 | 542 | . "</td></tr>"; |
543 | 543 | break; |
544 | 544 | case core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED: |
@@ -554,10 +554,10 @@ discard block |
||
554 | 554 | } |
555 | 555 | ${$outputBuffer} .= "<td>$formtext |
556 | 556 | <div class='sb-date-container' style='min-width: 200px;'> |
557 | - <span><input type='text' maxlength='19' class='sb-date-picker' name='userexpiry' value='" . $profile->getUserExpiryDate($oneUserId) . "'> (UTC)</span> |
|
557 | + <span><input type='text' maxlength='19' class='sb-date-picker' name='userexpiry' value='".$profile->getUserExpiryDate($oneUserId)."'> (UTC)</span> |
|
558 | 558 | </div> |
559 | 559 | <input type='hidden' name='userid' value='$oneUserId'/> |
560 | - <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_CHANGEUSEREXPIRY . "'>" . _("Update") . "</button> |
|
560 | + <button type='submit' name='command' value='".\web\lib\common\FormElements::BUTTON_CHANGEUSEREXPIRY."'>"._("Update")."</button> |
|
561 | 561 | </form> |
562 | 562 | </td> |
563 | 563 | <td> |
@@ -565,33 +565,33 @@ discard block |
||
565 | 565 | |
566 | 566 | if ($hasOnePendingInvite || count($validCerts) > 0) { |
567 | 567 | $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']); |
568 | - ${$outputBuffer} .= $formtext . " |
|
568 | + ${$outputBuffer} .= $formtext." |
|
569 | 569 | <input type='hidden' name='userid' value='$oneUserId'/> |
570 | 570 | <button type='submit' " |
571 | 571 | . "name='command' " |
572 | - . "value='" . \web\lib\common\FormElements::BUTTON_DEACTIVATEUSER . "' " |
|
572 | + . "value='".\web\lib\common\FormElements::BUTTON_DEACTIVATEUSER."' " |
|
573 | 573 | . "class='delete' " |
574 | - . ( count($validCerts) > 0 ? "onclick='return confirm(\"" . $deletionText . "\")' " : "" ) |
|
574 | + . (count($validCerts) > 0 ? "onclick='return confirm(\"".$deletionText."\")' " : "") |
|
575 | 575 | . ">" |
576 | 576 | . _("Deactivate User") |
577 | 577 | . "</button> |
578 | 578 | </form>"; |
579 | 579 | } |
580 | - ${$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'> |
|
581 | - <button type='submit'>" . _("Show Authentication Records") . "</button> |
|
580 | + ${$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'> |
|
581 | + <button type='submit'>"._("Show Authentication Records")."</button> |
|
582 | 582 | </form>"; |
583 | 583 | if (new DateTime() < new DateTime($expiryDate)) { // current user, allow sending new token |
584 | - ${$outputBuffer} .= $formtext . " |
|
584 | + ${$outputBuffer} .= $formtext." |
|
585 | 585 | <input type='hidden' name='userid' value='$oneUserId'/> |
586 | - <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_NEWINVITATION . "'>" . _("New Invitation") . "</button> |
|
587 | - <label>" . _("Activations:") . " |
|
586 | + <button type='submit' name='command' value='".\web\lib\common\FormElements::BUTTON_NEWINVITATION."'>"._("New Invitation")."</button> |
|
587 | + <label>" . _("Activations:")." |
|
588 | 588 | <input type='text' name='invitationsquantity' value='5' maxlength='3' style='width: 30px;'/> |
589 | 589 | </label> |
590 | 590 | </form>"; |
591 | 591 | } 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 |
592 | - ${$outputBuffer} .= $formtext . " |
|
592 | + ${$outputBuffer} .= $formtext." |
|
593 | 593 | <input type='hidden' name='userid' value='$oneUserId'/> |
594 | - <button type='submit' class='delete' name='command' value='" . \web\lib\common\FormElements::BUTTON_DELETE . "'>" . _("Delete User") . "</button> |
|
594 | + <button type='submit' class='delete' name='command' value='".\web\lib\common\FormElements::BUTTON_DELETE."'>"._("Delete User")."</button> |
|
595 | 595 | </form>"; |
596 | 596 | } |
597 | 597 | ${$outputBuffer} .= "</div> |
@@ -623,13 +623,13 @@ discard block |
||
623 | 623 | . ' If all accounts shown as active above are indeed still valid, please check the box below and push "Save".' |
624 | 624 | . ' 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); |
625 | 625 | |
626 | - echo $formtext . "<div style='padding-bottom: 20px;'>" |
|
626 | + echo $formtext."<div style='padding-bottom: 20px;'>" |
|
627 | 627 | . " |
628 | 628 | <p>$acknowledgeText</p> |
629 | 629 | <input type='checkbox' name='acknowledge' value='true'> |
630 | - <label>" . sprintf(_("I have verified that all configured users are still eligible for %s."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</label> |
|
630 | + <label>".sprintf(_("I have verified that all configured users are still eligible for %s."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</label> |
|
631 | 631 | </div> |
632 | - <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_ACKUSERELIGIBILITY . "'>" . _("Save") . "</button></form>"; |
|
632 | + <button type='submit' name='command' value='" . \web\lib\common\FormElements::BUTTON_ACKUSERELIGIBILITY."'>"._("Save")."</button></form>"; |
|
633 | 633 | } |
634 | 634 | ?> |
635 | 635 | </div> |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public function annotate($annotation) { |
145 | 145 | $encoded = json_encode($annotation); |
146 | 146 | $this->annotation = $encoded; |
147 | - $this->databaseHandle->exec("UPDATE silverbullet_certificate SET extrainfo = ? WHERE serial_number = ?", "si", $encoded, $this->serial ); |
|
147 | + $this->databaseHandle->exec("UPDATE silverbullet_certificate SET extrainfo = ? WHERE serial_number = ?", "si", $encoded, $this->serial); |
|
148 | 148 | } |
149 | 149 | /** |
150 | 150 | * we don't use caching in SB, so this function does nothing |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $invitationObject = new SilverbulletInvitation($token); |
171 | 171 | $profile = new ProfileSilverbullet($invitationObject->profile); |
172 | 172 | $inst = new IdP($profile->institution); |
173 | - $loggerInstance->debug(5, "tokenStatus: done, got " . $invitationObject->invitationTokenStatus . ", " . $invitationObject->profile . ", " . $invitationObject->userId . ", " . $invitationObject->expiry . ", " . $invitationObject->invitationTokenString . "\n"); |
|
173 | + $loggerInstance->debug(5, "tokenStatus: done, got ".$invitationObject->invitationTokenStatus.", ".$invitationObject->profile.", ".$invitationObject->userId.", ".$invitationObject->expiry.", ".$invitationObject->invitationTokenString."\n"); |
|
174 | 174 | if ($invitationObject->invitationTokenStatus != SilverbulletInvitation::SB_TOKENSTATUS_VALID && $invitationObject->invitationTokenStatus != SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED) { |
175 | 175 | throw new Exception("Attempt to generate a SilverBullet installer with an invalid/redeemed/expired token. The user should never have gotten that far!"); |
176 | 176 | } |
@@ -183,12 +183,12 @@ discard block |
||
183 | 183 | throw new Exception("Despite a valid token, the corresponding user was not found in database or database query error!"); |
184 | 184 | } |
185 | 185 | $expiryObject = mysqli_fetch_object(/** @scrutinizer ignore-type */ $userrow); |
186 | - $loggerInstance->debug(5, "EXP: " . $expiryObject->expiry . "\n"); |
|
186 | + $loggerInstance->debug(5, "EXP: ".$expiryObject->expiry."\n"); |
|
187 | 187 | $expiryDateObject = date_create_from_format("Y-m-d H:i:s", $expiryObject->expiry); |
188 | 188 | if ($expiryDateObject === FALSE) { |
189 | 189 | throw new Exception("The expiry date we got from the DB is bogus!"); |
190 | 190 | } |
191 | - $loggerInstance->debug(5, $expiryDateObject->format("Y-m-d H:i:s") . "\n"); |
|
191 | + $loggerInstance->debug(5, $expiryDateObject->format("Y-m-d H:i:s")."\n"); |
|
192 | 192 | // date_create with no parameters can't fail, i.e. is never FALSE |
193 | 193 | $validity = date_diff(/** @scrutinizer ignore-type */ date_create(), $expiryDateObject); |
194 | 194 | $expiryDays = $validity->days + 1; |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | $certString = ""; |
238 | 238 | openssl_x509_export($cert, $certString); |
239 | 239 | $parsedCert = $x509->processCertificate($certString); |
240 | - $loggerInstance->debug(5, "CERTINFO: " . print_r($parsedCert['full_details'], true)); |
|
240 | + $loggerInstance->debug(5, "CERTINFO: ".print_r($parsedCert['full_details'], true)); |
|
241 | 241 | $realExpiryDate = date_create_from_format("U", $parsedCert['full_details']['validTo_time_t'])->format("Y-m-d H:i:s"); |
242 | 242 | |
243 | 243 | // store new cert info in DB |
@@ -295,26 +295,26 @@ discard block |
||
295 | 295 | $cat = new CAT(); |
296 | 296 | $tempdirArray = $cat->createTemporaryDirectory("test"); |
297 | 297 | $tempdir = $tempdirArray['dir']; |
298 | - $nowIndexTxt = (new \DateTime())->format("ymdHis") . "Z"; |
|
299 | - $expiryIndexTxt = $originalExpiry->format("ymdHis") . "Z"; |
|
298 | + $nowIndexTxt = (new \DateTime())->format("ymdHis")."Z"; |
|
299 | + $expiryIndexTxt = $originalExpiry->format("ymdHis")."Z"; |
|
300 | 300 | $serialHex = strtoupper(dechex($this->serial)); |
301 | 301 | if (strlen($serialHex) % 2 == 1) { |
302 | - $serialHex = "0" . $serialHex; |
|
302 | + $serialHex = "0".$serialHex; |
|
303 | 303 | } |
304 | 304 | |
305 | - $indexStatement = "$certstatus\t$expiryIndexTxt\t" . ($certstatus == "R" ? "$nowIndexTxt,unspecified" : "") . "\t$serialHex\tunknown\t/O=" . CONFIG_CONFASSISTANT['CONSORTIUM']['name'] . "/OU=$federation/CN=$this->username\n"; |
|
305 | + $indexStatement = "$certstatus\t$expiryIndexTxt\t".($certstatus == "R" ? "$nowIndexTxt,unspecified" : "")."\t$serialHex\tunknown\t/O=".CONFIG_CONFASSISTANT['CONSORTIUM']['name']."/OU=$federation/CN=$this->username\n"; |
|
306 | 306 | $logHandle->debug(4, "index.txt contents-to-be: $indexStatement"); |
307 | - if (!file_put_contents($tempdir . "/index.txt", $indexStatement)) { |
|
307 | + if (!file_put_contents($tempdir."/index.txt", $indexStatement)) { |
|
308 | 308 | $logHandle->debug(1, "Unable to write openssl index.txt file for revocation handling!"); |
309 | 309 | } |
310 | 310 | // index.txt.attr is dull but needs to exist |
311 | - file_put_contents($tempdir . "/index.txt.attr", "unique_subject = yes\n"); |
|
311 | + file_put_contents($tempdir."/index.txt.attr", "unique_subject = yes\n"); |
|
312 | 312 | // call "openssl ocsp" to manufacture our own OCSP statement |
313 | 313 | // adding "-rmd sha1" to the following command-line makes the |
314 | 314 | // choice of signature algorithm for the response explicit |
315 | 315 | // but it's only available from openssl-1.1.0 (which we do not |
316 | 316 | // want to require just for that one thing). |
317 | - $execCmd = CONFIG['PATHS']['openssl'] . " ocsp -issuer " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rsigner " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rkey " . ROOT . "/config/SilverbulletClientCerts/real-".$this->ca_type.".key -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der"; |
|
317 | + $execCmd = CONFIG['PATHS']['openssl']." ocsp -issuer ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -sha1 -ndays 10 -no_nonce -serial 0x$serialHex -CA ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rsigner ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".pem -rkey ".ROOT."/config/SilverbulletClientCerts/real-".$this->ca_type.".key -index $tempdir/index.txt -no_cert_verify -respout $tempdir/$serialHex.response.der"; |
|
318 | 318 | $logHandle->debug(2, "Calling openssl ocsp with following cmdline: $execCmd\n"); |
319 | 319 | $output = []; |
320 | 320 | $return = 999; |
@@ -322,11 +322,11 @@ discard block |
||
322 | 322 | if ($return !== 0) { |
323 | 323 | throw new Exception("Non-zero return value from openssl ocsp!"); |
324 | 324 | } |
325 | - $ocsp = file_get_contents($tempdir . "/$serialHex.response.der"); |
|
325 | + $ocsp = file_get_contents($tempdir."/$serialHex.response.der"); |
|
326 | 326 | // remove the temp dir! |
327 | - unlink($tempdir . "/$serialHex.response.der"); |
|
328 | - unlink($tempdir . "/index.txt.attr"); |
|
329 | - unlink($tempdir . "/index.txt"); |
|
327 | + unlink($tempdir."/$serialHex.response.der"); |
|
328 | + unlink($tempdir."/index.txt.attr"); |
|
329 | + unlink($tempdir."/index.txt"); |
|
330 | 330 | rmdir($tempdir); |
331 | 331 | break; |
332 | 332 | default: |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $username = ""; |
381 | 381 | while ($usernameIsUnique === FALSE) { |
382 | 382 | $usernameLocalPart = common\Entity::randomString(64 - 1 - strlen($realm), "0123456789abcdefghijklmnopqrstuvwxyz"); |
383 | - $username = $usernameLocalPart . "@" . $realm; |
|
383 | + $username = $usernameLocalPart."@".$realm; |
|
384 | 384 | $uniquenessQuery = $databaseHandle->exec("SELECT cn from silverbullet_certificate WHERE cn = ?", "s", $username); |
385 | 385 | // SELECT -> resource, not boolean |
386 | 386 | if (mysqli_num_rows(/** @scrutinizer ignore-type */ $uniquenessQuery) == 0) { |
@@ -432,10 +432,10 @@ discard block |
||
432 | 432 | $databaseHandle = DBConnection::handle("INST"); |
433 | 433 | switch (CONFIG_CONFASSISTANT['SILVERBULLET']['CA']['type']) { |
434 | 434 | case "embedded": |
435 | - $rootCaPem = file_get_contents(ROOT . "/config/SilverbulletClientCerts/rootca-$certtype.pem"); |
|
436 | - $issuingCaPem = file_get_contents(ROOT . "/config/SilverbulletClientCerts/real-$certtype.pem"); |
|
435 | + $rootCaPem = file_get_contents(ROOT."/config/SilverbulletClientCerts/rootca-$certtype.pem"); |
|
436 | + $issuingCaPem = file_get_contents(ROOT."/config/SilverbulletClientCerts/real-$certtype.pem"); |
|
437 | 437 | $issuingCa = openssl_x509_read($issuingCaPem); |
438 | - $issuingCaKey = openssl_pkey_get_private("file://" . ROOT . "/config/SilverbulletClientCerts/real-$certtype.key"); |
|
438 | + $issuingCaKey = openssl_pkey_get_private("file://".ROOT."/config/SilverbulletClientCerts/real-$certtype.key"); |
|
439 | 439 | $nonDupSerialFound = FALSE; |
440 | 440 | do { |
441 | 441 | $serial = random_int(1000000000, PHP_INT_MAX); |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | throw new Exception("Unknown cert type!"); |
458 | 458 | } |
459 | 459 | return [ |
460 | - "CERT" => openssl_csr_sign($csr, $issuingCa, $issuingCaKey, $expiryDays, ['digest_alg' => $alg, 'config' => dirname(__DIR__) . "/config/SilverbulletClientCerts/openssl-$certtype.cnf"], $serial), |
|
460 | + "CERT" => openssl_csr_sign($csr, $issuingCa, $issuingCaKey, $expiryDays, ['digest_alg' => $alg, 'config' => dirname(__DIR__)."/config/SilverbulletClientCerts/openssl-$certtype.cnf"], $serial), |
|
461 | 461 | "SERIAL" => $serial, |
462 | 462 | "ISSUER" => $issuingCaPem, |
463 | 463 | "ROOT" => $rootCaPem, |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n"); |
108 | 108 | ob_start(); |
109 | - $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n"); |
|
109 | + $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n"); |
|
110 | 110 | $source = $this->findSourceFile($source_name); |
111 | 111 | |
112 | 112 | if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | $output = ob_get_clean(); |
116 | 116 | if ($encoding) { |
117 | - $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output); |
|
117 | + $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output); |
|
118 | 118 | if ($outputClean) { |
119 | 119 | $output = $outputClean; |
120 | 120 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $encoding = 0; |
159 | 159 | } |
160 | 160 | if ($encoding) { |
161 | - $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $source_string); |
|
161 | + $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $source_string); |
|
162 | 162 | } else { |
163 | 163 | $output_c = $source_string; |
164 | 164 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if (isset($this->LANGS[$this->languageInstance->getLang()])) { |
238 | 238 | $language = $this->LANGS[$this->languageInstance->getLang()]; |
239 | 239 | $this->lang = $language['nsis']; |
240 | - $this->codePage = 'cp' . $language['cp']; |
|
240 | + $this->codePage = 'cp'.$language['cp']; |
|
241 | 241 | } else { |
242 | 242 | $this->lang = 'English'; |
243 | 243 | $this->codePage = 'cp1252'; |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | $out .= sprintf(_("%s installer will be in the form of an EXE file. It will configure %s on your device, by creating wireless network profiles.<p>When you click the download button, the installer will be saved by your browser. Copy it to the machine you want to configure and execute."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
260 | 260 | $out .= "<p>"; |
261 | 261 | if ($ssidCount > $configCount) { |
262 | - $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList)) . " "; |
|
263 | - $out .= '<strong>' . join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)) . '</strong>'; |
|
262 | + $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList))." "; |
|
263 | + $out .= '<strong>'.join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)).'</strong>'; |
|
264 | 264 | $out .= "<p>"; |
265 | 265 | } |
266 | 266 | // TODO - change this below |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | $out .= _("When you are connecting to the network for the first time, Windows will pop up a login box, where you should enter your user name and password. This information will be saved so that you will reconnect to the network automatically each time you are in the range."); |
277 | 277 | if ($ssidCount > 1) { |
278 | 278 | $out .= "<p>"; |
279 | - $out .= _("You will be required to enter the same credentials for each of the configured networks:") . " "; |
|
280 | - $out .= '<strong>' . join('</strong>, <strong>', array_keys($ssids)) . '</strong>'; |
|
279 | + $out .= _("You will be required to enter the same credentials for each of the configured networks:")." "; |
|
280 | + $out .= '<strong>'.join('</strong>, <strong>', array_keys($ssids)).'</strong>'; |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | return $out; |
@@ -379,13 +379,13 @@ discard block |
||
379 | 379 | */ |
380 | 380 | protected function signInstaller() |
381 | 381 | { |
382 | - $fileName = $this->installerBasename . '.exe'; |
|
382 | + $fileName = $this->installerBasename.'.exe'; |
|
383 | 383 | if (!$this->sign) { |
384 | 384 | rename("installer.exe", $fileName); |
385 | 385 | return $fileName; |
386 | 386 | } |
387 | 387 | // are actually signing |
388 | - $outputFromSigning = system($this->sign . " installer.exe '$fileName' > /dev/null"); |
|
388 | + $outputFromSigning = system($this->sign." installer.exe '$fileName' > /dev/null"); |
|
389 | 389 | if ($outputFromSigning === FALSE) { |
390 | 390 | $this->loggerInstance->debug(2, "Signing the WindowsCommon installer $fileName FAILED!\n"); |
391 | 391 | } |
@@ -400,15 +400,15 @@ discard block |
||
400 | 400 | protected function compileNSIS() |
401 | 401 | { |
402 | 402 | if (CONFIG_CONFASSISTANT['NSIS_VERSION'] >= 3) { |
403 | - $makensis = CONFIG_CONFASSISTANT['PATHS']['makensis'] . " -INPUTCHARSET UTF8"; |
|
403 | + $makensis = CONFIG_CONFASSISTANT['PATHS']['makensis']." -INPUTCHARSET UTF8"; |
|
404 | 404 | } else { |
405 | 405 | $makensis = CONFIG_CONFASSISTANT['PATHS']['makensis']; |
406 | 406 | } |
407 | 407 | $lcAll = getenv("LC_ALL"); |
408 | 408 | putenv("LC_ALL=en_US.UTF-8"); |
409 | - $command = $makensis . ' -V4 cat.NSI > nsis.log 2>&1'; |
|
409 | + $command = $makensis.' -V4 cat.NSI > nsis.log 2>&1'; |
|
410 | 410 | system($command); |
411 | - putenv("LC_ALL=" . $lcAll); |
|
411 | + putenv("LC_ALL=".$lcAll); |
|
412 | 412 | $this->loggerInstance->debug(4, "compileNSIS:$command\n"); |
413 | 413 | } |
414 | 414 | |
@@ -425,10 +425,10 @@ discard block |
||
425 | 425 | 'email' => 'SUPPORT', |
426 | 426 | 'url' => 'URL', |
427 | 427 | ]; |
428 | - $s = "support_" . $type . "_substitute"; |
|
428 | + $s = "support_".$type."_substitute"; |
|
429 | 429 | $substitute = $this->translateString($this->$s, $this->codePage); |
430 | - $returnValue = !empty($attr['support:' . $type][0]) ? $attr['support:' . $type][0] : $substitute; |
|
431 | - return '!define ' . $supportString[$type] . ' "' . $returnValue . '"' . "\n"; |
|
430 | + $returnValue = !empty($attr['support:'.$type][0]) ? $attr['support:'.$type][0] : $substitute; |
|
431 | + return '!define '.$supportString[$type].' "'.$returnValue.'"'."\n"; |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | /** |
@@ -439,20 +439,20 @@ discard block |
||
439 | 439 | */ |
440 | 440 | protected function writeNsisDefines($attr) |
441 | 441 | { |
442 | - $fcontents = "\n" . '!define NSIS_MAJOR_VERSION ' . CONFIG_CONFASSISTANT['NSIS_VERSION']; |
|
442 | + $fcontents = "\n".'!define NSIS_MAJOR_VERSION '.CONFIG_CONFASSISTANT['NSIS_VERSION']; |
|
443 | 443 | if ($attr['internal:profile_count'][0] > 1) { |
444 | - $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '" |
|
444 | + $fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage).'" |
|
445 | 445 | '; |
446 | 446 | } |
447 | 447 | $fcontents .= ' |
448 | -Caption "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
449 | -!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
450 | -!define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '" |
|
448 | +Caption "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
449 | +!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
450 | +!define VERSION "' . \core\CAT::VERSION_MAJOR.'.'.\core\CAT::VERSION_MINOR.'" |
|
451 | 451 | !define INSTALLER_NAME "installer.exe" |
452 | -!define LANG "' . $this->lang . '" |
|
453 | -!define LOCALE "' . preg_replace('/\..*$/', '', CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['locale']) . '" |
|
452 | +!define LANG "' . $this->lang.'" |
|
453 | +!define LOCALE "' . preg_replace('/\..*$/', '', CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['locale']).'" |
|
454 | 454 | ;-------------------------------- |
455 | -!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '" |
|
455 | +!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage).'" |
|
456 | 456 | '; |
457 | 457 | $fcontents .= $this->getSupport($attr, 'email'); |
458 | 458 | $fcontents .= $this->getSupport($attr, 'url'); |
@@ -460,18 +460,18 @@ discard block |
||
460 | 460 | $fcontents .= '!define WIRED |
461 | 461 | '; |
462 | 462 | } |
463 | - $fcontents .= '!define PROVIDERID "urn:UUID:' . $this->deviceUUID . '" |
|
463 | + $fcontents .= '!define PROVIDERID "urn:UUID:'.$this->deviceUUID.'" |
|
464 | 464 | '; |
465 | 465 | if (!empty($attr['internal:realm'][0])) { |
466 | - $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '" |
|
466 | + $fcontents .= '!define REALM "'.$attr['internal:realm'][0].'" |
|
467 | 467 | '; |
468 | 468 | } |
469 | 469 | if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) { |
470 | - $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '" |
|
470 | + $fcontents .= '!define HINT_USER_INPUT "'.$attr['internal:hint_userinput_suffix'][0].'" |
|
471 | 471 | '; |
472 | 472 | } |
473 | 473 | if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) { |
474 | - $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '" |
|
474 | + $fcontents .= '!define VERIFY_USER_REALM_INPUT "'.$attr['internal:verify_userinput_suffix'][0].'" |
|
475 | 475 | '; |
476 | 476 | } |
477 | 477 | $fcontents .= $this->msInfoFile($attr); |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | $out .= '!define EXTERNAL_INFO "'; |
493 | 493 | // $this->loggerInstance->debug(4,"Info file type ".$attr['support:info_file'][0]['mime']."\n"); |
494 | 494 | if ($attr['internal:info_file'][0]['mime'] == 'rtf') { |
495 | - $out = '!define LICENSE_FILE "' . $attr['internal:info_file'][0]['name']; |
|
495 | + $out = '!define LICENSE_FILE "'.$attr['internal:info_file'][0]['name']; |
|
496 | 496 | } elseif ($attr['internal:info_file'][0]['mime'] == 'txt') { |
497 | 497 | $infoFile = file_get_contents($attr['internal:info_file'][0]['name']); |
498 | 498 | if ($infoFile === FALSE) { |
@@ -501,14 +501,14 @@ discard block |
||
501 | 501 | if (CONFIG_CONFASSISTANT['NSIS_VERSION'] >= 3) { |
502 | 502 | $infoFileConverted = $infoFile; |
503 | 503 | } else { |
504 | - $infoFileConverted = iconv('UTF-8', $this->codePage . '//TRANSLIT', $infoFile); |
|
504 | + $infoFileConverted = iconv('UTF-8', $this->codePage.'//TRANSLIT', $infoFile); |
|
505 | 505 | } |
506 | 506 | if ($infoFileConverted !== FALSE && strlen($infoFileConverted) > 0) { |
507 | 507 | file_put_contents('info_f.txt', $infoFileConverted); |
508 | 508 | $out = '!define LICENSE_FILE " info_f.txt'; |
509 | 509 | } |
510 | 510 | } else { |
511 | - $out = '!define EXTERNAL_INFO "' . $attr['internal:info_file'][0]['name']; |
|
511 | + $out = '!define EXTERNAL_INFO "'.$attr['internal:info_file'][0]['name']; |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | $out .= "\"\n"; |