Completed
Pull Request — master (#14)
by Janusz
10:08 queued 04:29
created
devices/redirect_dev/RedirectDev.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -2,20 +2,20 @@
 block discarded – undo
2 2
 require_once('DeviceConfig.php');
3 3
 
4 4
 class Device_RedirectDev extends DeviceConfig {
5
-   /**
6
-    * Constructs a Device object.
7
-    *
8
-    * It is CRUTCIAL that the constructor sets $this->supportedEapMethods to an array of methods
9
-    * available for the particular device.
10
-    * {@source}
11
-    * @param string $device a pointer to a device module, which must
12
-    * be an index of one of the devices defined in the {@link Devices}
13
-    * array in {@link devices.php}.
14
-    * @final not to be redefined
15
-    */
5
+    /**
6
+     * Constructs a Device object.
7
+     *
8
+     * It is CRUTCIAL that the constructor sets $this->supportedEapMethods to an array of methods
9
+     * available for the particular device.
10
+     * {@source}
11
+     * @param string $device a pointer to a device module, which must
12
+     * be an index of one of the devices defined in the {@link Devices}
13
+     * array in {@link devices.php}.
14
+     * @final not to be redefined
15
+     */
16 16
     final public function __construct() {
17
-      $this->supportedEapMethods  = [EAP::$EAP_NONE];
18
-      debug(4,"RedirectEx called");
17
+        $this->supportedEapMethods  = [EAP::$EAP_NONE];
18
+        debug(4,"RedirectEx called");
19 19
     }
20 20
     public function writeDeviceInfo() {
21 21
         $out = "<p>";
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
     * @final not to be redefined
15 15
     */
16 16
     final public function __construct() {
17
-      $this->supportedEapMethods  = [EAP::$EAP_NONE];
18
-      debug(4,"RedirectEx called");
17
+      $this->supportedEapMethods = [EAP::$EAP_NONE];
18
+      debug(4, "RedirectEx called");
19 19
     }
20 20
     public function writeDeviceInfo() {
21 21
         $out = "<p>";
Please login to merge, or discard this patch.
Doc Comments   -3 removed lines patch added patch discarded remove patch
@@ -76,9 +76,6 @@
 block discarded – undo
76 76
     * It is CRUTCIAL that the constructor sets $this->supportedEapMethods to an array of methods
77 77
     * available for the particular device.
78 78
     * {@source}
79
-    * @param string $device a pointer to a device module, which must
80
-    * be an index of one of the devices defined in the {@link Devices}
81
-    * array in {@link devices.php}.
82 79
     * @final not to be redefined
83 80
     */
84 81
     final public function __construct() {
Please login to merge, or discard this patch.
devices/linux/Linux.php 3 patches
Indentation   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -30,17 +30,17 @@  discard block
 block discarded – undo
30 30
  */
31 31
 class Device_Linux extends DeviceConfig {
32 32
 
33
-      final public function __construct() {
33
+        final public function __construct() {
34 34
 //      $this->supportedEapMethods  = array(EAP::$TLS, EAP::$PEAP_MSCHAP2, EAP::$TTLS_PAP);
35
-      $this->supportedEapMethods  = [ EAP::$PEAP_MSCHAP2, EAP::$TTLS_PAP, EAP::$TTLS_MSCHAP2, EAP::$TLS ];
36
-      $this->local_dir = '.cat_installer';
37
-      $this->conf_file = '$HOME/'.$this->local_dir.'/cat_installer.conf';
38
-      debug(4,"LINUX: This device supports the following EAP methods: ");
39
-      debug(4,$this->supportedEapMethods);
35
+        $this->supportedEapMethods  = [ EAP::$PEAP_MSCHAP2, EAP::$TTLS_PAP, EAP::$TTLS_MSCHAP2, EAP::$TLS ];
36
+        $this->local_dir = '.cat_installer';
37
+        $this->conf_file = '$HOME/'.$this->local_dir.'/cat_installer.conf';
38
+        debug(4,"LINUX: This device supports the following EAP methods: ");
39
+        debug(4,$this->supportedEapMethods);
40 40
     }
41 41
 
42
-   public function writeInstaller() {
43
-      $out_string = '#!/usr/bin/env bash
42
+    public function writeInstaller() {
43
+        $out_string = '#!/usr/bin/env bash
44 44
 if [ -z "$BASH" ] ; then
45 45
    bash  $0
46 46
    exit
@@ -48,42 +48,42 @@  discard block
 block discarded – undo
48 48
 
49 49
 
50 50
 ';
51
-      $out_string .= $this->printFunctions();
52
-      $out_string .= $this->printStart();
53
-      $out_string .= $this->printProfileConfirmation();
54
-      $out_string .= $this->printUserConsent();
55
-      $out_string .= $this->printCheckDirectory();
56
-      $CAs = $this->attributes['internal:CAs'][0];
57
-      $this->server_name = $this->glueServerNames($this->attributes['eap:server_name']);
58
-      $this->server_alt_subject_name_list = $this->mkSubjectAltNameList($this->attributes['eap:server_name']);
59
-      $out_string .= "# save certificates\n";
60
-      $out_string .= 'echo "';
61
-      foreach ($CAs as $ca) {
51
+        $out_string .= $this->printFunctions();
52
+        $out_string .= $this->printStart();
53
+        $out_string .= $this->printProfileConfirmation();
54
+        $out_string .= $this->printUserConsent();
55
+        $out_string .= $this->printCheckDirectory();
56
+        $CAs = $this->attributes['internal:CAs'][0];
57
+        $this->server_name = $this->glueServerNames($this->attributes['eap:server_name']);
58
+        $this->server_alt_subject_name_list = $this->mkSubjectAltNameList($this->attributes['eap:server_name']);
59
+        $out_string .= "# save certificates\n";
60
+        $out_string .= 'echo "';
61
+        foreach ($CAs as $ca) {
62 62
         $out_string .= $ca['pem']."\n";
63
-      }
64
-      $out_string .= '"'." > \$HOME/$this->local_dir/ca.pem\n";
63
+        }
64
+        $out_string .= '"'." > \$HOME/$this->local_dir/ca.pem\n";
65 65
 
66
-     $SSIDs = $this->attributes['internal:SSID'];
67
-     $delSSIDs = $this->attributes['internal:remove_SSID'];
66
+        $SSIDs = $this->attributes['internal:SSID'];
67
+        $delSSIDs = $this->attributes['internal:remove_SSID'];
68 68
 
69
-     $out_string .= $this->printNMScript($SSIDs,$delSSIDs);
70
-     $out_string .= $this->writeWpaConf($SSIDs);
71
-     if($this->selected_eap == EAP::$TLS) 
72
-       $out_string .= $this->printP12Dialog();
73
-     else
74
-       $out_string .= $this->printPasswordDialog();
75
-     $out_string .= $this->checkNMResultAndCont();
76
-     $installer_path = $this->installerBasename.'.sh';
77
-      file_put_contents($installer_path, $out_string);
78
-      return($installer_path);
79
-   }
69
+        $out_string .= $this->printNMScript($SSIDs,$delSSIDs);
70
+        $out_string .= $this->writeWpaConf($SSIDs);
71
+        if($this->selected_eap == EAP::$TLS) 
72
+        $out_string .= $this->printP12Dialog();
73
+        else
74
+        $out_string .= $this->printPasswordDialog();
75
+        $out_string .= $this->checkNMResultAndCont();
76
+        $installer_path = $this->installerBasename.'.sh';
77
+        file_put_contents($installer_path, $out_string);
78
+        return($installer_path);
79
+    }
80 80
 
81 81
     public function writeDeviceInfo() {
82 82
     $ssid_ct=count($this->attributes['internal:SSID']);
83 83
     $out = '';
84 84
 
85
-   $out .= _("The installer is in the form of a bash script. It will try to configure eduroam under Network Manager and if this is either not appropriate for your system or your version of Network Manager is too old, a wpa_supplicant config file will be created instead.");
86
-   $out .= "<p>";
85
+    $out .= _("The installer is in the form of a bash script. It will try to configure eduroam under Network Manager and if this is either not appropriate for your system or your version of Network Manager is too old, a wpa_supplicant config file will be created instead.");
86
+    $out .= "<p>";
87 87
     if($ssid_ct > 1) {
88 88
         if($ssid_ct > 2) {
89 89
             $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
@@ -91,39 +91,39 @@  discard block
 block discarded – undo
91 91
             $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
92 92
         $i = 0;
93 93
         foreach ($this->attributes['internal:SSID'] as $ssid=>$v) {
94
-           if(! in_array($ssid, Config::$CONSORTIUM['ssid'])) {
95
-             if($i > 0)
96
-           $out .= ", ";
97
-         $i++;
98
-         $out .= "<strong>$ssid</strong>";
99
-       }
94
+            if(! in_array($ssid, Config::$CONSORTIUM['ssid'])) {
95
+                if($i > 0)
96
+            $out .= ", ";
97
+            $i++;
98
+            $out .= "<strong>$ssid</strong>";
99
+        }
100 100
     }
101 101
     $out .= "<p>";
102 102
     }
103
-   $out .= _("The installer will create .cat_installer sub-directory in your home directory and will copy your server certificates there.");
103
+    $out .= _("The installer will create .cat_installer sub-directory in your home directory and will copy your server certificates there.");
104 104
 if($this->eap == EAP::$TLS)
105
-   $out .= _("In order to connect to the network you will need a personal certificate in the form of a p12 file. You should obtain this certificate from your home institution. Consult the support page to find out how this certificate can be obtained. Such certificate files are password protected. You should have both the file and the password available during the installation process. Your p12 file will also be copied to the .cat_installer directory.");
105
+    $out .= _("In order to connect to the network you will need a personal certificate in the form of a p12 file. You should obtain this certificate from your home institution. Consult the support page to find out how this certificate can be obtained. Such certificate files are password protected. You should have both the file and the password available during the installation process. Your p12 file will also be copied to the .cat_installer directory.");
106 106
 else {
107
-   $out .= _("In order to connect to the network you will need an account from your home institution. You should consult the support page to find out how this account can be obtained. It is very likely that your account is already activated.");
108
-   $out .= "<p>";
109
-   $out .= _("You will be requested to enter your account credentials during the installation. This information will be saved so that you will reconnect to the network automatically each time you are in the range.");
107
+    $out .= _("In order to connect to the network you will need an account from your home institution. You should consult the support page to find out how this account can be obtained. It is very likely that your account is already activated.");
108
+    $out .= "<p>";
109
+    $out .= _("You will be requested to enter your account credentials during the installation. This information will be saved so that you will reconnect to the network automatically each time you are in the range.");
110 110
 }
111 111
     $out .= "<p>";
112 112
     return $out;
113
-  }
113
+    }
114 114
 
115 115
 
116
-  private function printCheckDirectory() {
116
+    private function printCheckDirectory() {
117 117
 $out = 'if [ -d $HOME/'.$this->local_dir.' ] ; then
118 118
    if ! ask "'.sprintf(_("Directory %s exists; some of its files may be overwritten."),'$HOME/'.$this->local_dir).'" "'._("Continue").'" 1 ; then exit; fi
119 119
 else
120 120
   mkdir $HOME/'.$this->local_dir.'
121 121
 fi
122 122
 ';
123
- return $out;
124
-  }
123
+    return $out;
124
+    }
125 125
 
126
-  private function checkNMResultAndCont() {
126
+    private function checkNMResultAndCont() {
127 127
     $out = 'if run_python_script ; then
128 128
    show_info "'._("Installation successful").'"
129 129
 else
@@ -138,50 +138,50 @@  discard block
 block discarded – undo
138 138
    show_info "'.sprintf(_("Output written to %s"),$this->conf_file).'"
139 139
 fi
140 140
 ';
141
-  return $out;
142
-  }
141
+    return $out;
142
+    }
143 143
 
144 144
 private function printStart() {
145
-     $out = "setup_environment\n";
146
-     $out .= 'show_info "'._("This installer has been prepared for \${ORGANISATION}").'\n\n'._("More information and comments:").'\n\nEMAIL: ${SUPPORT}\nWWW: ${URL}\n\n'.
145
+        $out = "setup_environment\n";
146
+        $out .= 'show_info "'._("This installer has been prepared for \${ORGANISATION}").'\n\n'._("More information and comments:").'\n\nEMAIL: ${SUPPORT}\nWWW: ${URL}\n\n'.
147 147
 _("Installer created with software from the GEANT project.").'"
148 148
 ';
149
-  return $out;
149
+    return $out;
150 150
 }
151 151
 
152 152
 
153 153
 private function printProfileConfirmation() {
154
- if($this->attributes['internal:profile_count'][0] > 1)
155
-       $out = 'if ! ask "'.sprintf(_("This installer will only work properly if you are a member of %s and the user group: %s."),'${bf}'.$this->attributes['general:instname'][0].'${n}','${bf}'.$this->attributes['profile:name'][0]).'${n}"';
154
+    if($this->attributes['internal:profile_count'][0] > 1)
155
+        $out = 'if ! ask "'.sprintf(_("This installer will only work properly if you are a member of %s and the user group: %s."),'${bf}'.$this->attributes['general:instname'][0].'${n}','${bf}'.$this->attributes['profile:name'][0]).'${n}"';
156 156
     else
157
-       $out = 'if ! ask "'.sprintf(_("This installer will only work properly if you are a member of %s."),'${bf}'.$this->attributes['general:instname'][0]).'${n}"';
157
+        $out = 'if ! ask "'.sprintf(_("This installer will only work properly if you are a member of %s."),'${bf}'.$this->attributes['general:instname'][0]).'${n}"';
158 158
     $out .= ' "'._("Continue").'" 1 ; then exit; fi
159 159
 ';
160
-  return $out;
160
+    return $out;
161 161
 
162 162
 }
163 163
 
164 164
 
165
-  private function printUserConsent() {
165
+    private function printUserConsent() {
166 166
     $out = '';
167 167
     if(isset($this->attributes['support:info_file'])) {
168
-      if( $this->attributes['internal:info_file'][0]['mime'] == 'txt') {
169
-         $handle = fopen($this->attributes['internal:info_file'][0]['name'],"r");
170
-         $consent = '';
171
-         while (($buffer = fgets($handle, 4096)) !== false) {
172
-           $consent .= rtrim($buffer) . '\n';
173
-         }
174
-         $out = 'if ! ask "'.$consent.'${n}" "'._("Continue").'" 1 ; then exit; fi
168
+        if( $this->attributes['internal:info_file'][0]['mime'] == 'txt') {
169
+            $handle = fopen($this->attributes['internal:info_file'][0]['name'],"r");
170
+            $consent = '';
171
+            while (($buffer = fgets($handle, 4096)) !== false) {
172
+            $consent .= rtrim($buffer) . '\n';
173
+            }
174
+            $out = 'if ! ask "'.$consent.'${n}" "'._("Continue").'" 1 ; then exit; fi
175 175
 ';
176
-      }
176
+        }
177 177
     }
178 178
     return $out;
179
-  }
179
+    }
180 180
 # ask user for confirmation
181 181
 # the first argument is the user prompt
182 182
 # if the second argument is 0 then the first element of yes_no array
183 183
 # will be the default value prompted to the user
184
-  private function printFunctions() {
184
+    private function printFunctions() {
185 185
 $url = (isset($this->attributes['support:url'][0]) && $this->attributes['support:url'][0] ) ? $this->attributes['support:url'][0] : $this->support_url_substitute;
186 186
 $support=(isset($this->attributes['support:email'][0]) && $this->attributes['support:email'][0] ) ? $this->attributes['support:email'][0] : $this->support_email_substitute;
187 187
 $out ='
@@ -391,11 +391,11 @@  discard block
 block discarded – undo
391 391
 }
392 392
 
393 393
 
394
-  private function writeWpaConf($SSIDs) {
395
-     $e = EAP::eapDisplayName($this->selected_eap);
394
+    private function writeWpaConf($SSIDs) {
395
+        $e = EAP::eapDisplayName($this->selected_eap);
396 396
 $out = 'function create_wpa_conf {
397 397
 cat << EOFW >> '.$this->conf_file."\n";
398
-     foreach (array_keys($SSIDs) as $ssid) {
398
+        foreach (array_keys($SSIDs) as $ssid) {
399 399
     $out .= '
400 400
 network={
401 401
   ssid="'.$ssid.'"
@@ -405,42 +405,42 @@  discard block
 block discarded – undo
405 405
   eap='.$e['OUTER'].'
406 406
   ca_cert="${HOME}/'.$this->local_dir.'/ca.pem"
407 407
   identity="${USER_NAME}"';
408
-  if($this->server_name)
408
+    if($this->server_name)
409 409
     $out .= '
410 410
   domain_suffix_match="'.$this->server_name.'"';
411
-  if($this->selected_eap == EAP::$TLS) {
411
+    if($this->selected_eap == EAP::$TLS) {
412 412
     $out .= '
413 413
   private_key="${HOME}/'.$this->local_dir.'/user.p12"
414 414
   private_key_passwd="${PASSWORD}"';
415
-  } else {
415
+    } else {
416 416
     $out .= '
417 417
   phase2="auth='.$e['INNER'].'"
418 418
   password="${PASSWORD}"';
419
-  if($this->attributes['internal:use_anon_outer'][0] == 1) 
419
+    if($this->attributes['internal:use_anon_outer'][0] == 1) 
420 420
     $out .= '
421 421
   anonymous_identity="'.$this->attributes['internal:anon_local_value'][0].'@'.$this->attributes['internal:realm'][0].'"';
422
-  }
422
+    }
423 423
     $out .= '
424 424
 }';
425 425
 }
426
-  $out .= '
426
+    $out .= '
427 427
 EOFW
428 428
 chmod 600 '.$this->conf_file.'
429 429
 }
430 430
 ';
431
-  return $out;
431
+    return $out;
432 432
 }
433 433
 
434 434
 
435 435
 
436
-  private function printPasswordDialog() {
437
-  $out = '#prompt user for credentials
436
+    private function printPasswordDialog() {
437
+    $out = '#prompt user for credentials
438 438
   user_cred
439 439
   ';
440
-  return $out;
440
+    return $out;
441 441
 }
442
-  private function printP12Dialog() {
443
-  $out ='function p12dialog {
442
+    private function printP12Dialog() {
443
+    $out ='function p12dialog {
444 444
   if [ ! -z $ZENITY ] ; then
445 445
     if ! cert=`$ZENITY --file-selection --file-filter="'._("personal certificate file (p12 or pfx)").' | *.p12 *.P12 *.pfx *.PFX" --file-filter="All files | *" --title="'._("personal certificate file (p12 or pfx)").'" 2>/dev/null` ; then
446 446
        exit
@@ -499,37 +499,37 @@  discard block
 block discarded – undo
499 499
 }  
500 500
 p12dialog
501 501
 ';
502
- return $out;
502
+    return $out;
503 503
 }
504 504
 
505 505
 
506 506
 private function glueServerNames($server_list) {
507
-  if(! $server_list)
507
+    if(! $server_list)
508 508
     return '';
509
-  $A0 =  array_reverse(explode('.',array_shift($server_list)));
510
-  $B = $A0;
511
-  foreach($server_list as $a) {
512
-     $A= array_reverse(explode('.',$a));
513
-     $B = array_intersect_assoc($A0,$A);
514
-     $A0 = $B;
515
-   }
516
-  return(implode('.',array_reverse($B)));
509
+    $A0 =  array_reverse(explode('.',array_shift($server_list)));
510
+    $B = $A0;
511
+    foreach($server_list as $a) {
512
+        $A= array_reverse(explode('.',$a));
513
+        $B = array_intersect_assoc($A0,$A);
514
+        $A0 = $B;
515
+    }
516
+    return(implode('.',array_reverse($B)));
517 517
 }
518 518
 
519 519
 private function mkSubjectAltNameList($server_list) {
520
-  if(! $server_list)
520
+    if(! $server_list)
521 521
     return '';
522
-  $out = '';
523
-  foreach($server_list as $a) {
524
-     if($out)
525
-       $out .= ','; 
526
-     $out .= "'DNS:$a'";
527
-  }
528
-  return $out;
522
+    $out = '';
523
+    foreach($server_list as $a) {
524
+        if($out)
525
+        $out .= ','; 
526
+        $out .= "'DNS:$a'";
527
+    }
528
+    return $out;
529 529
 }
530 530
 
531 531
 private function printNMScript($SSIDs,$delSSIDs) {
532
-   $e = EAP::eapDisplayName($this->selected_eap);
532
+    $e = EAP::eapDisplayName($this->selected_eap);
533 533
 $out = 'function run_python_script {
534 534
 PASSWORD=$( echo "$PASSWORD" | sed "s/\'/\\\\\\\'/g" )
535 535
 if python << EEE1 > /dev/null 2>&1
@@ -668,20 +668,20 @@  discard block
 block discarded – undo
668 668
             \'identity\': \'$USER_NAME\',
669 669
             \'ca-cert\': dbus.ByteArray("file://{0}\0".format(self.cacert_file).encode(\'utf8\')),';
670 670
     if($this->server_name) {
671
-             $out .= '
671
+                $out .= '
672 672
              match_key: match_value,';
673 673
     }
674 674
     if($this->selected_eap == EAP::$TLS) {
675
-       $out .= '
675
+        $out .= '
676 676
             \'client-cert\':  dbus.ByteArray("file://{0}\0".format(self.pfx_file).encode(\'utf8\')),
677 677
             \'private-key\':  dbus.ByteArray("file://{0}\0".format(self.pfx_file).encode(\'utf8\')),
678 678
             \'private-key-password\':  \'$PASSWORD\',';
679 679
     } else {
680
-       $out .= '
680
+        $out .= '
681 681
             \'password\': \'$PASSWORD\',
682 682
             \'phase2-auth\': \''.strtolower($e['INNER']).'\',';
683
-         if($this->attributes['internal:use_anon_outer'][0] == 1) 
684
-              $out .= '
683
+            if($this->attributes['internal:use_anon_outer'][0] == 1) 
684
+                $out .= '
685 685
             \'anonymous-identity\': \''.$this->attributes['internal:anon_local_value'][0].'@'.$this->attributes['internal:realm'][0].'\',';
686 686
     }
687 687
     $out .= '
@@ -701,17 +701,17 @@  discard block
 block discarded – undo
701 701
     def main(self):
702 702
         self.check_opts()
703 703
         ver = self.connect_to_NM()';
704
-     foreach (array_keys($SSIDs) as $ssid) {
705
-           $out .='
704
+        foreach (array_keys($SSIDs) as $ssid) {
705
+            $out .='
706 706
         self.delete_existing_connections(\''.$ssid.'\')
707 707
         self.add_connection(\''.$ssid.'\')';
708
-     }
708
+        }
709 709
 //   create a list of profiles to be deleted after installation
710
-     foreach ($delSSIDs as $ssid => $cipher) {
711
-         if($cipher == 'DEL')
710
+        foreach ($delSSIDs as $ssid => $cipher) {
711
+            if($cipher == 'DEL')
712 712
             $out .='
713 713
         self.delete_existing_connections(\''.$ssid.'\')';
714
-     }
714
+        }
715 715
 
716 716
 $out .='
717 717
 
Please login to merge, or discard this patch.
Spacing   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 
33 33
       final public function __construct() {
34 34
 //      $this->supportedEapMethods  = array(EAP::$TLS, EAP::$PEAP_MSCHAP2, EAP::$TTLS_PAP);
35
-      $this->supportedEapMethods  = [ EAP::$PEAP_MSCHAP2, EAP::$TTLS_PAP, EAP::$TTLS_MSCHAP2, EAP::$TLS ];
35
+      $this->supportedEapMethods = [EAP::$PEAP_MSCHAP2, EAP::$TTLS_PAP, EAP::$TTLS_MSCHAP2, EAP::$TLS];
36 36
       $this->local_dir = '.cat_installer';
37
-      $this->conf_file = '$HOME/'.$this->local_dir.'/cat_installer.conf';
38
-      debug(4,"LINUX: This device supports the following EAP methods: ");
39
-      debug(4,$this->supportedEapMethods);
37
+      $this->conf_file = '$HOME/' . $this->local_dir . '/cat_installer.conf';
38
+      debug(4, "LINUX: This device supports the following EAP methods: ");
39
+      debug(4, $this->supportedEapMethods);
40 40
     }
41 41
 
42 42
    public function writeInstaller() {
@@ -59,40 +59,40 @@  discard block
 block discarded – undo
59 59
       $out_string .= "# save certificates\n";
60 60
       $out_string .= 'echo "';
61 61
       foreach ($CAs as $ca) {
62
-        $out_string .= $ca['pem']."\n";
62
+        $out_string .= $ca['pem'] . "\n";
63 63
       }
64
-      $out_string .= '"'." > \$HOME/$this->local_dir/ca.pem\n";
64
+      $out_string .= '"' . " > \$HOME/$this->local_dir/ca.pem\n";
65 65
 
66 66
      $SSIDs = $this->attributes['internal:SSID'];
67 67
      $delSSIDs = $this->attributes['internal:remove_SSID'];
68 68
 
69
-     $out_string .= $this->printNMScript($SSIDs,$delSSIDs);
69
+     $out_string .= $this->printNMScript($SSIDs, $delSSIDs);
70 70
      $out_string .= $this->writeWpaConf($SSIDs);
71
-     if($this->selected_eap == EAP::$TLS) 
71
+     if ($this->selected_eap == EAP::$TLS) 
72 72
        $out_string .= $this->printP12Dialog();
73 73
      else
74 74
        $out_string .= $this->printPasswordDialog();
75 75
      $out_string .= $this->checkNMResultAndCont();
76
-     $installer_path = $this->installerBasename.'.sh';
76
+     $installer_path = $this->installerBasename . '.sh';
77 77
       file_put_contents($installer_path, $out_string);
78 78
       return($installer_path);
79 79
    }
80 80
 
81 81
     public function writeDeviceInfo() {
82
-    $ssid_ct=count($this->attributes['internal:SSID']);
82
+    $ssid_ct = count($this->attributes['internal:SSID']);
83 83
     $out = '';
84 84
 
85 85
    $out .= _("The installer is in the form of a bash script. It will try to configure eduroam under Network Manager and if this is either not appropriate for your system or your version of Network Manager is too old, a wpa_supplicant config file will be created instead.");
86 86
    $out .= "<p>";
87
-    if($ssid_ct > 1) {
88
-        if($ssid_ct > 2) {
89
-            $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
87
+    if ($ssid_ct > 1) {
88
+        if ($ssid_ct > 2) {
89
+            $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"), implode(', ', Config::$CONSORTIUM['ssid'])) . " ";
90 90
         } else
91
-            $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
91
+            $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"), implode(', ', Config::$CONSORTIUM['ssid'])) . " ";
92 92
         $i = 0;
93 93
         foreach ($this->attributes['internal:SSID'] as $ssid=>$v) {
94
-           if(! in_array($ssid, Config::$CONSORTIUM['ssid'])) {
95
-             if($i > 0)
94
+           if (!in_array($ssid, Config::$CONSORTIUM['ssid'])) {
95
+             if ($i > 0)
96 96
            $out .= ", ";
97 97
          $i++;
98 98
          $out .= "<strong>$ssid</strong>";
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     $out .= "<p>";
102 102
     }
103 103
    $out .= _("The installer will create .cat_installer sub-directory in your home directory and will copy your server certificates there.");
104
-if($this->eap == EAP::$TLS)
104
+if ($this->eap == EAP::$TLS)
105 105
    $out .= _("In order to connect to the network you will need a personal certificate in the form of a p12 file. You should obtain this certificate from your home institution. Consult the support page to find out how this certificate can be obtained. Such certificate files are password protected. You should have both the file and the password available during the installation process. Your p12 file will also be copied to the .cat_installer directory.");
106 106
 else {
107 107
    $out .= _("In order to connect to the network you will need an account from your home institution. You should consult the support page to find out how this account can be obtained. It is very likely that your account is already activated.");
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
 
115 115
 
116 116
   private function printCheckDirectory() {
117
-$out = 'if [ -d $HOME/'.$this->local_dir.' ] ; then
118
-   if ! ask "'.sprintf(_("Directory %s exists; some of its files may be overwritten."),'$HOME/'.$this->local_dir).'" "'._("Continue").'" 1 ; then exit; fi
117
+$out = 'if [ -d $HOME/' . $this->local_dir . ' ] ; then
118
+   if ! ask "'.sprintf(_("Directory %s exists; some of its files may be overwritten."), '$HOME/' . $this->local_dir) . '" "' . _("Continue") . '" 1 ; then exit; fi
119 119
 else
120
-  mkdir $HOME/'.$this->local_dir.'
120
+  mkdir $HOME/'.$this->local_dir . '
121 121
 fi
122 122
 ';
123 123
  return $out;
@@ -125,17 +125,17 @@  discard block
 block discarded – undo
125 125
 
126 126
   private function checkNMResultAndCont() {
127 127
     $out = 'if run_python_script ; then
128
-   show_info "'._("Installation successful").'"
128
+   show_info "'._("Installation successful") . '"
129 129
 else
130
-   show_info "'._("Network Manager configuration failed, generating wpa_supplicant.conf").'"
131
-   if ! ask "'.("Network Manager configuration failed, but we may generate a wpa_supplicant configuration file if you wish. Be warned that your connection password will be saved in this file as clear text.").'" "'._("Write the file").'" 1 ; then exit ; fi
130
+   show_info "'._("Network Manager configuration failed, generating wpa_supplicant.conf") . '"
131
+   if ! ask "'.("Network Manager configuration failed, but we may generate a wpa_supplicant configuration file if you wish. Be warned that your connection password will be saved in this file as clear text.") . '" "' . _("Write the file") . '" 1 ; then exit ; fi
132 132
 
133
-if [ -f '.$this->conf_file.' ] ; then
134
-  if ! ask "'.sprintf(_("File %s exists; it will be overwritten."),$this->conf_file).'" "'._("Continue").'" 1 ; then confirm_exit; fi
135
-  rm '.$this->conf_file.'
133
+if [ -f '.$this->conf_file . ' ] ; then
134
+  if ! ask "'.sprintf(_("File %s exists; it will be overwritten."), $this->conf_file) . '" "' . _("Continue") . '" 1 ; then confirm_exit; fi
135
+  rm '.$this->conf_file . '
136 136
   fi
137 137
    create_wpa_conf
138
-   show_info "'.sprintf(_("Output written to %s"),$this->conf_file).'"
138
+   show_info "'.sprintf(_("Output written to %s"), $this->conf_file) . '"
139 139
 fi
140 140
 ';
141 141
   return $out;
@@ -143,19 +143,19 @@  discard block
 block discarded – undo
143 143
 
144 144
 private function printStart() {
145 145
      $out = "setup_environment\n";
146
-     $out .= 'show_info "'._("This installer has been prepared for \${ORGANISATION}").'\n\n'._("More information and comments:").'\n\nEMAIL: ${SUPPORT}\nWWW: ${URL}\n\n'.
147
-_("Installer created with software from the GEANT project.").'"
146
+     $out .= 'show_info "' . _("This installer has been prepared for \${ORGANISATION}") . '\n\n' . _("More information and comments:") . '\n\nEMAIL: ${SUPPORT}\nWWW: ${URL}\n\n' .
147
+_("Installer created with software from the GEANT project.") . '"
148 148
 ';
149 149
   return $out;
150 150
 }
151 151
 
152 152
 
153 153
 private function printProfileConfirmation() {
154
- if($this->attributes['internal:profile_count'][0] > 1)
155
-       $out = 'if ! ask "'.sprintf(_("This installer will only work properly if you are a member of %s and the user group: %s."),'${bf}'.$this->attributes['general:instname'][0].'${n}','${bf}'.$this->attributes['profile:name'][0]).'${n}"';
154
+ if ($this->attributes['internal:profile_count'][0] > 1)
155
+       $out = 'if ! ask "' . sprintf(_("This installer will only work properly if you are a member of %s and the user group: %s."), '${bf}' . $this->attributes['general:instname'][0] . '${n}', '${bf}' . $this->attributes['profile:name'][0]) . '${n}"';
156 156
     else
157
-       $out = 'if ! ask "'.sprintf(_("This installer will only work properly if you are a member of %s."),'${bf}'.$this->attributes['general:instname'][0]).'${n}"';
158
-    $out .= ' "'._("Continue").'" 1 ; then exit; fi
157
+       $out = 'if ! ask "' . sprintf(_("This installer will only work properly if you are a member of %s."), '${bf}' . $this->attributes['general:instname'][0]) . '${n}"';
158
+    $out .= ' "' . _("Continue") . '" 1 ; then exit; fi
159 159
 ';
160 160
   return $out;
161 161
 
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
 
165 165
   private function printUserConsent() {
166 166
     $out = '';
167
-    if(isset($this->attributes['support:info_file'])) {
168
-      if( $this->attributes['internal:info_file'][0]['mime'] == 'txt') {
169
-         $handle = fopen($this->attributes['internal:info_file'][0]['name'],"r");
167
+    if (isset($this->attributes['support:info_file'])) {
168
+      if ($this->attributes['internal:info_file'][0]['mime'] == 'txt') {
169
+         $handle = fopen($this->attributes['internal:info_file'][0]['name'], "r");
170 170
          $consent = '';
171 171
          while (($buffer = fgets($handle, 4096)) !== false) {
172 172
            $consent .= rtrim($buffer) . '\n';
173 173
          }
174
-         $out = 'if ! ask "'.$consent.'${n}" "'._("Continue").'" 1 ; then exit; fi
174
+         $out = 'if ! ask "' . $consent . '${n}" "' . _("Continue") . '" 1 ; then exit; fi
175 175
 ';
176 176
       }
177 177
     }
@@ -182,18 +182,18 @@  discard block
 block discarded – undo
182 182
 # if the second argument is 0 then the first element of yes_no array
183 183
 # will be the default value prompted to the user
184 184
   private function printFunctions() {
185
-$url = (isset($this->attributes['support:url'][0]) && $this->attributes['support:url'][0] ) ? $this->attributes['support:url'][0] : $this->support_url_substitute;
186
-$support=(isset($this->attributes['support:email'][0]) && $this->attributes['support:email'][0] ) ? $this->attributes['support:email'][0] : $this->support_email_substitute;
187
-$out ='
185
+$url = (isset($this->attributes['support:url'][0]) && $this->attributes['support:url'][0]) ? $this->attributes['support:url'][0] : $this->support_url_substitute;
186
+$support = (isset($this->attributes['support:email'][0]) && $this->attributes['support:email'][0]) ? $this->attributes['support:email'][0] : $this->support_email_substitute;
187
+$out = '
188 188
 my_name=$0
189 189
 
190 190
 
191 191
 function setup_environment {
192 192
   bf=""
193 193
   n=""
194
-  ORGANISATION="'.$this->attributes['general:instname'][0].'"
195
-  URL="'.$url.'"
196
-  SUPPORT="'.$support.'"
194
+  ORGANISATION="'.$this->attributes['general:instname'][0] . '"
195
+  URL="'.$url . '"
196
+  SUPPORT="'.$support . '"
197 197
 if [ ! -z "$DISPLAY" ] ; then
198 198
   if which zenity 1>/dev/null 2>&1 ; then
199 199
     ZENITY=`which zenity`
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
 
234 234
 function ask {
235
-     T="'.Config::$APPEARANCE['productname'].'"
235
+     T="'.Config::$APPEARANCE['productname'] . '"
236 236
 #  if ! [ -z "$3" ] ; then
237 237
 #     T="$T: $3"
238 238
 #  fi
@@ -252,8 +252,8 @@  discard block
 block discarded – undo
252 252
      fi
253 253
   fi
254 254
 
255
-  yes='._("Y").'
256
-  no='._("N").'
255
+  yes='._("Y") . '
256
+  no='._("N") . '
257 257
   yes1=`echo $yes | awk \'{ print toupper($0) }\'`
258 258
   no1=`echo $no | awk \'{ print toupper($0) }\'`
259 259
 
@@ -310,12 +310,12 @@  discard block
 block discarded – undo
310 310
 
311 311
 function confirm_exit {
312 312
   if [ ! -z $KDIALOG ] ; then
313
-     if $KDIALOG --yesno "'._("Really quit?").'"  ; then
313
+     if $KDIALOG --yesno "'._("Really quit?") . '"  ; then
314 314
      exit 1
315 315
      fi
316 316
   fi
317 317
   if [ ! -z $ZENITY ] ; then
318
-     if $ZENITY --question --text="'._("Really quit?").'" 2>/dev/null ; then
318
+     if $ZENITY --question --text="'._("Really quit?") . '" 2>/dev/null ; then
319 319
         exit 1
320 320
      fi
321 321
   fi
@@ -368,20 +368,20 @@  discard block
 block discarded – undo
368 368
   PASSWORD="a"
369 369
   PASSWORD1="b"
370 370
 
371
-  if ! USER_NAME=`prompt_nonempty_string 1 "'._("enter your userid").'"` ; then
371
+  if ! USER_NAME=`prompt_nonempty_string 1 "'._("enter your userid") . '"` ; then
372 372
     exit 1
373 373
   fi
374 374
 
375 375
   while [ "$PASSWORD" != "$PASSWORD1" ]
376 376
   do
377
-    if ! PASSWORD=`prompt_nonempty_string 0 "'._("enter your password").'"` ; then
377
+    if ! PASSWORD=`prompt_nonempty_string 0 "'._("enter your password") . '"` ; then
378 378
       exit 1
379 379
     fi
380
-    if ! PASSWORD1=`prompt_nonempty_string 0 "'._("repeat your password").'"` ; then
380
+    if ! PASSWORD1=`prompt_nonempty_string 0 "'._("repeat your password") . '"` ; then
381 381
       exit 1
382 382
     fi
383 383
     if [ "$PASSWORD" != "$PASSWORD1" ] ; then
384
-      alert "'._("passwords do not match").'"
384
+      alert "'._("passwords do not match") . '"
385 385
     fi
386 386
   done
387 387
 }
@@ -394,38 +394,38 @@  discard block
 block discarded – undo
394 394
   private function writeWpaConf($SSIDs) {
395 395
      $e = EAP::eapDisplayName($this->selected_eap);
396 396
 $out = 'function create_wpa_conf {
397
-cat << EOFW >> '.$this->conf_file."\n";
397
+cat << EOFW >> '.$this->conf_file . "\n";
398 398
      foreach (array_keys($SSIDs) as $ssid) {
399 399
     $out .= '
400 400
 network={
401
-  ssid="'.$ssid.'"
401
+  ssid="'.$ssid . '"
402 402
   key_mgmt=WPA-EAP
403 403
   pairwise=CCMP
404 404
   group=CCMP TKIP
405
-  eap='.$e['OUTER'].'
406
-  ca_cert="${HOME}/'.$this->local_dir.'/ca.pem"
405
+  eap='.$e['OUTER'] . '
406
+  ca_cert="${HOME}/'.$this->local_dir . '/ca.pem"
407 407
   identity="${USER_NAME}"';
408
-  if($this->server_name)
408
+  if ($this->server_name)
409 409
     $out .= '
410
-  domain_suffix_match="'.$this->server_name.'"';
411
-  if($this->selected_eap == EAP::$TLS) {
410
+  domain_suffix_match="'.$this->server_name . '"';
411
+  if ($this->selected_eap == EAP::$TLS) {
412 412
     $out .= '
413
-  private_key="${HOME}/'.$this->local_dir.'/user.p12"
413
+  private_key="${HOME}/'.$this->local_dir . '/user.p12"
414 414
   private_key_passwd="${PASSWORD}"';
415 415
   } else {
416 416
     $out .= '
417
-  phase2="auth='.$e['INNER'].'"
417
+  phase2="auth='.$e['INNER'] . '"
418 418
   password="${PASSWORD}"';
419
-  if($this->attributes['internal:use_anon_outer'][0] == 1) 
419
+  if ($this->attributes['internal:use_anon_outer'][0] == 1) 
420 420
     $out .= '
421
-  anonymous_identity="'.$this->attributes['internal:anon_local_value'][0].'@'.$this->attributes['internal:realm'][0].'"';
421
+  anonymous_identity="'.$this->attributes['internal:anon_local_value'][0] . '@' . $this->attributes['internal:realm'][0] . '"';
422 422
   }
423 423
     $out .= '
424 424
 }';
425 425
 }
426 426
   $out .= '
427 427
 EOFW
428
-chmod 600 '.$this->conf_file.'
428
+chmod 600 '.$this->conf_file . '
429 429
 }
430 430
 ';
431 431
   return $out;
@@ -440,13 +440,13 @@  discard block
 block discarded – undo
440 440
   return $out;
441 441
 }
442 442
   private function printP12Dialog() {
443
-  $out ='function p12dialog {
443
+  $out = 'function p12dialog {
444 444
   if [ ! -z $ZENITY ] ; then
445
-    if ! cert=`$ZENITY --file-selection --file-filter="'._("personal certificate file (p12 or pfx)").' | *.p12 *.P12 *.pfx *.PFX" --file-filter="All files | *" --title="'._("personal certificate file (p12 or pfx)").'" 2>/dev/null` ; then
445
+    if ! cert=`$ZENITY --file-selection --file-filter="'._("personal certificate file (p12 or pfx)") . ' | *.p12 *.P12 *.pfx *.PFX" --file-filter="All files | *" --title="' . _("personal certificate file (p12 or pfx)") . '" 2>/dev/null` ; then
446 446
        exit
447 447
     fi
448 448
   elif [ ! -z $KDIALOG ] ; then
449
-    if ! cert=`$KDIALOG --getopenfilename . "*.p12 *.P12 *.pfx *.PFX | '._("personal certificate file (p12 or pfx)").'" --title "'._("personal certificate file (p12 or pfx)").'"` ; then
449
+    if ! cert=`$KDIALOG --getopenfilename . "*.p12 *.P12 *.pfx *.PFX | '._("personal certificate file (p12 or pfx)") . '" --title "' . _("personal certificate file (p12 or pfx)") . '"` ; then
450 450
        exit
451 451
     fi
452 452
   
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
     fi
459 459
 
460 460
     while true ; do
461
-      prompt="'._("personal certificate file (p12 or pfx)").'"
461
+      prompt="'._("personal certificate file (p12 or pfx)") . '"
462 462
       read -p "${prompt} [$bf$cert${n}]" cert_f
463 463
       if [ "$cert" -a -z "$cert_f" ] ; then
464 464
          break
@@ -467,20 +467,20 @@  discard block
 block discarded – undo
467 467
           cert=$cert_f
468 468
           break
469 469
         else
470
-          echo "'._("file not found").'"
470
+          echo "'._("file not found") . '"
471 471
           cert=""
472 472
         fi
473 473
       fi
474 474
     done
475 475
 fi
476
-    cp "$cert" $HOME/'.$this->local_dir.'/user.p12
477
-    cert=$HOME/'.$this->local_dir.'/user.p12
476
+    cp "$cert" $HOME/'.$this->local_dir . '/user.p12
477
+    cert=$HOME/'.$this->local_dir . '/user.p12
478 478
 
479 479
     PASSWORD=""
480
-    prompt="'._("enter the password for the certificate file").'"
480
+    prompt="'._("enter the password for the certificate file") . '"
481 481
     while [ ! "$PASSWORD" ]
482 482
     do
483
-      if ! PASSWORD=`prompt_nonempty_string 0 "'._("enter the password for the certificate file").'"` ; then
483
+      if ! PASSWORD=`prompt_nonempty_string 0 "'._("enter the password for the certificate file") . '"` ; then
484 484
         exit 1
485 485
       fi
486 486
       if openssl pkcs12 -in $cert -passin pass:"$PASSWORD" -noout 2>/dev/null; then
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
         PASSWORD=""
494 494
       fi
495 495
     done
496
-      if ! USERNAME=`prompt_nonempty_string 1 "'._("enter your userid").'" "$USER_NAME"` ; then
496
+      if ! USERNAME=`prompt_nonempty_string 1 "'._("enter your userid") . '" "$USER_NAME"` ; then
497 497
        exit 1
498 498
     fi
499 499
 }  
@@ -504,31 +504,31 @@  discard block
 block discarded – undo
504 504
 
505 505
 
506 506
 private function glueServerNames($server_list) {
507
-  if(! $server_list)
507
+  if (!$server_list)
508 508
     return '';
509
-  $A0 =  array_reverse(explode('.',array_shift($server_list)));
509
+  $A0 = array_reverse(explode('.', array_shift($server_list)));
510 510
   $B = $A0;
511
-  foreach($server_list as $a) {
512
-     $A= array_reverse(explode('.',$a));
513
-     $B = array_intersect_assoc($A0,$A);
511
+  foreach ($server_list as $a) {
512
+     $A = array_reverse(explode('.', $a));
513
+     $B = array_intersect_assoc($A0, $A);
514 514
      $A0 = $B;
515 515
    }
516
-  return(implode('.',array_reverse($B)));
516
+  return(implode('.', array_reverse($B)));
517 517
 }
518 518
 
519 519
 private function mkSubjectAltNameList($server_list) {
520
-  if(! $server_list)
520
+  if (!$server_list)
521 521
     return '';
522 522
   $out = '';
523
-  foreach($server_list as $a) {
524
-     if($out)
523
+  foreach ($server_list as $a) {
524
+     if ($out)
525 525
        $out .= ','; 
526 526
      $out .= "'DNS:$a'";
527 527
   }
528 528
   return $out;
529 529
 }
530 530
 
531
-private function printNMScript($SSIDs,$delSSIDs) {
531
+private function printNMScript($SSIDs, $delSSIDs) {
532 532
    $e = EAP::eapDisplayName($this->selected_eap);
533 533
 $out = 'function run_python_script {
534 534
 PASSWORD=$( echo "$PASSWORD" | sed "s/\'/\\\\\\\'/g" )
@@ -588,8 +588,8 @@  discard block
 block discarded – undo
588 588
             sys.exit(2)
589 589
 
590 590
     def check_opts(self):
591
-        self.cacert_file = \'${HOME}/'.$this->local_dir.'/ca.pem\'
592
-        self.pfx_file = \'${HOME}/'.$this->local_dir.'/user.p12\'
591
+        self.cacert_file = \'${HOME}/'.$this->local_dir . '/ca.pem\'
592
+        self.pfx_file = \'${HOME}/'.$this->local_dir . '/user.p12\'
593 593
         if not os.path.isfile(self.cacert_file):
594 594
             print("Certificate file not found, looks like a CAT error")
595 595
             sys.exit(2)
@@ -638,8 +638,8 @@  discard block
 block discarded – undo
638 638
                pass
639 639
 
640 640
     def add_connection(self,ssid):
641
-        server_alt_subject_name_list = dbus.Array({'.$this->server_alt_subject_name_list.'})
642
-        server_name = \''.$this->server_name.'\'
641
+        server_alt_subject_name_list = dbus.Array({'.$this->server_alt_subject_name_list . '})
642
+        server_name = \''.$this->server_name . '\'
643 643
         if self.nm_version == "0.9" or self.nm_version == "1.0":
644 644
              match_key = \'altsubject-matches\'
645 645
              match_value = server_alt_subject_name_list
@@ -664,14 +664,14 @@  discard block
 block discarded – undo
664 664
             \'group\': [\'ccmp\', \'tkip\']
665 665
         })
666 666
         s_8021x = dbus.Dictionary({
667
-            \'eap\': [\''.strtolower($e['OUTER']).'\'],
667
+            \'eap\': [\''.strtolower($e['OUTER']) . '\'],
668 668
             \'identity\': \'$USER_NAME\',
669 669
             \'ca-cert\': dbus.ByteArray("file://{0}\0".format(self.cacert_file).encode(\'utf8\')),';
670
-    if($this->server_name) {
670
+    if ($this->server_name) {
671 671
              $out .= '
672 672
              match_key: match_value,';
673 673
     }
674
-    if($this->selected_eap == EAP::$TLS) {
674
+    if ($this->selected_eap == EAP::$TLS) {
675 675
        $out .= '
676 676
             \'client-cert\':  dbus.ByteArray("file://{0}\0".format(self.pfx_file).encode(\'utf8\')),
677 677
             \'private-key\':  dbus.ByteArray("file://{0}\0".format(self.pfx_file).encode(\'utf8\')),
@@ -679,10 +679,10 @@  discard block
 block discarded – undo
679 679
     } else {
680 680
        $out .= '
681 681
             \'password\': \'$PASSWORD\',
682
-            \'phase2-auth\': \''.strtolower($e['INNER']).'\',';
683
-         if($this->attributes['internal:use_anon_outer'][0] == 1) 
682
+            \'phase2-auth\': \''.strtolower($e['INNER']) . '\',';
683
+         if ($this->attributes['internal:use_anon_outer'][0] == 1) 
684 684
               $out .= '
685
-            \'anonymous-identity\': \''.$this->attributes['internal:anon_local_value'][0].'@'.$this->attributes['internal:realm'][0].'\',';
685
+            \'anonymous-identity\': \''.$this->attributes['internal:anon_local_value'][0] . '@' . $this->attributes['internal:realm'][0] . '\',';
686 686
     }
687 687
     $out .= '
688 688
         })
@@ -702,18 +702,18 @@  discard block
 block discarded – undo
702 702
         self.check_opts()
703 703
         ver = self.connect_to_NM()';
704 704
      foreach (array_keys($SSIDs) as $ssid) {
705
-           $out .='
706
-        self.delete_existing_connections(\''.$ssid.'\')
707
-        self.add_connection(\''.$ssid.'\')';
705
+           $out .= '
706
+        self.delete_existing_connections(\''.$ssid . '\')
707
+        self.add_connection(\''.$ssid . '\')';
708 708
      }
709 709
 //   create a list of profiles to be deleted after installation
710 710
      foreach ($delSSIDs as $ssid => $cipher) {
711
-         if($cipher == 'DEL')
712
-            $out .='
713
-        self.delete_existing_connections(\''.$ssid.'\')';
711
+         if ($cipher == 'DEL')
712
+            $out .= '
713
+        self.delete_existing_connections(\''.$ssid . '\')';
714 714
      }
715 715
 
716
-$out .='
716
+$out .= '
717 717
 
718 718
 if __name__ == "__main__":
719 719
     ENMCT = EduroamNMConfigTool()
Please login to merge, or discard this patch.
Braces   +39 added lines, -28 removed lines patch added patch discarded remove patch
@@ -68,10 +68,11 @@  discard block
 block discarded – undo
68 68
 
69 69
      $out_string .= $this->printNMScript($SSIDs,$delSSIDs);
70 70
      $out_string .= $this->writeWpaConf($SSIDs);
71
-     if($this->selected_eap == EAP::$TLS) 
72
-       $out_string .= $this->printP12Dialog();
73
-     else
74
-       $out_string .= $this->printPasswordDialog();
71
+     if($this->selected_eap == EAP::$TLS) {
72
+            $out_string .= $this->printP12Dialog();
73
+     } else {
74
+            $out_string .= $this->printPasswordDialog();
75
+     }
75 76
      $out_string .= $this->checkNMResultAndCont();
76 77
      $installer_path = $this->installerBasename.'.sh';
77 78
       file_put_contents($installer_path, $out_string);
@@ -87,13 +88,15 @@  discard block
 block discarded – undo
87 88
     if($ssid_ct > 1) {
88 89
         if($ssid_ct > 2) {
89 90
             $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
90
-        } else
91
-            $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
91
+        } else {
92
+                    $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
93
+        }
92 94
         $i = 0;
93 95
         foreach ($this->attributes['internal:SSID'] as $ssid=>$v) {
94 96
            if(! in_array($ssid, Config::$CONSORTIUM['ssid'])) {
95
-             if($i > 0)
96
-           $out .= ", ";
97
+             if($i > 0) {
98
+                        $out .= ", ";
99
+             }
97 100
          $i++;
98 101
          $out .= "<strong>$ssid</strong>";
99 102
        }
@@ -101,9 +104,9 @@  discard block
 block discarded – undo
101 104
     $out .= "<p>";
102 105
     }
103 106
    $out .= _("The installer will create .cat_installer sub-directory in your home directory and will copy your server certificates there.");
104
-if($this->eap == EAP::$TLS)
107
+if($this->eap == EAP::$TLS) {
105 108
    $out .= _("In order to connect to the network you will need a personal certificate in the form of a p12 file. You should obtain this certificate from your home institution. Consult the support page to find out how this certificate can be obtained. Such certificate files are password protected. You should have both the file and the password available during the installation process. Your p12 file will also be copied to the .cat_installer directory.");
106
-else {
109
+} else {
107 110
    $out .= _("In order to connect to the network you will need an account from your home institution. You should consult the support page to find out how this account can be obtained. It is very likely that your account is already activated.");
108 111
    $out .= "<p>";
109 112
    $out .= _("You will be requested to enter your account credentials during the installation. This information will be saved so that you will reconnect to the network automatically each time you are in the range.");
@@ -151,10 +154,11 @@  discard block
 block discarded – undo
151 154
 
152 155
 
153 156
 private function printProfileConfirmation() {
154
- if($this->attributes['internal:profile_count'][0] > 1)
155
-       $out = 'if ! ask "'.sprintf(_("This installer will only work properly if you are a member of %s and the user group: %s."),'${bf}'.$this->attributes['general:instname'][0].'${n}','${bf}'.$this->attributes['profile:name'][0]).'${n}"';
156
-    else
157
-       $out = 'if ! ask "'.sprintf(_("This installer will only work properly if you are a member of %s."),'${bf}'.$this->attributes['general:instname'][0]).'${n}"';
157
+ if($this->attributes['internal:profile_count'][0] > 1) {
158
+        $out = 'if ! ask "'.sprintf(_("This installer will only work properly if you are a member of %s and the user group: %s."),'${bf}'.$this->attributes['general:instname'][0].'${n}','${bf}'.$this->attributes['profile:name'][0]).'${n}"';
159
+ } else {
160
+           $out = 'if ! ask "'.sprintf(_("This installer will only work properly if you are a member of %s."),'${bf}'.$this->attributes['general:instname'][0]).'${n}"';
161
+    }
158 162
     $out .= ' "'._("Continue").'" 1 ; then exit; fi
159 163
 ';
160 164
   return $out;
@@ -405,9 +409,10 @@  discard block
 block discarded – undo
405 409
   eap='.$e['OUTER'].'
406 410
   ca_cert="${HOME}/'.$this->local_dir.'/ca.pem"
407 411
   identity="${USER_NAME}"';
408
-  if($this->server_name)
409
-    $out .= '
412
+  if($this->server_name) {
413
+      $out .= '
410 414
   domain_suffix_match="'.$this->server_name.'"';
415
+  }
411 416
   if($this->selected_eap == EAP::$TLS) {
412 417
     $out .= '
413 418
   private_key="${HOME}/'.$this->local_dir.'/user.p12"
@@ -416,10 +421,11 @@  discard block
 block discarded – undo
416 421
     $out .= '
417 422
   phase2="auth='.$e['INNER'].'"
418 423
   password="${PASSWORD}"';
419
-  if($this->attributes['internal:use_anon_outer'][0] == 1) 
420
-    $out .= '
424
+  if($this->attributes['internal:use_anon_outer'][0] == 1) {
425
+      $out .= '
421 426
   anonymous_identity="'.$this->attributes['internal:anon_local_value'][0].'@'.$this->attributes['internal:realm'][0].'"';
422 427
   }
428
+  }
423 429
     $out .= '
424 430
 }';
425 431
 }
@@ -504,8 +510,9 @@  discard block
 block discarded – undo
504 510
 
505 511
 
506 512
 private function glueServerNames($server_list) {
507
-  if(! $server_list)
508
-    return '';
513
+  if(! $server_list) {
514
+      return '';
515
+  }
509 516
   $A0 =  array_reverse(explode('.',array_shift($server_list)));
510 517
   $B = $A0;
511 518
   foreach($server_list as $a) {
@@ -517,12 +524,14 @@  discard block
 block discarded – undo
517 524
 }
518 525
 
519 526
 private function mkSubjectAltNameList($server_list) {
520
-  if(! $server_list)
521
-    return '';
527
+  if(! $server_list) {
528
+      return '';
529
+  }
522 530
   $out = '';
523 531
   foreach($server_list as $a) {
524
-     if($out)
525
-       $out .= ','; 
532
+     if($out) {
533
+            $out .= ',';
534
+     }
526 535
      $out .= "'DNS:$a'";
527 536
   }
528 537
   return $out;
@@ -680,9 +689,10 @@  discard block
 block discarded – undo
680 689
        $out .= '
681 690
             \'password\': \'$PASSWORD\',
682 691
             \'phase2-auth\': \''.strtolower($e['INNER']).'\',';
683
-         if($this->attributes['internal:use_anon_outer'][0] == 1) 
684
-              $out .= '
692
+         if($this->attributes['internal:use_anon_outer'][0] == 1) {
693
+                       $out .= '
685 694
             \'anonymous-identity\': \''.$this->attributes['internal:anon_local_value'][0].'@'.$this->attributes['internal:realm'][0].'\',';
695
+         }
686 696
     }
687 697
     $out .= '
688 698
         })
@@ -708,9 +718,10 @@  discard block
 block discarded – undo
708 718
      }
709 719
 //   create a list of profiles to be deleted after installation
710 720
      foreach ($delSSIDs as $ssid => $cipher) {
711
-         if($cipher == 'DEL')
712
-            $out .='
721
+         if($cipher == 'DEL') {
722
+                     $out .='
713 723
         self.delete_existing_connections(\''.$ssid.'\')';
724
+         }
714 725
      }
715 726
 
716 727
 $out .='
Please login to merge, or discard this patch.
devices/devices-template.php 2 patches
Indentation   +149 added lines, -149 removed lines patch added patch discarded remove patch
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
  */
56 56
 
57 57
 public static $Options=[
58
-  'sign'=>0,
59
-  'no_cache'=>0,
60
-  'hidden'=>0,
61
-  'redirect'=>0,
58
+    'sign'=>0,
59
+    'no_cache'=>0,
60
+    'hidden'=>0,
61
+    'redirect'=>0,
62 62
 ];
63 63
 
64 64
 /**
@@ -96,75 +96,75 @@  discard block
 block discarded – undo
96 96
 
97 97
 public static function listDevices() {
98 98
     return [
99
- 'w10'=>[
100
-   'group' => "microsoft",
101
-   'display'=>_("MS Windows 10"),
102
-   'match'=>'Windows NT 10',
103
-   'directory'=>'ms',
104
-   'module'=>'W8',
105
-   'signer'=>'ms_windows_sign',
99
+    'w10'=>[
100
+    'group' => "microsoft",
101
+    'display'=>_("MS Windows 10"),
102
+    'match'=>'Windows NT 10',
103
+    'directory'=>'ms',
104
+    'module'=>'W8',
105
+    'signer'=>'ms_windows_sign',
106 106
     'options'=>[
107
-       'sign'=>1,
108
-       'device_id'=>'W10',
109
-       'mime'=>'application/x-dosexec',
110
-      ],
111
-   ],
107
+        'sign'=>1,
108
+        'device_id'=>'W10',
109
+        'mime'=>'application/x-dosexec',
110
+        ],
111
+    ],
112 112
 	
113
- 'w8'=>[
114
-   'group' => "microsoft",
115
-   'display'=>_("MS Windows 8, 8.1"),
116
-   'match'=>'Windows NT 6[._][23]',
117
-   'directory'=>'ms',
118
-   'module'=>'W8',
119
-   'signer'=>'ms_windows_sign',
113
+    'w8'=>[
114
+    'group' => "microsoft",
115
+    'display'=>_("MS Windows 8, 8.1"),
116
+    'match'=>'Windows NT 6[._][23]',
117
+    'directory'=>'ms',
118
+    'module'=>'W8',
119
+    'signer'=>'ms_windows_sign',
120 120
     'options'=>[
121
-       'sign'=>1,
122
-       'device_id'=>'W8',
123
-       'mime'=>'application/x-dosexec',
124
-      ],
125
-   ],
121
+        'sign'=>1,
122
+        'device_id'=>'W8',
123
+        'mime'=>'application/x-dosexec',
124
+        ],
125
+    ],
126 126
 	
127
- 'w7'=>[
128
-   'group' => "microsoft",
129
-   'display'=>_("MS Windows 7"),
130
-   'match'=>'Windows NT 6[._]1',
131
-   'directory'=>'ms',
132
-   'module'=>'Vista7',
133
-   'signer'=>'ms_windows_sign',
127
+    'w7'=>[
128
+    'group' => "microsoft",
129
+    'display'=>_("MS Windows 7"),
130
+    'match'=>'Windows NT 6[._]1',
131
+    'directory'=>'ms',
132
+    'module'=>'Vista7',
133
+    'signer'=>'ms_windows_sign',
134 134
     'options'=>[
135
-       'sign'=>1,
136
-       'device_id'=>'W7',
137
-       'mime'=>'application/x-dosexec',
138
-      ],
139
-   ],
135
+        'sign'=>1,
136
+        'device_id'=>'W7',
137
+        'mime'=>'application/x-dosexec',
138
+        ],
139
+    ],
140 140
 	
141
- 'vista'=>[
142
-   'group' => "microsoft",
143
-   'display'=>_("MS Windows Vista"),
144
-   'match'=>'Windows NT 6[._]0',
145
-   'directory'=>'ms',
146
-   'module'=>'Vista7',
147
-   'signer'=>'ms_windows_sign',
141
+    'vista'=>[
142
+    'group' => "microsoft",
143
+    'display'=>_("MS Windows Vista"),
144
+    'match'=>'Windows NT 6[._]0',
145
+    'directory'=>'ms',
146
+    'module'=>'Vista7',
147
+    'signer'=>'ms_windows_sign',
148 148
     'options'=>[
149
-       'sign'=>1,
150
-       'device_id'=>'Vista',
151
-       'mime'=>'application/x-dosexec',
152
-      ],
153
-   ],
149
+        'sign'=>1,
150
+        'device_id'=>'Vista',
151
+        'mime'=>'application/x-dosexec',
152
+        ],
153
+    ],
154 154
 	
155
- 'win-rt'=>[
155
+    'win-rt'=>[
156 156
     'group' => "microsoft",
157 157
     'display'=>_("Windows RT"),
158 158
     'directory'=>'redirect_dev',
159 159
     'module'=>'RedirectDev',
160 160
     'options'=>[
161
-      'hidden'=>0,
162
-      'redirect'=>1,
163
-      ],
164
-   ],
161
+        'hidden'=>0,
162
+        'redirect'=>1,
163
+        ],
164
+    ],
165 165
     
166 166
 
167
- 'apple_el_cap'=>[
167
+    'apple_el_cap'=>[
168 168
     'group' => "apple",
169 169
     'display'=>_("Apple OS X El Capitan"),
170 170
     'match'=>'Mac OS X 10[._]11',
@@ -172,13 +172,13 @@  discard block
 block discarded – undo
172 172
     'module'=>'mobileconfig_os_x',
173 173
     'signer'=>'mobileconfig_sign',
174 174
     'options'=>array(
175
-       'sign'=>1,
176
-       'device_id'=>'OS_X',
177
-       'mime'=>'application/x-apple-aspen-config',
178
-      ),
175
+        'sign'=>1,
176
+        'device_id'=>'OS_X',
177
+        'mime'=>'application/x-apple-aspen-config',
178
+        ),
179 179
     ],
180 180
 
181
- 'apple_yos'=>[
181
+    'apple_yos'=>[
182 182
     'group' => "apple",
183 183
     'display'=>_("Apple OS X Yosemite"),
184 184
     'match'=>'Mac OS X 10[._]10',
@@ -186,13 +186,13 @@  discard block
 block discarded – undo
186 186
     'module'=>'mobileconfig_os_x',
187 187
     'signer'=>'mobileconfig_sign',
188 188
     'options'=>[
189
-       'sign'=>1,
190
-       'device_id'=>'OS_X',
191
-       'mime'=>'application/x-apple-aspen-config',
192
-      ],
189
+        'sign'=>1,
190
+        'device_id'=>'OS_X',
191
+        'mime'=>'application/x-apple-aspen-config',
192
+        ],
193 193
     ],
194 194
 
195
- 'apple_mav'=>[
195
+    'apple_mav'=>[
196 196
     'group' => "apple",
197 197
     'display'=>_("Apple OS X Mavericks"),
198 198
     'match'=>'Mac OS X 10[._]9',
@@ -200,13 +200,13 @@  discard block
 block discarded – undo
200 200
     'module'=>'mobileconfig_os_x',
201 201
     'signer'=>'mobileconfig_sign',
202 202
     'options'=>[
203
-       'sign'=>1,
204
-       'device_id'=>'OS_X',
205
-       'mime'=>'application/x-apple-aspen-config',
206
-      ],
203
+        'sign'=>1,
204
+        'device_id'=>'OS_X',
205
+        'mime'=>'application/x-apple-aspen-config',
206
+        ],
207 207
     ],
208 208
 
209
- 'apple_m_lion'=>[
209
+    'apple_m_lion'=>[
210 210
     'group' => "apple",
211 211
     'display'=>_("Apple OS X Mountain Lion"),
212 212
     'match'=>'Mac OS X 10[._]8',
@@ -214,13 +214,13 @@  discard block
 block discarded – undo
214 214
     'module'=>'mobileconfig_os_x',
215 215
     'signer'=>'mobileconfig_sign',
216 216
     'options'=>[
217
-       'sign'=>1,
218
-       'device_id'=>'OS_X',
219
-       'mime'=>'application/x-apple-aspen-config',
220
-      ],
217
+        'sign'=>1,
218
+        'device_id'=>'OS_X',
219
+        'mime'=>'application/x-apple-aspen-config',
220
+        ],
221 221
     ],
222 222
 	
223
- 'apple_lion'=>[
223
+    'apple_lion'=>[
224 224
     'group' => "apple",
225 225
     'display'=>_("Apple OS X Lion"),
226 226
     'match'=>'Mac OS X 10[._]7',
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
     'module'=>'mobileconfig_os_x',
229 229
     'signer'=>'mobileconfig_sign',
230 230
     'options'=>[
231
-       'sign'=>1,
232
-       'device_id'=>'OS_X',
233
-       'mime'=>'application/x-apple-aspen-config',
234
-      ],
231
+        'sign'=>1,
232
+        'device_id'=>'OS_X',
233
+        'mime'=>'application/x-apple-aspen-config',
234
+        ],
235 235
     ],
236 236
         
237
- 'mobileconfig'=>[
237
+    'mobileconfig'=>[
238 238
     'group' => "apple",     
239 239
     'display'=>_("Apple iOS mobile devices"),
240 240
     'match'=>'(iPad|iPhone|iPod);.*OS [7-9]_',
@@ -242,13 +242,13 @@  discard block
 block discarded – undo
242 242
     'module'=>'mobileconfig_ios',
243 243
     'signer'=>'mobileconfig_sign',
244 244
     'options'=>[
245
-       'sign'=>1,
246
-       'device_id'=>'iOS',
247
-       'mime'=>'application/x-apple-aspen-config',
248
-      ],
245
+        'sign'=>1,
246
+        'device_id'=>'iOS',
247
+        'mime'=>'application/x-apple-aspen-config',
248
+        ],
249 249
     ],
250 250
 
251
- 'mobileconfig-56'=>[
251
+    'mobileconfig-56'=>[
252 252
     'group' => "apple",
253 253
     'display'=>_("Apple iOS mobile devices (iOS 5 and 6)"),
254 254
     'match'=>'(iPad|iPhone|iPod);.*OS [56]_',
@@ -256,132 +256,132 @@  discard block
 block discarded – undo
256 256
     'module'=>'mobileconfig_ios_56',
257 257
     'signer'=>'mobileconfig_sign',
258 258
     'options'=>[
259
-       'sign'=>1,
260
-       'device_id'=>'iOS',
261
-       'mime'=>'application/x-apple-aspen-config',
262
-      ],
259
+        'sign'=>1,
260
+        'device_id'=>'iOS',
261
+        'mime'=>'application/x-apple-aspen-config',
262
+        ],
263 263
     ],
264 264
 
265 265
         
266
- 'linux'=>[
267
-     'group' => "linux",
268
-     'display'=>_("Linux"),
269
-     'match'=>'Linux(?!.*Android)',
270
-     'directory'=>'linux',
271
-     'module' => 'Linux',
272
-     'options'=>[
273
-       'mime'=>'application/x-sh',
274
-      ],
275
-   ],
266
+    'linux'=>[
267
+        'group' => "linux",
268
+        'display'=>_("Linux"),
269
+        'match'=>'Linux(?!.*Android)',
270
+        'directory'=>'linux',
271
+        'module' => 'Linux',
272
+        'options'=>[
273
+        'mime'=>'application/x-sh',
274
+        ],
275
+    ],
276 276
 
277
- 'chromeos'=>[
277
+    'chromeos'=>[
278 278
     'group' => "chrome",
279 279
     'display'=>_("Chrome OS"),
280 280
     'match'=>'CrOS',
281 281
     'directory'=>'chromebook',
282 282
     'module'=>'chromebook',
283 283
     'options'=>[
284
-       'mime'=>'application/x-onc',
285
-       'message'=>sprintf(_("After downloading the file, open the Chrome browser and browse to this URL: <a href='chrome://net-internals/#chromeos'>chrome://net-internals/#chromeos</a>. Then, use the 'Import ONC file' button. The import is silent; the new network definitions will be added to the preferred networks.")),
286
-      ],
287
-   ],
284
+        'mime'=>'application/x-onc',
285
+        'message'=>sprintf(_("After downloading the file, open the Chrome browser and browse to this URL: <a href='chrome://net-internals/#chromeos'>chrome://net-internals/#chromeos</a>. Then, use the 'Import ONC file' button. The import is silent; the new network definitions will be added to the preferred networks.")),
286
+        ],
287
+    ],
288 288
         
289
- 'android_marshmallow'=>[
289
+    'android_marshmallow'=>[
290 290
     'group' => "android",
291 291
     'display'=>_("Android 6.0 Marshmallow"),
292
-     'match'=>'Android 6\.[0-9]',
292
+        'match'=>'Android 6\.[0-9]',
293 293
     'directory'=>'xml',
294 294
     'module'=>'Lollipop',
295 295
     'options'=>[
296
-       'mime'=>'application/eap-config',
297
-       'message'=>sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from %s, %s and %s, and will use the configuration file downloaded from CAT to create all necessary settings."),
296
+        'mime'=>'application/eap-config',
297
+        'message'=>sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from %s, %s and %s, and will use the configuration file downloaded from CAT to create all necessary settings."),
298 298
                             "eduroamCAT",
299 299
                             "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>",
300 300
                             "<a target='_blank' href='unbeknownst'>Amazon Appstore</a>",
301 301
                             "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
302
-      ],
303
-   ],
302
+        ],
303
+    ],
304 304
 
305
- 'android_lollipop'=>[
305
+    'android_lollipop'=>[
306 306
     'group' => "android",
307 307
     'display'=>_("Android 5.0 Lollipop"),
308
-     'match'=>'Android 5\.[0-9]',
308
+        'match'=>'Android 5\.[0-9]',
309 309
     'directory'=>'xml',
310 310
     'module'=>'Lollipop',
311 311
     'options'=>[
312
-       'mime'=>'application/eap-config',
313
-       'message'=>sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from %s, %s and %s, and will use the configuration file downloaded from CAT to create all necessary settings."),
312
+        'mime'=>'application/eap-config',
313
+        'message'=>sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from %s, %s and %s, and will use the configuration file downloaded from CAT to create all necessary settings."),
314 314
                             "eduroamCAT",
315 315
                             "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>",
316 316
                             "<a target='_blank' href='unbeknownst'>Amazon Appstore</a>",
317 317
                             "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
318
-      ],
319
-   ],
318
+        ],
319
+    ],
320 320
 
321
- 'android_kitkat'=>[
321
+    'android_kitkat'=>[
322 322
     'group' => "android",
323 323
     'display'=>_("Android 4.4 KitKat"),
324
-     'match'=>'Android 4\.[4-9]',
324
+        'match'=>'Android 4\.[4-9]',
325 325
     'directory'=>'xml',
326 326
     'module'=>'KitKat',
327 327
     'options'=>[
328
-       'mime'=>'application/eap-config',
329
-       'message'=>sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from %s, %s and %s, and will use the configuration file downloaded from CAT to create all necessary settings."),
328
+        'mime'=>'application/eap-config',
329
+        'message'=>sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from %s, %s and %s, and will use the configuration file downloaded from CAT to create all necessary settings."),
330 330
                             "eduroamCAT",
331 331
                             "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>",
332 332
                             "<a target='_blank' href='unbeknownst'>Amazon Appstore</a>",
333 333
                             "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
334
-      ],
335
-   ],
334
+        ],
335
+    ],
336 336
 
337 337
 
338
- 'android_43'=>[
338
+    'android_43'=>[
339 339
     'group' => "android",
340 340
     'display'=>_("Android 4.3"),
341
-     'match'=>'Android 4\.3',
341
+        'match'=>'Android 4\.3',
342 342
     'directory'=>'xml',
343 343
     'module'=>'KitKat',
344 344
     'options'=>[
345
-       'mime'=>'application/eap-config',
346
-       'message'=>sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from %s, %s and %s, and will use the configuration file downloaded from CAT to create all necessary settings."),
345
+        'mime'=>'application/eap-config',
346
+        'message'=>sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from %s, %s and %s, and will use the configuration file downloaded from CAT to create all necessary settings."),
347 347
                             "eduroamCAT",
348 348
                             "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>",
349 349
                             "<a target='_blank' href='unbeknownst'>Amazon Appstore</a>",
350 350
                             "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
351
-      ],
352
-   ],
351
+        ],
352
+    ],
353 353
 
354
- 'android_legacy'=>[
355
-     'group' => "android",
356
-     'display'=>_("Android"),
357
-     'match'=>'Android',
358
-     'directory'=>'redirect_dev',
359
-     'module'=>'RedirectDev',
360
-     'options'=>[
361
-       'redirect'=>1,
362
-      ],
363
-   ],
354
+    'android_legacy'=>[
355
+        'group' => "android",
356
+        'display'=>_("Android"),
357
+        'match'=>'Android',
358
+        'directory'=>'redirect_dev',
359
+        'module'=>'RedirectDev',
360
+        'options'=>[
361
+        'redirect'=>1,
362
+        ],
363
+    ],
364 364
 
365
- 'eap-config'=>[
365
+    'eap-config'=>[
366 366
     'group' => "eap-config",
367 367
     'display'=>_("EAP config"),
368 368
     'directory'=>'xml',
369 369
     'module'=>'XML_ALL',
370 370
     'options'=>[
371
-       'mime'=>'application/eap-config',
372
-       'message'=>sprintf(_("This option provides a generic EAP config XML file, which can be consumed by dedicated applications like eduroamCAT for Android and Linux platforms. This is still an experimental feature.")),
373
-      ],
371
+        'mime'=>'application/eap-config',
372
+        'message'=>sprintf(_("This option provides a generic EAP config XML file, which can be consumed by dedicated applications like eduroamCAT for Android and Linux platforms. This is still an experimental feature.")),
373
+        ],
374 374
     ],
375 375
 
376
- 'test'=>[
376
+    'test'=>[
377 377
     'group' => "other",
378 378
     'display'=>_("Test"),
379 379
     'directory'=>'test_module',
380 380
     'module'=>'TestModule',
381 381
     'options'=>[
382
-       'hidden'=>1,
383
-      ],
384
-   ],
382
+        'hidden'=>1,
383
+        ],
384
+    ],
385 385
 
386 386
 
387 387
 /*    
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  * 
20 20
  * @package ModuleWriting
21 21
  */
22
-class Devices{
22
+class Devices {
23 23
 
24 24
 /**
25 25
  * This array lists available configuration options for local device management.
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
  *         The default is unset, so it is not listed in the Options array.
55 55
  */
56 56
 
57
-public static $Options=[
57
+public static $Options = [
58 58
   'sign'=>0,
59 59
   'no_cache'=>0,
60 60
   'hidden'=>0,
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
                             "eduroamCAT",
299 299
                             "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>",
300 300
                             "<a target='_blank' href='unbeknownst'>Amazon Appstore</a>",
301
-                            "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
301
+                            "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
302 302
       ],
303 303
    ],
304 304
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
                             "eduroamCAT",
315 315
                             "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>",
316 316
                             "<a target='_blank' href='unbeknownst'>Amazon Appstore</a>",
317
-                            "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
317
+                            "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
318 318
       ],
319 319
    ],
320 320
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
                             "eduroamCAT",
331 331
                             "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>",
332 332
                             "<a target='_blank' href='unbeknownst'>Amazon Appstore</a>",
333
-                            "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
333
+                            "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
334 334
       ],
335 335
    ],
336 336
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
                             "eduroamCAT",
348 348
                             "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>",
349 349
                             "<a target='_blank' href='unbeknownst'>Amazon Appstore</a>",
350
-                            "<a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
350
+                            "<a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
351 351
       ],
352 352
    ],
353 353
 
Please login to merge, or discard this patch.
devices/ms/Vista7.php 4 patches
Spacing   +130 added lines, -130 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 class Device_Vista7 extends WindowsCommon {
28 28
     final public function __construct() {
29 29
       $this->supportedEapMethods = [EAP::$TLS, EAP::$PEAP_MSCHAP2, EAP::$PWD];
30
-      debug(4,"This device supports the following EAP methods: ");
31
-      debug(4,$this->supportedEapMethods);
30
+      debug(4, "This device supports the following EAP methods: ");
31
+      debug(4, $this->supportedEapMethods);
32 32
       $this->specialities['anon_id'][serialize(EAP::$PEAP_MSCHAP2)] = _("Anonymous identities do not use the realm as specified in the profile - it is derived from the suffix of the user's username input instead.");
33 33
     }
34 34
 
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
 //   create a list of profiles to be deleted after installation
46 46
      $delProfiles = [];
47 47
      foreach ($delSSIDs as $ssid => $cipher) {
48
-         if($cipher == 'DEL') 
48
+         if ($cipher == 'DEL') 
49 49
           $delProfiles[] = $ssid;
50
-         if($cipher == 'TKIP') 
51
-          $delProfiles[] = $ssid.' (TKIP)';
50
+         if ($cipher == 'TKIP') 
51
+          $delProfiles[] = $ssid . ' (TKIP)';
52 52
      }
53 53
 
54 54
      if ($this->selected_eap == EAP::$TLS || $this->selected_eap == EAP::$PEAP_MSCHAP2 || $this->selected_eap == EAP::$PWD || $this->selected_eap == EAP::$TTLS_PAP) {
@@ -56,28 +56,28 @@  discard block
 block discarded – undo
56 56
        $eap_config = $this->prepareEapConfig($this->attributes);
57 57
        $i = 0;
58 58
        foreach ($SSIDs as $ssid => $cipher) {
59
-          if($cipher == 'TKIP') {
60
-             $WindowsProfile[$i] = $this->writeWLANprofile ($ssid.' (TKIP)',$ssid,'WPA','TKIP',$eap_config,$i);
59
+          if ($cipher == 'TKIP') {
60
+             $WindowsProfile[$i] = $this->writeWLANprofile($ssid . ' (TKIP)', $ssid, 'WPA', 'TKIP', $eap_config, $i);
61 61
              $i++;
62 62
           }
63
-          $WindowsProfile[$i] = $this->writeWLANprofile ($ssid,$ssid,'WPA2','AES',$eap_config,$i);
63
+          $WindowsProfile[$i] = $this->writeWLANprofile($ssid, $ssid, 'WPA2', 'AES', $eap_config, $i);
64 64
           $i++;
65 65
        }
66
-       if($set_wired) {
66
+       if ($set_wired) {
67 67
          $this->writeLANprofile($eap_config);
68 68
        }
69 69
      } else {
70 70
        error("  this EAP type is not handled yet");
71 71
        return;
72 72
      }
73
-    debug(4,"WindowsProfile"); debug(4,$WindowsProfile);
73
+    debug(4, "WindowsProfile"); debug(4, $WindowsProfile);
74 74
     
75
-    $this->writeProfilesNSH($WindowsProfile, $CA_files,$set_wired);
75
+    $this->writeProfilesNSH($WindowsProfile, $CA_files, $set_wired);
76 76
     $this->writeAdditionalDeletes($delProfiles);
77 77
     $this->copyFiles($this->selected_eap);
78
-    if(isset($this->attributes['internal:logo_file']))
78
+    if (isset($this->attributes['internal:logo_file']))
79 79
        $this->combineLogo($this->attributes['internal:logo_file']);
80
-    $this->writeMainNSH($this->selected_eap,$this->attributes);
80
+    $this->writeMainNSH($this->selected_eap, $this->attributes);
81 81
     $this->compileNSIS();
82 82
     $installer_path = $this->signInstaller($this->attributes); 
83 83
 
@@ -86,19 +86,19 @@  discard block
 block discarded – undo
86 86
   }
87 87
 
88 88
   public function writeDeviceInfo() {
89
-    $ssid_ct=count($this->attributes['internal:SSID']);
89
+    $ssid_ct = count($this->attributes['internal:SSID']);
90 90
     $out = "<p>";
91
-    $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::$CONSORTIUM['name'],Config::$CONSORTIUM['name']);
91
+    $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::$CONSORTIUM['name'], Config::$CONSORTIUM['name']);
92 92
     $out .= "<p>";
93
-    if($ssid_ct > 1) {
94
-        if($ssid_ct > 2) {
95
-            $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
93
+    if ($ssid_ct > 1) {
94
+        if ($ssid_ct > 2) {
95
+            $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"), implode(', ', Config::$CONSORTIUM['ssid'])) . " ";
96 96
         } else
97
-            $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
97
+            $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"), implode(', ', Config::$CONSORTIUM['ssid'])) . " ";
98 98
         $i = 0;
99 99
         foreach ($this->attributes['internal:SSID'] as $ssid=>$v) {
100
-           if(! in_array($ssid, Config::$CONSORTIUM['ssid'])) {
101
-             if($i > 0)
100
+           if (!in_array($ssid, Config::$CONSORTIUM['ssid'])) {
101
+             if ($i > 0)
102 102
            $out .= ", ";
103 103
          $i++;
104 104
          $out .= "<strong>$ssid</strong>";
@@ -106,20 +106,20 @@  discard block
 block discarded – undo
106 106
     }
107 107
     $out .= "<p>";
108 108
     }
109
-    if($this->eap == EAP::$TLS)
109
+    if ($this->eap == EAP::$TLS)
110 110
         $out .= _("In order to connect to the network you will need an a personal certificate in the form of a p12 file. You should obtain this certificate from your home institution. Consult the support page to find out how this certificate can be obtained. Such certificate files are password protected. You should have both the file and the password available during the installation process.");
111 111
     else {
112 112
     $out .= _("In order to connect to the network you will need an account from your home institution. You should consult the support page to find out how this account can be obtained. It is very likely that your account is already activated.");
113 113
 
114
-    if($this->eap == EAP::$PEAP_MSCHAP2) {
114
+    if ($this->eap == EAP::$PEAP_MSCHAP2) {
115 115
         $out .= "<p>";
116 116
         $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.");
117
-        if($ssid_ct > 1) {
117
+        if ($ssid_ct > 1) {
118 118
              $out .= "<p>";
119
-             $out .= _("You will be required to enter the same credentials for each of the configured notworks:")." ";
119
+             $out .= _("You will be required to enter the same credentials for each of the configured notworks:") . " ";
120 120
              $i = 0;
121 121
             foreach ($this->attributes['internal:SSID'] as $ssid=>$v) {
122
-                 if($i > 0)
122
+                 if ($i > 0)
123 123
                    $out .= ", ";
124 124
                  $i++;
125 125
                  $out .= "<strong>$ssid</strong>";
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     $w7_ext = '';
138 138
     $eap = $this->selected_eap;
139 139
     if ($eap != EAP::$TLS && $eap != EAP::$PEAP_MSCHAP2 && $eap != EAP::$PWD && $eap != EAP::$TTLS_PAP) {
140
-      debug(2,"this method only allows TLS, PEAP, TTLS-PAP or EAP-pwd");
140
+      debug(2, "this method only allows TLS, PEAP, TTLS-PAP or EAP-pwd");
141 141
       error("this method only allows TLS, PEAP, TTLS-PAP or EAP-pwd");
142 142
      return;
143 143
     }
@@ -147,26 +147,26 @@  discard block
 block discarded – undo
147 147
      $outer_user = $attr['internal:anon_local_value'][0];
148 148
    }
149 149
 //   $servers = preg_quote(implode(';',$attr['eap:server_name']));
150
-   $servers = implode(';',$attr['eap:server_name']);
150
+   $servers = implode(';', $attr['eap:server_name']);
151 151
    $ca_array = $attr['internal:CAs'][0];
152 152
    $author_id = "0";
153
-   if( $eap == EAP::$TTLS_PAP) {
153
+   if ($eap == EAP::$TTLS_PAP) {
154 154
       $author_id = "17236";
155
-      $servers = implode('</ServerName><ServerName>',$attr['eap:server_name']);
155
+      $servers = implode('</ServerName><ServerName>', $attr['eap:server_name']);
156 156
    }
157 157
 
158 158
   $profile_file_contents = '<EAPConfig><EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
159 159
 <EapMethod>
160 160
 <Type xmlns="http://www.microsoft.com/provisioning/EapCommon">'.
161
-    $this->selected_eap["OUTER"] .'</Type>
161
+    $this->selected_eap["OUTER"] . '</Type>
162 162
 <VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId>
163 163
 <VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType>
164
-<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">'.$author_id.'</AuthorId>
164
+<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">'.$author_id . '</AuthorId>
165 165
 </EapMethod>
166 166
 ';
167 167
 
168 168
 
169
-   if( $eap == EAP::$TTLS_PAP) {
169
+   if ($eap == EAP::$TTLS_PAP) {
170 170
 $profile_file_contents .= '
171 171
 <Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
172 172
 <EAPIdentityProviderList xmlns="urn:ietf:params:xml:ns:yang:ietf-eap-metadata">
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 <ID>eduroam.si</ID>
175 175
 <ProviderInfo>
176 176
 <CredentialPrompt>
177
-<localized-text><lang>en</lang><text>'._("Please provide your user ID and password.").'</text></localized-text>
177
+<localized-text><lang>en</lang><text>'._("Please provide your user ID and password.") . '</text></localized-text>
178 178
 </CredentialPrompt>
179 179
 <UserNameLabel>
180 180
 <localized-text><lang>en</lang><text>Username@domain:</text></localized-text>
@@ -187,13 +187,13 @@  discard block
 block discarded – undo
187 187
 <AuthenticationMethod>
188 188
 <EAPMethod>21</EAPMethod>
189 189
 ';
190
-if($use_anon == 1) {
190
+if ($use_anon == 1) {
191 191
     $profile_file_contents .= '<ClientSideCredential>
192 192
 ';
193
-    if($outer_user == '')
193
+    if ($outer_user == '')
194 194
         $profile_file_contents .= '<AnonymousIdentity>@</AnonymousIdentity>';
195 195
     else
196
-        $profile_file_contents .= '<AnonymousIdentity>'.$outer_user.'@'.$realm.'</AnonymousIdentity>';
196
+        $profile_file_contents .= '<AnonymousIdentity>' . $outer_user . '@' . $realm . '</AnonymousIdentity>';
197 197
 $profile_file_contents .= '
198 198
 </ClientSideCredential>
199 199
 ';
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
 }
229 229
 
230
-elseif( $eap == EAP::$TLS) {
230
+elseif ($eap == EAP::$TLS) {
231 231
   $profile_file_contents .= '
232 232
 
233 233
 <Config xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1" 
@@ -240,15 +240,15 @@  discard block
 block discarded – undo
240 240
 </eapTls:CredentialsSource>
241 241
 <eapTls:ServerValidation>
242 242
 <eapTls:DisableUserPromptForServerValidation>true</eapTls:DisableUserPromptForServerValidation>
243
-<eapTls:ServerNames>'.$servers.'</eapTls:ServerNames>';
244
-if($ca_array) {
243
+<eapTls:ServerNames>'.$servers . '</eapTls:ServerNames>';
244
+if ($ca_array) {
245 245
 foreach ($ca_array as $CA)
246
-    if($CA['root'])
247
-       $profile_file_contents .= "<eapTls:TrustedRootCA>".$CA['sha1']."</eapTls:TrustedRootCA>\n";
246
+    if ($CA['root'])
247
+       $profile_file_contents .= "<eapTls:TrustedRootCA>" . $CA['sha1'] . "</eapTls:TrustedRootCA>\n";
248 248
 }
249 249
 $profile_file_contents .= '</eapTls:ServerValidation>
250 250
 ';
251
-if(isset($attr['eap-specific:tls_use_other_id']) && $attr['eap-specific:tls_use_other_id'][0] == 'on')
251
+if (isset($attr['eap-specific:tls_use_other_id']) && $attr['eap-specific:tls_use_other_id'][0] == 'on')
252 252
    $profile_file_contents .= '<eapTls:DifferentUsername>true</eapTls:DifferentUsername>';
253 253
 else
254 254
    $profile_file_contents .= '<eapTls:DifferentUsername>false</eapTls:DifferentUsername>';
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
 </baseEap:Eap>
258 258
 </Config>
259 259
 ';
260
-} elseif ( $eap == EAP::$PEAP_MSCHAP2) {
261
-if(isset($attr['eap:enable_nea']) && $attr['eap:enable_nea'][0] == 'on')
260
+} elseif ($eap == EAP::$PEAP_MSCHAP2) {
261
+if (isset($attr['eap:enable_nea']) && $attr['eap:enable_nea'][0] == 'on')
262 262
    $nea = 'true';
263 263
 else
264 264
    $nea = 'false';
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
 <msPeap:EapType>
272 272
 <msPeap:ServerValidation>
273 273
 <msPeap:DisableUserPromptForServerValidation>true</msPeap:DisableUserPromptForServerValidation> 
274
-<msPeap:ServerNames>'.$servers.'</msPeap:ServerNames>';
275
-if($ca_array) {
274
+<msPeap:ServerNames>'.$servers . '</msPeap:ServerNames>';
275
+if ($ca_array) {
276 276
 foreach ($ca_array as $CA)
277
-    if($CA['root'])
278
-       $vista_ext .= "<msPeap:TrustedRootCA>".$CA['sha1']."</msPeap:TrustedRootCA>\n";
277
+    if ($CA['root'])
278
+       $vista_ext .= "<msPeap:TrustedRootCA>" . $CA['sha1'] . "</msPeap:TrustedRootCA>\n";
279 279
 }
280 280
 $vista_ext .= '</msPeap:ServerValidation>
281 281
 <msPeap:FastReconnect>true</msPeap:FastReconnect> 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 <msChapV2:UseWinLogonCredentials>false</msChapV2:UseWinLogonCredentials> 
287 287
 </msChapV2:EapType>
288 288
 </baseEap:Eap>
289
-<msPeap:EnableQuarantineChecks>'.$nea.'</msPeap:EnableQuarantineChecks>
289
+<msPeap:EnableQuarantineChecks>'.$nea . '</msPeap:EnableQuarantineChecks>
290 290
 <msPeap:RequireCryptoBinding>false</msPeap:RequireCryptoBinding>
291 291
 </msPeap:EapType>
292 292
 </baseEap:Eap>
@@ -298,11 +298,11 @@  discard block
 block discarded – undo
298 298
 <EapType xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV1">
299 299
 <ServerValidation>
300 300
 <DisableUserPromptForServerValidation>true</DisableUserPromptForServerValidation>
301
-<ServerNames>'.$servers.'</ServerNames>';
302
-if($ca_array) {
301
+<ServerNames>'.$servers . '</ServerNames>';
302
+if ($ca_array) {
303 303
 foreach ($ca_array as $CA)
304
-    if($CA['root'])
305
-        $w7_ext .= "<TrustedRootCA>".$CA['sha1']."</TrustedRootCA>\n";
304
+    if ($CA['root'])
305
+        $w7_ext .= "<TrustedRootCA>" . $CA['sha1'] . "</TrustedRootCA>\n";
306 306
 }
307 307
 $w7_ext .= '</ServerValidation>
308 308
 <FastReconnect>true</FastReconnect> 
@@ -313,22 +313,22 @@  discard block
 block discarded – undo
313 313
 <UseWinLogonCredentials>false</UseWinLogonCredentials> 
314 314
 </EapType>
315 315
 </Eap>
316
-<EnableQuarantineChecks>'.$nea.'</EnableQuarantineChecks>
316
+<EnableQuarantineChecks>'.$nea . '</EnableQuarantineChecks>
317 317
 <RequireCryptoBinding>false</RequireCryptoBinding>
318 318
 ';
319
-if($use_anon == 1)
320
-$w7_ext .='<PeapExtensions>
319
+if ($use_anon == 1)
320
+$w7_ext .= '<PeapExtensions>
321 321
 <IdentityPrivacy xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">
322 322
 <EnableIdentityPrivacy>true</EnableIdentityPrivacy>
323
-<AnonymousUserName>'.$outer_user.'</AnonymousUserName>
323
+<AnonymousUserName>'.$outer_user . '</AnonymousUserName>
324 324
 </IdentityPrivacy>
325 325
 </PeapExtensions>
326 326
 ';
327
-$w7_ext .='</EapType>
327
+$w7_ext .= '</EapType>
328 328
 </Eap>
329 329
 </Config>
330 330
 ';
331
-} elseif ( $eap == EAP::$PWD) {
331
+} elseif ($eap == EAP::$PWD) {
332 332
    $profile_file_contents .= '<ConfigBlob></ConfigBlob>';
333 333
 } 
334 334
 
@@ -337,8 +337,8 @@  discard block
 block discarded – undo
337 337
 $profile_file_contents_end = '</EapHostConfig></EAPConfig>
338 338
 ';
339 339
 $return_array = [];
340
-$return_array['vista']= $profile_file_contents.$vista_ext.$profile_file_contents_end;
341
-$return_array['w7']= $profile_file_contents.$w7_ext.$profile_file_contents_end;
340
+$return_array['vista'] = $profile_file_contents . $vista_ext . $profile_file_contents_end;
341
+$return_array['w7'] = $profile_file_contents . $w7_ext . $profile_file_contents_end;
342 342
 return $return_array;
343 343
 }
344 344
 
@@ -351,13 +351,13 @@  discard block
 block discarded – undo
351 351
 /**
352 352
  * produce PEAP and TLS configuration files for Vista and Windows 7
353 353
  */
354
-  private function writeWLANprofile($wlan_profile_name,$ssid,$auth,$encryption,$eap_config,$i) {
354
+  private function writeWLANprofile($wlan_profile_name, $ssid, $auth, $encryption, $eap_config, $i) {
355 355
 $profile_file_contents = '<?xml version="1.0"?>
356 356
 <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
357
-<name>'.$wlan_profile_name.'</name>
357
+<name>'.$wlan_profile_name . '</name>
358 358
 <SSIDConfig>
359 359
 <SSID>
360
-<name>'.$ssid.'</name>
360
+<name>'.$ssid . '</name>
361 361
 </SSID>
362 362
 <nonBroadcast>true</nonBroadcast>
363 363
 </SSIDConfig>
@@ -367,12 +367,12 @@  discard block
 block discarded – undo
367 367
 <MSM>
368 368
 <security>
369 369
 <authEncryption>
370
-<authentication>'.$auth.'</authentication>
371
-<encryption>'.$encryption.'</encryption>
370
+<authentication>'.$auth . '</authentication>
371
+<encryption>'.$encryption . '</encryption>
372 372
 <useOneX>true</useOneX>
373 373
 </authEncryption>
374 374
 ';
375
-if($auth == 'WPA2')
375
+if ($auth == 'WPA2')
376 376
 $profile_file_contents .= '<PMKCacheMode>enabled</PMKCacheMode>
377 377
 <PMKCacheTTL>720</PMKCacheTTL>
378 378
 <PMKCacheSize>128</PMKCacheSize>
@@ -390,20 +390,20 @@  discard block
 block discarded – undo
390 390
 </WLANProfile>
391 391
 ';
392 392
 
393
-if(! is_dir('w7'))
393
+if (!is_dir('w7'))
394 394
   mkdir('w7');
395
-if(! is_dir('vista'))
395
+if (!is_dir('vista'))
396 396
   mkdir('vista');
397 397
 $xml_f_name = "vista/wlan_prof-$i.xml";
398
-$xml_f = fopen($xml_f_name,'w');
399
-fwrite($xml_f,$profile_file_contents. $eap_config['vista']. $closing) ;
398
+$xml_f = fopen($xml_f_name, 'w');
399
+fwrite($xml_f, $profile_file_contents . $eap_config['vista'] . $closing);
400 400
 fclose($xml_f);
401 401
 $xml_f_name = "w7/wlan_prof-$i.xml";
402
-$xml_f = fopen($xml_f_name,'w');
403
-fwrite($xml_f,$profile_file_contents. $eap_config['w7']. $closing) ;
402
+$xml_f = fopen($xml_f_name, 'w');
403
+fwrite($xml_f, $profile_file_contents . $eap_config['w7'] . $closing);
404 404
 fclose($xml_f);
405
-debug(2,"Installer has been written into directory $this->FPATH\n");
406
-debug(4,"WLAN_Profile:$wlan_profile_name:$encryption\n");
405
+debug(2, "Installer has been written into directory $this->FPATH\n");
406
+debug(4, "WLAN_Profile:$wlan_profile_name:$encryption\n");
407 407
 return("\"$wlan_profile_name\" \"$encryption\"");
408 408
 }
409 409
 
@@ -422,48 +422,48 @@  discard block
 block discarded – undo
422 422
 </MSM>
423 423
 </LANProfile>
424 424
 ';
425
-if(! is_dir('w7'))
425
+if (!is_dir('w7'))
426 426
   mkdir('w7');
427
-if(! is_dir('vista'))
427
+if (!is_dir('vista'))
428 428
   mkdir('vista');
429 429
 $xml_f_name = "vista/lan_prof.xml";
430
-$xml_f = fopen($xml_f_name,'w');
431
-fwrite($xml_f,$profile_file_contents. $eap_config['vista']. $closing) ;
430
+$xml_f = fopen($xml_f_name, 'w');
431
+fwrite($xml_f, $profile_file_contents . $eap_config['vista'] . $closing);
432 432
 fclose($xml_f);
433 433
 $xml_f_name = "w7/lan_prof.xml";
434
-$xml_f = fopen($xml_f_name,'w');
435
-fwrite($xml_f,$profile_file_contents. $eap_config['w7']. $closing) ;
434
+$xml_f = fopen($xml_f_name, 'w');
435
+fwrite($xml_f, $profile_file_contents . $eap_config['w7'] . $closing);
436 436
 fclose($xml_f);
437 437
 }
438 438
 
439 439
 private function glueServerNames($server_list) {
440 440
 //print_r($server_list);
441
- $A0 =  array_reverse(explode('.',array_shift($server_list)));
441
+ $A0 = array_reverse(explode('.', array_shift($server_list)));
442 442
  $B = $A0;
443
- if($server_list) {
444
-   foreach($server_list as $a) {
445
-   $A= array_reverse(explode('.',$a));
446
-   $B = array_intersect_assoc($A0,$A);
443
+ if ($server_list) {
444
+   foreach ($server_list as $a) {
445
+   $A = array_reverse(explode('.', $a));
446
+   $B = array_intersect_assoc($A0, $A);
447 447
    $A0 = $B;
448 448
    }
449 449
   }
450
-  return(implode('.',array_reverse($B)));
450
+  return(implode('.', array_reverse($B)));
451 451
 }
452 452
 
453 453
 
454
-private function writeMainNSH($eap,$attr) {
455
-debug(4,"writeMainNSH"); debug(4,$attr);
456
-debug(4,"MYLANG=".$this->lang."\n");
454
+private function writeMainNSH($eap, $attr) {
455
+debug(4, "writeMainNSH"); debug(4, $attr);
456
+debug(4, "MYLANG=" . $this->lang . "\n");
457 457
 
458 458
 $EAP_OPTS = [
459
-PEAP=>['str'=>'PEAP','exec'=>'user'],
460
-TLS=>['str'=>'TLS','exec'=>'user'],
461
-TTLS=>['str'=>'ArnesLink','exec'=>'user'],
462
-PWD=>['str'=>'PWD','exec'=>'user'],
459
+PEAP=>['str'=>'PEAP', 'exec'=>'user'],
460
+TLS=>['str'=>'TLS', 'exec'=>'user'],
461
+TTLS=>['str'=>'ArnesLink', 'exec'=>'user'],
462
+PWD=>['str'=>'PWD', 'exec'=>'user'],
463 463
 ];
464 464
 $fcontents = '';
465
-if(Config::$NSIS_VERSION >= 3)
466
-    $fcontents .=  "Unicode true\n";
465
+if (Config::$NSIS_VERSION >= 3)
466
+    $fcontents .= "Unicode true\n";
467 467
  
468 468
 // Uncomment the line below if you want this module to run under XP (only displaying a warning)
469 469
 // $fcontents .= "!define ALLOW_XP\n";
@@ -471,27 +471,27 @@  discard block
 block discarded – undo
471 471
 // $fcontents .= "!define DEBUG_CAT\n";
472 472
 $exec_level = $EAP_OPTS[$eap["OUTER"]]['exec'];
473 473
 $eap_str = $EAP_OPTS[$eap["OUTER"]]['str'];
474
-debug(4,"EAP_STR=$eap_str\n");
475
-debug(4,$eap);
474
+debug(4, "EAP_STR=$eap_str\n");
475
+debug(4, $eap);
476 476
 
477
-$fcontents .= '!define '.$eap_str;
478
-$fcontents .= "\n".'!define EXECLEVEL "'.$exec_level.'"';
479
-if($attr['internal:profile_count'][0] > 1)
480
-$fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"','$\\"',$attr['profile:name'][0]), $this->code_page).'"';
477
+$fcontents .= '!define ' . $eap_str;
478
+$fcontents .= "\n" . '!define EXECLEVEL "' . $exec_level . '"';
479
+if ($attr['internal:profile_count'][0] > 1)
480
+$fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->code_page) . '"';
481 481
 $fcontents .= '
482
-Caption "'. $this->translateString(sprintf(sprint_nsi(_("%s installer for %s")),Config::$CONSORTIUM['name'],$attr['general:instname'][0]), $this->code_page).'"
483
-!define APPLICATION "'. $this->translateString(sprintf(sprint_nsi(_("%s installer for %s")),Config::$CONSORTIUM['name'],$attr['general:instname'][0]), $this->code_page).'"
484
-!define VERSION "'.CAT::$VERSION_MAJOR.'.'.CAT::$VERSION_MINOR.'"
482
+Caption "'. $this->translateString(sprintf(sprint_nsi(_("%s installer for %s")), Config::$CONSORTIUM['name'], $attr['general:instname'][0]), $this->code_page) . '"
483
+!define APPLICATION "'. $this->translateString(sprintf(sprint_nsi(_("%s installer for %s")), Config::$CONSORTIUM['name'], $attr['general:instname'][0]), $this->code_page) . '"
484
+!define VERSION "'.CAT::$VERSION_MAJOR . '.' . CAT::$VERSION_MINOR . '"
485 485
 !define INSTALLER_NAME "installer.exe"
486
-!define LANG "'.$this->lang.'"
486
+!define LANG "'.$this->lang . '"
487 487
 ';
488 488
 $fcontents .= $this->msInfoFile($attr);
489 489
 
490 490
 
491 491
 $fcontents .= ';--------------------------------
492
-!define ORGANISATION "'.$this->translateString($attr['general:instname'][0], $this->code_page).'"
493
-!define SUPPORT "'. ((isset($attr['support:email'][0]) && $attr['support:email'][0] ) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute , $this->code_page)) .'"
494
-!define URL "'. ((isset($attr['support:url'][0]) && $attr['support:url'][0] ) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->code_page)) .'"
492
+!define ORGANISATION "'.$this->translateString($attr['general:instname'][0], $this->code_page) . '"
493
+!define SUPPORT "'. ((isset($attr['support:email'][0]) && $attr['support:email'][0]) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->code_page)) . '"
494
+!define URL "'. ((isset($attr['support:url'][0]) && $attr['support:url'][0]) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->code_page)) . '"
495 495
 
496 496
 !ifdef TLS
497 497
 ';
@@ -501,42 +501,42 @@  discard block
 block discarded – undo
501 501
 !endif
502 502
 ';
503 503
 
504
-if(isset($this->attributes['media:wired'][0]) && $attr['media:wired'][0] == 'on')
504
+if (isset($this->attributes['media:wired'][0]) && $attr['media:wired'][0] == 'on')
505 505
   $fcontents .= '!define WIRED
506 506
 ';
507 507
 
508
-$f = fopen('main.nsh','w');
508
+$f = fopen('main.nsh', 'w');
509 509
 fwrite($f, $fcontents);
510 510
 fclose($f);
511 511
 
512 512
 }
513 513
 
514
-private function writeProfilesNSH($P,$ca_array,$wired=0) {
515
-debug(4,"writeProfilesNSH");
516
-debug(4,$P);
514
+private function writeProfilesNSH($P, $ca_array, $wired = 0) {
515
+debug(4, "writeProfilesNSH");
516
+debug(4, $P);
517 517
   $fcontents = '';
518
-  foreach($P as $p) 
518
+  foreach ($P as $p) 
519 519
     $fcontents .= "!insertmacro define_wlan_profile $p\n";
520 520
   
521
-$f = fopen('profiles.nsh','w');
521
+$f = fopen('profiles.nsh', 'w');
522 522
 fwrite($f, $fcontents);
523 523
 fclose($f);
524 524
 
525 525
 $fcontents = '';
526
-$f = fopen('certs.nsh','w');
527
-if($ca_array) {
526
+$f = fopen('certs.nsh', 'w');
527
+if ($ca_array) {
528 528
 foreach ($ca_array as $CA) {
529 529
       $store = $CA['root'] ? "root" : "ca";
530
-      $fcontents .= '!insertmacro install_ca_cert "'.$CA['file'].'" "'.$CA['sha1'].'" "'.$store."\"\n";
530
+      $fcontents .= '!insertmacro install_ca_cert "' . $CA['file'] . '" "' . $CA['sha1'] . '" "' . $store . "\"\n";
531 531
     }
532 532
 fwrite($f, $fcontents);
533 533
 }
534 534
 fclose($f);
535 535
 }
536 536
 
537
-private function copyFiles ($eap) {
538
-debug(4,"copyFiles start\n");
539
-debug(4,"code_page=".$this->code_page."\n");
537
+private function copyFiles($eap) {
538
+debug(4, "copyFiles start\n");
539
+debug(4, "code_page=" . $this->code_page . "\n");
540 540
    $result;
541 541
    $result = $this->copyFile('wlan_test.exe');
542 542
    $result = $this->copyFile('check_wired.cmd');
@@ -546,23 +546,23 @@  discard block
 block discarded – undo
546 546
    $result = $this->copyFile('cat_bg.bmp');
547 547
    $result = $result && $this->copyFile('cat32.ico');
548 548
    $result = $result && $this->copyFile('cat_150.bmp');
549
-   $this->translateFile('common.inc','common.nsh',$this->code_page);
550
-   if( $eap["OUTER"] == TTLS)  {
549
+   $this->translateFile('common.inc', 'common.nsh', $this->code_page);
550
+   if ($eap["OUTER"] == TTLS) {
551 551
      $result = $this->copyFile('GPL3.rtf');
552 552
      $result = $result && $this->copyFile('ArnesLinkEn32.msi');
553 553
      $result = $result && $this->copyFile('ArnesLinkEn64.msi');
554 554
      $result = $result && $this->copyFile('dump_arneslink_profile.cmd');
555 555
      $result = $result && $this->copyFile('install_arneslink_profile.cmd');
556
-     $this->translateFile('arnes_link.inc','cat.NSI',$this->code_page);
557
-   } elseif($eap["OUTER"] == PWD) {
558
-     $this->translateFile('pwd.inc','cat.NSI',$this->code_page);
556
+     $this->translateFile('arnes_link.inc', 'cat.NSI', $this->code_page);
557
+   } elseif ($eap["OUTER"] == PWD) {
558
+     $this->translateFile('pwd.inc', 'cat.NSI', $this->code_page);
559 559
      $result = $result && $this->copyFile('Aruba_Networks_EAP-pwd_x32.msi');
560 560
      $result = $result && $this->copyFile('Aruba_Networks_EAP-pwd_x64.msi');
561 561
     } else {
562
-     $this->translateFile('peap_tls.inc','cat.NSI',$this->code_page);
562
+     $this->translateFile('peap_tls.inc', 'cat.NSI', $this->code_page);
563 563
      $result = 1;
564 564
     }
565
-debug(4,"copyFiles end\n");
565
+debug(4, "copyFiles end\n");
566 566
    return($result);
567 567
 }
568 568
 
Please login to merge, or discard this patch.
Braces   +64 added lines, -44 removed lines patch added patch discarded remove patch
@@ -45,10 +45,12 @@  discard block
 block discarded – undo
45 45
 //   create a list of profiles to be deleted after installation
46 46
      $delProfiles = [];
47 47
      foreach ($delSSIDs as $ssid => $cipher) {
48
-         if($cipher == 'DEL') 
49
-          $delProfiles[] = $ssid;
50
-         if($cipher == 'TKIP') 
51
-          $delProfiles[] = $ssid.' (TKIP)';
48
+         if($cipher == 'DEL') {
49
+                   $delProfiles[] = $ssid;
50
+         }
51
+         if($cipher == 'TKIP') {
52
+                   $delProfiles[] = $ssid.' (TKIP)';
53
+         }
52 54
      }
53 55
 
54 56
      if ($this->selected_eap == EAP::$TLS || $this->selected_eap == EAP::$PEAP_MSCHAP2 || $this->selected_eap == EAP::$PWD || $this->selected_eap == EAP::$TTLS_PAP) {
@@ -75,8 +77,9 @@  discard block
 block discarded – undo
75 77
     $this->writeProfilesNSH($WindowsProfile, $CA_files,$set_wired);
76 78
     $this->writeAdditionalDeletes($delProfiles);
77 79
     $this->copyFiles($this->selected_eap);
78
-    if(isset($this->attributes['internal:logo_file']))
79
-       $this->combineLogo($this->attributes['internal:logo_file']);
80
+    if(isset($this->attributes['internal:logo_file'])) {
81
+           $this->combineLogo($this->attributes['internal:logo_file']);
82
+    }
80 83
     $this->writeMainNSH($this->selected_eap,$this->attributes);
81 84
     $this->compileNSIS();
82 85
     $installer_path = $this->signInstaller($this->attributes); 
@@ -93,22 +96,24 @@  discard block
 block discarded – undo
93 96
     if($ssid_ct > 1) {
94 97
         if($ssid_ct > 2) {
95 98
             $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
96
-        } else
97
-            $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
99
+        } else {
100
+                    $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
101
+        }
98 102
         $i = 0;
99 103
         foreach ($this->attributes['internal:SSID'] as $ssid=>$v) {
100 104
            if(! in_array($ssid, Config::$CONSORTIUM['ssid'])) {
101
-             if($i > 0)
102
-           $out .= ", ";
105
+             if($i > 0) {
106
+                        $out .= ", ";
107
+             }
103 108
          $i++;
104 109
          $out .= "<strong>$ssid</strong>";
105 110
        }
106 111
     }
107 112
     $out .= "<p>";
108 113
     }
109
-    if($this->eap == EAP::$TLS)
110
-        $out .= _("In order to connect to the network you will need an a personal certificate in the form of a p12 file. You should obtain this certificate from your home institution. Consult the support page to find out how this certificate can be obtained. Such certificate files are password protected. You should have both the file and the password available during the installation process.");
111
-    else {
114
+    if($this->eap == EAP::$TLS) {
115
+            $out .= _("In order to connect to the network you will need an a personal certificate in the form of a p12 file. You should obtain this certificate from your home institution. Consult the support page to find out how this certificate can be obtained. Such certificate files are password protected. You should have both the file and the password available during the installation process.");
116
+    } else {
112 117
     $out .= _("In order to connect to the network you will need an account from your home institution. You should consult the support page to find out how this account can be obtained. It is very likely that your account is already activated.");
113 118
 
114 119
     if($this->eap == EAP::$PEAP_MSCHAP2) {
@@ -119,8 +124,9 @@  discard block
 block discarded – undo
119 124
              $out .= _("You will be required to enter the same credentials for each of the configured notworks:")." ";
120 125
              $i = 0;
121 126
             foreach ($this->attributes['internal:SSID'] as $ssid=>$v) {
122
-                 if($i > 0)
123
-                   $out .= ", ";
127
+                 if($i > 0) {
128
+                                    $out .= ", ";
129
+                 }
124 130
                  $i++;
125 131
                  $out .= "<strong>$ssid</strong>";
126 132
             }
@@ -190,11 +196,12 @@  discard block
 block discarded – undo
190 196
 if($use_anon == 1) {
191 197
     $profile_file_contents .= '<ClientSideCredential>
192 198
 ';
193
-    if($outer_user == '')
194
-        $profile_file_contents .= '<AnonymousIdentity>@</AnonymousIdentity>';
195
-    else
196
-        $profile_file_contents .= '<AnonymousIdentity>'.$outer_user.'@'.$realm.'</AnonymousIdentity>';
197
-$profile_file_contents .= '
199
+    if($outer_user == '') {
200
+            $profile_file_contents .= '<AnonymousIdentity>@</AnonymousIdentity>';
201
+    } else {
202
+            $profile_file_contents .= '<AnonymousIdentity>'.$outer_user.'@'.$realm.'</AnonymousIdentity>';
203
+    }
204
+    $profile_file_contents .= '
198 205
 </ClientSideCredential>
199 206
 ';
200 207
 }
@@ -225,9 +232,7 @@  discard block
 block discarded – undo
225 232
 </Config>
226 233
 ';
227 234
 
228
-}
229
-
230
-elseif( $eap == EAP::$TLS) {
235
+} elseif( $eap == EAP::$TLS) {
231 236
   $profile_file_contents .= '
232 237
 
233 238
 <Config xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1" 
@@ -242,26 +247,29 @@  discard block
 block discarded – undo
242 247
 <eapTls:DisableUserPromptForServerValidation>true</eapTls:DisableUserPromptForServerValidation>
243 248
 <eapTls:ServerNames>'.$servers.'</eapTls:ServerNames>';
244 249
 if($ca_array) {
245
-foreach ($ca_array as $CA)
250
+foreach ($ca_array as $CA) {
246 251
     if($CA['root'])
247 252
        $profile_file_contents .= "<eapTls:TrustedRootCA>".$CA['sha1']."</eapTls:TrustedRootCA>\n";
248 253
 }
254
+}
249 255
 $profile_file_contents .= '</eapTls:ServerValidation>
250 256
 ';
251
-if(isset($attr['eap-specific:tls_use_other_id']) && $attr['eap-specific:tls_use_other_id'][0] == 'on')
257
+if(isset($attr['eap-specific:tls_use_other_id']) && $attr['eap-specific:tls_use_other_id'][0] == 'on') {
252 258
    $profile_file_contents .= '<eapTls:DifferentUsername>true</eapTls:DifferentUsername>';
253
-else
259
+} else {
254 260
    $profile_file_contents .= '<eapTls:DifferentUsername>false</eapTls:DifferentUsername>';
261
+}
255 262
 $profile_file_contents .= '
256 263
 </eapTls:EapType>
257 264
 </baseEap:Eap>
258 265
 </Config>
259 266
 ';
260 267
 } elseif ( $eap == EAP::$PEAP_MSCHAP2) {
261
-if(isset($attr['eap:enable_nea']) && $attr['eap:enable_nea'][0] == 'on')
268
+if(isset($attr['eap:enable_nea']) && $attr['eap:enable_nea'][0] == 'on') {
262 269
    $nea = 'true';
263
-else
270
+} else {
264 271
    $nea = 'false';
272
+}
265 273
 $vista_ext = '<Config xmlns:eapUser="http://www.microsoft.com/provisioning/EapUserPropertiesV1" 
266 274
 xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1" 
267 275
   xmlns:msPeap="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV1" 
@@ -273,10 +281,11 @@  discard block
 block discarded – undo
273 281
 <msPeap:DisableUserPromptForServerValidation>true</msPeap:DisableUserPromptForServerValidation> 
274 282
 <msPeap:ServerNames>'.$servers.'</msPeap:ServerNames>';
275 283
 if($ca_array) {
276
-foreach ($ca_array as $CA)
284
+foreach ($ca_array as $CA) {
277 285
     if($CA['root'])
278 286
        $vista_ext .= "<msPeap:TrustedRootCA>".$CA['sha1']."</msPeap:TrustedRootCA>\n";
279 287
 }
288
+}
280 289
 $vista_ext .= '</msPeap:ServerValidation>
281 290
 <msPeap:FastReconnect>true</msPeap:FastReconnect> 
282 291
 <msPeap:InnerEapOptional>0</msPeap:InnerEapOptional> 
@@ -300,10 +309,11 @@  discard block
 block discarded – undo
300 309
 <DisableUserPromptForServerValidation>true</DisableUserPromptForServerValidation>
301 310
 <ServerNames>'.$servers.'</ServerNames>';
302 311
 if($ca_array) {
303
-foreach ($ca_array as $CA)
312
+foreach ($ca_array as $CA) {
304 313
     if($CA['root'])
305 314
         $w7_ext .= "<TrustedRootCA>".$CA['sha1']."</TrustedRootCA>\n";
306 315
 }
316
+}
307 317
 $w7_ext .= '</ServerValidation>
308 318
 <FastReconnect>true</FastReconnect> 
309 319
 <InnerEapOptional>false</InnerEapOptional> 
@@ -316,14 +326,15 @@  discard block
 block discarded – undo
316 326
 <EnableQuarantineChecks>'.$nea.'</EnableQuarantineChecks>
317 327
 <RequireCryptoBinding>false</RequireCryptoBinding>
318 328
 ';
319
-if($use_anon == 1)
320
-$w7_ext .='<PeapExtensions>
329
+if($use_anon == 1) {
330
+    $w7_ext .='<PeapExtensions>
321 331
 <IdentityPrivacy xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">
322 332
 <EnableIdentityPrivacy>true</EnableIdentityPrivacy>
323 333
 <AnonymousUserName>'.$outer_user.'</AnonymousUserName>
324 334
 </IdentityPrivacy>
325 335
 </PeapExtensions>
326 336
 ';
337
+}
327 338
 $w7_ext .='</EapType>
328 339
 </Eap>
329 340
 </Config>
@@ -372,12 +383,13 @@  discard block
 block discarded – undo
372 383
 <useOneX>true</useOneX>
373 384
 </authEncryption>
374 385
 ';
375
-if($auth == 'WPA2')
376
-$profile_file_contents .= '<PMKCacheMode>enabled</PMKCacheMode>
386
+if($auth == 'WPA2') {
387
+    $profile_file_contents .= '<PMKCacheMode>enabled</PMKCacheMode>
377 388
 <PMKCacheTTL>720</PMKCacheTTL>
378 389
 <PMKCacheSize>128</PMKCacheSize>
379 390
 <preAuthMode>disabled</preAuthMode>
380 391
 ';
392
+}
381 393
 $profile_file_contents .= '<OneX xmlns="http://www.microsoft.com/networking/OneX/v1">
382 394
 <cacheUserData>true</cacheUserData>
383 395
 <authMode>user</authMode>
@@ -390,10 +402,12 @@  discard block
 block discarded – undo
390 402
 </WLANProfile>
391 403
 ';
392 404
 
393
-if(! is_dir('w7'))
405
+if(! is_dir('w7')) {
394 406
   mkdir('w7');
395
-if(! is_dir('vista'))
407
+}
408
+if(! is_dir('vista')) {
396 409
   mkdir('vista');
410
+}
397 411
 $xml_f_name = "vista/wlan_prof-$i.xml";
398 412
 $xml_f = fopen($xml_f_name,'w');
399 413
 fwrite($xml_f,$profile_file_contents. $eap_config['vista']. $closing) ;
@@ -422,10 +436,12 @@  discard block
 block discarded – undo
422 436
 </MSM>
423 437
 </LANProfile>
424 438
 ';
425
-if(! is_dir('w7'))
439
+if(! is_dir('w7')) {
426 440
   mkdir('w7');
427
-if(! is_dir('vista'))
441
+}
442
+if(! is_dir('vista')) {
428 443
   mkdir('vista');
444
+}
429 445
 $xml_f_name = "vista/lan_prof.xml";
430 446
 $xml_f = fopen($xml_f_name,'w');
431 447
 fwrite($xml_f,$profile_file_contents. $eap_config['vista']. $closing) ;
@@ -462,8 +478,9 @@  discard block
 block discarded – undo
462 478
 PWD=>['str'=>'PWD','exec'=>'user'],
463 479
 ];
464 480
 $fcontents = '';
465
-if(Config::$NSIS_VERSION >= 3)
481
+if(Config::$NSIS_VERSION >= 3) {
466 482
     $fcontents .=  "Unicode true\n";
483
+}
467 484
  
468 485
 // Uncomment the line below if you want this module to run under XP (only displaying a warning)
469 486
 // $fcontents .= "!define ALLOW_XP\n";
@@ -476,8 +493,9 @@  discard block
 block discarded – undo
476 493
 
477 494
 $fcontents .= '!define '.$eap_str;
478 495
 $fcontents .= "\n".'!define EXECLEVEL "'.$exec_level.'"';
479
-if($attr['internal:profile_count'][0] > 1)
480
-$fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"','$\\"',$attr['profile:name'][0]), $this->code_page).'"';
496
+if($attr['internal:profile_count'][0] > 1) {
497
+    $fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"','$\\"',$attr['profile:name'][0]), $this->code_page).'"';
498
+}
481 499
 $fcontents .= '
482 500
 Caption "'. $this->translateString(sprintf(sprint_nsi(_("%s installer for %s")),Config::$CONSORTIUM['name'],$attr['general:instname'][0]), $this->code_page).'"
483 501
 !define APPLICATION "'. $this->translateString(sprintf(sprint_nsi(_("%s installer for %s")),Config::$CONSORTIUM['name'],$attr['general:instname'][0]), $this->code_page).'"
@@ -501,9 +519,10 @@  discard block
 block discarded – undo
501 519
 !endif
502 520
 ';
503 521
 
504
-if(isset($this->attributes['media:wired'][0]) && $attr['media:wired'][0] == 'on')
522
+if(isset($this->attributes['media:wired'][0]) && $attr['media:wired'][0] == 'on') {
505 523
   $fcontents .= '!define WIRED
506 524
 ';
525
+}
507 526
 
508 527
 $f = fopen('main.nsh','w');
509 528
 fwrite($f, $fcontents);
@@ -515,8 +534,9 @@  discard block
 block discarded – undo
515 534
 debug(4,"writeProfilesNSH");
516 535
 debug(4,$P);
517 536
   $fcontents = '';
518
-  foreach($P as $p) 
519
-    $fcontents .= "!insertmacro define_wlan_profile $p\n";
537
+  foreach($P as $p) {
538
+      $fcontents .= "!insertmacro define_wlan_profile $p\n";
539
+  }
520 540
   
521 541
 $f = fopen('profiles.nsh','w');
522 542
 fwrite($f, $fcontents);
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -308,6 +308,9 @@
 block discarded – undo
308 308
 
309 309
 /**
310 310
  * produce PEAP, TLS and TTLS configuration files for Windows 8
311
+ * @param string $auth
312
+ * @param string $encryption
313
+ * @param integer $i
311 314
  */
312 315
   private function writeWLANprofile($wlan_profile_name,$ssid,$auth,$encryption,$eap_config,$i) {
313 316
 $profile_file_contents = '<?xml version="1.0"?>
Please login to merge, or discard this patch.
Indentation   +135 added lines, -135 removed lines patch added patch discarded remove patch
@@ -26,66 +26,66 @@  discard block
 block discarded – undo
26 26
  */
27 27
 class Device_Vista7 extends WindowsCommon {
28 28
     final public function __construct() {
29
-      $this->supportedEapMethods = [EAP::$TLS, EAP::$PEAP_MSCHAP2, EAP::$PWD];
30
-      debug(4,"This device supports the following EAP methods: ");
31
-      debug(4,$this->supportedEapMethods);
32
-      $this->specialities['anon_id'][serialize(EAP::$PEAP_MSCHAP2)] = _("Anonymous identities do not use the realm as specified in the profile - it is derived from the suffix of the user's username input instead.");
29
+        $this->supportedEapMethods = [EAP::$TLS, EAP::$PEAP_MSCHAP2, EAP::$PWD];
30
+        debug(4,"This device supports the following EAP methods: ");
31
+        debug(4,$this->supportedEapMethods);
32
+        $this->specialities['anon_id'][serialize(EAP::$PEAP_MSCHAP2)] = _("Anonymous identities do not use the realm as specified in the profile - it is derived from the suffix of the user's username input instead.");
33 33
     }
34 34
 
35
-  public function writeInstaller() {
36
-      $dom = textdomain(NULL);
37
-      textdomain("devices");
38
-   // create certificate files and save their names in $CA_files arrary
39
-     $CA_files = $this->saveCertificateFiles('der');
35
+    public function writeInstaller() {
36
+        $dom = textdomain(NULL);
37
+        textdomain("devices");
38
+    // create certificate files and save their names in $CA_files arrary
39
+        $CA_files = $this->saveCertificateFiles('der');
40 40
 
41
-     $SSIDs = $this->attributes['internal:SSID'];
42
-     $delSSIDs = $this->attributes['internal:remove_SSID'];
43
-     $this->prepareInstallerLang();
44
-     $set_wired = isset($this->attributes['media:wired'][0]) && $this->attributes['media:wired'][0] == 'on' ? 1 : 0;
41
+        $SSIDs = $this->attributes['internal:SSID'];
42
+        $delSSIDs = $this->attributes['internal:remove_SSID'];
43
+        $this->prepareInstallerLang();
44
+        $set_wired = isset($this->attributes['media:wired'][0]) && $this->attributes['media:wired'][0] == 'on' ? 1 : 0;
45 45
 //   create a list of profiles to be deleted after installation
46
-     $delProfiles = [];
47
-     foreach ($delSSIDs as $ssid => $cipher) {
48
-         if($cipher == 'DEL') 
49
-          $delProfiles[] = $ssid;
50
-         if($cipher == 'TKIP') 
51
-          $delProfiles[] = $ssid.' (TKIP)';
52
-     }
53
-
54
-     if ($this->selected_eap == EAP::$TLS || $this->selected_eap == EAP::$PEAP_MSCHAP2 || $this->selected_eap == EAP::$PWD || $this->selected_eap == EAP::$TTLS_PAP) {
55
-       $WindowsProfile = [];
56
-       $eap_config = $this->prepareEapConfig($this->attributes);
57
-       $i = 0;
58
-       foreach ($SSIDs as $ssid => $cipher) {
59
-          if($cipher == 'TKIP') {
60
-             $WindowsProfile[$i] = $this->writeWLANprofile ($ssid.' (TKIP)',$ssid,'WPA','TKIP',$eap_config,$i);
61
-             $i++;
62
-          }
63
-          $WindowsProfile[$i] = $this->writeWLANprofile ($ssid,$ssid,'WPA2','AES',$eap_config,$i);
64
-          $i++;
65
-       }
66
-       if($set_wired) {
67
-         $this->writeLANprofile($eap_config);
68
-       }
69
-     } else {
70
-       error("  this EAP type is not handled yet");
71
-       return;
72
-     }
46
+        $delProfiles = [];
47
+        foreach ($delSSIDs as $ssid => $cipher) {
48
+            if($cipher == 'DEL') 
49
+            $delProfiles[] = $ssid;
50
+            if($cipher == 'TKIP') 
51
+            $delProfiles[] = $ssid.' (TKIP)';
52
+        }
53
+
54
+        if ($this->selected_eap == EAP::$TLS || $this->selected_eap == EAP::$PEAP_MSCHAP2 || $this->selected_eap == EAP::$PWD || $this->selected_eap == EAP::$TTLS_PAP) {
55
+        $WindowsProfile = [];
56
+        $eap_config = $this->prepareEapConfig($this->attributes);
57
+        $i = 0;
58
+        foreach ($SSIDs as $ssid => $cipher) {
59
+            if($cipher == 'TKIP') {
60
+                $WindowsProfile[$i] = $this->writeWLANprofile ($ssid.' (TKIP)',$ssid,'WPA','TKIP',$eap_config,$i);
61
+                $i++;
62
+            }
63
+            $WindowsProfile[$i] = $this->writeWLANprofile ($ssid,$ssid,'WPA2','AES',$eap_config,$i);
64
+            $i++;
65
+        }
66
+        if($set_wired) {
67
+            $this->writeLANprofile($eap_config);
68
+        }
69
+        } else {
70
+        error("  this EAP type is not handled yet");
71
+        return;
72
+        }
73 73
     debug(4,"WindowsProfile"); debug(4,$WindowsProfile);
74 74
     
75 75
     $this->writeProfilesNSH($WindowsProfile, $CA_files,$set_wired);
76 76
     $this->writeAdditionalDeletes($delProfiles);
77 77
     $this->copyFiles($this->selected_eap);
78 78
     if(isset($this->attributes['internal:logo_file']))
79
-       $this->combineLogo($this->attributes['internal:logo_file']);
79
+        $this->combineLogo($this->attributes['internal:logo_file']);
80 80
     $this->writeMainNSH($this->selected_eap,$this->attributes);
81 81
     $this->compileNSIS();
82 82
     $installer_path = $this->signInstaller($this->attributes); 
83 83
 
84 84
     textdomain($dom);
85 85
     return($installer_path);  
86
-  }
86
+    }
87 87
 
88
-  public function writeDeviceInfo() {
88
+    public function writeDeviceInfo() {
89 89
     $ssid_ct=count($this->attributes['internal:SSID']);
90 90
     $out = "<p>";
91 91
     $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::$CONSORTIUM['name'],Config::$CONSORTIUM['name']);
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
             $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"),implode(', ',Config::$CONSORTIUM['ssid']))." ";
98 98
         $i = 0;
99 99
         foreach ($this->attributes['internal:SSID'] as $ssid=>$v) {
100
-           if(! in_array($ssid, Config::$CONSORTIUM['ssid'])) {
101
-             if($i > 0)
102
-           $out .= ", ";
103
-         $i++;
104
-         $out .= "<strong>$ssid</strong>";
105
-       }
100
+            if(! in_array($ssid, Config::$CONSORTIUM['ssid'])) {
101
+                if($i > 0)
102
+            $out .= ", ";
103
+            $i++;
104
+            $out .= "<strong>$ssid</strong>";
105
+        }
106 106
     }
107 107
     $out .= "<p>";
108 108
     }
@@ -115,21 +115,21 @@  discard block
 block discarded – undo
115 115
         $out .= "<p>";
116 116
         $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.");
117 117
         if($ssid_ct > 1) {
118
-             $out .= "<p>";
119
-             $out .= _("You will be required to enter the same credentials for each of the configured notworks:")." ";
120
-             $i = 0;
118
+                $out .= "<p>";
119
+                $out .= _("You will be required to enter the same credentials for each of the configured notworks:")." ";
120
+                $i = 0;
121 121
             foreach ($this->attributes['internal:SSID'] as $ssid=>$v) {
122
-                 if($i > 0)
123
-                   $out .= ", ";
124
-                 $i++;
125
-                 $out .= "<strong>$ssid</strong>";
122
+                    if($i > 0)
123
+                    $out .= ", ";
124
+                    $i++;
125
+                    $out .= "<strong>$ssid</strong>";
126 126
             }
127 127
     }
128 128
 
129
-   }
129
+    }
130 130
 
131
-   }
132
-  return($out);
131
+    }
132
+    return($out);
133 133
 }
134 134
 
135 135
 private function prepareEapConfig($attr) {
@@ -137,25 +137,25 @@  discard block
 block discarded – undo
137 137
     $w7_ext = '';
138 138
     $eap = $this->selected_eap;
139 139
     if ($eap != EAP::$TLS && $eap != EAP::$PEAP_MSCHAP2 && $eap != EAP::$PWD && $eap != EAP::$TTLS_PAP) {
140
-      debug(2,"this method only allows TLS, PEAP, TTLS-PAP or EAP-pwd");
141
-      error("this method only allows TLS, PEAP, TTLS-PAP or EAP-pwd");
142
-     return;
140
+        debug(2,"this method only allows TLS, PEAP, TTLS-PAP or EAP-pwd");
141
+        error("this method only allows TLS, PEAP, TTLS-PAP or EAP-pwd");
142
+        return;
143
+    }
144
+    $use_anon = $attr['internal:use_anon_outer'] [0];
145
+    $realm = $attr['internal:realm'] [0];
146
+    if ($use_anon) {
147
+        $outer_user = $attr['internal:anon_local_value'][0];
143 148
     }
144
-   $use_anon = $attr['internal:use_anon_outer'] [0];
145
-   $realm = $attr['internal:realm'] [0];
146
-   if ($use_anon) {
147
-     $outer_user = $attr['internal:anon_local_value'][0];
148
-   }
149 149
 //   $servers = preg_quote(implode(';',$attr['eap:server_name']));
150
-   $servers = implode(';',$attr['eap:server_name']);
151
-   $ca_array = $attr['internal:CAs'][0];
152
-   $author_id = "0";
153
-   if( $eap == EAP::$TTLS_PAP) {
154
-      $author_id = "17236";
155
-      $servers = implode('</ServerName><ServerName>',$attr['eap:server_name']);
156
-   }
157
-
158
-  $profile_file_contents = '<EAPConfig><EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
150
+    $servers = implode(';',$attr['eap:server_name']);
151
+    $ca_array = $attr['internal:CAs'][0];
152
+    $author_id = "0";
153
+    if( $eap == EAP::$TTLS_PAP) {
154
+        $author_id = "17236";
155
+        $servers = implode('</ServerName><ServerName>',$attr['eap:server_name']);
156
+    }
157
+
158
+    $profile_file_contents = '<EAPConfig><EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
159 159
 <EapMethod>
160 160
 <Type xmlns="http://www.microsoft.com/provisioning/EapCommon">'.
161 161
     $this->selected_eap["OUTER"] .'</Type>
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 ';
167 167
 
168 168
 
169
-   if( $eap == EAP::$TTLS_PAP) {
169
+    if( $eap == EAP::$TTLS_PAP) {
170 170
 $profile_file_contents .= '
171 171
 <Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig">
172 172
 <EAPIdentityProviderList xmlns="urn:ietf:params:xml:ns:yang:ietf-eap-metadata">
@@ -201,14 +201,14 @@  discard block
 block discarded – undo
201 201
 $profile_file_contents .= '<ServerSideCredential>
202 202
 ';
203 203
 
204
-   foreach ($ca_array as $ca) {
204
+    foreach ($ca_array as $ca) {
205 205
       
206
-      $profile_file_contents .= '<CA><format>PEM</format><cert-data>';
207
-      $profile_file_contents .= base64_encode($ca['der']);
208
-      $profile_file_contents .= '</cert-data></CA>
206
+        $profile_file_contents .= '<CA><format>PEM</format><cert-data>';
207
+        $profile_file_contents .= base64_encode($ca['der']);
208
+        $profile_file_contents .= '</cert-data></CA>
209 209
 ';
210
-   }
211
-   $profile_file_contents .= "<ServerName>$servers</ServerName>\n";
210
+    }
211
+    $profile_file_contents .= "<ServerName>$servers</ServerName>\n";
212 212
 
213 213
 $profile_file_contents .= '
214 214
 </ServerSideCredential>
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 }
229 229
 
230 230
 elseif( $eap == EAP::$TLS) {
231
-  $profile_file_contents .= '
231
+    $profile_file_contents .= '
232 232
 
233 233
 <Config xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1" 
234 234
   xmlns:eapTls="http://www.microsoft.com/provisioning/EapTlsConnectionPropertiesV1">
@@ -244,14 +244,14 @@  discard block
 block discarded – undo
244 244
 if($ca_array) {
245 245
 foreach ($ca_array as $CA)
246 246
     if($CA['root'])
247
-       $profile_file_contents .= "<eapTls:TrustedRootCA>".$CA['sha1']."</eapTls:TrustedRootCA>\n";
247
+        $profile_file_contents .= "<eapTls:TrustedRootCA>".$CA['sha1']."</eapTls:TrustedRootCA>\n";
248 248
 }
249 249
 $profile_file_contents .= '</eapTls:ServerValidation>
250 250
 ';
251 251
 if(isset($attr['eap-specific:tls_use_other_id']) && $attr['eap-specific:tls_use_other_id'][0] == 'on')
252
-   $profile_file_contents .= '<eapTls:DifferentUsername>true</eapTls:DifferentUsername>';
252
+    $profile_file_contents .= '<eapTls:DifferentUsername>true</eapTls:DifferentUsername>';
253 253
 else
254
-   $profile_file_contents .= '<eapTls:DifferentUsername>false</eapTls:DifferentUsername>';
254
+    $profile_file_contents .= '<eapTls:DifferentUsername>false</eapTls:DifferentUsername>';
255 255
 $profile_file_contents .= '
256 256
 </eapTls:EapType>
257 257
 </baseEap:Eap>
@@ -259,9 +259,9 @@  discard block
 block discarded – undo
259 259
 ';
260 260
 } elseif ( $eap == EAP::$PEAP_MSCHAP2) {
261 261
 if(isset($attr['eap:enable_nea']) && $attr['eap:enable_nea'][0] == 'on')
262
-   $nea = 'true';
262
+    $nea = 'true';
263 263
 else
264
-   $nea = 'false';
264
+    $nea = 'false';
265 265
 $vista_ext = '<Config xmlns:eapUser="http://www.microsoft.com/provisioning/EapUserPropertiesV1" 
266 266
 xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1" 
267 267
   xmlns:msPeap="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV1" 
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 if($ca_array) {
276 276
 foreach ($ca_array as $CA)
277 277
     if($CA['root'])
278
-       $vista_ext .= "<msPeap:TrustedRootCA>".$CA['sha1']."</msPeap:TrustedRootCA>\n";
278
+        $vista_ext .= "<msPeap:TrustedRootCA>".$CA['sha1']."</msPeap:TrustedRootCA>\n";
279 279
 }
280 280
 $vista_ext .= '</msPeap:ServerValidation>
281 281
 <msPeap:FastReconnect>true</msPeap:FastReconnect> 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 </Config>
330 330
 ';
331 331
 } elseif ( $eap == EAP::$PWD) {
332
-   $profile_file_contents .= '<ConfigBlob></ConfigBlob>';
332
+    $profile_file_contents .= '<ConfigBlob></ConfigBlob>';
333 333
 } 
334 334
 
335 335
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 /**
352 352
  * produce PEAP and TLS configuration files for Vista and Windows 7
353 353
  */
354
-  private function writeWLANprofile($wlan_profile_name,$ssid,$auth,$encryption,$eap_config,$i) {
354
+    private function writeWLANprofile($wlan_profile_name,$ssid,$auth,$encryption,$eap_config,$i) {
355 355
 $profile_file_contents = '<?xml version="1.0"?>
356 356
 <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
357 357
 <name>'.$wlan_profile_name.'</name>
@@ -391,9 +391,9 @@  discard block
 block discarded – undo
391 391
 ';
392 392
 
393 393
 if(! is_dir('w7'))
394
-  mkdir('w7');
394
+    mkdir('w7');
395 395
 if(! is_dir('vista'))
396
-  mkdir('vista');
396
+    mkdir('vista');
397 397
 $xml_f_name = "vista/wlan_prof-$i.xml";
398 398
 $xml_f = fopen($xml_f_name,'w');
399 399
 fwrite($xml_f,$profile_file_contents. $eap_config['vista']. $closing) ;
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
 </LANProfile>
424 424
 ';
425 425
 if(! is_dir('w7'))
426
-  mkdir('w7');
426
+    mkdir('w7');
427 427
 if(! is_dir('vista'))
428
-  mkdir('vista');
428
+    mkdir('vista');
429 429
 $xml_f_name = "vista/lan_prof.xml";
430 430
 $xml_f = fopen($xml_f_name,'w');
431 431
 fwrite($xml_f,$profile_file_contents. $eap_config['vista']. $closing) ;
@@ -438,16 +438,16 @@  discard block
 block discarded – undo
438 438
 
439 439
 private function glueServerNames($server_list) {
440 440
 //print_r($server_list);
441
- $A0 =  array_reverse(explode('.',array_shift($server_list)));
442
- $B = $A0;
443
- if($server_list) {
444
-   foreach($server_list as $a) {
445
-   $A= array_reverse(explode('.',$a));
446
-   $B = array_intersect_assoc($A0,$A);
447
-   $A0 = $B;
448
-   }
449
-  }
450
-  return(implode('.',array_reverse($B)));
441
+    $A0 =  array_reverse(explode('.',array_shift($server_list)));
442
+    $B = $A0;
443
+    if($server_list) {
444
+    foreach($server_list as $a) {
445
+    $A= array_reverse(explode('.',$a));
446
+    $B = array_intersect_assoc($A0,$A);
447
+    $A0 = $B;
448
+    }
449
+    }
450
+    return(implode('.',array_reverse($B)));
451 451
 }
452 452
 
453 453
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 ';
503 503
 
504 504
 if(isset($this->attributes['media:wired'][0]) && $attr['media:wired'][0] == 'on')
505
-  $fcontents .= '!define WIRED
505
+    $fcontents .= '!define WIRED
506 506
 ';
507 507
 
508 508
 $f = fopen('main.nsh','w');
@@ -514,8 +514,8 @@  discard block
 block discarded – undo
514 514
 private function writeProfilesNSH($P,$ca_array,$wired=0) {
515 515
 debug(4,"writeProfilesNSH");
516 516
 debug(4,$P);
517
-  $fcontents = '';
518
-  foreach($P as $p) 
517
+    $fcontents = '';
518
+    foreach($P as $p) 
519 519
     $fcontents .= "!insertmacro define_wlan_profile $p\n";
520 520
   
521 521
 $f = fopen('profiles.nsh','w');
@@ -526,8 +526,8 @@  discard block
 block discarded – undo
526 526
 $f = fopen('certs.nsh','w');
527 527
 if($ca_array) {
528 528
 foreach ($ca_array as $CA) {
529
-      $store = $CA['root'] ? "root" : "ca";
530
-      $fcontents .= '!insertmacro install_ca_cert "'.$CA['file'].'" "'.$CA['sha1'].'" "'.$store."\"\n";
529
+        $store = $CA['root'] ? "root" : "ca";
530
+        $fcontents .= '!insertmacro install_ca_cert "'.$CA['file'].'" "'.$CA['sha1'].'" "'.$store."\"\n";
531 531
     }
532 532
 fwrite($f, $fcontents);
533 533
 }
@@ -537,33 +537,33 @@  discard block
 block discarded – undo
537 537
 private function copyFiles ($eap) {
538 538
 debug(4,"copyFiles start\n");
539 539
 debug(4,"code_page=".$this->code_page."\n");
540
-   $result;
541
-   $result = $this->copyFile('wlan_test.exe');
542
-   $result = $this->copyFile('check_wired.cmd');
543
-   $result = $this->copyFile('install_wired.cmd');
544
-   $result = $this->copyFile('setEAPCred.exe');
545
-   $result = $this->copyFile('base64.nsh');
546
-   $result = $this->copyFile('cat_bg.bmp');
547
-   $result = $result && $this->copyFile('cat32.ico');
548
-   $result = $result && $this->copyFile('cat_150.bmp');
549
-   $this->translateFile('common.inc','common.nsh',$this->code_page);
550
-   if( $eap["OUTER"] == TTLS)  {
551
-     $result = $this->copyFile('GPL3.rtf');
552
-     $result = $result && $this->copyFile('ArnesLinkEn32.msi');
553
-     $result = $result && $this->copyFile('ArnesLinkEn64.msi');
554
-     $result = $result && $this->copyFile('dump_arneslink_profile.cmd');
555
-     $result = $result && $this->copyFile('install_arneslink_profile.cmd');
556
-     $this->translateFile('arnes_link.inc','cat.NSI',$this->code_page);
557
-   } elseif($eap["OUTER"] == PWD) {
558
-     $this->translateFile('pwd.inc','cat.NSI',$this->code_page);
559
-     $result = $result && $this->copyFile('Aruba_Networks_EAP-pwd_x32.msi');
560
-     $result = $result && $this->copyFile('Aruba_Networks_EAP-pwd_x64.msi');
540
+    $result;
541
+    $result = $this->copyFile('wlan_test.exe');
542
+    $result = $this->copyFile('check_wired.cmd');
543
+    $result = $this->copyFile('install_wired.cmd');
544
+    $result = $this->copyFile('setEAPCred.exe');
545
+    $result = $this->copyFile('base64.nsh');
546
+    $result = $this->copyFile('cat_bg.bmp');
547
+    $result = $result && $this->copyFile('cat32.ico');
548
+    $result = $result && $this->copyFile('cat_150.bmp');
549
+    $this->translateFile('common.inc','common.nsh',$this->code_page);
550
+    if( $eap["OUTER"] == TTLS)  {
551
+        $result = $this->copyFile('GPL3.rtf');
552
+        $result = $result && $this->copyFile('ArnesLinkEn32.msi');
553
+        $result = $result && $this->copyFile('ArnesLinkEn64.msi');
554
+        $result = $result && $this->copyFile('dump_arneslink_profile.cmd');
555
+        $result = $result && $this->copyFile('install_arneslink_profile.cmd');
556
+        $this->translateFile('arnes_link.inc','cat.NSI',$this->code_page);
557
+    } elseif($eap["OUTER"] == PWD) {
558
+        $this->translateFile('pwd.inc','cat.NSI',$this->code_page);
559
+        $result = $result && $this->copyFile('Aruba_Networks_EAP-pwd_x32.msi');
560
+        $result = $result && $this->copyFile('Aruba_Networks_EAP-pwd_x64.msi');
561 561
     } else {
562
-     $this->translateFile('peap_tls.inc','cat.NSI',$this->code_page);
563
-     $result = 1;
562
+        $this->translateFile('peap_tls.inc','cat.NSI',$this->code_page);
563
+        $result = 1;
564 564
     }
565 565
 debug(4,"copyFiles end\n");
566
-   return($result);
566
+    return($result);
567 567
 }
568 568
 
569 569
 }
570 570
\ No newline at end of file
Please login to merge, or discard this patch.
devices/ms/Files/common.inc 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -107,10 +107,10 @@  discard block
 block discarded – undo
107 107
 !define MUI_HEADERIMAGE_BITMAP "cat_150.bmp"
108 108
 !define MUI_COMPONENTSPAGE_SMALLDESC
109 109
 
110
-!define WELCOME_HEADER "<?php printf(sprint_nsi(_("Welcome to the %s installer")),Config::$CONSORTIUM['name'])?>"
111
-!define FAREWELL_HEADER "<?php echo_nsi( _("Installation complete"))?>"
112
-!define FAREWELL_TEXT	"<?php echo_nsi( _("Network profiles have been installed."))?>$\r$\n$\n <?php echo_nsi(  _("Your system is ready."))?>"
113
-!define FAREWELL_FAIL	"<?php echo_nsi( _("Network installation had errors."))?>$\r$\n$\n <?php echo_nsi( _("Please contact \${SUPPORT}."))?>"
110
+!define WELCOME_HEADER "<?php printf(sprint_nsi(_("Welcome to the %s installer")), Config::$CONSORTIUM['name'])?>"
111
+!define FAREWELL_HEADER "<?php echo_nsi(_("Installation complete"))?>"
112
+!define FAREWELL_TEXT	"<?php echo_nsi(_("Network profiles have been installed."))?>$\r$\n$\n <?php echo_nsi(_("Your system is ready."))?>"
113
+!define FAREWELL_FAIL	"<?php echo_nsi(_("Network installation had errors."))?>$\r$\n$\n <?php echo_nsi(_("Please contact \${SUPPORT}."))?>"
114 114
 ;--------------------------------
115 115
 ;Languages
116 116
 !insertmacro MUI_LANGUAGE "${LANG}"
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
 ;--------------------------------
119 119
 ; License file
120 120
 !ifdef LICENSE_FILE
121
-LicenseForceSelection checkbox "<?php echo_nsi( _("Accept"))?>"
121
+LicenseForceSelection checkbox "<?php echo_nsi(_("Accept"))?>"
122 122
 LicenseText "<?php echo_nsi(_("If you accept the conditions then select Accept and then click Install to continue."))?>"
123 123
 LicenseData ${LICENSE_FILE}
124 124
 !endif
125 125
 
126 126
 ;-----------------------------------
127 127
 
128
-MiscButtonText "" "" "" "<?php echo_nsi( _("Finish"))?>"
128
+MiscButtonText "" "" "" "<?php echo_nsi(_("Finish"))?>"
129 129
 ;----------------------------------
130 130
 ;  FUNCTIONS
131 131
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
 !macro install_ca_cert ca_file ca_fingerprint level
160 160
    !insertmacro debug_cat 2 "locating certificate  SHA=${ca_fingerprint} Level=${level}"
161
-   DetailPrint "<?php echo_nsi( _("searching for certificate"))?> ${ca_file}"
161
+   DetailPrint "<?php echo_nsi(_("searching for certificate"))?> ${ca_file}"
162 162
    File "${ca_file}"
163 163
    nsArray::Set Delete_files "${ca_file}"
164 164
    !insertmacro debug_cat 2 "Testing machine store root"
@@ -220,13 +220,13 @@  discard block
 block discarded – undo
220 220
    ${EndIf}
221 221
    !insertmacro debug_cat 2 "installing certificate $TEMP\${ca_file}"
222 222
    !insertmacro debug_cat 3 "Execute: certutil -addstore -user ${level} $TEMP\${ca_file}"
223
-   DetailPrint "<?php echo_nsi( _("installing certificate"))?> ${ca_file}"
223
+   DetailPrint "<?php echo_nsi(_("installing certificate"))?> ${ca_file}"
224 224
    nsExec::Exec '"certutil" -addstore -user ${level} $TEMP\${ca_file}'
225 225
    Pop $0
226 226
    !insertmacro debug_cat 3 "certutil returned $0"
227 227
    ${If} $0 != 0
228 228
      IfSilent +2
229
-     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php echo_nsi( _("could not install certificate"))?>  ${ca_file}"
229
+     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php echo_nsi(_("could not install certificate"))?>  ${ca_file}"
230 230
      !insertmacro debug_cat 1 "could not install certificate ${ca_file}"
231 231
    ${EndIf}
232 232
 no_install_${ca_file}:
@@ -417,26 +417,26 @@  discard block
 block discarded – undo
417 417
   pop $R0
418 418
   ${If} $tkip_count > 0
419 419
     ${If} $aes_count > 1
420
-      StrCpy $R1 "$\r$\n$\n<?php echo_nsi( _("The non TKIP profiles are preferred. Always use them if you have a choice."))?>"
420
+      StrCpy $R1 "$\r$\n$\n<?php echo_nsi(_("The non TKIP profiles are preferred. Always use them if you have a choice."))?>"
421 421
     ${Else}
422
-     StrCpy $R1 "$\r$\n$\n<?php echo_nsi( _("The non TKIP profile is preferred. Always use it if you have a choice."))?>"
422
+     StrCpy $R1 "$\r$\n$\n<?php echo_nsi(_("The non TKIP profile is preferred. Always use it if you have a choice."))?>"
423 423
     ${EndIf}
424 424
   ${Else}
425 425
     StrCpy $R1 ""
426 426
   ${EndIf}
427 427
   ${If} $profile_count > 0
428
-    StrCpy $welcome_message "<?php echo_nsi( _("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
429
-<?php echo_nsi( _("The installer will create the following wireless profiles:"))?>$\r$\n\
428
+    StrCpy $welcome_message "<?php echo_nsi(_("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
429
+<?php echo_nsi(_("The installer will create the following wireless profiles:"))?>$\r$\n\
430 430
 $R0.\
431 431
 $R1$\r$\n$\n\
432
-<?php echo_nsi( _("More information and comments:"))?>$\r$\n\
432
+<?php echo_nsi(_("More information and comments:"))?>$\r$\n\
433 433
    EMAIL: ${SUPPORT}$\r$\n\
434 434
    WWW: ${URL}"
435 435
 ${Else}
436
-StrCpy $welcome_message "<?php echo_nsi( _("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
437
-<?php echo_nsi( _("The installer will create the wireless profile:"))?> $R0.\
436
+StrCpy $welcome_message "<?php echo_nsi(_("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
437
+<?php echo_nsi(_("The installer will create the wireless profile:"))?> $R0.\
438 438
 $R1$\r$\n$\n\
439
-<?php echo_nsi( _("More information and comments:"))?>$\r$\n\
439
+<?php echo_nsi(_("More information and comments:"))?>$\r$\n\
440 440
    EMAIL: ${SUPPORT}$\r$\n\
441 441
    WWW: ${URL}"
442 442
 ${EndIf}
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
   SendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0
463 463
 ;TRANSLATION
464 464
   nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 46u -130u -32u "$welcome_message\
465
-$\r$\n$\r$\n<?php echo_nsi( _("Installer created with software from the GEANT project."))?>"
465
+$\r$\n$\r$\n<?php echo_nsi(_("Installer created with software from the GEANT project."))?>"
466 466
   Pop $TEXT
467 467
 
468 468
   SetCtlColors $DIALOG "" 0xffffff
@@ -573,18 +573,18 @@  discard block
 block discarded – undo
573 573
     ${If} $wireless_result == 1
574 574
       !insertmacro debug_cat 1 "wlan_test.exe did not find wireless configuration service"
575 575
       IfSilent +2
576
-      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php echo_nsi( _("Windows wireless configuration service is not enabled. The installer cannot continue."))?>"
576
+      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php echo_nsi(_("Windows wireless configuration service is not enabled. The installer cannot continue."))?>"
577 577
       Call Cleanup
578 578
     ${EndIf}
579 579
     ${If} $wireless_result == 2
580 580
       IfSilent +2
581
-      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php echo_nsi( _("No wireless interfaces found. The installer cannot continue."))?>"
581
+      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php echo_nsi(_("No wireless interfaces found. The installer cannot continue."))?>"
582 582
       Call Cleanup
583 583
     ${EndIf}
584 584
   ${Else}
585 585
     ${If} $wireless_result > 0
586 586
        IfSilent +3
587
-       MessageBox MB_YESNO "<?php echo_nsi( _("No wireless interfaces found. Wireless access will not be configured. Would you like to continue and configure access on the wired interface?"))?>" IDYES wired_yes
587
+       MessageBox MB_YESNO "<?php echo_nsi(_("No wireless interfaces found. Wireless access will not be configured. Would you like to continue and configure access on the wired interface?"))?>" IDYES wired_yes
588 588
        Call Cleanup
589 589
        wired_yes:
590 590
        Push 1
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
     ${If} $wired == 1
601 601
       ${If} $force_wired == 0
602 602
         IfSilent wired
603
-        MessageBox MB_YESNO "<?php echo_nsi( _("Do you want to enable access on wired interfaces?"))?>" IDYES wired
603
+        MessageBox MB_YESNO "<?php echo_nsi(_("Do you want to enable access on wired interfaces?"))?>" IDYES wired
604 604
         Push 0
605 605
         Pop $wired
606 606
       ${EndIf}
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
 ;================================
636 636
 
637 637
 Function ShowInstfiles
638
-  !insertmacro MUI_HEADER_TEXT "<?php echo_nsi( _("Profiles installation"))?>" " "
638
+  !insertmacro MUI_HEADER_TEXT "<?php echo_nsi(_("Profiles installation"))?>" " "
639 639
 FunctionEnd
640 640
 ;================================
641 641
 ;  Check if a wireless profile exist and put it on delete list
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
 
655 655
 Function FindProfile
656 656
   Pop $R8
657
-  DetailPrint "<?php echo_nsi( _("Checking for profile \$R8"))?>"
657
+  DetailPrint "<?php echo_nsi(_("Checking for profile \$R8"))?>"
658 658
   !insertmacro debug_cat 2 "Checking for profile $R8"
659 659
   !insertmacro debug_cat 3 "Exec: $Netsh wlan show profiles $R8"
660 660
   nsExec::Exec  '"$Netsh" wlan show profiles "$R8"'
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
   !insertmacro debug_cat 4 "netsh returned $0"
663 663
   ${If} $0 == 0
664 664
     !insertmacro debug_cat 1 "found profile $R8"
665
-    DetailPrint "<?php echo_nsi( _("found profile \$R8"))?>"
665
+    DetailPrint "<?php echo_nsi(_("found profile \$R8"))?>"
666 666
     Push 0
667 667
   ${Else}
668 668
     !insertmacro debug_cat 1 "profile $R8 not found"
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
     ${If} $Symantec_installed  != 0
755 755
      !insertmacro debug_cat 3 "Symantec problem"
756 756
      IfSilent +2
757
-     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php printf(sprint_nsi(_("Please READ this message it is IMPORTANT.$\\r$\\nInstallation problems may be due to the fact that Symantec Endpoint Protection is installed on your machine.$\\r$\\nWhile this is a well-known bug of the Symantec product, about which the installer can not do anything, there is a workaround.$\\r$\\nWhen you close this window the installer will exit and an explorer window will be started (it could appear underneath already opened windows). In this window you should see a script named inst_cat. Start it by double-clicking, It will install the profiles. You will need to login to %s with your username and password.")),Config::$CONSORTIUM['name']) ?>"
757
+     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php printf(sprint_nsi(_("Please READ this message it is IMPORTANT.$\\r$\\nInstallation problems may be due to the fact that Symantec Endpoint Protection is installed on your machine.$\\r$\\nWhile this is a well-known bug of the Symantec product, about which the installer can not do anything, there is a workaround.$\\r$\\nWhen you close this window the installer will exit and an explorer window will be started (it could appear underneath already opened windows). In this window you should see a script named inst_cat. Start it by double-clicking, It will install the profiles. You will need to login to %s with your username and password.")), Config::$CONSORTIUM['name']) ?>"
758 758
     Exec '"explorer" /select,"$EXEDIR\inst_cat.cmd"'
759 759
     Quit
760 760
 
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
 !ifdef TLS
990 990
 Function PFXCertificateSelect
991 991
 ;TRANSLATION
992
-!insertmacro MUI_HEADER_TEXT "<?php printf(sprint_nsi(_("%s installer for")),Config::$CONSORTIUM['name'])?> " "<?php echo_nsi(_("Install personal certificate"))?>"
992
+!insertmacro MUI_HEADER_TEXT "<?php printf(sprint_nsi(_("%s installer for")), Config::$CONSORTIUM['name'])?> " "<?php echo_nsi(_("Install personal certificate"))?>"
993 993
   ${If} $PFX_install == 0
994 994
     Return
995 995
   ${EndIf}
@@ -1160,7 +1160,7 @@  discard block
 block discarded – undo
1160 1160
 PageEx components
1161 1161
 PageCallbacks showComponents "" ""
1162 1162
 ;TRANSLATION
1163
-ComponentText "<?php printf(sprint_nsi(_("In order to install/update %s access all selected steps need to be performed. Click Continue to proceed")),Config::$CONSORTIUM['name'])?>" "" \
1163
+ComponentText "<?php printf(sprint_nsi(_("In order to install/update %s access all selected steps need to be performed. Click Continue to proceed")), Config::$CONSORTIUM['name'])?>" "" \
1164 1164
       "<?php echo_nsi(_("If an option is not selected by default, then it is either not available or optional."))?>"
1165 1165
 PageExEnd
1166 1166
 ;=============================
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
 Section "-start"
1181 1181
 SectionIn RO
1182 1182
 
1183
-!insertmacro MUI_HEADER_TEXT "<?php echo_nsi( _("Installation"))?>" "<?php echo_nsi( _("Checking for existing wireless profiles"))?>"
1183
+!insertmacro MUI_HEADER_TEXT "<?php echo_nsi(_("Installation"))?>" "<?php echo_nsi(_("Checking for existing wireless profiles"))?>"
1184 1184
 !ifndef PWD
1185 1185
 !ifndef ArnesLink
1186 1186
 !include "certs.nsh"
Please login to merge, or discard this patch.
devices/xml/XML_TTLS_PAP.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@
 block discarded – undo
5 5
 
6 6
 class Device_XML_TTLS_PAP extends Device_XML {
7 7
     final public function __construct() {
8
-      $this->supportedEapMethods  =
8
+        $this->supportedEapMethods  =
9 9
             [
10
-              EAP::$TTLS_PAP,
11
-       ];
12
-      $this->lang_scope = 'single';
10
+                EAP::$TTLS_PAP,
11
+        ];
12
+        $this->lang_scope = 'single';
13 13
     }
14 14
 }
15 15
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 
6 6
 class Device_XML_PWD extends Device_XML {
7 7
     final public function __construct() {
8
-      $this->supportedEapMethods  =
8
+      $this->supportedEapMethods =
9 9
             [
10 10
               EAP::$PWD,
11 11
        ];
Please login to merge, or discard this patch.
devices/xml/XML_ALL.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -5,16 +5,16 @@
 block discarded – undo
5 5
 
6 6
 class Device_XML_ALL extends Device_XML{
7 7
     final public function __construct() {
8
-      $this->supportedEapMethods  =
8
+        $this->supportedEapMethods  =
9 9
             [
10
-              EAP::$PEAP_MSCHAP2,
11
-              EAP::$TTLS_PAP,
12
-              EAP::$TTLS_MSCHAP2,
13
-              EAP::$TLS,
14
-              EAP::$PWD,
15
-       ];
16
-      $this->lang_scope = 'single';
17
-      $this->all_eaps = TRUE;
10
+                EAP::$PEAP_MSCHAP2,
11
+                EAP::$TTLS_PAP,
12
+                EAP::$TTLS_MSCHAP2,
13
+                EAP::$TLS,
14
+                EAP::$PWD,
15
+        ];
16
+        $this->lang_scope = 'single';
17
+        $this->all_eaps = TRUE;
18 18
     }
19 19
 }
20 20
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 require_once('DeviceConfig.php');
4 4
 require_once('XML.php');
5 5
 
6
-class Device_XML_ALL extends Device_XML{
6
+class Device_XML_ALL extends Device_XML {
7 7
     final public function __construct() {
8
-      $this->supportedEapMethods  =
8
+      $this->supportedEapMethods =
9 9
             [
10 10
               EAP::$PEAP_MSCHAP2,
11 11
               EAP::$TTLS_PAP,
Please login to merge, or discard this patch.
devices/xml/KitKat.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@
 block discarded – undo
5 5
 
6 6
 class Device_KitKat extends Device_XML{
7 7
     final public function __construct() {
8
-      $this->supportedEapMethods  =
8
+        $this->supportedEapMethods  =
9 9
             [
10
-              EAP::$PEAP_MSCHAP2,
11
-              EAP::$TTLS_PAP,
12
-              EAP::$TTLS_MSCHAP2,
13
-       ];
14
-      $this->lang_scope = 'single';
15
-      $this->all_eaps = TRUE;
10
+                EAP::$PEAP_MSCHAP2,
11
+                EAP::$TTLS_PAP,
12
+                EAP::$TTLS_MSCHAP2,
13
+        ];
14
+        $this->lang_scope = 'single';
15
+        $this->all_eaps = TRUE;
16 16
     }
17 17
 }
18 18
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 require_once('DeviceConfig.php');
4 4
 require_once('XML.php');
5 5
 
6
-class Device_KitKat extends Device_XML{
6
+class Device_KitKat extends Device_XML {
7 7
     final public function __construct() {
8
-      $this->supportedEapMethods  =
8
+      $this->supportedEapMethods =
9 9
             [
10 10
               EAP::$PEAP_MSCHAP2,
11 11
               EAP::$TTLS_PAP,
Please login to merge, or discard this patch.
devices/xml/XML_TLS.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@
 block discarded – undo
5 5
 
6 6
 class Device_XML_TLS extends Device_XML {
7 7
     final public function __construct() {
8
-      $this->supportedEapMethods  =
8
+        $this->supportedEapMethods  =
9 9
             [
10
-              EAP::$TLS,
11
-       ];
12
-      $this->lang_scope = 'single';
10
+                EAP::$TLS,
11
+        ];
12
+        $this->lang_scope = 'single';
13 13
     }
14 14
 }
15 15
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 
6 6
 class Device_XML_PWD extends Device_XML {
7 7
     final public function __construct() {
8
-      $this->supportedEapMethods  =
8
+      $this->supportedEapMethods =
9 9
             [
10 10
               EAP::$PWD,
11 11
        ];
Please login to merge, or discard this patch.