Code Duplication    Length = 22-23 lines in 3 locations

devices/ms/Device_Vista7.php 1 location

@@ 483-504 (lines=22) @@
480
        fclose($fileHandle);
481
    }
482
483
    private function writeProfilesNSH($wlanProfiles, $caArray, $wired = 0) {
484
        $this->loggerInstance->debug(4, "writeProfilesNSH");
485
        $this->loggerInstance->debug(4, $wlanProfiles);
486
        $contentWlan = '';
487
        foreach ($wlanProfiles as $wlanProfile) {
488
            $contentWlan .= "!insertmacro define_wlan_profile $wlanProfile\n";
489
        }
490
491
        $fileHandleProfiles = fopen('profiles.nsh', 'w');
492
        fwrite($fileHandleProfiles, $contentWlan);
493
        fclose($fileHandleProfiles);
494
495
        $contentCerts = '';
496
        $fileHandleCerts = fopen('certs.nsh', 'w');
497
        if ($caArray) {
498
            foreach ($caArray as $certAuthority) {
499
                $store = $certAuthority['root'] ? "root" : "ca";
500
                $contentCerts .= '!insertmacro install_ca_cert "' . $certAuthority['file'] . '" "' . $certAuthority['sha1'] . '" "' . $store . "\"\n";
501
            }
502
            fwrite($fileHandleCerts, $contentCerts);
503
        }
504
        fclose($fileHandleCerts);
505
    }
506
507
    private function copyFiles($eap) {

devices/ms/Device_W10.php 1 location

@@ 508-530 (lines=23) @@
505
        fclose($fileHandle);
506
    }
507
508
    private function writeProfilesNSH($wlanProfiles, $caArray, $wired = 0) {
509
        $this->loggerInstance->debug(4, "writeProfilesNSH");
510
        $this->loggerInstance->debug(4, $wlanProfiles);
511
        $fcontentsProfile = '';
512
        foreach ($wlanProfiles as $wlanProfile) {
513
            $fcontentsProfile .= "!insertmacro define_wlan_profile $wlanProfile\n";
514
        }
515
516
        $fileHandleProfiles = fopen('profiles.nsh', 'w');
517
        fwrite($fileHandleProfiles, $fcontentsProfile);
518
        fclose($fileHandleProfiles);
519
520
        $fcontentsCerts = '';
521
        $fileHandleCerts = fopen('certs.nsh', 'w');
522
        if ($caArray) {
523
            foreach ($caArray as $certAuthority) {
524
                $store = $certAuthority['root'] ? "root" : "ca";
525
                $fcontentsCerts .= '!insertmacro install_ca_cert "' . $certAuthority['file'] . '" "' . $certAuthority['sha1'] . '" "' . $store . "\"\n";
526
            }
527
            fwrite($fileHandleCerts, $fcontentsCerts);
528
        }
529
        fclose($fileHandleCerts);
530
    }
531
532
//private function write
533

devices/ms/Device_W8.php 1 location

@@ 442-463 (lines=22) @@
439
        fclose($fileHandle);
440
    }
441
442
    private function writeProfilesNSH($wlanProfiles, $caArray, $wired = 0) {
443
        $this->loggerInstance->debug(4, "writeProfilesNSH");
444
        $this->loggerInstance->debug(4, $wlanProfiles);
445
        $fcontentsProfile = '';
446
        foreach ($wlanProfiles as $wlanProfile) {
447
            $fcontentsProfile .= "!insertmacro define_wlan_profile $wlanProfile\n";
448
        }
449
450
        $fileHandleProfiles = fopen('profiles.nsh', 'w');
451
        fwrite($fileHandleProfiles, $fcontentsProfile);
452
        fclose($fileHandleProfiles);
453
454
        $fcontentsCerts = '';
455
        $fileHandleCerts = fopen('certs.nsh', 'w');
456
        if ($caArray) {
457
            foreach ($caArray as $certAuthority) {
458
                $store = $certAuthority['root'] ? "root" : "ca";
459
                $fcontentsCerts .= '!insertmacro install_ca_cert "' . $certAuthority['file'] . '" "' . $certAuthority['sha1'] . '" "' . $store . "\"\n";
460
            }
461
            fwrite($fileHandleCerts, $fcontentsCerts);
462
        }
463
        fclose($fileHandleCerts);
464
    }
465
466
//private function write