phpDocumentor Developer
[ class tree: Developer ] [ index: Developer ] [ all elements ]

Class: Device_welcomeletter

Source Location: /devices/welcomeletter/welcomeletter.php

Class Device_welcomeletter

Class Overview

This is the main implementation class of the module

The class should only define one public method: writeInstaller.

All other methods and properties should be private. This example sets zipInstaller method to protected, so that it can be seen in the documentation.

Located in /devices/welcomeletter/welcomeletter.php [line 26]

DeviceConfig
   |
   --Device_welcomeletter
Author(s): Information Tags:

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From DeviceConfig

DeviceConfig::$attributes
DeviceConfig::$FPATH
DeviceConfig::$lang_index
DeviceConfig::$module_path
DeviceConfig::$selected_eap
DeviceConfig::$sign

Inherited From DeviceConfig

DeviceConfig::__construct()
device module constructor should be defined by each module, but if it is not, then here is a default one
DeviceConfig::copyFile()
Copy a file from the module location to the temporary directory.
DeviceConfig::dumpAttibutes()
dumps attributes for debugging purposes
DeviceConfig::getPreferredEapType()
select the preferred eap method
DeviceConfig::saveCertificateFiles()
Save certificate files in either DER or PEM format
DeviceConfig::setup()
Set up working environment for a device module
DeviceConfig::translateFile()
Copy a file from the module location to the temporary directory aplying translation.
DeviceConfig::writeInstaller()
placeholder for the main device method

[ Top ]
Method Summary
Device_welcomeletter   __construct()  
void   writeInstaller()   prepare a zip archive containing files and settings which normally would be used inside the module to produce an installer

[ Top ]
Methods
Constructor __construct  [line 27]

  Device_welcomeletter __construct( )


API Tags:
Access:  public


Redefinition of:
DeviceConfig::__construct()
device module constructor should be defined by each module, but if it is not, then here is a default one

[ Top ]
writeInstaller  [line 46]

  void writeInstaller( )

prepare a zip archive containing files and settings which normally would be used inside the module to produce an installer

  1. function writeInstaller({
  2.    /** run innitial setup
  3.       this will:
  4.        - create the temporary directory and save its path as $this->FPATH
  5.        - process the CA certificates and store results in $this->attributes['internal:CAs'][0]
  6.             $this->attributes['internal:CAs'][0] is an array of processed CA certificates
  7.             a processed certifincate is an array 
  8.                'pem' points to pem feromat certificate
  9.                'der' points to der format certificate
  10.                'md5' points to md5 fingerprint
  11.                'sha1' points to sha1 fingerprint
  12.                'name' points to the certificate subject
  13.        - save the info_file (if exists) and put the name in $this->attributes['internal:info_file_name'][0]
  14.    */
  15. //    $this->supportedEapMethods = Device_welcomeletter::$my_eap_methods;
  16.  
  17.     debug(4,"mobileconfig Module Installer start\n");
  18.  
  19.     $this->copyFile('welcomeletter.odt');
  20.  
  21.     $o system('unzip -q -d ./ welcomeletter.odt');
  22.  
  23.     $filename 'content.xml';
  24.  
  25.     
  26.  
  27.     $source fopen($filename,'r+');
  28.     $content fread($source1000000);
  29.     ftruncate($source0);
  30.     $content preg_replace('/XXXINSTITUTIONXXX/',$this->attributes['internal:inst_name'][0],$content);
  31.     $content preg_replace('/XXXPROFILEXXX/',$this->attributes['internal:profile_name'][0],$content);
  32.     $helpdesktext "";
  33.  
  34.     if ($this->attributes['support:email'])
  35.             foreach ($this->attributes['support:email'as $number => $option)
  36.                 $helpdesktext .= "E-Mail: <text:span text:style-name=\"T2\">".$option."</text:span></text:p><text:p style-name=\"Standard\">";
  37.     if ($this->attributes['support:eap_types'])
  38.             foreach ($this->attributes['support:eap_types'as $number => $option)
  39.                 $helpdesktext .= "Special EAP Type support URL: <text:span text:style-name=\"T1\">".$option."</text:span></text:p><text:p style-name=\"Standard\">";
  40.     if ($this->attributes['support:phone'])
  41.             foreach ($this->attributes['support:phone'as $number => $option)
  42.                 $helpdesktext .= "Phone: <text:span text:style-name=\"T2\">".$option."</text:span></text:p><text:p style-name=\"Standard\">";
  43.     if ($this->attributes['support:url'])
  44.             foreach ($this->attributes['support:url'as $number => $option)
  45.                 $helpdesktext .= "Web: <text:span text:style-name=\"T2\">".$option."</text:span></text:p><text:p style-name=\"Standard\">";
  46.     
  47.     $content preg_replace('/XXXHELPDESKXXX/',$helpdesktext,$content);
  48.     fseek($source,0SEEK_SET);
  49.     fwrite($source,$content);
  50.     fclose($source);
  51.     $o system('zip -q welcomeletter.odt *');
  52.     // openoffice needs to be running on headless TCP/8100 mode on the system...
  53.     // python needs to be python2.7
  54.     //$o2 = system('python /root/DocumentConverter.py '.$this->FPATH.'/welcomeletter.odt '.$this->FPATH.'/welcomeletter.pdf');
  55.     return 'welcomeletter.odt';
  56.    }


API Tags:
Access:  public


Redefinition of:
DeviceConfig::writeInstaller()
placeholder for the main device method

[ Top ]

Documentation generated on Thu, 13 Oct 2011 08:42:11 +0200 by phpDocumentor 1.4.3