@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | final public function __construct() { |
29 | 29 | $this->supportedEapMethods = [EAP::$TLS, EAP::$PEAP_MSCHAP2, EAP::$TTLS_PAP, EAP::$TTLS_MSCHAP2, EAP::$PWD]; |
30 | 30 | # $this->supportedEapMethods = array(EAP::$TLS, EAP::$PEAP_MSCHAP2, EAP::$TTLS_PAP, EAP::$PWD); |
31 | - debug(4,"This device supports the following EAP methods: "); |
|
32 | - debug(4,$this->supportedEapMethods); |
|
31 | + debug(4, "This device supports the following EAP methods: "); |
|
32 | + debug(4, $this->supportedEapMethods); |
|
33 | 33 | $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."); |
34 | 34 | } |
35 | 35 | |
@@ -46,42 +46,42 @@ discard block |
||
46 | 46 | // create a list of profiles to be deleted after installation |
47 | 47 | $delProfiles = []; |
48 | 48 | foreach ($delSSIDs as $ssid => $cipher) { |
49 | - if($cipher == 'DEL') |
|
49 | + if ($cipher == 'DEL') |
|
50 | 50 | $delProfiles[] = $ssid; |
51 | - if($cipher == 'TKIP') |
|
52 | - $delProfiles[] = $ssid.' (TKIP)'; |
|
51 | + if ($cipher == 'TKIP') |
|
52 | + $delProfiles[] = $ssid . ' (TKIP)'; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | - if ($this->selected_eap == EAP::$TLS || $this->selected_eap == EAP::$PEAP_MSCHAP2 || $this->selected_eap == EAP::$TTLS_PAP || $this->selected_eap == EAP::$TTLS_MSCHAP2 || $this->selected_eap == EAP::$PWD) { |
|
56 | + if ($this->selected_eap == EAP::$TLS || $this->selected_eap == EAP::$PEAP_MSCHAP2 || $this->selected_eap == EAP::$TTLS_PAP || $this->selected_eap == EAP::$TTLS_MSCHAP2 || $this->selected_eap == EAP::$PWD) { |
|
57 | 57 | $WindowsProfile = []; |
58 | 58 | $eap_config = $this->prepareEapConfig($this->attributes); |
59 | 59 | $i = 0; |
60 | 60 | foreach ($SSIDs as $ssid => $cipher) { |
61 | - if($cipher == 'TKIP') { |
|
62 | - $WindowsProfile[$i] = $this->writeWLANprofile ($ssid.' (TKIP)',$ssid,'WPA','TKIP',$eap_config,$i); |
|
61 | + if ($cipher == 'TKIP') { |
|
62 | + $WindowsProfile[$i] = $this->writeWLANprofile($ssid . ' (TKIP)', $ssid, 'WPA', 'TKIP', $eap_config, $i); |
|
63 | 63 | $i++; |
64 | 64 | } |
65 | - $WindowsProfile[$i] = $this->writeWLANprofile ($ssid,$ssid,'WPA2','AES',$eap_config,$i); |
|
65 | + $WindowsProfile[$i] = $this->writeWLANprofile($ssid, $ssid, 'WPA2', 'AES', $eap_config, $i); |
|
66 | 66 | $i++; |
67 | 67 | } |
68 | - if($set_wired) { |
|
68 | + if ($set_wired) { |
|
69 | 69 | $this->writeLANprofile($eap_config); |
70 | 70 | } |
71 | 71 | } else { |
72 | 72 | error(" this EAP type is not handled yet"); |
73 | 73 | return; |
74 | 74 | } |
75 | - debug(4,"WindowsProfile"); debug(4,$WindowsProfile); |
|
75 | + debug(4, "WindowsProfile"); debug(4, $WindowsProfile); |
|
76 | 76 | |
77 | - $this->writeProfilesNSH($WindowsProfile, $CA_files,$set_wired); |
|
77 | + $this->writeProfilesNSH($WindowsProfile, $CA_files, $set_wired); |
|
78 | 78 | $this->writeAdditionalDeletes($delProfiles); |
79 | - if(isset($additional_deletes) && count($additional_deletes)) |
|
79 | + if (isset($additional_deletes) && count($additional_deletes)) |
|
80 | 80 | $this->writeAdditionalDeletes($additional_deletes); |
81 | 81 | $this->copyFiles($this->selected_eap); |
82 | - if(isset($this->attributes['internal:logo_file'])) |
|
82 | + if (isset($this->attributes['internal:logo_file'])) |
|
83 | 83 | $this->combineLogo($this->attributes['internal:logo_file']); |
84 | - $this->writeMainNSH($this->selected_eap,$this->attributes); |
|
84 | + $this->writeMainNSH($this->selected_eap, $this->attributes); |
|
85 | 85 | $this->compileNSIS(); |
86 | 86 | $installer_path = $this->signInstaller($this->attributes); |
87 | 87 | |
@@ -90,19 +90,19 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | public function writeDeviceInfo() { |
93 | - $ssid_ct=count($this->attributes['internal:SSID']); |
|
93 | + $ssid_ct = count($this->attributes['internal:SSID']); |
|
94 | 94 | $out = "<p>"; |
95 | - $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']); |
|
95 | + $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']); |
|
96 | 96 | $out .= "<p>"; |
97 | - if($ssid_ct > 1) { |
|
98 | - if($ssid_ct > 2) { |
|
99 | - $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"),implode(', ',Config::$CONSORTIUM['ssid']))." "; |
|
97 | + if ($ssid_ct > 1) { |
|
98 | + if ($ssid_ct > 2) { |
|
99 | + $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"), implode(', ', Config::$CONSORTIUM['ssid'])) . " "; |
|
100 | 100 | } else |
101 | - $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"),implode(', ',Config::$CONSORTIUM['ssid']))." "; |
|
101 | + $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"), implode(', ', Config::$CONSORTIUM['ssid'])) . " "; |
|
102 | 102 | $i = 0; |
103 | 103 | foreach ($this->attributes['internal:SSID'] as $ssid=>$v) { |
104 | - if(! in_array($ssid, Config::$CONSORTIUM['ssid'])) { |
|
105 | - if($i > 0) |
|
104 | + if (!in_array($ssid, Config::$CONSORTIUM['ssid'])) { |
|
105 | + if ($i > 0) |
|
106 | 106 | $out .= ", "; |
107 | 107 | $i++; |
108 | 108 | $out .= "<strong>$ssid</strong>"; |
@@ -111,18 +111,18 @@ discard block |
||
111 | 111 | $out .= "<p>"; |
112 | 112 | } |
113 | 113 | |
114 | -if($this->eap == EAP::$TLS) |
|
114 | +if ($this->eap == EAP::$TLS) |
|
115 | 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 | 116 | else { |
117 | 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."); |
118 | 118 | $out .= "<p>"; |
119 | 119 | $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."); |
120 | - if($ssid_ct > 1) { |
|
120 | + if ($ssid_ct > 1) { |
|
121 | 121 | $out .= "<p>"; |
122 | - $out .= _("You will be required to enter the same credentials for each of the configured notworks:")." "; |
|
122 | + $out .= _("You will be required to enter the same credentials for each of the configured notworks:") . " "; |
|
123 | 123 | $i = 0; |
124 | 124 | foreach ($this->attributes['internal:SSID'] as $ssid=>$v) { |
125 | - if($i > 0) |
|
125 | + if ($i > 0) |
|
126 | 126 | $out .= ", "; |
127 | 127 | $i++; |
128 | 128 | $out .= "<strong>$ssid</strong>"; |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | $use_anon = $attr['internal:use_anon_outer'] [0]; |
142 | 142 | if ($use_anon) { |
143 | 143 | $outer_user = $attr['internal:anon_local_value'][0]; |
144 | - $outer_id = $outer_user.'@'.$attr['internal:realm'][0]; |
|
144 | + $outer_id = $outer_user . '@' . $attr['internal:realm'][0]; |
|
145 | 145 | } |
146 | 146 | // $servers = preg_quote(implode(';',$attr['eap:server_name'])); |
147 | - $servers = implode(';',$attr['eap:server_name']); |
|
147 | + $servers = implode(';', $attr['eap:server_name']); |
|
148 | 148 | |
149 | 149 | $ca_array = $attr['internal:CAs'][0]; |
150 | 150 | |
@@ -153,12 +153,12 @@ discard block |
||
153 | 153 | <EapMethod> |
154 | 154 | '; |
155 | 155 | |
156 | -$profile_file_contents .= '<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">'. |
|
157 | - $this->selected_eap["OUTER"].'</Type> |
|
156 | +$profile_file_contents .= '<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">' . |
|
157 | + $this->selected_eap["OUTER"] . '</Type> |
|
158 | 158 | <VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId> |
159 | 159 | <VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType> |
160 | 160 | '; |
161 | -if( $eap == EAP::$TLS) { |
|
161 | +if ($eap == EAP::$TLS) { |
|
162 | 162 | $profile_file_contents .= '<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId> |
163 | 163 | </EapMethod> |
164 | 164 | '; |
@@ -174,15 +174,15 @@ discard block |
||
174 | 174 | </eapTls:CredentialsSource> |
175 | 175 | <eapTls:ServerValidation> |
176 | 176 | <eapTls:DisableUserPromptForServerValidation>true</eapTls:DisableUserPromptForServerValidation> |
177 | -<eapTls:ServerNames>'.$servers.'</eapTls:ServerNames>'; |
|
178 | -if($ca_array) { |
|
177 | +<eapTls:ServerNames>'.$servers . '</eapTls:ServerNames>'; |
|
178 | +if ($ca_array) { |
|
179 | 179 | foreach ($ca_array as $CA) |
180 | - if($CA['root']) |
|
181 | - $profile_file_contents .= "<eapTls:TrustedRootCA>".$CA['sha1']."</eapTls:TrustedRootCA>\n"; |
|
180 | + if ($CA['root']) |
|
181 | + $profile_file_contents .= "<eapTls:TrustedRootCA>" . $CA['sha1'] . "</eapTls:TrustedRootCA>\n"; |
|
182 | 182 | } |
183 | 183 | $profile_file_contents .= '</eapTls:ServerValidation> |
184 | 184 | '; |
185 | -if(isset($attr['eap-specific:tls_use_other_id']) && $attr['eap-specific:tls_use_other_id'][0] == 'on') |
|
185 | +if (isset($attr['eap-specific:tls_use_other_id']) && $attr['eap-specific:tls_use_other_id'][0] == 'on') |
|
186 | 186 | $profile_file_contents .= '<eapTls:DifferentUsername>true</eapTls:DifferentUsername>'; |
187 | 187 | else |
188 | 188 | $profile_file_contents .= '<eapTls:DifferentUsername>false</eapTls:DifferentUsername>'; |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | </baseEap:Eap> |
192 | 192 | </Config> |
193 | 193 | '; |
194 | -} elseif ( $eap == EAP::$PEAP_MSCHAP2) { |
|
195 | -if(isset($attr['eap:enable_nea']) && $attr['eap:enable_nea'][0] == 'on') |
|
194 | +} elseif ($eap == EAP::$PEAP_MSCHAP2) { |
|
195 | +if (isset($attr['eap:enable_nea']) && $attr['eap:enable_nea'][0] == 'on') |
|
196 | 196 | $nea = 'true'; |
197 | 197 | else |
198 | 198 | $nea = 'false'; |
@@ -205,11 +205,11 @@ discard block |
||
205 | 205 | <EapType xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV1"> |
206 | 206 | <ServerValidation> |
207 | 207 | <DisableUserPromptForServerValidation>true</DisableUserPromptForServerValidation> |
208 | -<ServerNames>'.$servers.'</ServerNames>'; |
|
209 | -if($ca_array) { |
|
208 | +<ServerNames>'.$servers . '</ServerNames>'; |
|
209 | +if ($ca_array) { |
|
210 | 210 | foreach ($ca_array as $CA) |
211 | - if($CA['root']) |
|
212 | - $w8_ext .= "<TrustedRootCA>".$CA['sha1']."</TrustedRootCA>\n"; |
|
211 | + if ($CA['root']) |
|
212 | + $w8_ext .= "<TrustedRootCA>" . $CA['sha1'] . "</TrustedRootCA>\n"; |
|
213 | 213 | } |
214 | 214 | $w8_ext .= '</ServerValidation> |
215 | 215 | <FastReconnect>true</FastReconnect> |
@@ -220,50 +220,50 @@ discard block |
||
220 | 220 | <UseWinLogonCredentials>false</UseWinLogonCredentials> |
221 | 221 | </EapType> |
222 | 222 | </Eap> |
223 | -<EnableQuarantineChecks>'.$nea.'</EnableQuarantineChecks> |
|
223 | +<EnableQuarantineChecks>'.$nea . '</EnableQuarantineChecks> |
|
224 | 224 | <RequireCryptoBinding>false</RequireCryptoBinding> |
225 | 225 | '; |
226 | -if($use_anon == 1) { |
|
227 | -$w8_ext .='<PeapExtensions> |
|
226 | +if ($use_anon == 1) { |
|
227 | +$w8_ext .= '<PeapExtensions> |
|
228 | 228 | <IdentityPrivacy xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2"> |
229 | 229 | <EnableIdentityPrivacy>true</EnableIdentityPrivacy> |
230 | 230 | '; |
231 | -if(isset($outer_user) && $outer_user) |
|
232 | -$w8_ext .='<AnonymousUserName>'.$outer_user.'</AnonymousUserName> |
|
231 | +if (isset($outer_user) && $outer_user) |
|
232 | +$w8_ext .= '<AnonymousUserName>' . $outer_user . '</AnonymousUserName> |
|
233 | 233 | '; |
234 | 234 | else |
235 | -$w8_ext .='<AnonymousUserName/> |
|
235 | +$w8_ext .= '<AnonymousUserName/> |
|
236 | 236 | '; |
237 | -$w8_ext .='</IdentityPrivacy> |
|
237 | +$w8_ext .= '</IdentityPrivacy> |
|
238 | 238 | </PeapExtensions> |
239 | 239 | '; |
240 | 240 | } |
241 | -$w8_ext .='</EapType> |
|
241 | +$w8_ext .= '</EapType> |
|
242 | 242 | </Eap> |
243 | 243 | </Config> |
244 | 244 | '; |
245 | -} elseif ( $eap == EAP::$TTLS_PAP || $eap == EAP::$TTLS_MSCHAP2) { |
|
245 | +} elseif ($eap == EAP::$TTLS_PAP || $eap == EAP::$TTLS_MSCHAP2) { |
|
246 | 246 | $profile_file_contents .= '<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">311</AuthorId> |
247 | 247 | </EapMethod> |
248 | 248 | '; |
249 | 249 | $w8_ext = '<Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig"> |
250 | 250 | <EapTtls xmlns="http://www.microsoft.com/provisioning/EapTtlsConnectionPropertiesV1"> |
251 | 251 | <ServerValidation> |
252 | -<ServerNames>'.$servers.'</ServerNames> '; |
|
253 | -if($ca_array) { |
|
252 | +<ServerNames>'.$servers . '</ServerNames> '; |
|
253 | +if ($ca_array) { |
|
254 | 254 | foreach ($ca_array as $CA) |
255 | - if($CA['root']) |
|
256 | - $w8_ext .= "<TrustedRootCAHash>".chunk_split($CA['sha1'],2,' ')."</TrustedRootCAHash>\n"; |
|
255 | + if ($CA['root']) |
|
256 | + $w8_ext .= "<TrustedRootCAHash>" . chunk_split($CA['sha1'], 2, ' ') . "</TrustedRootCAHash>\n"; |
|
257 | 257 | } |
258 | -$w8_ext .='<DisablePrompt>true</DisablePrompt> |
|
258 | +$w8_ext .= '<DisablePrompt>true</DisablePrompt> |
|
259 | 259 | </ServerValidation> |
260 | 260 | <Phase2Authentication> |
261 | 261 | '; |
262 | -if ( $eap == EAP::$TTLS_PAP) { |
|
263 | - $w8_ext .='<PAPAuthentication /> '; |
|
262 | +if ($eap == EAP::$TTLS_PAP) { |
|
263 | + $w8_ext .= '<PAPAuthentication /> '; |
|
264 | 264 | } |
265 | -if ( $eap == EAP::$TTLS_MSCHAP2) { |
|
266 | - $w8_ext .='<MSCHAPv2Authentication> |
|
265 | +if ($eap == EAP::$TTLS_MSCHAP2) { |
|
266 | + $w8_ext .= '<MSCHAPv2Authentication> |
|
267 | 267 | <UseWinlogonCredentials>false</UseWinlogonCredentials> |
268 | 268 | </MSCHAPv2Authentication> |
269 | 269 | '; |
@@ -271,24 +271,24 @@ discard block |
||
271 | 271 | $w8_ext .= '</Phase2Authentication> |
272 | 272 | <Phase1Identity> |
273 | 273 | '; |
274 | -if($use_anon == 1) { |
|
274 | +if ($use_anon == 1) { |
|
275 | 275 | $w8_ext .= '<IdentityPrivacy>true</IdentityPrivacy> |
276 | 276 | '; |
277 | - if(isset($outer_id) && $outer_id) |
|
278 | - $w8_ext .='<AnonymousIdentity>'.$outer_id.'</AnonymousIdentity> |
|
277 | + if (isset($outer_id) && $outer_id) |
|
278 | + $w8_ext .= '<AnonymousIdentity>' . $outer_id . '</AnonymousIdentity> |
|
279 | 279 | '; |
280 | 280 | else |
281 | - $w8_ext .='<AnonymousIdentity/> |
|
281 | + $w8_ext .= '<AnonymousIdentity/> |
|
282 | 282 | '; |
283 | 283 | } else { |
284 | 284 | $w8_ext .= '<IdentityPrivacy>false</IdentityPrivacy> |
285 | 285 | '; |
286 | 286 | } |
287 | -$w8_ext .='</Phase1Identity> |
|
287 | +$w8_ext .= '</Phase1Identity> |
|
288 | 288 | </EapTtls> |
289 | 289 | </Config> |
290 | 290 | '; |
291 | -} elseif ( $eap == EAP::$PWD) { |
|
291 | +} elseif ($eap == EAP::$PWD) { |
|
292 | 292 | $profile_file_contents .= '<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId> |
293 | 293 | </EapMethod> |
294 | 294 | '; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | |
298 | 298 | $profile_file_contents_end = '</EapHostConfig></EAPConfig>'; |
299 | 299 | $return_array = []; |
300 | -$return_array['w8'] = $profile_file_contents.$w8_ext.$profile_file_contents_end; |
|
300 | +$return_array['w8'] = $profile_file_contents . $w8_ext . $profile_file_contents_end; |
|
301 | 301 | return $return_array; |
302 | 302 | } |
303 | 303 | |
@@ -309,13 +309,13 @@ discard block |
||
309 | 309 | /** |
310 | 310 | * produce PEAP, TLS and TTLS configuration files for Windows 8 |
311 | 311 | */ |
312 | - private function writeWLANprofile($wlan_profile_name,$ssid,$auth,$encryption,$eap_config,$i) { |
|
312 | + private function writeWLANprofile($wlan_profile_name, $ssid, $auth, $encryption, $eap_config, $i) { |
|
313 | 313 | $profile_file_contents = '<?xml version="1.0"?> |
314 | 314 | <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"> |
315 | -<name>'.$wlan_profile_name.'</name> |
|
315 | +<name>'.$wlan_profile_name . '</name> |
|
316 | 316 | <SSIDConfig> |
317 | 317 | <SSID> |
318 | -<name>'.$ssid.'</name> |
|
318 | +<name>'.$ssid . '</name> |
|
319 | 319 | </SSID> |
320 | 320 | <nonBroadcast>true</nonBroadcast> |
321 | 321 | </SSIDConfig> |
@@ -325,12 +325,12 @@ discard block |
||
325 | 325 | <MSM> |
326 | 326 | <security> |
327 | 327 | <authEncryption> |
328 | -<authentication>'.$auth.'</authentication> |
|
329 | -<encryption>'.$encryption.'</encryption> |
|
328 | +<authentication>'.$auth . '</authentication> |
|
329 | +<encryption>'.$encryption . '</encryption> |
|
330 | 330 | <useOneX>true</useOneX> |
331 | 331 | </authEncryption> |
332 | 332 | '; |
333 | -if($auth == 'WPA2') |
|
333 | +if ($auth == 'WPA2') |
|
334 | 334 | $profile_file_contents .= '<PMKCacheMode>enabled</PMKCacheMode> |
335 | 335 | <PMKCacheTTL>720</PMKCacheTTL> |
336 | 336 | <PMKCacheSize>128</PMKCacheSize> |
@@ -348,14 +348,14 @@ discard block |
||
348 | 348 | </WLANProfile> |
349 | 349 | '; |
350 | 350 | |
351 | -if(! is_dir('w8')) |
|
351 | +if (!is_dir('w8')) |
|
352 | 352 | mkdir('w8'); |
353 | 353 | $xml_f_name = "w8/wlan_prof-$i.xml"; |
354 | -$xml_f = fopen($xml_f_name,'w'); |
|
355 | -fwrite($xml_f,$profile_file_contents. $eap_config['w8']. $closing) ; |
|
354 | +$xml_f = fopen($xml_f_name, 'w'); |
|
355 | +fwrite($xml_f, $profile_file_contents . $eap_config['w8'] . $closing); |
|
356 | 356 | fclose($xml_f); |
357 | -debug(2,"Installer has been written into directory $this->FPATH\n"); |
|
358 | -debug(4,"WWWWLAN_Profile:$wlan_profile_name:$encryption\n"); |
|
357 | +debug(2, "Installer has been written into directory $this->FPATH\n"); |
|
358 | +debug(4, "WWWWLAN_Profile:$wlan_profile_name:$encryption\n"); |
|
359 | 359 | return("\"$wlan_profile_name\" \"$encryption\""); |
360 | 360 | } |
361 | 361 | |
@@ -375,29 +375,29 @@ discard block |
||
375 | 375 | </LANProfile> |
376 | 376 | '; |
377 | 377 | |
378 | -if(! is_dir('w8')) |
|
378 | +if (!is_dir('w8')) |
|
379 | 379 | mkdir('w8'); |
380 | 380 | $xml_f_name = "w8/lan_prof.xml"; |
381 | -$xml_f = fopen($xml_f_name,'w'); |
|
382 | -fwrite($xml_f,$profile_file_contents. $eap_config['w8']. $closing) ; |
|
381 | +$xml_f = fopen($xml_f_name, 'w'); |
|
382 | +fwrite($xml_f, $profile_file_contents . $eap_config['w8'] . $closing); |
|
383 | 383 | fclose($xml_f); |
384 | -debug(2,"Installer has been written into directory $this->FPATH\n"); |
|
384 | +debug(2, "Installer has been written into directory $this->FPATH\n"); |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | |
388 | 388 | |
389 | -private function writeMainNSH($eap,$attr) { |
|
390 | -debug(4,"writeMainNSH"); debug(4,$attr); |
|
389 | +private function writeMainNSH($eap, $attr) { |
|
390 | +debug(4, "writeMainNSH"); debug(4, $attr); |
|
391 | 391 | $fcontents = "!define W8\n"; |
392 | -if(Config::$NSIS_VERSION >= 3) |
|
393 | - $fcontents .= "Unicode true\n"; |
|
392 | +if (Config::$NSIS_VERSION >= 3) |
|
393 | + $fcontents .= "Unicode true\n"; |
|
394 | 394 | |
395 | 395 | |
396 | 396 | $EAP_OPTS = [ |
397 | -PEAP=>['str'=>'PEAP','exec'=>'user'], |
|
398 | -TLS=>['str'=>'TLS','exec'=>'user'], |
|
399 | -TTLS=>['str'=>'TTLS','exec'=>'user'], |
|
400 | -PWD=>['str'=>'PWD','exec'=>'user'], |
|
397 | +PEAP=>['str'=>'PEAP', 'exec'=>'user'], |
|
398 | +TLS=>['str'=>'TLS', 'exec'=>'user'], |
|
399 | +TTLS=>['str'=>'TTLS', 'exec'=>'user'], |
|
400 | +PWD=>['str'=>'PWD', 'exec'=>'user'], |
|
401 | 401 | ]; |
402 | 402 | |
403 | 403 | // Uncomment the line below if you want this module to run under XP (only displaying a warning) |
@@ -407,24 +407,24 @@ discard block |
||
407 | 407 | $exec_level = $EAP_OPTS[$eap["OUTER"]]['exec']; |
408 | 408 | $eap_str = $EAP_OPTS[$eap["OUTER"]]['str']; |
409 | 409 | |
410 | -$fcontents .= '!define '.$eap_str; |
|
411 | -$fcontents .= "\n".'!define EXECLEVEL "'.$exec_level.'"'; |
|
410 | +$fcontents .= '!define ' . $eap_str; |
|
411 | +$fcontents .= "\n" . '!define EXECLEVEL "' . $exec_level . '"'; |
|
412 | 412 | |
413 | -if($attr['internal:profile_count'][0] > 1) |
|
414 | -$fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"','$\\"',$attr['profile:name'][0]), $this->code_page).'"'; |
|
413 | +if ($attr['internal:profile_count'][0] > 1) |
|
414 | +$fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->code_page) . '"'; |
|
415 | 415 | $fcontents .= ' |
416 | -Caption "'. $this->translateString(sprintf(sprint_nsi(_("%s installer for %s")),Config::$CONSORTIUM['name'],$attr['general:instname'][0]), $this->code_page).'" |
|
417 | -!define APPLICATION "'. $this->translateString(sprintf(sprint_nsi(_("%s installer for %s")),Config::$CONSORTIUM['name'],$attr['general:instname'][0]), $this->code_page).'" |
|
418 | -!define VERSION "'.CAT::$VERSION_MAJOR.'.'.CAT::$VERSION_MINOR.'" |
|
416 | +Caption "'. $this->translateString(sprintf(sprint_nsi(_("%s installer for %s")), Config::$CONSORTIUM['name'], $attr['general:instname'][0]), $this->code_page) . '" |
|
417 | +!define APPLICATION "'. $this->translateString(sprintf(sprint_nsi(_("%s installer for %s")), Config::$CONSORTIUM['name'], $attr['general:instname'][0]), $this->code_page) . '" |
|
418 | +!define VERSION "'.CAT::$VERSION_MAJOR . '.' . CAT::$VERSION_MINOR . '" |
|
419 | 419 | !define INSTALLER_NAME "installer.exe" |
420 | -!define LANG "'.$this->lang.'" |
|
420 | +!define LANG "'.$this->lang . '" |
|
421 | 421 | '; |
422 | 422 | $fcontents .= $this->msInfoFile($attr); |
423 | 423 | |
424 | 424 | $fcontents .= ';-------------------------------- |
425 | -!define ORGANISATION "'.$this->translateString($attr['general:instname'][0], $this->code_page).'" |
|
426 | -!define SUPPORT "'. ((isset($attr['support:email'][0]) && $attr['support:email'][0] ) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute , $this->code_page)) .'" |
|
427 | -!define URL "'. ((isset($attr['support:url'][0]) && $attr['support:url'][0] ) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->code_page)) .'" |
|
425 | +!define ORGANISATION "'.$this->translateString($attr['general:instname'][0], $this->code_page) . '" |
|
426 | +!define SUPPORT "'. ((isset($attr['support:email'][0]) && $attr['support:email'][0]) ? $attr['support:email'][0] : $this->translateString($this->support_email_substitute, $this->code_page)) . '" |
|
427 | +!define URL "'. ((isset($attr['support:url'][0]) && $attr['support:url'][0]) ? $attr['support:url'][0] : $this->translateString($this->support_url_substitute, $this->code_page)) . '" |
|
428 | 428 | |
429 | 429 | !ifdef TLS |
430 | 430 | '; |
@@ -434,33 +434,33 @@ discard block |
||
434 | 434 | !endif |
435 | 435 | '; |
436 | 436 | |
437 | -if(isset($this->attributes['media:wired'][0]) && $attr['media:wired'][0] == 'on') |
|
437 | +if (isset($this->attributes['media:wired'][0]) && $attr['media:wired'][0] == 'on') |
|
438 | 438 | $fcontents .= '!define WIRED |
439 | 439 | '; |
440 | 440 | |
441 | -$f = fopen('main.nsh','w'); |
|
441 | +$f = fopen('main.nsh', 'w'); |
|
442 | 442 | fwrite($f, $fcontents); |
443 | 443 | fclose($f); |
444 | 444 | |
445 | 445 | } |
446 | 446 | |
447 | -private function writeProfilesNSH($P,$ca_array,$wired=0) { |
|
448 | -debug(4,"writeProfilesNSH"); |
|
449 | -debug(4,$P); |
|
447 | +private function writeProfilesNSH($P, $ca_array, $wired = 0) { |
|
448 | +debug(4, "writeProfilesNSH"); |
|
449 | +debug(4, $P); |
|
450 | 450 | $fcontents = ''; |
451 | - foreach($P as $p) |
|
451 | + foreach ($P as $p) |
|
452 | 452 | $fcontents .= "!insertmacro define_wlan_profile $p\n"; |
453 | 453 | |
454 | -$f = fopen('profiles.nsh','w'); |
|
454 | +$f = fopen('profiles.nsh', 'w'); |
|
455 | 455 | fwrite($f, $fcontents); |
456 | 456 | fclose($f); |
457 | 457 | |
458 | 458 | $fcontents = ''; |
459 | -$f = fopen('certs.nsh','w'); |
|
460 | -if($ca_array) { |
|
459 | +$f = fopen('certs.nsh', 'w'); |
|
460 | +if ($ca_array) { |
|
461 | 461 | foreach ($ca_array as $CA) { |
462 | 462 | $store = $CA['root'] ? "root" : "ca"; |
463 | - $fcontents .= '!insertmacro install_ca_cert "'.$CA['file'].'" "'.$CA['sha1'].'" "'.$store."\"\n"; |
|
463 | + $fcontents .= '!insertmacro install_ca_cert "' . $CA['file'] . '" "' . $CA['sha1'] . '" "' . $store . "\"\n"; |
|
464 | 464 | } |
465 | 465 | fwrite($f, $fcontents); |
466 | 466 | } |
@@ -469,8 +469,8 @@ discard block |
||
469 | 469 | |
470 | 470 | //private function write |
471 | 471 | |
472 | -private function copyFiles ($eap) { |
|
473 | -debug(4,"copyFiles start\n"); |
|
472 | +private function copyFiles($eap) { |
|
473 | +debug(4, "copyFiles start\n"); |
|
474 | 474 | $result; |
475 | 475 | $result = $this->copyFile('wlan_test.exe'); |
476 | 476 | $result = $this->copyFile('check_wired.cmd'); |
@@ -480,16 +480,16 @@ discard block |
||
480 | 480 | $result = $this->copyFile('base64.nsh'); |
481 | 481 | $result = $result && $this->copyFile('cat32.ico'); |
482 | 482 | $result = $result && $this->copyFile('cat_150.bmp'); |
483 | - $this->translateFile('common.inc','common.nsh',$this->code_page); |
|
484 | - if($eap["OUTER"] == PWD) { |
|
485 | - $this->translateFile('pwd.inc','cat.NSI',$this->code_page); |
|
483 | + $this->translateFile('common.inc', 'common.nsh', $this->code_page); |
|
484 | + if ($eap["OUTER"] == PWD) { |
|
485 | + $this->translateFile('pwd.inc', 'cat.NSI', $this->code_page); |
|
486 | 486 | $result = $result && $this->copyFile('Aruba_Networks_EAP-pwd_x32.msi'); |
487 | 487 | $result = $result && $this->copyFile('Aruba_Networks_EAP-pwd_x64.msi'); |
488 | 488 | } else { |
489 | - $this->translateFile('eap_w8.inc','cat.NSI',$this->code_page); |
|
489 | + $this->translateFile('eap_w8.inc', 'cat.NSI', $this->code_page); |
|
490 | 490 | $result = 1; |
491 | 491 | } |
492 | -debug(4,"copyFiles end\n"); |
|
492 | +debug(4, "copyFiles end\n"); |
|
493 | 493 | return($result); |
494 | 494 | } |
495 | 495 |
@@ -27,8 +27,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -107,10 +107,10 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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" |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | * @param string $in input string |
19 | 19 | */ |
20 | 20 | function echo_nsi($in) { |
21 | - echo preg_replace('/"/','$\"',$in); |
|
21 | + echo preg_replace('/"/', '$\"', $in); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | function sprint_nsi($in) { |
25 | - return preg_replace('/"/','$\"',$in); |
|
25 | + return preg_replace('/"/', '$\"', $in); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | class WindowsCommon extends DeviceConfig { |
35 | 35 | |
36 | 36 | protected function prepareInstallerLang() { |
37 | - if(isset($this->LANGS[$this->lang_index])) { |
|
37 | + if (isset($this->LANGS[$this->lang_index])) { |
|
38 | 38 | $L = $this->LANGS[$this->lang_index]; |
39 | 39 | $this->lang = $L['nsis']; |
40 | - $this->code_page = 'cp'.$L['cp']; |
|
40 | + $this->code_page = 'cp' . $L['cp']; |
|
41 | 41 | } else { |
42 | 42 | $this->lang = 'English'; |
43 | 43 | $this->code_page = 'cp1252'; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | protected function combineLogo($Logos) { |
48 | 48 | // maximum size to which we want to resize |
49 | - $max_size= 120; |
|
49 | + $max_size = 120; |
|
50 | 50 | // logo wull be shited up by this much |
51 | 51 | $vshift = 20; |
52 | 52 | $bg_image = new Imagick('cat_bg.bmp'); |
@@ -55,19 +55,19 @@ discard block |
||
55 | 55 | $logo = new Imagick($Logos[0]['name']); |
56 | 56 | $logo_size = $logo->getImageGeometry(); |
57 | 57 | $max = max($logo_size); |
58 | - debug(4,"Logo size: "); debug(4,$logo_size); debug(4,"max=$max\n"); |
|
58 | + debug(4, "Logo size: "); debug(4, $logo_size); debug(4, "max=$max\n"); |
|
59 | 59 | // resize logo if necessary |
60 | - if($max > $max_size) { |
|
61 | - if($max == $logo_size['width']) |
|
62 | - $logo->scaleImage($max_size,0); |
|
60 | + if ($max > $max_size) { |
|
61 | + if ($max == $logo_size['width']) |
|
62 | + $logo->scaleImage($max_size, 0); |
|
63 | 63 | else |
64 | - $logo->scaleImage(0,$max_size); |
|
64 | + $logo->scaleImage(0, $max_size); |
|
65 | 65 | } |
66 | 66 | $logo_size = $logo->getImageGeometry(); |
67 | - debug(4,"New logo size: "); debug(4,$logo_size); |
|
67 | + debug(4, "New logo size: "); debug(4, $logo_size); |
|
68 | 68 | // calculate logo offsets for composition with the background |
69 | - $hoffset = round(($bg_image_size['width'] - $logo_size['width'])/2); |
|
70 | - $voffset = round(($bg_image_size['height'] - $logo_size['height'])/2) - $vshift; |
|
69 | + $hoffset = round(($bg_image_size['width'] - $logo_size['width']) / 2); |
|
70 | + $voffset = round(($bg_image_size['height'] - $logo_size['height']) / 2) - $vshift; |
|
71 | 71 | |
72 | 72 | //logo image is put on top of the background |
73 | 73 | $bg_image->compositeImage($logo, $logo->getImageCompose(), $hoffset, $voffset); |
@@ -77,109 +77,109 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | protected function signInstaller($attr) { |
80 | - $e = $this->installerBasename.'.exe'; |
|
81 | - if($this->sign) { |
|
82 | - $o = system($this->sign." installer.exe '$e' > /dev/null"); |
|
80 | + $e = $this->installerBasename . '.exe'; |
|
81 | + if ($this->sign) { |
|
82 | + $o = system($this->sign . " installer.exe '$e' > /dev/null"); |
|
83 | 83 | } |
84 | 84 | else |
85 | - rename("installer.exe",$e); |
|
85 | + rename("installer.exe", $e); |
|
86 | 86 | return $e; |
87 | 87 | } |
88 | 88 | |
89 | 89 | protected function compileNSIS() { |
90 | - if(Config::$NSIS_VERSION >= 3) |
|
90 | + if (Config::$NSIS_VERSION >= 3) |
|
91 | 91 | $makensis = Config::$PATHS['makensis'] . " -INPUTCHARSET UTF8"; |
92 | 92 | else |
93 | 93 | $makensis = Config::$PATHS['makensis']; |
94 | - $o = $makensis.' -V4 cat.NSI > nsis.log'; |
|
94 | + $o = $makensis . ' -V4 cat.NSI > nsis.log'; |
|
95 | 95 | system($o); |
96 | - debug(4,"compileNSIS:$o\n"); |
|
96 | + debug(4, "compileNSIS:$o\n"); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | protected function msInfoFile($attr) { |
100 | 100 | $out = ''; |
101 | -if(isset($attr['support:info_file'])) { |
|
101 | +if (isset($attr['support:info_file'])) { |
|
102 | 102 | $out .= '!define EXTERNAL_INFO "'; |
103 | 103 | // debug(4,"Info file type ".$attr['support:info_file'][0]['mime']."\n"); |
104 | 104 | if ($attr['internal:info_file'][0]['mime'] == 'rtf') |
105 | - $out = '!define LICENSE_FILE "'. $attr['internal:info_file'][0]['name']; |
|
106 | - elseif( $attr['internal:info_file'][0]['mime'] == 'txt') { |
|
105 | + $out = '!define LICENSE_FILE "' . $attr['internal:info_file'][0]['name']; |
|
106 | + elseif ($attr['internal:info_file'][0]['mime'] == 'txt') { |
|
107 | 107 | $in_txt = file_get_contents($attr['internal:info_file'][0]['name']); |
108 | - if(Config::$NSIS_VERSION >= 3) |
|
108 | + if (Config::$NSIS_VERSION >= 3) |
|
109 | 109 | $out_txt = $in_txt; |
110 | 110 | else |
111 | - $out_txt = iconv('UTF-8',$this->code_page.'//TRANSLIT',$in_txt); |
|
112 | - if($out_txt) { |
|
113 | - file_put_contents('info_f.txt',$out_txt); |
|
111 | + $out_txt = iconv('UTF-8', $this->code_page . '//TRANSLIT', $in_txt); |
|
112 | + if ($out_txt) { |
|
113 | + file_put_contents('info_f.txt', $out_txt); |
|
114 | 114 | $out = '!define LICENSE_FILE " info_f.txt'; |
115 | 115 | } |
116 | 116 | } |
117 | 117 | else |
118 | - $out = '!define EXTERNAL_INFO "'. $attr['internal:info_file'][0]['name']; |
|
118 | + $out = '!define EXTERNAL_INFO "' . $attr['internal:info_file'][0]['name']; |
|
119 | 119 | |
120 | 120 | $out .= "\"\n"; |
121 | 121 | } |
122 | - debug(4,"Info file returned: $out"); |
|
122 | + debug(4, "Info file returned: $out"); |
|
123 | 123 | return $out; |
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | protected function writeAdditionalDeletes($P) { |
128 | - if(count($P) == 0 ) |
|
128 | + if (count($P) == 0) |
|
129 | 129 | return; |
130 | - $f = fopen('profiles.nsh','a'); |
|
131 | - fwrite($f,"!define AdditionalDeletes\n"); |
|
130 | + $f = fopen('profiles.nsh', 'a'); |
|
131 | + fwrite($f, "!define AdditionalDeletes\n"); |
|
132 | 132 | foreach ($P as $p) |
133 | - fwrite($f,"!insertmacro define_delete_profile \"$p\"\n"); |
|
133 | + fwrite($f, "!insertmacro define_delete_profile \"$p\"\n"); |
|
134 | 134 | fclose($f); |
135 | 135 | } |
136 | 136 | |
137 | 137 | |
138 | -public $LANGS=[ |
|
139 | -'fr'=>['nsis'=>"French",'cp'=>'1252'], |
|
140 | -'de'=>['nsis'=>"German",'cp'=>'1252'], |
|
141 | -'es'=>['nsis'=>"SpanishInternational",'cp'=>'1252'], |
|
142 | -'it'=>['nsis'=>"Italian",'cp'=>'1252'], |
|
143 | -'nl'=>['nsis'=>"Dutch",'cp'=>'1252'], |
|
144 | -'sv'=>['nsis'=>"Swedish",'cp'=>'1252'], |
|
145 | -'fi'=>['nsis'=>"Finnish",'cp'=>'1252'], |
|
146 | -'pl'=>['nsis'=>"Polish",'cp'=>'1250'], |
|
147 | -'ca'=>['nsis'=>"Catalan",'cp'=>'1252'], |
|
148 | -'sr'=>['nsis'=>"SerbianLatin",'cp'=>'1250'], |
|
149 | -'hr'=>['nsis'=>"Croatian",'cp'=>'1250'], |
|
150 | -'sl'=>['nsis'=>"Slovenian",'cp'=>'1250'], |
|
151 | -'da'=>['nsis'=>"Danish",'cp'=>'1252'], |
|
152 | -'nb'=>['nsis'=>"Norwegian",'cp'=>'1252'], |
|
153 | -'nn'=>['nsis'=>"NorwegianNynorsk",'cp'=>'1252'], |
|
154 | -'el'=>['nsis'=>"Greek",'cp'=>'1253'], |
|
155 | -'ru'=>['nsis'=>"Russian",'cp'=>'1251'], |
|
156 | -'pt'=>['nsis'=>"Portuguese",'cp'=>'1252'], |
|
157 | -'uk'=>['nsis'=>"Ukrainian",'cp'=>'1251'], |
|
158 | -'cs'=>['nsis'=>"Czech",'cp'=>'1250'], |
|
159 | -'sk'=>['nsis'=>"Slovak",'cp'=>'1250'], |
|
160 | -'bg'=>['nsis'=>"Bulgarian",'cp'=>'1251'], |
|
161 | -'hu'=>['nsis'=>"Hungarian",'cp'=>'1250'], |
|
162 | -'ro'=>['nsis'=>"Romanian",'cp'=>'1250'], |
|
163 | -'lv'=>['nsis'=>"Latvian",'cp'=>'1257'], |
|
164 | -'mk'=>['nsis'=>"Macedonian",'cp'=>'1251'], |
|
165 | -'et'=>['nsis'=>"Estonian",'cp'=>'1257'], |
|
166 | -'tr'=>['nsis'=>"Turkish",'cp'=>'1254'], |
|
167 | -'lt'=>['nsis'=>"Lithuanian",'cp'=>'1257'], |
|
168 | -'ar'=>['nsis'=>"Arabic",'cp'=>'1256'], |
|
169 | -'he'=>['nsis'=>"Hebrew",'cp'=>'1255'], |
|
170 | -'id'=>['nsis'=>"Indonesian",'cp'=>'1252'], |
|
171 | -'mn'=>['nsis'=>"Mongolian",'cp'=>'1251'], |
|
172 | -'sq'=>['nsis'=>"Albanian",'cp'=>'1252'], |
|
173 | -'br'=>['nsis'=>"Breton",'cp'=>'1252'], |
|
174 | -'be'=>['nsis'=>"Belarusian",'cp'=>'1251'], |
|
175 | -'is'=>['nsis'=>"Icelandic",'cp'=>'1252'], |
|
176 | -'ms'=>['nsis'=>"Malay",'cp'=>'1252'], |
|
177 | -'bs'=>['nsis'=>"Bosnian",'cp'=>'1250'], |
|
178 | -'ga'=>['nsis'=>"Irish",'cp'=>'1250'], |
|
179 | -'uz'=>['nsis'=>"Uzbek",'cp'=>'1251'], |
|
180 | -'gl'=>['nsis'=>"Galician",'cp'=>'1252'], |
|
181 | -'af'=>['nsis'=>"Afrikaans",'cp'=>'1252'], |
|
182 | -'ast'=>['nsis'=>"Asturian",'cp'=>'1252'], |
|
138 | +public $LANGS = [ |
|
139 | +'fr'=>['nsis'=>"French", 'cp'=>'1252'], |
|
140 | +'de'=>['nsis'=>"German", 'cp'=>'1252'], |
|
141 | +'es'=>['nsis'=>"SpanishInternational", 'cp'=>'1252'], |
|
142 | +'it'=>['nsis'=>"Italian", 'cp'=>'1252'], |
|
143 | +'nl'=>['nsis'=>"Dutch", 'cp'=>'1252'], |
|
144 | +'sv'=>['nsis'=>"Swedish", 'cp'=>'1252'], |
|
145 | +'fi'=>['nsis'=>"Finnish", 'cp'=>'1252'], |
|
146 | +'pl'=>['nsis'=>"Polish", 'cp'=>'1250'], |
|
147 | +'ca'=>['nsis'=>"Catalan", 'cp'=>'1252'], |
|
148 | +'sr'=>['nsis'=>"SerbianLatin", 'cp'=>'1250'], |
|
149 | +'hr'=>['nsis'=>"Croatian", 'cp'=>'1250'], |
|
150 | +'sl'=>['nsis'=>"Slovenian", 'cp'=>'1250'], |
|
151 | +'da'=>['nsis'=>"Danish", 'cp'=>'1252'], |
|
152 | +'nb'=>['nsis'=>"Norwegian", 'cp'=>'1252'], |
|
153 | +'nn'=>['nsis'=>"NorwegianNynorsk", 'cp'=>'1252'], |
|
154 | +'el'=>['nsis'=>"Greek", 'cp'=>'1253'], |
|
155 | +'ru'=>['nsis'=>"Russian", 'cp'=>'1251'], |
|
156 | +'pt'=>['nsis'=>"Portuguese", 'cp'=>'1252'], |
|
157 | +'uk'=>['nsis'=>"Ukrainian", 'cp'=>'1251'], |
|
158 | +'cs'=>['nsis'=>"Czech", 'cp'=>'1250'], |
|
159 | +'sk'=>['nsis'=>"Slovak", 'cp'=>'1250'], |
|
160 | +'bg'=>['nsis'=>"Bulgarian", 'cp'=>'1251'], |
|
161 | +'hu'=>['nsis'=>"Hungarian", 'cp'=>'1250'], |
|
162 | +'ro'=>['nsis'=>"Romanian", 'cp'=>'1250'], |
|
163 | +'lv'=>['nsis'=>"Latvian", 'cp'=>'1257'], |
|
164 | +'mk'=>['nsis'=>"Macedonian", 'cp'=>'1251'], |
|
165 | +'et'=>['nsis'=>"Estonian", 'cp'=>'1257'], |
|
166 | +'tr'=>['nsis'=>"Turkish", 'cp'=>'1254'], |
|
167 | +'lt'=>['nsis'=>"Lithuanian", 'cp'=>'1257'], |
|
168 | +'ar'=>['nsis'=>"Arabic", 'cp'=>'1256'], |
|
169 | +'he'=>['nsis'=>"Hebrew", 'cp'=>'1255'], |
|
170 | +'id'=>['nsis'=>"Indonesian", 'cp'=>'1252'], |
|
171 | +'mn'=>['nsis'=>"Mongolian", 'cp'=>'1251'], |
|
172 | +'sq'=>['nsis'=>"Albanian", 'cp'=>'1252'], |
|
173 | +'br'=>['nsis'=>"Breton", 'cp'=>'1252'], |
|
174 | +'be'=>['nsis'=>"Belarusian", 'cp'=>'1251'], |
|
175 | +'is'=>['nsis'=>"Icelandic", 'cp'=>'1252'], |
|
176 | +'ms'=>['nsis'=>"Malay", 'cp'=>'1252'], |
|
177 | +'bs'=>['nsis'=>"Bosnian", 'cp'=>'1250'], |
|
178 | +'ga'=>['nsis'=>"Irish", 'cp'=>'1250'], |
|
179 | +'uz'=>['nsis'=>"Uzbek", 'cp'=>'1251'], |
|
180 | +'gl'=>['nsis'=>"Galician", 'cp'=>'1252'], |
|
181 | +'af'=>['nsis'=>"Afrikaans", 'cp'=>'1252'], |
|
182 | +'ast'=>['nsis'=>"Asturian", 'cp'=>'1252'], |
|
183 | 183 | |
184 | 184 | ]; |
185 | 185 |
@@ -5,7 +5,7 @@ |
||
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 | 10 | EAP::$TTLS_PAP, |
11 | 11 | ]; |
@@ -3,9 +3,9 @@ |
||
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, |
@@ -3,9 +3,9 @@ |
||
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, |
@@ -5,7 +5,7 @@ |
||
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 | 10 | EAP::$TLS, |
11 | 11 | ]; |
@@ -34,19 +34,19 @@ discard block |
||
34 | 34 | * @var array of XLM element names which are allowed |
35 | 35 | * EAP method names are defined in core/EAP.php |
36 | 36 | */ |
37 | - public static $AuthMethodElements = [ |
|
37 | + public static $AuthMethodElements = [ |
|
38 | 38 | 'server' => [ |
39 | 39 | TLS => ['CA', 'ServerID'], |
40 | - FAST => ['CA','ServerID'], |
|
41 | - PEAP => ['CA','ServerID'], |
|
42 | - TTLS => ['CA','ServerID'], |
|
40 | + FAST => ['CA', 'ServerID'], |
|
41 | + PEAP => ['CA', 'ServerID'], |
|
42 | + TTLS => ['CA', 'ServerID'], |
|
43 | 43 | PWD => [], |
44 | 44 | ], |
45 | 45 | 'client' => [ |
46 | - TLS => ['UserName','Password','ClientCertificate'], |
|
47 | - MSCHAP2 => ['UserName','Password','OuterIdentity'], |
|
48 | - GTC => ['UserName','OneTimeToken'], |
|
49 | - NE_PAP => ['UserName','Password','OuterIdentity'], |
|
46 | + TLS => ['UserName', 'Password', 'ClientCertificate'], |
|
47 | + MSCHAP2 => ['UserName', 'Password', 'OuterIdentity'], |
|
48 | + GTC => ['UserName', 'OneTimeToken'], |
|
49 | + NE_PAP => ['UserName', 'Password', 'OuterIdentity'], |
|
50 | 50 | ] |
51 | 51 | ]; |
52 | 52 | |
@@ -67,21 +67,21 @@ discard block |
||
67 | 67 | return $this->value; |
68 | 68 | } |
69 | 69 | public function areAttributes() { |
70 | - return empty($this->attributes)?0:1; |
|
70 | + return empty($this->attributes) ? 0 : 1; |
|
71 | 71 | } |
72 | - public function setAttribute($attribute,$value) { |
|
73 | - if( ! isset($this->attributes)) |
|
72 | + public function setAttribute($attribute, $value) { |
|
73 | + if (!isset($this->attributes)) |
|
74 | 74 | $this->attributes = []; |
75 | 75 | $this->attributes[$attribute] = $value; |
76 | 76 | } |
77 | - public function setProperty($property,$value) { |
|
77 | + public function setProperty($property, $value) { |
|
78 | 78 | $this->$property = $value; |
79 | 79 | } |
80 | 80 | public function getAll() { |
81 | 81 | $elems = get_object_vars($this); |
82 | 82 | $objvars = []; |
83 | 83 | foreach ($elems as $key=>$val) |
84 | - if ( ($key!='attributes') && ($key!='value') ) |
|
84 | + if (($key != 'attributes') && ($key != 'value')) |
|
85 | 85 | $objvars[$key] = $val; |
86 | 86 | return $objvars; |
87 | 87 | } |
@@ -129,12 +129,12 @@ discard block |
||
129 | 129 | protected $CA; // multi |
130 | 130 | protected $ServerID; //multi |
131 | 131 | public function getAll() { |
132 | - if(isset(XMLElement::$AuthMethodElements['server'][$this->EAPType]) && XMLElement::$AuthMethodElements['server'][$this->EAPType]) { |
|
132 | + if (isset(XMLElement::$AuthMethodElements['server'][$this->EAPType]) && XMLElement::$AuthMethodElements['server'][$this->EAPType]) { |
|
133 | 133 | $E = XMLElement::$AuthMethodElements['server'][$this->EAPType]; |
134 | 134 | $out = get_object_vars($this); |
135 | 135 | $OUT = []; |
136 | 136 | foreach ($out as $o => $v) { |
137 | - if(in_array($o, $E)) |
|
137 | + if (in_array($o, $E)) |
|
138 | 138 | $OUT[$o] = $v; |
139 | 139 | } |
140 | 140 | return($OUT); |
@@ -154,14 +154,14 @@ discard block |
||
154 | 154 | protected $PAC; |
155 | 155 | protected $ProvisionPAC; |
156 | 156 | public function getAll() { |
157 | - if(isset(XMLElement::$AuthMethodElements['client'][$this->EAPType]) && XMLElement::$AuthMethodElements['client'][$this->EAPType]) { |
|
157 | + if (isset(XMLElement::$AuthMethodElements['client'][$this->EAPType]) && XMLElement::$AuthMethodElements['client'][$this->EAPType]) { |
|
158 | 158 | $E = XMLElement::$AuthMethodElements['client'][$this->EAPType]; |
159 | 159 | $out = get_object_vars($this); |
160 | 160 | $OUT = []; |
161 | -debug(4,"EEE:".$this->EAPType.":\n"); |
|
162 | -debug(4,$E); |
|
161 | +debug(4, "EEE:" . $this->EAPType . ":\n"); |
|
162 | +debug(4, $E); |
|
163 | 163 | foreach ($out as $o => $v) { |
164 | - if(in_array($o, $E)) |
|
164 | + if (in_array($o, $E)) |
|
165 | 165 | $OUT[$o] = $v; |
166 | 166 | } |
167 | 167 | return($OUT); |
@@ -267,8 +267,8 @@ discard block |
||
267 | 267 | $val = ''; |
268 | 268 | } |
269 | 269 | if ($val) { |
270 | - if(getType($val) == 'string') |
|
271 | - $val = preg_replace('/&/','&',$val); |
|
270 | + if (getType($val) == 'string') |
|
271 | + $val = preg_replace('/&/', '&', $val); |
|
272 | 272 | $node = $node->addChild($name, $val); |
273 | 273 | } |
274 | 274 | else |
@@ -282,14 +282,14 @@ discard block |
||
282 | 282 | $fields = $object->getAll(); |
283 | 283 | if (!empty($fields)) { |
284 | 284 | foreach ($fields as $name=>$value) { |
285 | - if (getType($value)=='string' || getType($value)=='integer' || getType($value)=='double') { |
|
285 | + if (getType($value) == 'string' || getType($value) == 'integer' || getType($value) == 'double') { |
|
286 | 286 | $node->addChild($name, $value); |
287 | 287 | } else { |
288 | - if (getType($value)=='array') { |
|
288 | + if (getType($value) == 'array') { |
|
289 | 289 | foreach ($value as $v) |
290 | 290 | if (is_object($v)) |
291 | 291 | marshalObject($node, $v); |
292 | - } else if (getType($value)=='object') { |
|
292 | + } else if (getType($value) == 'object') { |
|
293 | 293 | marshalObject($node, $value); |
294 | 294 | } |
295 | 295 | } |