@@ -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"; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * <base_url>/copyright.php after deploying the software |
20 | 20 | */ |
21 | 21 | |
22 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
23 | 23 | |
24 | 24 | $auth = new \web\lib\admin\Authentication(); |
25 | 25 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -94,12 +94,12 @@ discard block |
||
94 | 94 | </table> |
95 | 95 | </div> |
96 | 96 | <?php |
97 | - echo "<form enctype='multipart/form-data' action='edit_idp_result.php?inst_id=$my_inst->identifier" . ($wizardStyle ? "&wizard=true" : "") . "' method='post' accept-charset='UTF-8'> |
|
98 | - <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE'] . "'>"; |
|
97 | + echo "<form enctype='multipart/form-data' action='edit_idp_result.php?inst_id=$my_inst->identifier".($wizardStyle ? "&wizard=true" : "")."' method='post' accept-charset='UTF-8'> |
|
98 | + <input type='hidden' name='MAX_FILE_SIZE' value='" . CONFIG['MAX_UPLOAD_SIZE']."'>"; |
|
99 | 99 | |
100 | 100 | if ($wizardStyle) { |
101 | - echo "<p>" . |
|
102 | - sprintf(_("Hello, newcomer. The %s is new to us. This wizard will ask you several questions about it, so that we can generate beautiful profiles for you in the end. All of the information below is optional, but it is important to fill out as many fields as possible for the benefit of your end users."), $uiElements->nomenclatureInst) . "</p>"; |
|
101 | + echo "<p>". |
|
102 | + sprintf(_("Hello, newcomer. The %s is new to us. This wizard will ask you several questions about it, so that we can generate beautiful profiles for you in the end. All of the information below is optional, but it is important to fill out as many fields as possible for the benefit of your end users."), $uiElements->nomenclatureInst)."</p>"; |
|
103 | 103 | } |
104 | 104 | $optionDisplay = new web\lib\admin\OptionDisplay($idpoptions, "IdP"); |
105 | 105 | ?> |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | <legend><strong><?php echo _("General Information"); ?></strong></legend> |
108 | 108 | <?php |
109 | 109 | if ($wizardStyle) { |
110 | - echo "<p>" . |
|
111 | - _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:") . "</p> |
|
110 | + echo "<p>". |
|
111 | + _("Some properties are valid across all deployment profiles. This is the place where you can describe those properties in a fine-grained way. The solicited information is used as follows:")."</p> |
|
112 | 112 | <ul> |
113 | - <li>" . _("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).") . "</li> |
|
114 | - <li>" . sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."),$uiElements->nomenclatureInst) . "</li>"; |
|
113 | + <li>" . _("<strong>Logo</strong>: When you submit a logo, we will embed this logo into all installers where a custom logo is possible. We accept any image format, but for best results, we suggest SVG. If you don't upload a logo, we will use the generic logo instead (see top-right corner of this page).")."</li> |
|
114 | + <li>" . sprintf(_("<strong>Name</strong>: The %s may have names in multiple languages. It is recommended to always populate at least the 'default/other' language, as it is used as a fallback if the system does not have a name in the exact language the user requests a download in."), $uiElements->nomenclatureInst)."</li>"; |
|
115 | 115 | echo "</ul>"; |
116 | 116 | } |
117 | 117 | echo $optionDisplay->prefilledOptionTable("general"); |
@@ -125,30 +125,30 @@ discard block |
||
125 | 125 | <legend><strong><?php echo _("Media Properties"); ?></strong></legend> |
126 | 126 | <?php |
127 | 127 | if ($wizardStyle) { |
128 | - echo "<p>" . |
|
129 | - sprintf(_("In this section, you define on which media %s should be configured on user devices."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</p> |
|
128 | + echo "<p>". |
|
129 | + sprintf(_("In this section, you define on which media %s should be configured on user devices."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</p> |
|
130 | 130 | <ul>"; |
131 | 131 | echo "<li>"; |
132 | - echo "<strong>" . ( count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:")) . " </strong>"; |
|
132 | + echo "<strong>".(count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional SSIDs:") : _("SSIDs:"))." </strong>"; |
|
133 | 133 | if (count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) { |
134 | 134 | $ssidlist = ""; |
135 | 135 | foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssid) { |
136 | - $ssidlist .= ", '<strong>" . $ssid . "</strong>'"; |
|
136 | + $ssidlist .= ", '<strong>".$ssid."</strong>'"; |
|
137 | 137 | } |
138 | 138 | $ssidlist = substr($ssidlist, 2); |
139 | 139 | echo sprintf(ngettext("We will always configure this SSID for WPA2/AES: %s.", "We will always configure these SSIDs for WPA2/AES: %s.", count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'])), $ssidlist); |
140 | 140 | if (CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) { |
141 | - echo " " . _("They will also be configured for WPA/TKIP if the device supports multiple encryption types."); |
|
141 | + echo " "._("They will also be configured for WPA/TKIP if the device supports multiple encryption types."); |
|
142 | 142 | } |
143 | - echo "<br/>" . sprintf(_("It is also possible to define custom additional SSIDs with the options '%s' and '%s' below."), $uiElements->displayName("media:SSID"), $uiElements->displayName("media:SSID_with_legacy")); |
|
143 | + echo "<br/>".sprintf(_("It is also possible to define custom additional SSIDs with the options '%s' and '%s' below."), $uiElements->displayName("media:SSID"), $uiElements->displayName("media:SSID_with_legacy")); |
|
144 | 144 | } else { |
145 | 145 | echo _("Please configure which SSIDs should be configured in the installers."); |
146 | 146 | } |
147 | - echo " " . _("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible."); |
|
147 | + echo " "._("By default, we will only configure the SSIDs with WPA2/AES encryption. By using the '(with WPA/TKIP)' option you can specify that we should include legacy support for WPA/TKIP where possible."); |
|
148 | 148 | echo "</li>"; |
149 | 149 | |
150 | 150 | echo "<li>"; |
151 | - echo "<strong>" . ( count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:")) . " </strong>"; |
|
151 | + echo "<strong>".(count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0 ? _("Additional Hotspot 2.0 / Passpoint Consortia:") : _("Hotspot 2.0 / Passpoint Consortia:"))." </strong>"; |
|
152 | 152 | if (count(CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']) > 0) { |
153 | 153 | $consortiumlist = ""; |
154 | 154 | foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi'] as $displayName => $oi) { |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | $consortiumlistFinal = substr($consortiumlist, 2); |
158 | 158 | echo sprintf(ngettext("We will always configure this Consortium OI: %s.", "We will always configure these Consortium OIs: %s.", count(CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi'])), $consortiumlistFinal); |
159 | 159 | |
160 | - echo "<br/>" . sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $uiElements->displayName("media:consortium_OI")); |
|
160 | + echo "<br/>".sprintf(_("It is also possible to define custom additional OIs with the option '%s' below."), $uiElements->displayName("media:consortium_OI")); |
|
161 | 161 | } else { |
162 | 162 | echo _("Please configure which Consortium OIs should be configured in the installers."); |
163 | 163 | } |
164 | 164 | echo "</li>"; |
165 | - echo "<li><strong>" . _("Support for wired IEEE 802.1X:") . " </strong>" |
|
166 | - . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail).") . |
|
165 | + echo "<li><strong>"._("Support for wired IEEE 802.1X:")." </strong>" |
|
166 | + . _("If you want to configure your users' devices with IEEE 802.1X support for wired ethernet, please check the corresponding box. Note that this makes the installation process a bit more difficult on some platforms (Windows: needs administrator privileges; Apple: attempting to install a profile with wired support on a device without an active wired ethernet card will fail)."). |
|
167 | 167 | "</li>"; |
168 | - echo "<li><strong>" . _("Removal of bootstrap/onboarding SSIDs:") . " </strong>" |
|
168 | + echo "<li><strong>"._("Removal of bootstrap/onboarding SSIDs:")." </strong>" |
|
169 | 169 | . _("If you use a captive portal to distribute configurations, you may want to unconfigure/disable that SSID after the bootstrap process. With this option, the SSID will either be removed, or be defined as 'Only connect manually'.") |
170 | 170 | . "</li>"; |
171 | 171 | echo "</ul>"; |
@@ -181,16 +181,16 @@ discard block |
||
181 | 181 | echo "<p>"._("This section can be used to upload specific Terms of Use for your users and to display details of how your users can reach your local helpdesk.")."</p>"; |
182 | 182 | |
183 | 183 | if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") { |
184 | - echo "<p>" . |
|
184 | + echo "<p>". |
|
185 | 185 | |
186 | - sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."),$uiElements->nomenclatureInst) . "</p>" . |
|
187 | - "<p>" . |
|
188 | - _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.") . "</p>"; |
|
186 | + sprintf(_("Do you provide helpdesk services for your users? If so, it would be nice if you would tell us the pointers to this helpdesk."), $uiElements->nomenclatureInst)."</p>". |
|
187 | + "<p>". |
|
188 | + _("If you enter a value here, it will be added to the installers for all your users, and will be displayed on the download page. If you operate separate helpdesks for different user groups (we call this 'profiles') specify per-profile helpdesk information later in this wizard. If you operate no help desk at all, just leave these fields empty.")."</p>"; |
|
189 | 189 | if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL") { |
190 | - echo "<p>" . sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), core\ProfileSilverbullet::PRODUCTNAME) ." " . _("This is the contact point for your end users' level 1 support.") . "</p>"; |
|
190 | + echo "<p>".sprintf(_("For %s deployments, providing at least a local e-mail contact is required."), core\ProfileSilverbullet::PRODUCTNAME)." "._("This is the contact point for your end users' level 1 support.")."</p>"; |
|
191 | 191 | } |
192 | 192 | } elseif (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_SILVERBULLET'] == "LOCAL") { |
193 | - echo "<p>". _("Providing at least a local support e-mail contact is required.")." "._("This is the contact point for your end users' level 1 support.")."</p>"; |
|
193 | + echo "<p>"._("Providing at least a local support e-mail contact is required.")." "._("This is the contact point for your end users' level 1 support.")."</p>"; |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | } |
@@ -200,8 +200,8 @@ discard block |
||
200 | 200 | <button type='button' class='newoption' onclick='getXML("support")'><?php echo _("Add new option"); ?></button></fieldset> |
201 | 201 | <?php |
202 | 202 | if ($wizardStyle) { |
203 | - echo "<p>" . sprintf(_("When you are sure that everything is correct, please click on %sContinue ...%s"), "<button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CONTINUE . "'>", "</button>") . "</p></form>"; |
|
203 | + echo "<p>".sprintf(_("When you are sure that everything is correct, please click on %sContinue ...%s"), "<button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CONTINUE."'>", "</button>")."</p></form>"; |
|
204 | 204 | } else { |
205 | - echo "<div><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button> <button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></div></form>"; |
|
205 | + echo "<div><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button> <button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></div></form>"; |
|
206 | 206 | } |
207 | 207 | echo $deco->footer(); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | foreach ($this->attributes['internal:consortia'] as $oneCons) { |
97 | 97 | $knownOiName = array_search($oneCons, CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-consortium-oi']); |
98 | 98 | if ($knownOiName === FALSE) { // a custom RCOI as set by the IdP admin; do not use the term "eduroam" in that one! |
99 | - $knownOiName = $this->attributes['general:instname'][0] . " "._("Roaming Partner") . " $roamingPartner"; |
|
99 | + $knownOiName = $this->attributes['general:instname'][0]." "._("Roaming Partner")." $roamingPartner"; |
|
100 | 100 | $roamingPartner++; |
101 | 101 | } |
102 | 102 | $ssid = 'cat-passpoint-profile'; |
@@ -148,12 +148,12 @@ discard block |
||
148 | 148 | if (empty($this->attributes['internal:realm'][0])) { |
149 | 149 | $retval .= CONFIG_CONFASSISTANT['CONSORTIUM']['interworking-domainname-fallback']; |
150 | 150 | } else { |
151 | - $retval .= $this->attributes['internal:realm'][0]; |
|
151 | + $retval .= $this->attributes['internal:realm'][0]; |
|
152 | 152 | } |
153 | 153 | $retval .= '</DomainName>'; |
154 | - $retval .= '<RoamingConsortium><OUI>' . $oi . |
|
154 | + $retval .= '<RoamingConsortium><OUI>'.$oi. |
|
155 | 155 | '</OUI></RoamingConsortium>'; |
156 | - $retval .= '</Hotspot2>'; |
|
156 | + $retval .= '</Hotspot2>'; |
|
157 | 157 | return($retval); |
158 | 158 | } |
159 | 159 | |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | $profileFileCont = '<EAPConfig><EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig"> |
163 | 163 | <EapMethod> |
164 | 164 | '; |
165 | - $profileFileCont .= '<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">' . |
|
166 | - $this->selectedEap["OUTER"] . '</Type> |
|
165 | + $profileFileCont .= '<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">'. |
|
166 | + $this->selectedEap["OUTER"].'</Type> |
|
167 | 167 | <VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId> |
168 | 168 | <VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType> |
169 | -<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">' . $authorId . '</AuthorId> |
|
169 | +<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">' . $authorId.'</AuthorId> |
|
170 | 170 | </EapMethod> |
171 | 171 | '; |
172 | 172 | return($profileFileCont); |
@@ -177,10 +177,10 @@ discard block |
||
177 | 177 | <eapTls:ServerValidation> |
178 | 178 | <eapTls:DisableUserPromptForServerValidation>true</eapTls:DisableUserPromptForServerValidation> |
179 | 179 | '; |
180 | - $profileFileCont .= '<eapTls:ServerNames>' . $this->servers . '</eapTls:ServerNames>'; |
|
180 | + $profileFileCont .= '<eapTls:ServerNames>'.$this->servers.'</eapTls:ServerNames>'; |
|
181 | 181 | foreach ($this->caArray as $certAuthority) { |
182 | 182 | if ($certAuthority['root']) { |
183 | - $profileFileCont .= "<eapTls:TrustedRootCA>" . $certAuthority['sha1'] . "</eapTls:TrustedRootCA>\n"; |
|
183 | + $profileFileCont .= "<eapTls:TrustedRootCA>".$certAuthority['sha1']."</eapTls:TrustedRootCA>\n"; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | $profileFileCont .= '</eapTls:ServerValidation> |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | $profileFileCont = ' |
193 | 193 | <ServerValidation> |
194 | 194 | '; |
195 | - $profileFileCont .= '<ServerNames>' . $this->servers . '</ServerNames> '; |
|
195 | + $profileFileCont .= '<ServerNames>'.$this->servers.'</ServerNames> '; |
|
196 | 196 | foreach ($this->caArray as $certAuthority) { |
197 | 197 | if ($certAuthority['root']) { |
198 | - $profileFileCont .= "<TrustedRootCAHash>" . chunk_split($certAuthority['sha1'], 2, ' ') . "</TrustedRootCAHash>\n"; |
|
198 | + $profileFileCont .= "<TrustedRootCAHash>".chunk_split($certAuthority['sha1'], 2, ' ')."</TrustedRootCAHash>\n"; |
|
199 | 199 | } |
200 | 200 | } |
201 | 201 | $profileFileCont .= '<DisablePrompt>true</DisablePrompt> |
@@ -227,10 +227,10 @@ discard block |
||
227 | 227 | $profileFileCont = ' |
228 | 228 | <ServerValidation> |
229 | 229 | <DisableUserPromptForServerValidation>true</DisableUserPromptForServerValidation> |
230 | -<ServerNames>' . $this->servers . '</ServerNames>'; |
|
230 | +<ServerNames>' . $this->servers.'</ServerNames>'; |
|
231 | 231 | foreach ($this->caArray as $certAuthority) { |
232 | 232 | if ($certAuthority['root']) { |
233 | - $profileFileCont .= "<TrustedRootCA>" . $certAuthority['sha1'] . "</TrustedRootCA>\n"; |
|
233 | + $profileFileCont .= "<TrustedRootCA>".$certAuthority['sha1']."</TrustedRootCA>\n"; |
|
234 | 234 | } |
235 | 235 | } |
236 | 236 | $profileFileCont .= '</ServerValidation> |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | if ($this->useAnon) { |
287 | 287 | $profileFileCont .= '<IdentityPrivacy>true</IdentityPrivacy> |
288 | 288 | '; |
289 | - $profileFileCont .= '<AnonymousIdentity>' . $this->outerId . '</AnonymousIdentity> |
|
289 | + $profileFileCont .= '<AnonymousIdentity>'.$this->outerId.'</AnonymousIdentity> |
|
290 | 290 | '; |
291 | 291 | } else { |
292 | 292 | $profileFileCont .= '<IdentityPrivacy>false</IdentityPrivacy> |
@@ -303,10 +303,10 @@ discard block |
||
303 | 303 | $profileFileCont = ' |
304 | 304 | <Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig"> |
305 | 305 | <EAPIdentityProviderList xmlns="urn:ietf:params:xml:ns:yang:ietf-eap-metadata"> |
306 | -<EAPIdentityProvider ID="' . $this->deviceUUID . '" namespace="urn:UUID"> |
|
306 | +<EAPIdentityProvider ID="' . $this->deviceUUID.'" namespace="urn:UUID"> |
|
307 | 307 | |
308 | 308 | <ProviderInfo> |
309 | -<DisplayName>' . $this->translateString($this->attributes['general:instname'][0], $this->codePage) . '</DisplayName> |
|
309 | +<DisplayName>' . $this->translateString($this->attributes['general:instname'][0], $this->codePage).'</DisplayName> |
|
310 | 310 | </ProviderInfo> |
311 | 311 | <AuthenticationMethods> |
312 | 312 | <AuthenticationMethod> |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | if ($this->outerUser == '') { |
319 | 319 | $profileFileCont .= '<AnonymousIdentity>@</AnonymousIdentity>'; |
320 | 320 | } else { |
321 | - $profileFileCont .= '<AnonymousIdentity>' . $this->outerId . '</AnonymousIdentity>'; |
|
321 | + $profileFileCont .= '<AnonymousIdentity>'.$this->outerId.'</AnonymousIdentity>'; |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | $profileFileCont .= '</ClientSideCredential> |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $profileFileCont .= $this->glTtlsServerValidation(); |
327 | 327 | $profileFileCont .= ' |
328 | 328 | <InnerAuthenticationMethod> |
329 | -<NonEAPAuthMethod>' . \core\common\EAP::eapDisplayName($this->selectedEap)['INNER'] . '</NonEAPAuthMethod> |
|
329 | +<NonEAPAuthMethod>' . \core\common\EAP::eapDisplayName($this->selectedEap)['INNER'].'</NonEAPAuthMethod> |
|
330 | 330 | </InnerAuthenticationMethod> |
331 | 331 | <VendorSpecific> |
332 | 332 | <SessionResumption>false</SessionResumption> |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | <UseWinLogonCredentials>false</UseWinLogonCredentials> |
358 | 358 | </EapType> |
359 | 359 | </Eap> |
360 | -<EnableQuarantineChecks>' . $nea . '</EnableQuarantineChecks> |
|
360 | +<EnableQuarantineChecks>' . $nea.'</EnableQuarantineChecks> |
|
361 | 361 | <RequireCryptoBinding>false</RequireCryptoBinding> |
362 | 362 | '; |
363 | 363 | if ($this->useAnon) { |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $profileFileCont .= '<AnonymousUserName/> |
370 | 370 | '; |
371 | 371 | } else { |
372 | - $profileFileCont .= '<AnonymousUserName>' . $this->outerUser . '</AnonymousUserName> |
|
372 | + $profileFileCont .= '<AnonymousUserName>'.$this->outerUser.'</AnonymousUserName> |
|
373 | 373 | '; |
374 | 374 | } |
375 | 375 | $profileFileCont .= '</IdentityPrivacy> |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | private function prepareEapConfig() { |
400 | 400 | if ($this->useAnon) { |
401 | 401 | $this->outerUser = $this->attributes['internal:anon_local_value'][0]; |
402 | - $this->outerId = $this->outerUser . '@' . $this->attributes['internal:realm'][0]; |
|
402 | + $this->outerId = $this->outerUser.'@'.$this->attributes['internal:realm'][0]; |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | $profileFileCont = $this->eapConfigHeader(); |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | default: |
425 | 425 | break; |
426 | 426 | } |
427 | - return(['win' => $profileFileCont . '</EapHostConfig></EAPConfig>']); |
|
427 | + return(['win' => $profileFileCont.'</EapHostConfig></EAPConfig>']); |
|
428 | 428 | } |
429 | 429 | |
430 | 430 | /** |
@@ -442,10 +442,10 @@ discard block |
||
442 | 442 | private function writeWLANprofile($wlanProfileName, $ssid, $auth, $encryption, $eapConfig, $profileNumber, $oi = '') { |
443 | 443 | $profileFileCont = '<?xml version="1.0"?> |
444 | 444 | <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"> |
445 | -<name>' . $wlanProfileName . '</name> |
|
445 | +<name>' . $wlanProfileName.'</name> |
|
446 | 446 | <SSIDConfig> |
447 | 447 | <SSID> |
448 | -<name>' . $ssid . '</name> |
|
448 | +<name>' . $ssid.'</name> |
|
449 | 449 | </SSID> |
450 | 450 | <nonBroadcast>true</nonBroadcast> |
451 | 451 | </SSIDConfig>'; |
@@ -457,8 +457,8 @@ discard block |
||
457 | 457 | <MSM> |
458 | 458 | <security> |
459 | 459 | <authEncryption> |
460 | -<authentication>' . $auth . '</authentication> |
|
461 | -<encryption>' . $encryption . '</encryption> |
|
460 | +<authentication>' . $auth.'</authentication> |
|
461 | +<encryption>' . $encryption.'</encryption> |
|
462 | 462 | <useOneX>true</useOneX> |
463 | 463 | </authEncryption> |
464 | 464 | '; |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | mkdir('w8'); |
486 | 486 | } |
487 | 487 | $xmlFname = "w8/wlan_prof-$profileNumber.xml"; |
488 | - file_put_contents($xmlFname, $profileFileCont . $eapConfig['win'] . $closing); |
|
488 | + file_put_contents($xmlFname, $profileFileCont.$eapConfig['win'].$closing); |
|
489 | 489 | $this->loggerInstance->debug(2, "Installer has been written into directory $this->FPATH\n"); |
490 | 490 | $hs20 = $oi == '' ? 0 : 1; |
491 | 491 | return("\"$wlanProfileName\" \"$encryption\" $hs20"); |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | mkdir('w8'); |
514 | 514 | } |
515 | 515 | $xmlFname = "w8/lan_prof.xml"; |
516 | - file_put_contents($xmlFname, $profileFileCont . $eapConfig['win'] . $closing); |
|
516 | + file_put_contents($xmlFname, $profileFileCont.$eapConfig['win'].$closing); |
|
517 | 517 | $this->loggerInstance->debug(2, "Installer has been written into directory $this->FPATH\n"); |
518 | 518 | } |
519 | 519 | |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | } |
535 | 535 | foreach ($caArray as $certAuthority) { |
536 | 536 | $store = $certAuthority['root'] ? "root" : "ca"; |
537 | - $fcontentsCerts .= '!insertmacro install_ca_cert "' . $certAuthority['file'] . '" "' . $certAuthority['sha1'] . '" "' . $store . "\"\n"; |
|
537 | + $fcontentsCerts .= '!insertmacro install_ca_cert "'.$certAuthority['file'].'" "'.$certAuthority['sha1'].'" "'.$store."\"\n"; |
|
538 | 538 | } |
539 | 539 | fwrite($fileHandleCerts, $fcontentsCerts); |
540 | 540 | fclose($fileHandleCerts); |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | private function writeMainNSH($eap, $attr) { |
544 | 544 | $this->loggerInstance->debug(4, "writeMainNSH"); |
545 | 545 | $this->loggerInstance->debug(4, $attr); |
546 | - $this->loggerInstance->debug(4, "Device_id = " . $this->device_id . "\n"); |
|
546 | + $this->loggerInstance->debug(4, "Device_id = ".$this->device_id."\n"); |
|
547 | 547 | $fcontents = "!define W8\n"; |
548 | 548 | if ($this->device_id == 'w10') { |
549 | 549 | $fcontents .= "!define W10\n"; |
@@ -573,8 +573,8 @@ discard block |
||
573 | 573 | if ($eap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
574 | 574 | $fcontents .= "!define SILVERBULLET\n"; |
575 | 575 | } |
576 | - $fcontents .= '!define ' . $eapStr; |
|
577 | - $fcontents .= "\n" . '!define EXECLEVEL "' . $execLevel . '"'; |
|
576 | + $fcontents .= '!define '.$eapStr; |
|
577 | + $fcontents .= "\n".'!define EXECLEVEL "'.$execLevel.'"'; |
|
578 | 578 | $fcontents .= $this->writeNsisDefines($attr); |
579 | 579 | file_put_contents('main.nsh', $fcontents); |
580 | 580 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * <base_url>/copyright.php after deploying the software |
20 | 20 | */ |
21 | 21 | |
22 | -require_once dirname(dirname(__DIR__)) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(__DIR__))."/config/_config.php"; |
|
23 | 23 | |
24 | 24 | $loggerInstance = new \core\common\Logging(); |
25 | 25 | |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | $testsuite = new \core\diag\RADIUSTests($check_realm, $testedProfile->getRealmCheckOuterUsername(), $testedProfile->getEapMethodsinOrderOfPreference(1), $testedProfile->getCollapsedAttributes()['eap:server_name'], $testedProfile->getCollapsedAttributes()["eap:ca_file"]); |
66 | 66 | $rfc7585suite = new \core\diag\RFC7585Tests($check_realm); |
67 | 67 | } else { |
68 | - $error_message = _("You asked for a realm check, but we don't know the realm for this profile!") . "</p>"; |
|
68 | + $error_message = _("You asked for a realm check, but we don't know the realm for this profile!")."</p>"; |
|
69 | 69 | } |
70 | 70 | } else { // someone else's realm, and we don't know anything about it... only shallow checks |
71 | 71 | $check_realm = $validator->realm($realm ?? $_SESSION['check_realm'] ?? ""); |
72 | 72 | if ($check_realm !== FALSE) { |
73 | 73 | $_SESSION['check_realm'] = $check_realm; |
74 | - $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm); |
|
74 | + $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm); |
|
75 | 75 | $rfc7585suite = new \core\diag\RFC7585Tests($check_realm); |
76 | 76 | } else { |
77 | 77 | $error_message = _("No valid realm name given, cannot execute any checks!"); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | var listofcas = "<?php echo _("You should update your list of accredited CAs") ?>"; |
120 | 120 | var getitfrom = "<?php echo _("Get it from here.") ?>"; |
121 | 121 | var listsource = "<?php echo CONFIG_DIAGNOSTICS['RADIUSTESTS']['accreditedCAsURL'] ?>"; |
122 | - var moretext = "<?php echo _("more") . "»" ?>"; |
|
122 | + var moretext = "<?php echo _("more")."»" ?>"; |
|
123 | 123 | var lesstext = "<?php echo "«" ?>"; |
124 | 124 | var morealltext = "<?php echo _("Show detailed information for all tests") ?>"; |
125 | 125 | var unknownca_code = "<?php echo \core\diag\RADIUSTests::CERTPROB_UNKNOWN_CA ?>"; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | } |
258 | 258 | cliinfo = cliinfo + '<li><table><tbody><tr><td class="icon_td"><img class="icon" src="' + icons[level] + '" style="width: 24px;"></td><td>' + state; |
259 | - cliinfo = cliinfo + ' <?php echo "(" . sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+' ") . ")"; ?>' + add + '</td></tr>'; |
|
259 | + cliinfo = cliinfo + ' <?php echo "(".sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+' ").")"; ?>' + add + '</td></tr>'; |
|
260 | 260 | cliinfo = cliinfo + '</tbody></table></ul></li>'; |
261 | 261 | if (data.ca[key].certificate[c].finalerror === 1) { |
262 | 262 | cliinfo = cliinfo + '<li>' + restskipped + '</li>'; |
@@ -426,8 +426,8 @@ discard block |
||
426 | 426 | <?php |
427 | 427 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) { |
428 | 428 | print " |
429 | -$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading); |
|
430 | -$(\"#live_src" . $hostindex . "_img\").show(); |
|
429 | +$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading); |
|
430 | +$(\"#live_src" . $hostindex."_img\").show(); |
|
431 | 431 | $.ajax({ |
432 | 432 | url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm, |
433 | 433 | type: 'POST', |
@@ -457,15 +457,15 @@ discard block |
||
457 | 457 | <?php |
458 | 458 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) { |
459 | 459 | if ($testedProfile !== NULL) { |
460 | - $extraarg = "profile_id: " . $testedProfile->identifier . ", "; |
|
460 | + $extraarg = "profile_id: ".$testedProfile->identifier.", "; |
|
461 | 461 | } else { |
462 | 462 | $extraarg = ""; |
463 | 463 | } |
464 | 464 | print " |
465 | -$(\"#src" . $hostindex . "_img\").attr('src',icon_loading); |
|
465 | +$(\"#src" . $hostindex."_img\").attr('src',icon_loading); |
|
466 | 466 | $(\"#src$hostindex\").html(''); |
467 | 467 | running_ajax_stat++; |
468 | -$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, udp, 'json'); |
|
468 | +$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, udp, 'json'); |
|
469 | 469 | |
470 | 470 | "; |
471 | 471 | } |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | if ($check_realm === FALSE) { |
493 | 493 | print "<p>$error_message</p>"; |
494 | 494 | } else { |
495 | - print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n"; |
|
495 | + print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n"; |
|
496 | 496 | ?> |
497 | 497 | <div id="debug_out" style="display: none"></div> |
498 | 498 | <div id="tabs" style="min-width: 600px; max-width:800px"> |
@@ -509,12 +509,12 @@ discard block |
||
509 | 509 | </legend> |
510 | 510 | <?php |
511 | 511 | // NAPTR existence check |
512 | - echo "<strong>" . _("DNS chekcs") . "</strong><div>"; |
|
512 | + echo "<strong>"._("DNS chekcs")."</strong><div>"; |
|
513 | 513 | $naptr = $rfc7585suite->relevantNAPTR(); |
514 | 514 | if ($naptr != \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) { |
515 | 515 | echo "<table>"; |
516 | 516 | // output in friendly words |
517 | - echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>"; |
|
517 | + echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>"; |
|
518 | 518 | switch ($naptr) { |
519 | 519 | case \core\diag\RFC7585Tests::RETVAL_NONAPTR: |
520 | 520 | echo _("This realm has no NAPTR records."); |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | |
530 | 530 | // compliance checks for NAPTRs |
531 | 531 | if ($naptr > 0) { |
532 | - echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>"; |
|
532 | + echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>"; |
|
533 | 533 | $naptr_valid = $rfc7585suite->relevantNAPTRcompliance(); |
534 | 534 | switch ($naptr_valid) { |
535 | 535 | case \core\diag\RADIUSTests::RETVAL_OK: |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | |
547 | 547 | if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) { |
548 | 548 | $srv = $rfc7585suite->relevantNAPTRsrvResolution(); |
549 | - echo "<tr><td>" . _("Checking SRVs:") . "</td><td>"; |
|
549 | + echo "<tr><td>"._("Checking SRVs:")."</td><td>"; |
|
550 | 550 | switch ($srv) { |
551 | 551 | case \core\diag\RADIUSTests::RETVAL_SKIPPED: |
552 | 552 | echo _("This check was skipped."); |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | // IP addresses for the hosts |
563 | 563 | if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) { |
564 | 564 | $hosts = $rfc7585suite->relevantNAPTRhostnameResolution(); |
565 | - echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>"; |
|
565 | + echo "<tr><td>"._("Checking IP address resolution:")."</td><td>"; |
|
566 | 566 | switch ($srv) { |
567 | 567 | case \core\diag\RADIUSTests::RETVAL_SKIPPED: |
568 | 568 | echo _("This check was skipped."); |
@@ -578,12 +578,12 @@ discard block |
||
578 | 578 | |
579 | 579 | echo "</table><br/><br/>"; |
580 | 580 | if (count($testsuite->listerrors()) == 0) { |
581 | - echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!"); |
|
581 | + echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!"); |
|
582 | 582 | } else { |
583 | - echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("but there were DNS errors! Check them!") . " " . _("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below."); |
|
583 | + echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("but there were DNS errors! Check them!")." "._("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below."); |
|
584 | 584 | echo "<div class='notacceptable'><table>"; |
585 | 585 | foreach ($testsuite->listerrors() as $details) { |
586 | - echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>"; |
|
586 | + echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>"; |
|
587 | 587 | } |
588 | 588 | echo "</table></div>"; |
589 | 589 | } |
@@ -599,25 +599,25 @@ discard block |
||
599 | 599 | $("#dynamic_tests").show(); |
600 | 600 | '; |
601 | 601 | foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) { |
602 | - $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port']; |
|
602 | + $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port']; |
|
603 | 603 | print " |
604 | 604 | running_ajax_dyn++; |
605 | - $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, error: eee, success: capath, dataType: 'json'}); |
|
605 | + $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, error: eee, success: capath, dataType: 'json'}); |
|
606 | 606 | running_ajax_dyn++; |
607 | - $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '" . $gui->langObject->getLang() . "', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); |
|
607 | + $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '".$gui->langObject->getLang()."', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); |
|
608 | 608 | "; |
609 | 609 | } |
610 | 610 | echo "} |
611 | 611 | </script><hr>"; |
612 | 612 | } else { |
613 | - echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>"; |
|
613 | + echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>"; |
|
614 | 614 | } |
615 | - echo "<strong>" . _("Static connectivity tests") . "</strong> |
|
615 | + echo "<strong>"._("Static connectivity tests")."</strong> |
|
616 | 616 | <table><tr> |
617 | 617 | <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_static_ico' class='icon'></td><td id='main_static_result' style='display:none'> </td> |
618 | 618 | </tr></table>"; |
619 | 619 | if ($naptr > 0) { |
620 | - echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong> |
|
620 | + echo "<hr><strong>"._("Dynamic connectivity tests")."</strong> |
|
621 | 621 | <table><tr> |
622 | 622 | <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_dynamic_ico' class='icon'></td><td id='main_dynamic_result' style='display:none'> </td> |
623 | 623 | </tr></table>"; |
@@ -637,12 +637,12 @@ discard block |
||
637 | 637 | print "<p>"; |
638 | 638 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) { |
639 | 639 | print "<hr>"; |
640 | - printf(_("Testing from: %s"), "<strong>" . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name'] . "</strong>"); |
|
640 | + printf(_("Testing from: %s"), "<strong>".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name']."</strong>"); |
|
641 | 641 | print "<table id='results$hostindex' style='width:100%' class='udp_results'> |
642 | 642 | <tr> |
643 | -<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td> |
|
643 | +<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td> |
|
644 | 644 | <td id='src$hostindex' colspan=2> |
645 | -" . _("testing...") . " |
|
645 | +"._("testing...")." |
|
646 | 646 | </td> |
647 | 647 | </tr> |
648 | 648 | </table>"; |
@@ -661,21 +661,21 @@ discard block |
||
661 | 661 | |
662 | 662 | <?php |
663 | 663 | echo "<div id='dynamic_tests'><fieldset class='option_container'> |
664 | - <legend><strong>" . _("DYNAMIC connectivity tests") . "</strong></legend>"; |
|
664 | + <legend><strong>" . _("DYNAMIC connectivity tests")."</strong></legend>"; |
|
665 | 665 | |
666 | 666 | $resultstoprint = []; |
667 | 667 | if (count($rfc7585suite->NAPTR_hostname_records) > 0) { |
668 | - $resultstoprint[] = '<table style="align:right; display: none;" id="dynamic_result_fail">' . _("Some errors were found during the tests, see below") . '</table><table style="align:right; display: none;" id="dynamic_result_pass">' . _("All tests passed, congratulations!") . '</table>'; |
|
669 | - $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>"; |
|
668 | + $resultstoprint[] = '<table style="align:right; display: none;" id="dynamic_result_fail">'._("Some errors were found during the tests, see below").'</table><table style="align:right; display: none;" id="dynamic_result_pass">'._("All tests passed, congratulations!").'</table>'; |
|
669 | + $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>"; |
|
670 | 670 | foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) { |
671 | - $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]); |
|
672 | - $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong>'; |
|
671 | + $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]); |
|
672 | + $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong>'; |
|
673 | 673 | $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>'; |
674 | 674 | $resultstoprint[] = "<table id='caresults$hostindex' style='width:100%'> |
675 | 675 | <tr> |
676 | -<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca" . $hostindex . "_img'></td> |
|
676 | +<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca".$hostindex."_img'></td> |
|
677 | 677 | <td id='srcca$hostindex'> |
678 | -" . _("testing...") . " |
|
678 | +"._("testing...")." |
|
679 | 679 | </td> |
680 | 680 | </tr> |
681 | 681 | </table>"; |
@@ -683,12 +683,12 @@ discard block |
||
683 | 683 | } |
684 | 684 | $clientstest = []; |
685 | 685 | foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) { |
686 | - $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>'; |
|
686 | + $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>'; |
|
687 | 687 | $clientstest[] = "<span id='clientresults$hostindex$clinx'><table style='width:100%'> |
688 | 688 | <tr> |
689 | -<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient" . $hostindex . "_img'></td> |
|
689 | +<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient".$hostindex."_img'></td> |
|
690 | 690 | <td id='srcclient$hostindex'> |
691 | -" . _("testing...") . " |
|
691 | +"._("testing...")." |
|
692 | 692 | </td> |
693 | 693 | </tr> |
694 | 694 | </table></span>"; |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | } |
697 | 697 | echo '<div style="align:right;">'; |
698 | 698 | echo join('', $resultstoprint); |
699 | - echo '<span id="clientstest" style="display: none;"><p><hr><b>' . _('Checking if certificates from CAs are accepted...') . '</b><p>' . _('A few client certificates will be tested to check if servers are resistant to some certificate problems.') . '<p>'; |
|
699 | + echo '<span id="clientstest" style="display: none;"><p><hr><b>'._('Checking if certificates from CAs are accepted...').'</b><p>'._('A few client certificates will be tested to check if servers are resistant to some certificate problems.').'<p>'; |
|
700 | 700 | print join('', $clientstest); |
701 | 701 | echo '</span>'; |
702 | 702 | echo '</div>'; |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | // check if truncates/dies on Operator-Name |
711 | 711 | if ($my_profile !== NULL) { |
712 | 712 | echo "<div id='tabs-4'><fieldset class='option_container'> |
713 | - <legend><strong>" . _("Live login test") . "</strong></legend>"; |
|
713 | + <legend><strong>" . _("Live login test")."</strong></legend>"; |
|
714 | 714 | $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1); |
715 | 715 | if (count($prof_compl) > 0) { |
716 | 716 | $passwordReqired = FALSE; |
@@ -723,34 +723,34 @@ discard block |
||
723 | 723 | $clientCertRequired = TRUE; |
724 | 724 | } |
725 | 725 | } |
726 | - echo "<div id='disposable_credential_container'><p>" . _("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.") . "</p> |
|
727 | - <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.") . "</p> |
|
728 | - <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!") . "</p></div> |
|
726 | + echo "<div id='disposable_credential_container'><p>"._("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.")."</p> |
|
727 | + <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.")."</p> |
|
728 | + <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!")."</p></div> |
|
729 | 729 | <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'> |
730 | 730 | <input type='hidden' name='test_type' value='udp_login'> |
731 | - <input type='hidden' name='lang' value='" . $gui->langObject->getLang() . "'> |
|
732 | - <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'> |
|
731 | + <input type='hidden' name='lang' value='" . $gui->langObject->getLang()."'> |
|
732 | + <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'> |
|
733 | 733 | <table id='live_tests'>"; |
734 | 734 | // if any password based EAP methods are available enable this section |
735 | 735 | if ($passwordReqired) { |
736 | - echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr> |
|
737 | - <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>"; |
|
738 | - echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>"; |
|
739 | - echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>"; |
|
736 | + echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr> |
|
737 | + <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>"; |
|
738 | + echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>"; |
|
739 | + echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>"; |
|
740 | 740 | } |
741 | 741 | // ask for cert + privkey if TLS-based method is active |
742 | 742 | if ($clientCertRequired) { |
743 | - echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr> |
|
744 | - <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr> |
|
745 | - <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr> |
|
746 | - <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>"; |
|
743 | + echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr> |
|
744 | + <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr> |
|
745 | + <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr> |
|
746 | + <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>"; |
|
747 | 747 | } |
748 | - echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>"; |
|
748 | + echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>"; |
|
749 | 749 | echo "<div id='live_login_results' style='display:none'>"; |
750 | 750 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'] as $hostindex => $host) { |
751 | 751 | print "<hr>"; |
752 | - printf(_("Testing from: %s"), "<strong>" . CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name'] . "</strong>"); |
|
753 | - print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src" . $hostindex . "_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>"; |
|
752 | + printf(_("Testing from: %s"), "<strong>".CONFIG_DIAGNOSTICS['RADIUSTESTS']['UDP-hosts'][$hostindex]['display_name']."</strong>"); |
|
753 | + print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src".$hostindex."_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>"; |
|
754 | 754 | print "<div id='eap_test$hostindex' class='eap_test_results'></div>"; |
755 | 755 | } |
756 | 756 | echo "</div>"; |
@@ -765,9 +765,9 @@ discard block |
||
765 | 765 | } |
766 | 766 | |
767 | 767 | if (isset($_POST['comefrom'])) { |
768 | - $return = htmlspecialchars_decode($_POST['comefrom']) . "?inst_id=" . $my_inst->identifier; |
|
768 | + $return = htmlspecialchars_decode($_POST['comefrom'])."?inst_id=".$my_inst->identifier; |
|
769 | 769 | echo "<form method='post' action='$return' accept-charset='UTF-8'> |
770 | - <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst) . "</button>" |
|
770 | + <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst)."</button>" |
|
771 | 771 | . "</form>"; |
772 | 772 | } |
773 | 773 | if ($check_realm !== FALSE) { |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | use GeoIp2\Database\Reader; |
50 | 50 | use \Exception; |
51 | 51 | |
52 | -require_once dirname(dirname(__FILE__)) . "/config/_config.php"; |
|
53 | -require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/PHPMailer.php"; |
|
54 | -require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/SMTP.php"; |
|
52 | +require_once dirname(dirname(__FILE__))."/config/_config.php"; |
|
53 | +require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/PHPMailer.php"; |
|
54 | +require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/SMTP.php"; |
|
55 | 55 | |
56 | 56 | class SanityTests extends CAT |
57 | 57 | { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $this->test_result = []; |
94 | 94 | $this->test_result['global'] = 0; |
95 | 95 | // parse the schema file to find out the number of expected rows... |
96 | - $schema = file(dirname(dirname(__FILE__)) . "/schema/schema.sql"); |
|
96 | + $schema = file(dirname(dirname(__FILE__))."/schema/schema.sql"); |
|
97 | 97 | $this->profile_option_ct = 0; |
98 | 98 | $passedTheWindmill = FALSE; |
99 | 99 | foreach ($schema as $schemaLine) { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | $this->out[$test] = []; |
122 | 122 | $this->name = $test; |
123 | - $m_name = $test . '_test'; |
|
123 | + $m_name = $test.'_test'; |
|
124 | 124 | $this->test_result[$test] = 0; |
125 | 125 | if (!method_exists($this, $m_name)) { |
126 | 126 | $this->testReturn(\core\common\Entity::L_ERROR, "Configuration error, no test configured for <strong>$test</strong>."); |
@@ -229,9 +229,9 @@ discard block |
||
229 | 229 | private function php_test() |
230 | 230 | { |
231 | 231 | if (version_compare(phpversion(), $this->php_needversion, '>=')) { |
232 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . "."); |
|
232 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion()."."); |
|
233 | 233 | } else { |
234 | - $this->testReturn(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->php_needversion, but you only have " . phpversion() . "."); |
|
234 | + $this->testReturn(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->php_needversion, but you only have ".phpversion()."."); |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $this->testReturn(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly"); |
249 | 249 | } else { |
250 | 250 | $rootFromScript = $m[1] === '' ? '/' : $m[1]; |
251 | - $this->testReturn(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>" . CONFIG['PATHS']['cat_base_url'] . "</strong> and should be <strong>$rootFromScript</strong>"); |
|
251 | + $this->testReturn(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>".CONFIG['PATHS']['cat_base_url']."</strong> and should be <strong>$rootFromScript</strong>"); |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | |
@@ -266,9 +266,9 @@ discard block |
||
266 | 266 | $SSPconfig = \SimpleSAML\Configuration::getInstance(); |
267 | 267 | $sspVersion = explode('.', $SSPconfig->getVersion()); |
268 | 268 | if ((int) $sspVersion[0] >= $this->ssp_needversion['major'] && (int) $sspVersion[1] >= $this->ssp_needversion['minor']) { |
269 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion)); |
|
269 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion)); |
|
270 | 270 | } else { |
271 | - $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->ssp_needversion)); |
|
271 | + $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->ssp_needversion)); |
|
272 | 272 | } |
273 | 273 | } |
274 | 274 | } |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | */ |
330 | 330 | private function logdir_test() |
331 | 331 | { |
332 | - if (fopen(CONFIG['PATHS']['logdir'] . "/debug.log", "a") == FALSE) { |
|
333 | - $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>" . CONFIG['PATHS']['logdir'] . "</strong> are not writable!"); |
|
332 | + if (fopen(CONFIG['PATHS']['logdir']."/debug.log", "a") == FALSE) { |
|
333 | + $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>".CONFIG['PATHS']['logdir']."</strong> are not writable!"); |
|
334 | 334 | } else { |
335 | 335 | $this->testReturn(\core\common\Entity::L_OK, "Log directory is writable."); |
336 | 336 | } |
@@ -367,10 +367,10 @@ discard block |
||
367 | 367 | } else { |
368 | 368 | $classname = 'Imagick'; |
369 | 369 | } |
370 | - if (class_exists('\\' . $classname)) { |
|
370 | + if (class_exists('\\'.$classname)) { |
|
371 | 371 | $this->testReturn(\core\common\Entity::L_OK, "PHP extension <strong>$classname</strong> is installed."); |
372 | 372 | } else { |
373 | - $this->testReturn(\core\common\Entity::L_ERROR, "PHP extension <strong>$classname</strong> not found! Get it from your distribution or <a href='http://pecl.php.net/get/" . strtolower($classname) . "'>here</a>."); |
|
373 | + $this->testReturn(\core\common\Entity::L_ERROR, "PHP extension <strong>$classname</strong> not found! Get it from your distribution or <a href='http://pecl.php.net/get/".strtolower($classname)."'>here</a>."); |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | if (function_exists('ImageCreate')) { |
@@ -468,15 +468,15 @@ discard block |
||
468 | 468 | } |
469 | 469 | $output = []; |
470 | 470 | $retval = -100; |
471 | - $t = exec($A['exec'] . ' version', $output, $retval); |
|
471 | + $t = exec($A['exec'].' version', $output, $retval); |
|
472 | 472 | if ($retval != 0 || count($output) != 1) { |
473 | 473 | $this->testReturn(\core\common\Entity::L_ERROR, "<strong>openssl</strong> was not found on your system despite being configured!"); |
474 | 474 | return; |
475 | 475 | } |
476 | 476 | if ($A['exec_is'] == "EXPLICIT") { |
477 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>" . $output[0] . "</strong> was found and is configured explicitly in your config."); |
|
477 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>".$output[0]."</strong> was found and is configured explicitly in your config."); |
|
478 | 478 | } else { |
479 | - $this->testReturn(\core\common\Entity::L_WARN, "<strong>" . $output[0] . "</strong> was found, but is not configured with an absolute path in your config."); |
|
479 | + $this->testReturn(\core\common\Entity::L_WARN, "<strong>".$output[0]."</strong> was found, but is not configured with an absolute path in your config."); |
|
480 | 480 | } |
481 | 481 | } |
482 | 482 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | } |
503 | 503 | $output = []; |
504 | 504 | $retval = -100; |
505 | - $t = exec($A['exec'] . ' -VERSION', $output, $retval); |
|
505 | + $t = exec($A['exec'].' -VERSION', $output, $retval); |
|
506 | 506 | if ($retval != 0 || count($output) != 1) { |
507 | 507 | $this->testReturn(\core\common\Entity::L_ERROR, "<strong>makensis</strong> was not found on your system despite being configured!"); |
508 | 508 | return; |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | $this->testReturn(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config."); |
514 | 514 | } |
515 | 515 | $outputArray = []; |
516 | - exec($A['exec'] . ' -HELP', $outputArray); |
|
516 | + exec($A['exec'].' -HELP', $outputArray); |
|
517 | 517 | $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray)); |
518 | 518 | if ($t1 == 1 && CONFIG_CONFASSISTANT['NSIS_VERSION'] == 2) { |
519 | 519 | $this->testReturn(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!"); |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | $NSIS_Module_status = []; |
541 | 541 | foreach ($this->NSIS_Modules as $module) { |
542 | 542 | unset($out); |
543 | - exec(CONFIG_CONFASSISTANT['PATHS']['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
543 | + exec(CONFIG_CONFASSISTANT['PATHS']['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
544 | 544 | if ($retval > 0) { |
545 | 545 | $NSIS_Module_status[$module] = 0; |
546 | 546 | } else { |
@@ -605,8 +605,8 @@ discard block |
||
605 | 605 | $locales = shell_exec("locale -a"); |
606 | 606 | $allthere = ""; |
607 | 607 | foreach (CONFIG['LANGUAGES'] as $onelanguage) { |
608 | - if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) { |
|
609 | - $allthere .= $onelanguage['locale'] . " "; |
|
608 | + if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) { |
|
609 | + $allthere .= $onelanguage['locale']." "; |
|
610 | 610 | } |
611 | 611 | } |
612 | 612 | if ($allthere == "") { |
@@ -620,47 +620,47 @@ discard block |
||
620 | 620 | ["SETTING" => CONFIG['APPEARANCE']['from-mail'], |
621 | 621 | "DEFVALUE" => "[email protected]", |
622 | 622 | "COMPLAINTSTRING" => "APPEARANCE/from-mail ", |
623 | - "REQUIRED" => FALSE,], |
|
623 | + "REQUIRED" => FALSE, ], |
|
624 | 624 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['url'], |
625 | 625 | "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!", |
626 | 626 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ", |
627 | - "REQUIRED" => FALSE,], |
|
627 | + "REQUIRED" => FALSE, ], |
|
628 | 628 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['display'], |
629 | 629 | "DEFVALUE" => "[email protected]", |
630 | 630 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ", |
631 | - "REQUIRED" => FALSE,], |
|
631 | + "REQUIRED" => FALSE, ], |
|
632 | 632 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['developer-mail'], |
633 | 633 | "DEFVALUE" => "[email protected]", |
634 | 634 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ", |
635 | - "REQUIRED" => FALSE,], |
|
635 | + "REQUIRED" => FALSE, ], |
|
636 | 636 | ["SETTING" => CONFIG['APPEARANCE']['abuse-mail'], |
637 | 637 | "DEFVALUE" => "[email protected]", |
638 | 638 | "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ", |
639 | - "REQUIRED" => FALSE,], |
|
639 | + "REQUIRED" => FALSE, ], |
|
640 | 640 | ["SETTING" => CONFIG['APPEARANCE']['MOTD'], |
641 | 641 | "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!", |
642 | 642 | "COMPLAINTSTRING" => "APPEARANCE/MOTD ", |
643 | - "REQUIRED" => FALSE,], |
|
643 | + "REQUIRED" => FALSE, ], |
|
644 | 644 | ["SETTING" => CONFIG['APPEARANCE']['webcert_CRLDP'], |
645 | 645 | "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'], |
646 | 646 | "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ", |
647 | - "REQUIRED" => TRUE,], |
|
647 | + "REQUIRED" => TRUE, ], |
|
648 | 648 | ["SETTING" => CONFIG['APPEARANCE']['webcert_OCSP'], |
649 | 649 | "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'], |
650 | 650 | "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ", |
651 | - "REQUIRED" => TRUE,], |
|
651 | + "REQUIRED" => TRUE, ], |
|
652 | 652 | ["SETTING" => CONFIG['DB']['INST']['host'], |
653 | 653 | "DEFVALUE" => "db.host.example", |
654 | 654 | "COMPLAINTSTRING" => "DB/INST ", |
655 | - "REQUIRED" => TRUE,], |
|
655 | + "REQUIRED" => TRUE, ], |
|
656 | 656 | ["SETTING" => CONFIG['DB']['INST']['host'], |
657 | 657 | "DEFVALUE" => "db.host.example", |
658 | 658 | "COMPLAINTSTRING" => "DB/USER ", |
659 | - "REQUIRED" => TRUE,], |
|
659 | + "REQUIRED" => TRUE, ], |
|
660 | 660 | ["SETTING" => CONFIG['DB']['EXTERNAL']['host'], |
661 | 661 | "DEFVALUE" => "customerdb.otherhost.example", |
662 | 662 | "COMPLAINTSTRING" => "DB/EXTERNAL ", |
663 | - "REQUIRED" => FALSE,], |
|
663 | + "REQUIRED" => FALSE, ], |
|
664 | 664 | ]; |
665 | 665 | |
666 | 666 | /** |
@@ -688,11 +688,11 @@ discard block |
||
688 | 688 | if (isset(CONFIG_DIAGNOSTICS['RADIUSTESTS']['TLS-clientcerts'])) { |
689 | 689 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['TLS-clientcerts'] as $cadata) { |
690 | 690 | foreach ($cadata['certificates'] as $cert_files) { |
691 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) { |
|
692 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " "; |
|
691 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) { |
|
692 | + $defaultvalues .= "CERTIFICATE/".$cert_files['public']." "; |
|
693 | 693 | } |
694 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) { |
|
695 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " "; |
|
694 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) { |
|
695 | + $defaultvalues .= "CERTIFICATE/".$cert_files['private']." "; |
|
696 | 696 | } |
697 | 697 | } |
698 | 698 | } |
@@ -785,14 +785,14 @@ discard block |
||
785 | 785 | if ($global_no_cache) { |
786 | 786 | foreach ($Devs as $dev => $D) { |
787 | 787 | if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) { |
788 | - $no_cache_dev .= $dev . " "; |
|
788 | + $no_cache_dev .= $dev." "; |
|
789 | 789 | $no_cache_dev_count++; |
790 | 790 | } |
791 | 791 | } |
792 | 792 | } else { |
793 | 793 | foreach ($Devs as $dev => $D) { |
794 | 794 | if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) { |
795 | - $no_cache_dev .= $dev . " "; |
|
795 | + $no_cache_dev .= $dev." "; |
|
796 | 796 | $no_cache_dev_count++; |
797 | 797 | } |
798 | 798 | } |
@@ -831,13 +831,13 @@ discard block |
||
831 | 831 | $mail->isHTML(FALSE); |
832 | 832 | $mail->CharSet = 'UTF-8'; |
833 | 833 | $mail->From = CONFIG['APPEARANCE']['from-mail']; |
834 | - $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Invitation System"; |
|
834 | + $mail->FromName = CONFIG['APPEARANCE']['productname']." Invitation System"; |
|
835 | 835 | $mail->addAddress(CONFIG['APPEARANCE']['abuse-mail']); |
836 | 836 | $mail->Subject = "testing CAT configuration mail"; |
837 | 837 | $mail->Body = "Testing CAT mailing\n"; |
838 | 838 | $sent = $mail->send(); |
839 | 839 | if ($sent) { |
840 | - $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check " . CONFIG['APPEARANCE']['abuse-mail'] . " mailbox if the message was receiced."); |
|
840 | + $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check ".CONFIG['APPEARANCE']['abuse-mail']." mailbox if the message was receiced."); |
|
841 | 841 | } else { |
842 | 842 | $this->testReturn(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS"); |
843 | 843 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function __construct() { |
96 | 96 | $this->loggerInstance = new Logging(); |
97 | - $this->loggerInstance->debug(3, "--- BEGIN constructing class " . get_class($this) . " .\n"); |
|
97 | + $this->loggerInstance->debug(3, "--- BEGIN constructing class ".get_class($this)." .\n"); |
|
98 | 98 | $this->languageInstance = new Language(); |
99 | 99 | Entity::intoThePotatoes("core"); |
100 | 100 | // some config elements are displayable. We need some dummies to |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $dummy_inst2 = _("organisation"); |
107 | 107 | $dummy_inst3 = _("Identity Provider"); |
108 | 108 | // and do something useless with the strings so that there's no "unused" complaint |
109 | - if (strlen($dummy_NRO . $dummy_inst1 . $dummy_inst2 . $dummy_inst3) < 0) { |
|
109 | + if (strlen($dummy_NRO.$dummy_inst1.$dummy_inst2.$dummy_inst3) < 0) { |
|
110 | 110 | throw new \Exception("Strings are usually not shorter than 0 characters. We've encountered a string blackhole."); |
111 | 111 | } |
112 | 112 | Entity::$nomenclature_fed = _(CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * Logs the end of lifetime of the entity to the debug log on level 5. |
122 | 122 | */ |
123 | 123 | public function __destruct() { |
124 | - (new Logging())->debug(5, "--- KILL Destructing class " . get_class($this) . " .\n"); |
|
124 | + (new Logging())->debug(5, "--- KILL Destructing class ".get_class($this)." .\n"); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function createTemporaryDirectory($purpose = 'installer', $failIsFatal = 1) { |
153 | 153 | $loggerInstance = new Logging(); |
154 | - $name = md5(time() . rand()); |
|
154 | + $name = md5(time().rand()); |
|
155 | 155 | $path = ROOT; |
156 | 156 | switch ($purpose) { |
157 | 157 | case 'silverbullet': |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | default: |
170 | 170 | throw new Exception("unable to create temporary directory due to unknown purpose: $purpose\n"); |
171 | 171 | } |
172 | - $tmpDir = $path . '/' . $name; |
|
172 | + $tmpDir = $path.'/'.$name; |
|
173 | 173 | $loggerInstance->debug(4, "temp dir: $purpose : $tmpDir\n"); |
174 | 174 | if (!mkdir($tmpDir, 0700, true)) { |
175 | 175 | if ($failIsFatal) { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | * @return void |
190 | 190 | */ |
191 | 191 | public static function rrmdir($dir) { |
192 | - foreach (glob($dir . '/*') as $file) { |
|
192 | + foreach (glob($dir.'/*') as $file) { |
|
193 | 193 | if (is_dir($file)) { |
194 | 194 | Entity::rrmdir($file); |
195 | 195 | } else { |
@@ -214,12 +214,12 @@ discard block |
||
214 | 214 | } |
215 | 215 | // these substr() are guaranteed to yield actual string data, as the |
216 | 216 | // base string is an MD5 hash - has sufficient length |
217 | - $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8) . '-'; |
|
218 | - $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4) . '-'; |
|
219 | - $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4) . '-'; |
|
220 | - $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4) . '-'; |
|
217 | + $uuid = /** @scrutinizer ignore-type */ substr($chars, 0, 8).'-'; |
|
218 | + $uuid .= /** @scrutinizer ignore-type */ substr($chars, 8, 4).'-'; |
|
219 | + $uuid .= /** @scrutinizer ignore-type */ substr($chars, 12, 4).'-'; |
|
220 | + $uuid .= /** @scrutinizer ignore-type */ substr($chars, 16, 4).'-'; |
|
221 | 221 | $uuid .= /** @scrutinizer ignore-type */ substr($chars, 20, 12); |
222 | - return $prefix . $uuid; |
|
222 | + return $prefix.$uuid; |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | for ($i = count($trace); $i--; $i > 0) { |
259 | 259 | if (isset($trace[$i - 1]['class']) && preg_match('/Entity/', $trace[$i - 1]['class'])) { |
260 | 260 | if ($showTrace) { |
261 | - echo "FOUND caller: ".print_r($trace[$i],true). " - class is ".$trace[$i]['class']; |
|
261 | + echo "FOUND caller: ".print_r($trace[$i], true)." - class is ".$trace[$i]['class']; |
|
262 | 262 | } |
263 | 263 | $caller = $trace[$i]; |
264 | 264 | break; |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | $myName = $caller['class'] ?? substr($caller['file'], strlen(ROOT)); |
270 | 270 | if ($showTrace === TRUE) { |
271 | 271 | echo "<pre>".print_r($trace, true)."</pre>"; |
272 | - echo "CLASS = " . $myName ."<br/>"; |
|
272 | + echo "CLASS = ".$myName."<br/>"; |
|
273 | 273 | } |
274 | 274 | if (preg_match("/diag/", $myName) == 1) { |
275 | 275 | $ret = "diagnostics"; |
@@ -302,10 +302,10 @@ discard block |
||
302 | 302 | if ($catalogue === NULL) { |
303 | 303 | $theCatalogue = Entity::determineOwnCatalogue($trace); |
304 | 304 | textdomain($theCatalogue); |
305 | - bindtextdomain($theCatalogue, ROOT . "/translation/"); |
|
305 | + bindtextdomain($theCatalogue, ROOT."/translation/"); |
|
306 | 306 | } else { |
307 | 307 | textdomain($catalogue); |
308 | - bindtextdomain($catalogue, ROOT . "/translation/"); |
|
308 | + bindtextdomain($catalogue, ROOT."/translation/"); |
|
309 | 309 | } |
310 | 310 | } |
311 | 311 |