Device_mobileconfig __construct(
)
|
|
this array holds the list of EAP methods supported by this device
API Tags:
Redefinition of:
- DeviceConfig::__construct()
- device module constructor should be defined by each module, but if it is not, then here is a default one
prepare a zip archive containing files and settings which normally would be used inside the module to produce an installer
/** run innitial setup
this will:
- create the temporary directory and save its path as $this->FPATH
- process the CA certificates and store results in $this->attributes['internal:CAs'][0]
$this->attributes['internal:CAs'][0] is an array of processed CA certificates
a processed certifincate is an array
'pem' points to pem feromat certificate
'der' points to der format certificate
'md5' points to md5 fingerprint
'sha1' points to sha1 fingerprint
'name' points to the certificate subject
- save the info_file (if exists) and put the name in $this->attributes['internal:info_file_name'][0]
*/
debug(4,"mobileconfig Module Installer start\n");
// $this->setup($profile);
if (isset
($this->attributes['internal:use_anon_outer']) &&
$this->attributes['internal:use_anon_outer'][0] ==
"1" && isset
($this->attributes['internal:realm']))
$use_realm =
$this->attributes['internal:realm'][0];
else
$use_realm = 0;
$filename =
$this->attributes['internal:inst_name'][0].
"-".
$this->attributes['internal:profile_name'][0].
".mobileconfig";
$xml_f =
fopen($filename,'w');
$server_names =
$this->attributes['eap:server_name'];
$uuid_list =
$this->list_ca_uuids($this->attributes['internal:CAs'][0]);
fwrite($xml_f,"<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>PayloadContent</key>
<array>");
fwrite($xml_f,$this->all_wlan($ssid_list,$server_names,$uuid_list,$eap_type, $use_realm));
</array>
<key>PayloadDescription</key>
<string>".
sprintf(_("iPhone profile '%s' of '%s' - provided by eduroam.org"),$this->attributes['internal:profile_name'][0],$this->attributes['internal:inst_name'][0]).
"</string>
<key>PayloadDisplayName</key>
<string>".
$this->attributes['internal:profile_name'][0].
"</string>
<key>PayloadIdentifier</key>
<string>".
Device_mobileconfig::$IPHONE_PAYLOAD_PREFIX.
".$this->massaged_country.$this->massaged_inst.$this->massaged_profile.$this->lang</string>
<key>PayloadOrganization</key>
<string>".$this->attributes['internal:inst_name'][0]."</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>".
uuid().
"</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>");
$e = 'signed-'.$filename;
$o =
system($this->sign.
" $filename $e > /dev/null");
}
else
$e = $filename;
return $e;
}
API Tags:
Redefinition of:
- DeviceConfig::writeInstaller()
- placeholder for the main device method