Device_welcomeletter __construct(
)
|
|
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]
*/
// $this->supportedEapMethods = Device_welcomeletter::$my_eap_methods;
debug(4,"mobileconfig Module Installer start\n");
$o =
system('unzip -q -d ./ welcomeletter.odt');
$filename = 'content.xml';
$source =
fopen($filename,'r+');
$content =
fread($source, 1000000);
$helpdesktext = "";
foreach ($this->attributes['support:email'] as $number =>
$option)
$helpdesktext .= "E-Mail: <text:span text:style-name=\"T2\">".$option."</text:span></text:p><text:p style-name=\"Standard\">";
foreach ($this->attributes['support:eap_types'] as $number =>
$option)
$helpdesktext .= "Special EAP Type support URL: <text:span text:style-name=\"T1\">".$option."</text:span></text:p><text:p style-name=\"Standard\">";
foreach ($this->attributes['support:phone'] as $number =>
$option)
$helpdesktext .= "Phone: <text:span text:style-name=\"T2\">".$option."</text:span></text:p><text:p style-name=\"Standard\">";
foreach ($this->attributes['support:url'] as $number =>
$option)
$helpdesktext .= "Web: <text:span text:style-name=\"T2\">".$option."</text:span></text:p><text:p style-name=\"Standard\">";
$content =
preg_replace('/XXXHELPDESKXXX/',$helpdesktext,$content);
fseek($source,0, SEEK_SET);
$o =
system('zip -q welcomeletter.odt *');
// openoffice needs to be running on headless TCP/8100 mode on the system...
// python needs to be python2.7
//$o2 = system('python /root/DocumentConverter.py '.$this->FPATH.'/welcomeletter.odt '.$this->FPATH.'/welcomeletter.pdf');
return 'welcomeletter.odt';
}
API Tags:
Redefinition of:
- DeviceConfig::writeInstaller()
- placeholder for the main device method