Passed
Push — master ( bc7ecd...4efa95 )
by Stefan
07:48
created
web/skins/modern/diag/diag.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  */
28 28
 function my_nonce($optSalt = '') {
29 29
     $remote = filter_input(INPUT_SERVER, 'REMOTE_ADDR');
30
-    return hash_hmac('sha256', session_id() . $optSalt, date("YmdG") . '1qaz2wsx3edc!QAZ@WSX#EDC' . $remote);
30
+    return hash_hmac('sha256', session_id().$optSalt, date("YmdG").'1qaz2wsx3edc!QAZ@WSX#EDC'.$remote);
31 31
 }
32 32
 error_reporting(E_ALL | E_STRICT);
33 33
 $Gui->defaultPagePrelude();
@@ -51,16 +51,16 @@  discard block
 block discarded – undo
51 51
 <?php
52 52
 $admin = filter_input(INPUT_GET, 'admin', FILTER_VALIDATE_INT);
53 53
 $profile_list_size = 1;
54
-require_once dirname(__DIR__) . '/Divs.php';
54
+require_once dirname(__DIR__).'/Divs.php';
55 55
 $divs = new \web\skins\modern\Divs($Gui);
56 56
 $visibility = 'index';
57 57
 $operatingSystem = $Gui->detectOS();
58 58
 $Gui->loggerInstance->debug(4, $operatingSystem);
59 59
 $uiElements = new web\lib\admin\UIElements();
60 60
 if ($operatingSystem) {
61
-    print "recognisedOS = '" . $operatingSystem['device'] . "';\n";
61
+    print "recognisedOS = '".$operatingSystem['device']."';\n";
62 62
 }
63
-require dirname(__DIR__) . '/user/js/cat_js.php';
63
+require dirname(__DIR__).'/user/js/cat_js.php';
64 64
 ?>
65 65
 
66 66
 </script>
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
             <?php echo $divs->div_pagetitle(_("Diagnostics site"), ""); ?>
94 94
             <div id="user_info" style='padding-top: 10px;'>
95 95
             <div id='diagnostic_choice'>
96
-                <?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") . ' '; ?>
97
-                <input type='radio' name='diagnostic_usertype' value='0'><?php echo _("end-user") . ' ' . _("or"); ?>   
98
-                <input type='radio' name='diagnostic_usertype' value='1' <?php if ($admin == 1) { echo " checked"; } ?> > <?php echo _("eduroam administrator") .'?'; ?>
96
+                <?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").' '; ?>
97
+                <input type='radio' name='diagnostic_usertype' value='0'><?php echo _("end-user").' '._("or"); ?>   
98
+                <input type='radio' name='diagnostic_usertype' value='1' <?php if ($admin == 1) { echo " checked"; } ?> > <?php echo _("eduroam administrator").'?'; ?>
99 99
             </div>
100 100
             <div id='diagnostic_enduser' style='display: none;'>
101 101
                 <h2><?php echo _("Tools for End Users"); ?></h2>
@@ -105,24 +105,24 @@  discard block
 block discarded – undo
105 105
                 ?>
106 106
                 </p>
107 107
                 <?php
108
-                    echo '<div id="before_stage_1"><h3>' . _("The system needs some information on your home institution - issuer of your account") . '</h3>';
108
+                    echo '<div id="before_stage_1"><h3>'._("The system needs some information on your home institution - issuer of your account").'</h3>';
109 109
                     echo _("What is the realm part of your user account (the part behind the @ of 'your.username@<b>realm.tld</b>):");
110 110
                 ?>
111 111
                 <input type='text' name='user_realm' id='user_realm' value=''>
112 112
                 <?php
113
-                    echo '<div id="realm_by_select"><br/>' . _("alternatively") . '<br/>';
114
-                    echo _("You can select your home institution from the following list") . '<br/>';
113
+                    echo '<div id="realm_by_select"><br/>'._("alternatively").'<br/>';
114
+                    echo _("You can select your home institution from the following list").'<br/>';
115 115
                     echo '<div id="select_idp_country"><a href="" id="idp_countries_list">';    
116
-                    echo '<span id="realmselect">' . _("Click to select your country/region and organisation") . '</span></a></div>';
116
+                    echo '<span id="realmselect">'._("Click to select your country/region and organisation").'</span></a></div>';
117 117
                 ?>
118 118
                 <div id="select_idp_area" style="display:none;">
119 119
                 </div>
120 120
                 </div>
121 121
                 <div id="position_info">
122 122
                     <?php
123
-                        echo '<h3>' . _("Optionally, to improve tests, you can provide information on your current location") . '</h3>';
123
+                        echo '<h3>'._("Optionally, to improve tests, you can provide information on your current location").'</h3>';
124 124
                         echo '<div id="select_sp_country"><a href="" id="sp_countries_list">';    
125
-                        echo '<span id="spselect">' . _("Click to select a location in which you have an eduroam problem") . '</span></a></div>';
125
+                        echo '<span id="spselect">'._("Click to select a location in which you have an eduroam problem").'</span></a></div>';
126 126
                     ?>
127 127
                     <div id="select_sp_area" style="display:none;">
128 128
                     </div>
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
                             echo 'none';
158 158
                         }
159 159
                         echo ";'>";
160
-                        echo '<h3>' . _("Which problem are you reporting?") . '</h3>';
160
+                        echo '<h3>'._("Which problem are you reporting?").'</h3>';
161 161
                         echo '<input type="radio" name="problem_type" value="1">';
162
-                        echo _("SP contacting IdP due to technical problems or abuse") . '<br>';
162
+                        echo _("SP contacting IdP due to technical problems or abuse").'<br>';
163 163
                         echo '<input type="radio" name="problem_type" value="2">';
164 164
                         echo _("IdP contacting SP due to technical problems");
165 165
                         echo "<div id='idp_contact_area'></div>";
@@ -168,9 +168,9 @@  discard block
 block discarded – undo
168 168
                         echo "</div>"; 
169 169
                     } else {
170 170
                         echo "0\">";
171
-                        echo _("This service is for authenticated admins only.") . '<br>';
172
-                        echo "<a href=\"diag.php?admin=1\">" .
173
-                            _("eduroam® admin access is needed") . "</a>";
171
+                        echo _("This service is for authenticated admins only.").'<br>';
172
+                        echo "<a href=\"diag.php?admin=1\">".
173
+                            _("eduroam® admin access is needed")."</a>";
174 174
                     }
175 175
                 ?>
176 176
             </div> 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         if (type === 'idp' || type === 'sp') {
195 195
             shtml = '<table><tbody><tr id="row_'+type+'_country"></tr>';
196 196
             shtml = shtml + '<tr id="row_'+type+'_institution" style="visibility: collapse;">';
197
-            shtml = shtml + '<td>' + <?php echo '"' . _("Select institiution:") . '"'; ?> + '</td><td></td></tr>';
197
+            shtml = shtml + '<td>' + <?php echo '"'._("Select institiution:").'"'; ?> + '</td><td></td></tr>';
198 198
             if (type === 'idp') {
199 199
                 shtml = shtml + '<tr id="row_idp_realm"></tr>';
200 200
             }
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         var options = '';
221 221
         var selecthead = '';
222 222
         if (type1 === 'sp' || type1 === 'idp') {
223
-            selecthead = <?php echo '"<td>' . _("Select country or region:") . ' </td>"'; ?>;
223
+            selecthead = <?php echo '"<td>'._("Select country or region:").' </td>"'; ?>;
224 224
             selecthead = selecthead + '<td>\n';
225 225
         }
226 226
         var select = '<select id="' + type1 + '_country" name="' + type1 + '_country" style="margin-left:0px; width:400px;">';
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
             options = ($('#'+type2+'_country').html());
229 229
             countryAddSelect(selecthead, select + options + '</select>', type1);
230 230
         } else {
231
-            var comment = <?php echo '"<br><br>' . _("Fetching country/region list") . '..."'; ?>;
231
+            var comment = <?php echo '"<br><br>'._("Fetching country/region list").'..."'; ?>;
232 232
             inProgress(1, comment);
233 233
             $.ajax({
234 234
                 url: "findRealm.php",
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         return false;
262 262
     }
263 263
     function testSociopath(realm, answer) {
264
-        var comment = <?php echo '"' . _("Testing realm") . '..."'; ?>; 
264
+        var comment = <?php echo '"'._("Testing realm").'..."'; ?>; 
265 265
         inProgress(1, comment);
266 266
         if ($('#tested_realm').length == 0) {
267 267
             console.log('MGW, tested_realm=0')
@@ -288,9 +288,9 @@  discard block
 block discarded – undo
288 288
                                 query = '<input type="hidden" id="tested_realm" value="' + realm + '">';
289 289
                             }    
290 290
                             query = query + '<div id="current_query">'+data['TEXT']+'</div>';
291
-                            query = query + '<div><button id="answer_yes">' + <?php echo '"' . _("Yes") . '"'; ?> + '</button>';
292
-                            query = query + '<button style="margin-left:20px;" id="answer_no">' + <?php echo '"' . _("No") . '"'; ?> + '</button>';
293
-                            query = query + '<button style="margin-left:20px;" id="answer_noidea">' + <?php echo '"' . _("I don't know") . '"'; ?> + '</button></div>';
291
+                            query = query + '<div><button id="answer_yes">' + <?php echo '"'._("Yes").'"'; ?> + '</button>';
292
+                            query = query + '<button style="margin-left:20px;" id="answer_no">' + <?php echo '"'._("No").'"'; ?> + '</button>';
293
+                            query = query + '<button style="margin-left:20px;" id="answer_noidea">' + <?php echo '"'._("I don't know").'"'; ?> + '</button></div>';
294 294
                             $('#sociopath_queries').html(query);
295 295
                             $('#sociopath_query_area').show();
296 296
                         }
@@ -321,55 +321,55 @@  discard block
 block discarded – undo
321 321
        }); 
322 322
     }
323 323
     function finalVerdict(realm, verdict) {
324
-        var title = <?php echo '"' . _("Diagnostic tests results for selected realm") . '"'; ?>;
324
+        var title = <?php echo '"'._("Diagnostic tests results for selected realm").'"'; ?>;
325 325
         result = '<div class="padding">';
326 326
         result = result + '<div><h3>';
327
-        result = result + <?php echo '"' . _("The result for tested realm:") . ' "'; ?> + realm;
327
+        result = result + <?php echo '"'._("The result for tested realm:").' "'; ?> + realm;
328 328
         result = result + '</h3></p><div style="padding: 5px;"><div style="padding: 0px;">';
329
-        result = result + <?php echo '"' . _("The system identified") . '" '; ?>  + ' ';
329
+        result = result + <?php echo '"'._("The system identified").'" '; ?>  + ' ';
330 330
         result = result + Object.keys(verdict).length + ' ';
331
-        result = result + <?php echo '"' . _("suspected areas which potentially can cause a problem.") . '"'; ?> + '<br>';
332
-        result = result + <?php echo '"' . _("Next to the problem description we show a speculated probability of this event.") . '"'; ?>;
331
+        result = result + <?php echo '"'._("suspected areas which potentially can cause a problem.").'"'; ?> + '<br>';
332
+        result = result + <?php echo '"'._("Next to the problem description we show a speculated probability of this event.").'"'; ?>;
333 333
         result = result + '</div><div style="padding: 5px;"><table>';
334 334
         k = 1;
335 335
         for (key in verdict) {
336 336
             result = result + '<tr><td>' + k + '.</td>';
337 337
             k = k + 1;
338 338
             if (key === 'INFRA_DEVICE') {
339
-                result = result + '<td>' + <?php echo '"' . _("Your device configuration is broken") . '"'; ?> + '</td>';
339
+                result = result + '<td>' + <?php echo '"'._("Your device configuration is broken").'"'; ?> + '</td>';
340 340
             }
341 341
             if (key === 'INFRA_SP_80211') {
342
-                result = result + '<td>' + <?php echo '"' . _("The Wi-Fi network in your vicinity has quality issues") . '"'; ?> + '</td>';
342
+                result = result + '<td>' + <?php echo '"'._("The Wi-Fi network in your vicinity has quality issues").'"'; ?> + '</td>';
343 343
             }
344 344
             if (key === 'INFRA_SP_LAN') {
345
-                result = result + '<td>' + <?php echo '"' . _("The network environment around you is broken") . '"'; ?> + '</td>';
345
+                result = result + '<td>' + <?php echo '"'._("The network environment around you is broken").'"'; ?> + '</td>';
346 346
             }
347 347
             if (key === 'INFRA_SP_RADIUS') {
348
-                result = result + '<td>' + <?php echo '"' . _("The RADIUS server of your service provider is the source of the problem") . '"'; ?> + '</td>';
348
+                result = result + '<td>' + <?php echo '"'._("The RADIUS server of your service provider is the source of the problem").'"'; ?> + '</td>';
349 349
             }
350 350
             if (key === 'INFRA_IDP_AUTHBACKEND') {
351
-                result = result + '<td>' + <?php echo '"' . _("The RADIUS server in your home institution is currently unable to authenticate you") . '"'; ?> + '</td>';
351
+                result = result + '<td>' + <?php echo '"'._("The RADIUS server in your home institution is currently unable to authenticate you").'"'; ?> + '</td>';
352 352
             }
353 353
             if (key === 'INFRA_NRO_SP') {
354
-                result = result + '<td>' + <?php echo '"' . _("The national server in the country/region you are visiting is not functioning correctly") . '"'; ?> + '</td>';
354
+                result = result + '<td>' + <?php echo '"'._("The national server in the country/region you are visiting is not functioning correctly").'"'; ?> + '</td>';
355 355
             }
356 356
             if (key === 'INFRA_LINK_ETLR_NRO_SP') {
357
-                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>';
357
+                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>';
358 358
             }
359 359
             if (key === 'INFRA_LINK_ETLR_NRO_IdP') {
360
-                result = result + '<td>' + <?php echo '"' . _("The link between the national server of your home country/region and the top-level server is broken") . '"'; ?> + '</td>';
360
+                result = result + '<td>' + <?php echo '"'._("The link between the national server of your home country/region and the top-level server is broken").'"'; ?> + '</td>';
361 361
             }
362 362
             if (key === 'INFRA_ETLR') {
363
-                result = result + '<td>' + <?php echo '"' . _("The communication to the top-level server is down") . '"'; ?> + '</td>';
363
+                result = result + '<td>' + <?php echo '"'._("The communication to the top-level server is down").'"'; ?> + '</td>';
364 364
             }
365 365
             if (key === 'INFRA_NRO_IdP') {
366
-                result = result + '<td>' + <?php echo '"' . _("The national server in your home country/region is not functioning properly.") . '"'; ?> + '</td>';
366
+                result = result + '<td>' + <?php echo '"'._("The national server in your home country/region is not functioning properly.").'"'; ?> + '</td>';
367 367
             }
368 368
             if (key === 'INFRA_IdP_RADIUS') {
369
-                result = result + '<td>' + <?php echo '"' . _("The RADIUS server of your home institution is the source of the problem") . '"'; ?> + '</td>';
369
+                result = result + '<td>' + <?php echo '"'._("The RADIUS server of your home institution is the source of the problem").'"'; ?> + '</td>';
370 370
             }
371 371
             if (key === 'INFRA_NONEXISTENTREALM') {
372
-                result = result + '<td>' + <?php echo '"' . _("This realm does not exist") . '"'; ?> + '</td>';
372
+                result = result + '<td>' + <?php echo '"'._("This realm does not exist").'"'; ?> + '</td>';
373 373
             }
374 374
             result = result + '<td style="padding-left: 5px;">' + (verdict[key] * 100).toFixed(2) + "%</td></tr>";
375 375
         }
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
         return false;
476 476
     });
477 477
     $(document).on('change', '#idp_country, #sp_country, #asp_country' , function() {
478
-        var comment = <?php echo '"' . _("Fetching institutions list") . '..."'; ?>;  
478
+        var comment = <?php echo '"'._("Fetching institutions list").'..."'; ?>;  
479 479
         var id = $(this).attr('id');
480 480
         var k = id.indexOf('_');
481 481
         var type = id.substr(0,k);
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
                         var shtml = '';
494 494
                         var select = '';
495 495
                         if (type !== 'asp') {
496
-                            shtml = <?php echo '"<td>' . _("Select institution:") . '</td><td>"'; ?>;
496
+                            shtml = <?php echo '"<td>'._("Select institution:").'</td><td>"'; ?>;
497 497
                         }
498 498
                         select = '<select id="' + type + '_inst" name="' + type + '_inst" style="margin-left:0px; width:400px;"><option value=""></option>';
499 499
                         for (var i in institutions) {
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
             $('#start_test_area').hide();
534 534
             return false;
535 535
         }
536
-        var comment = <?php echo '"' . _("Fetching realms list") . '..."'; ?>;
536
+        var comment = <?php echo '"'._("Fetching realms list").'..."'; ?>;
537 537
         inProgress(1, comment);
538 538
         $.ajax({
539 539
             url: "findRealm.php",
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
                     var realms = data.realms;
546 546
                     var realmselect = '';
547 547
                     if (realms.length > 1) {
548
-                        realmselect = <?php echo '"<td>' . _("Check realm(s):") . '</td>"'; ?>;
548
+                        realmselect = <?php echo '"<td>'._("Check realm(s):").'</td>"'; ?>;
549 549
                         realmselect = realmselect + '<td>' + "<span style='margin-left: 10px'>";
550 550
                         for (var i in realms) {
551 551
                             realmselect = realmselect + '<input type="radio" name="realm" ';
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
                         }
558 558
                         realmselect = realmselect + '</span></td>';
559 559
                     } else {
560
-                        realmselect = <?php echo '"<td>' . _("Realm:") . '</td>"'; ?>;
560
+                        realmselect = <?php echo '"<td>'._("Realm:").'</td>"'; ?>;
561 561
                         realmselect = realmselect + '<td>' + "<span style='margin-left: 10px'>";
562 562
                         realmselect = realmselect + realms[0] + '</span>';
563 563
                         realmselect = realmselect + '<input type="hidden" name="realm" value="' + realms[0] + '">';
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
             });
613 613
             t = 1;
614 614
         }
615
-        var comment = <?php echo '"' . _("Running realm tests") . '..."'; ?>;
615
+        var comment = <?php echo '"'._("Running realm tests").'..."'; ?>;
616 616
         inProgress(1, comment);
617 617
         /*waiting(comment);*/
618 618
         $.ajax({
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
                             }
657 657
                         });
658 658
                         $('#sp_questions > tbody').append('<tr class="error_row"><td>' +
659
-                                <?php echo '"' . _("Realm is not registered with the eduroam database:") . '"'; ?> +
659
+                                <?php echo '"'._("Realm is not registered with the eduroam database:").'"'; ?> +
660 660
                                 '</td><td>' + realm + '</td></tr>');
661 661
                         $('#admin_realm').val('');
662 662
                     }    
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
         testSociopath('', answer);
682 682
     });
683 683
     $('#realmtest').click(function(event){
684
-        var comment = <?php echo '"<br><br>' . _("Running realm tests") . '..."'; ?>;
684
+        var comment = <?php echo '"<br><br>'._("Running realm tests").'..."'; ?>;
685 685
         inProgress(1, comment);
686 686
         $('#start_test_area').hide();
687 687
         if ($('#select_sp_area').is(':hidden')) {
@@ -725,13 +725,13 @@  discard block
 block discarded – undo
725 725
                         reset_footer();
726 726
                         testSociopath(realm, 0);
727 727
                     } else {
728
-                        var title = <?php echo '"' . _("Diagnostics results for selected realms") . '"'; ?>;
729
-                        result = '<div class="padding"><h3>' + <?php echo '"' . _("An unknown problem occured") . '"'; ?>;
728
+                        var title = <?php echo '"'._("Diagnostics results for selected realms").'"'; ?>;
729
+                        result = '<div class="padding"><h3>' + <?php echo '"'._("An unknown problem occured").'"'; ?>;
730 730
                         result = result + '</h3>'
731 731
                         if (r.length == 1) {
732
-                            result = result + <?php echo '"' . _("This test includes checking of the following realm") . '"'; ?>;
732
+                            result = result + <?php echo '"'._("This test includes checking of the following realm").'"'; ?>;
733 733
                         } else {    
734
-                            result = result + <?php echo '"' . _("This test includes checking of the following realms") . '"'; ?>;
734
+                            result = result + <?php echo '"'._("This test includes checking of the following realms").'"'; ?>;
735 735
                         }
736 736
                         result = result + ': '
737 737
                         for (var i=0; i < r.length; i++) {
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
                             result = result + r[i];
742 742
                         }
743 743
                         result = result + '.<br>';
744
-                        result = result + <?php echo '"' . _("You should report this to") . '"'; ?> + ' <a href="mailto:[email protected]">[email protected]</a>';
744
+                        result = result + <?php echo '"'._("You should report this to").'"'; ?> + ' <a href="mailto:[email protected]">[email protected]</a>';
745 745
                         result = result + '</div>';
746 746
                         $('#after_stage_1').hide();
747 747
                         $('#before_stage_1').show();
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
                 });
796 796
             });
797 797
         });
798
-        var comment = <?php echo '"' . _("Running realm tests") . '..."'; ?>;
798
+        var comment = <?php echo '"'._("Running realm tests").'..."'; ?>;
799 799
         inProgress(1, comment);
800 800
         $.ajax({
801 801
             url: "findRealm.php",
@@ -868,29 +868,29 @@  discard block
 block discarded – undo
868 868
             success:function(data) {
869 869
                 if (data.status === 1) {
870 870
                     var result = '';
871
-                    var title = <?php echo '"' . _("eduroam admin report submission") . '"'; ?>;
871
+                    var title = <?php echo '"'._("eduroam admin report submission").'"'; ?>;
872 872
                     result = '<div class="padding">';
873 873
                     if (type == 'idp_send') {
874
-                        result = result + '<h3>'+ <?php echo '"' . _("SP contacting IdP due to technical problems or abuse") . '"'; ?> + '</h3>';
874
+                        result = result + '<h3>'+ <?php echo '"'._("SP contacting IdP due to technical problems or abuse").'"'; ?> + '</h3>';
875 875
                         result = result + '<table>';
876
-                        result = result + '<tr><td>' + <?php echo '"' . _("Reason") . '"'; ?> + '</td><td>' + data.reason + '</td></tr>';
877
-                        result = result + '<tr><td>' + <?php echo '"' . _("SP email") . '"'; ?> + '</td><td>' + data.email + '</td></tr>';
878
-                        result = result + '<tr><td>' + <?php echo '"' . _("IdP email(s)") . '"'; ?> + '</td><td>' + data.idpcontact + '</td></tr>';
879
-                        result = result + '<tr><td>' + <?php echo '"' . _("Event's timestamp") . '"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
880
-                        result = result + '<tr><td>' + <?php echo '"' . _("Calling-Station-Id") . '"'; ?> + '</td><td>' + data.mac + '</td></tr>';
881
-                        result = result + '<tr><td>' + <?php echo '"' . _("Additional description") . '"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
876
+                        result = result + '<tr><td>' + <?php echo '"'._("Reason").'"'; ?> + '</td><td>' + data.reason + '</td></tr>';
877
+                        result = result + '<tr><td>' + <?php echo '"'._("SP email").'"'; ?> + '</td><td>' + data.email + '</td></tr>';
878
+                        result = result + '<tr><td>' + <?php echo '"'._("IdP email(s)").'"'; ?> + '</td><td>' + data.idpcontact + '</td></tr>';
879
+                        result = result + '<tr><td>' + <?php echo '"'._("Event's timestamp").'"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
880
+                        result = result + '<tr><td>' + <?php echo '"'._("Calling-Station-Id").'"'; ?> + '</td><td>' + data.mac + '</td></tr>';
881
+                        result = result + '<tr><td>' + <?php echo '"'._("Additional description").'"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
882 882
                     }
883 883
                     if (type == 'sp_send') {
884
-                        result = result + '<h3>'+ <?php echo '"' . _("IdP contacting SP due to technical problems or abuse") . '"'; ?> + '</h3>';
884
+                        result = result + '<h3>'+ <?php echo '"'._("IdP contacting SP due to technical problems or abuse").'"'; ?> + '</h3>';
885 885
                         result = result + '<table>';
886
-                        result = result + '<tr><td>' + <?php echo '"' . _("Reason") . '"'; ?> + '</td><td>' + data.reason + '</td></tr>';
887
-                        result = result + '<tr><td>' + <?php echo '"' . _("SP's Operator-Name") . '"'; ?> + '</td><td>' + data.opname + '</td></tr>';
888
-                        result = result + '<tr><td>' + <?php echo '"' . _("User's outer ID") . '"'; ?> + '</td><td>' + data.outerid + '</td></tr>';
889
-                        result = result + '<tr><td>' + <?php echo '"' . _("IdP email") . '"'; ?> + '</td><td>' + data.email + '</td></tr>';
890
-                        result = result + '<tr><td>' + <?php echo '"' . _("Event's timestamp") . '"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
891
-                        result = result + '<tr><td>' + <?php echo '"' . _("Calling-Station-Id") . '"'; ?> + '</td><td>' + data.mac + '</td></tr>';
892
-                        result = result + '<tr><td>' + <?php echo '"' . _("Additional description") . '"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
893
-                        result = result + '<tr><td>' + <?php echo '"' . _("How to contact the user") . '"'; ?> +'</td><td>' + data.cdetails + '</td></tr>';
886
+                        result = result + '<tr><td>' + <?php echo '"'._("Reason").'"'; ?> + '</td><td>' + data.reason + '</td></tr>';
887
+                        result = result + '<tr><td>' + <?php echo '"'._("SP's Operator-Name").'"'; ?> + '</td><td>' + data.opname + '</td></tr>';
888
+                        result = result + '<tr><td>' + <?php echo '"'._("User's outer ID").'"'; ?> + '</td><td>' + data.outerid + '</td></tr>';
889
+                        result = result + '<tr><td>' + <?php echo '"'._("IdP email").'"'; ?> + '</td><td>' + data.email + '</td></tr>';
890
+                        result = result + '<tr><td>' + <?php echo '"'._("Event's timestamp").'"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
891
+                        result = result + '<tr><td>' + <?php echo '"'._("Calling-Station-Id").'"'; ?> + '</td><td>' + data.mac + '</td></tr>';
892
+                        result = result + '<tr><td>' + <?php echo '"'._("Additional description").'"'; ?> +'</td><td>' + data.freetext + '</td></tr>';
893
+                        result = result + '<tr><td>' + <?php echo '"'._("How to contact the user").'"'; ?> +'</td><td>' + data.cdetails + '</td></tr>';
894 894
                     }
895 895
                     result = result + '</div>';
896 896
                     showInfo(result, title);
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
         if ($('#mac').val().length > 0) {
908 908
             if ($('#mac').val().length != 17) {
909 909
                 $('#mac').addClass('error_input');
910
-                $('#mac').attr('title', <?php echo '"' . _("MAC address is incomplete") . '"'; ?>);
910
+                $('#mac').attr('title', <?php echo '"'._("MAC address is incomplete").'"'; ?>);
911 911
             } else {
912 912
                 $('#mac').removeClass('error_input'); 
913 913
                 $('#mac').attr('title', '');
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
         if ($(this).attr('id') == 'email' &&  $(this).val().length > 0) {
917 917
             if (!isEmail($(this).val())) {
918 918
                 $('#email').addClass('error_input');
919
-                $('#email').attr('title', <?php echo '"' . _("Wrong format of email") . '"'; ?>);
919
+                $('#email').attr('title', <?php echo '"'._("Wrong format of email").'"'; ?>);
920 920
             } else {
921 921
                 $('#email').removeClass('error_input');
922 922
                 $('#email').attr('title', '');
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
         if ($(this).attr('id') == 'outer_id' &&  $(this).val().length > 0) {
926 926
             if (!isEmail($(this).val(), true)) {
927 927
                 $('#outer_id').addClass('error_input');
928
-                $('#outer_id').attr('title', <?php echo '"' . _("Wrong format of outer ID") . '"'; ?>);
928
+                $('#outer_id').attr('title', <?php echo '"'._("Wrong format of outer ID").'"'; ?>);
929 929
             } else {
930 930
                 $('#outer_id').removeClass('error_input');
931 931
                 $('#outer_id').attr('title', '');
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
         if ($(this).attr('id') == 'opname' && $('#opname').val().length > 0) {
935 935
             if (!isOperatorName($(this).val())) {
936 936
                 $('#opname').addClass('error_input');
937
-                $('#opname').attr('title', <?php echo '"' . _("Wrong string given as OperatorName") . '"'; ?>);
937
+                $('#opname').attr('title', <?php echo '"'._("Wrong string given as OperatorName").'"'; ?>);
938 938
                 $('#spmanually').show();
939 939
             } else {
940 940
                 $('#opname').removeClass('error_input');
Please login to merge, or discard this patch.
web/skins/modern/accountstatus/accountstatus.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
     var sbPage = 1;
34 34
 <?php
35 35
 $profile_list_size = 1;
36
-require_once dirname(__DIR__) . '/Divs.php';
36
+require_once dirname(__DIR__).'/Divs.php';
37 37
 $divs = new \web\skins\modern\Divs($Gui);
38 38
 
39 39
 $visibility = 'sb';
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 $Gui->loggerInstance->debug(4, $operatingSystem);
45 45
 $uiElements = new web\lib\admin\UIElements();
46 46
 if ($operatingSystem) {
47
-    print "recognisedOS = '" . $operatingSystem['device'] . "';\n";
47
+    print "recognisedOS = '".$operatingSystem['device']."';\n";
48 48
 }
49
-require dirname(__DIR__) . '/user/js/cat_js.php';
49
+require dirname(__DIR__).'/user/js/cat_js.php';
50 50
 ?>
51 51
     var lang = "<?php echo($Gui->langObject->getLang()) ?>";
52 52
 </script>
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                         <?php
77 77
                         switch ($statusInfo['errorcode']) {
78 78
                             case "GENERATOR_CONSUMED":
79
-                                echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to re-use download link"), TRUE) . "<p>";
79
+                                echo $uiElements->boxError(_("You attempted to download an installer that was already downloaded before. Please request a new token from your administrator instead."), _("Attempt to re-use download link"), TRUE)."<p>";
80 80
                                 break;
81 81
                             case NULL:
82 82
                             default:
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                                     echo " ";
100 100
                                     echo sprintf(ngettext("<strong>%d</strong> of your credentials is not valid any more.", "<strong>%d</strong> of your credentials are not valid any more.", $noGoodCerts), $noGoodCerts);
101 101
                                 }
102
-                                echo " <span id='detailtext'>" . _("I want to see the details.") . "</span>";
102
+                                echo " <span id='detailtext'>"._("I want to see the details.")."</span>";
103 103
                                 echo "<table id='cert_details'></table>";
104 104
                             }
105 105
                         }
@@ -108,60 +108,60 @@  discard block
 block discarded – undo
108 108
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_VALID: // treat both cases as equal
109 109
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_PARTIALLY_REDEEMED:
110 110
                                 if ($statusInfo['invitation_object']->activationsTotal > 1) { // only show this extra info in the non-trivial case.
111
-                                    echo "<h3>" . sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining) . "</h3>";
111
+                                    echo "<h3>".sprintf(_("Your invitation token is valid for %d more device activations (%d have already been used)."), $statusInfo['invitation_object']->activationsRemaining, $statusInfo['invitation_object']->activationsTotal - $statusInfo['invitation_object']->activationsRemaining)."</h3>";
112 112
                                 }
113 113
                                 if (!$statusInfo["OS"]) {
114
-                                    echo "<p>" . _("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.") . "</p>";
114
+                                    echo "<p>"._("Unfortunately, we are unable to determine your device's operating system. If you have made modifications on your device which prevent it from being recognised (e.g. custom 'User Agent' settings), please undo such modifications. You can come back to this page again; the invitation link has not been used up yet.")."</p>";
115 115
                                     break;
116 116
                                 }
117 117
 
118 118
                                 $dev = new \core\DeviceFactory($statusInfo['OS']['device']);
119 119
                                 $dev->device->calculatePreferredEapType([new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET)]);
120 120
                                 if ($dev->device->selectedEap == []) {
121
-                                    echo "<p>" . sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display']) . "</p>";
121
+                                    echo "<p>".sprintf(_("Unfortunately, the operating system your device uses (%s) is currently not supported for hosted end-user accounts. You can visit this page with a supported operating system later; the invitation link has not been used up yet."), $statusInfo['OS']['display'])."</p>";
122 122
                                     break;
123 123
                                 }
124
-                                $message = $dev->device->options['message'] ?? '' ;
124
+                                $message = $dev->device->options['message'] ?? '';
125 125
 
126 126
                                 $sbMessage = $dev->device->options['sb_message'] ?? '';
127 127
                                 if ($message != '' && $sbMessage != '') {
128
-                                    $message = $message . "<p>" . $sbMessage;
128
+                                    $message = $message."<p>".$sbMessage;
129 129
                                 } else {
130
-                                    $message = $message . $sbMessage;
130
+                                    $message = $message.$sbMessage;
131 131
                                 }
132 132
                          
133
-                                echo "<div id='sb_download_message'><p>" . sprintf(_("You can now download a personalised  %s installation program."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
133
+                                echo "<div id='sb_download_message'><p>".sprintf(_("You can now download a personalised  %s installation program."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']);
134 134
 //                       echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']);
135 135
                                 echo sprintf(_("The installation program is <span class='emph'>strictly personal</span>, to be used <span class='emph'>only on this device (%s)</span>, and it is <span class='emph'>not permitted to share</span> this information with anyone."), $statusInfo['OS']['display']);
136
-                                echo "<p style='color:red;'>" . sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</p>";
137
-                                echo "<p>" . _("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.") . "</p></div>";
136
+                                echo "<p style='color:red;'>".sprintf(_("When the system detects abuse such as sharing login data with others, all access rights for you will be revoked and you may be sanctioned by your local %s administrator."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</p>";
137
+                                echo "<p>"._("During the installation process, you will be asked for the following import PIN. This only happens once during the installation. You do not have to write down this PIN.")."</p></div>";
138 138
 
139 139
                                 $importPassword = \core\common\Entity::randomString(4, "0123456789");
140 140
                                 $profile = new \core\ProfileSilverbullet($statusInfo['profile']->identifier, NULL);
141 141
                                 
142
-                                echo "<h2>" . sprintf(_("Import PIN: %s"), $importPassword) . "</h2>";
142
+                                echo "<h2>".sprintf(_("Import PIN: %s"), $importPassword)."</h2>";
143 143
                                 $_SESSION['individualtoken'] = $cleanToken;
144 144
                                 $_SESSION['importpassword'] = $importPassword;
145
-                                echo "<input type='hidden' name='device' value='" . $statusInfo['OS']['device'] . "'/>";
145
+                                echo "<input type='hidden' name='device' value='".$statusInfo['OS']['device']."'/>";
146 146
                                 echo "<input type='hidden' name='generatedfor' value='silverbullet'/>";
147
-                                echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>" . sprintf(_("Click here to download your %s installer!"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']) . "</span></button>";
147
+                                echo "<button class='large_button' id='user_button_sb' style='height:80px;'><span id='user_buttonnnn'>".sprintf(_("Click here to download your %s installer!"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'])."</span></button>";
148 148
                                 echo "<div class='device_info' id='info_g_sb'></div>";
149 149
                                 break;
150 150
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_EXPIRED:
151 151
                                 echo "<h2>Invitation link expired</h2>";
152
-                                echo "<p>" . sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $statusInfo['invitation_object']->expiry) . "</p>";
152
+                                echo "<p>".sprintf(_("Unfortunately, the invitation link you just used is too old. The %s sign-up invitation was valid until %s. You cannot use this link any more. Please ask your administrator to issue you a new invitation link."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $statusInfo['invitation_object']->expiry)."</p>";
153 153
                                 echo "<p>Below is all the information about your account's other login details, if any.</p>";
154 154
 // do NOT break, display full account info instead (this was a previously valid token after all)
155 155
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_REDEEMED:
156 156
                                 // nothing to say really. User got the breakdown of certs above, and this link doesn't give him any new ones.
157 157
                                 break;
158 158
                             case \core\SilverbulletInvitation::SB_TOKENSTATUS_INVALID:
159
-                                echo "<h2>" . _("Account information not found") . "</h2>";
160
-                                echo "<p>" . sprintf(_("The invitation link you followed does not map to any invititation we have on file.") . "</p><p>" . _("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']);
159
+                                echo "<h2>"._("Account information not found")."</h2>";
160
+                                echo "<p>".sprintf(_("The invitation link you followed does not map to any invititation we have on file.")."</p><p>"._("You should use the exact link you got during sign-up to come here. Alternatively, if you have a valid %s credential already, you can visit this page and Accept the question about logging in with a client certificate (select a certificate with a name ending in '…%s')."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix']);
161 161
                         }
162 162
                         if (isset($statusInfo['profile_id']) && isset($statusInfo['idp_id'])) {
163
-                            echo "<input type='hidden' name='profile' id='profile_id' value='" . $statusInfo['profile_id'] . "'/>";
164
-                            echo "<input type='hidden' id='inst_id' name='idp' value='" . $statusInfo['idp_id'] . "'/>";
163
+                            echo "<input type='hidden' name='profile' id='profile_id' value='".$statusInfo['profile_id']."'/>";
164
+                            echo "<input type='hidden' id='inst_id' name='idp' value='".$statusInfo['idp_id']."'/>";
165 165
                         }
166 166
                         ?>
167 167
                     </div>
@@ -181,18 +181,18 @@  discard block
 block discarded – undo
181 181
     $attributes = $statusInfo['attributes'];
182 182
     $supportInfo = '';
183 183
     if (!empty($attributes['local_url'])) {
184
-        $supportInfo .= '<tr><td>' . ("WWW:") . '</td><td><a href="' . $attributes['local_url'] . '" target="_blank">' . $attributes['local_url'] . '</a></td></tr>';
184
+        $supportInfo .= '<tr><td>'.("WWW:").'</td><td><a href="'.$attributes['local_url'].'" target="_blank">'.$attributes['local_url'].'</a></td></tr>';
185 185
     }
186 186
     if (!empty($attributes['local_email'])) {
187
-        $supportInfo .= '<tr><td>' . ("email:") . '</td><td><a href="' . $attributes['local_email'] . '" target="_blank">' . $attributes['local_email'] . '</a></td></tr>';
187
+        $supportInfo .= '<tr><td>'.("email:").'</td><td><a href="'.$attributes['local_email'].'" target="_blank">'.$attributes['local_email'].'</a></td></tr>';
188 188
     }
189 189
     if (!empty($attributes['local_phone'])) {
190
-        $supportInfo .= '<tr><td>' . ("tel:") . '</td><td><a href="' . $attributes['local_phone'] . '" target="_blank">' . $attributes['local_phone'] . '</a></td></tr>';
190
+        $supportInfo .= '<tr><td>'.("tel:").'</td><td><a href="'.$attributes['local_phone'].'" target="_blank">'.$attributes['local_phone'].'</a></td></tr>';
191 191
     }
192 192
     if ($supportInfo != '') {
193
-        $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems, then you can obtain direct assistance from your organisation at:") . "</th></tr>$supportInfo</table>";
193
+        $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems, then you can obtain direct assistance from your organisation at:")."</th></tr>$supportInfo</table>";
194 194
     } else {
195
-        $supportInfo = "<table><tr><th colspan='2'>" . _("If you encounter problems you should ask those who gave you your account for help.") . "</th></tr></table>";
195
+        $supportInfo = "<table><tr><th colspan='2'>"._("If you encounter problems you should ask those who gave you your account for help.")."</th></tr></table>";
196 196
     }
197 197
     ?>
198 198
     <script>
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
             var logo = <?php echo $statusInfo['idp_logo']; ?>;
202 202
             var idpId = <?php echo $statusInfo['idp_id']; ?>;
203 203
             <?php
204
-                if($message != '') {
204
+                if ($message != '') {
205 205
                     echo "message = \"$message\";\n";
206 206
                 }
207 207
             ?>
Please login to merge, or discard this patch.
web/skins/modern/Menu.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 namespace web\skins\modern;
22
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php";
23 23
 
24 24
 /**
25 25
  * Menu class helps to define the menu on the main page
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
         $langsArray = [];
40 40
         foreach (CONFIG['LANGUAGES'] as $lang => $value) {
41 41
             if ($lang == $selectedLang) {
42
-                $langsArray[] = ['text'=>$value['display'], 'link'=>'javascript:changeLang("' . $lang . '")', 'class'=>'selected-lang'];
42
+                $langsArray[] = ['text'=>$value['display'], 'link'=>'javascript:changeLang("'.$lang.'")', 'class'=>'selected-lang'];
43 43
             } else {
44
-                $langsArray[] = ['text'=>$value['display'], 'link'=>'javascript:changeLang("' . $lang . '")'];
44
+                $langsArray[] = ['text'=>$value['display'], 'link'=>'javascript:changeLang("'.$lang.'")'];
45 45
             }
46 46
         }
47 47
         $this->menu = [['id' => 'start',
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
                 $iD = $menuItem['id'] ?? $id;
93 93
                 $catInfo = NULL;
94 94
                 if (!empty($menuItem['catInfo'])) {
95
-                    $catInfo = 'javascript:infoCAT("' . $iD . '", "' . $menuItem['catInfo'][0] . '","' . $menuItem['catInfo'][1] . '")';
95
+                    $catInfo = 'javascript:infoCAT("'.$iD.'", "'.$menuItem['catInfo'][0].'","'.$menuItem['catInfo'][1].'")';
96 96
                 }
97 97
                 if (!empty($menuItem['link']) && substr($menuItem['link'], 0, 1) === '/') {
98
-                    $menuItem['link'] = \core\CAT::getRootUrlPath() . $menuItem['link'];
98
+                    $menuItem['link'] = \core\CAT::getRootUrlPath().$menuItem['link'];
99 99
                 }
100 100
                 $link = $catInfo ?? $menuItem['link'] ?? '';
101
-                $class = empty($menuItem['class']) ? '' : ' class="' . $menuItem['class'] . '"';
101
+                $class = empty($menuItem['class']) ? '' : ' class="'.$menuItem['class'].'"';
102 102
                 $submenu = $menuItem['submenu'] ?? [];
103 103
                 $out .= $this->printMenuItem($menuItem['text'], $link, $class);
104 104
                 $out .= $this->printMenu($submenu, $iD);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         if ($itemLink === '') {
115 115
             return("<li><span>$itemText</span>");
116 116
         }
117
-        return "<li><a href='" . $itemLink . "'" . $itemClass . '>' . $itemText . "</a>";
117
+        return "<li><a href='".$itemLink."'".$itemClass.'>'.$itemText."</a>";
118 118
     }
119 119
     
120 120
     public function printMinimalMenu() {
Please login to merge, or discard this patch.