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

Class: Device_macosx

Source Location: /devices/apple_mac_os_x/macosx.php

Class Device_macosx

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/apple_mac_os_x/macosx.php [line 33]

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

Properties

Methods

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

Inherited From DeviceConfig

DeviceConfig::$attributes
DeviceConfig::$device_id
DeviceConfig::$FPATH
DeviceConfig::$installerBasename
DeviceConfig::$lang_index
DeviceConfig::$module_path
DeviceConfig::$options
DeviceConfig::$selected_eap
DeviceConfig::$sign
DeviceConfig::$signer
DeviceConfig::$specialities
DeviceConfig::$support_email_substitute
DeviceConfig::$support_url_substitute

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()
Selects the preferred eap method based on profile EAP configuration and device EAP capabilities
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::translateString()
DeviceConfig::writeDeviceInfo()
prepare usage information for the installer every device module should override this method
DeviceConfig::writeInstaller()
placeholder for the main device method

[ Top ]
Property Summary
static mixed   $my_eap_methods  

[ Top ]
Method Summary
Device_macosx   __construct()   this array holds the list of EAP methods supported by this device
void   writeInstaller()   prepare a zip archive containing files and settings which normally would be used inside the module to produce an installer

[ Top ]
Properties
static mixed   $my_eap_methods = array(array("OUTER" => TLS, "INNER" => NONE),array("OUTER"=>PEAP,"INNER"=>MSCHAPv2),array("OUTER"=>TTLS,"INNER"=>NONE)) [line 48]
API Tags:
Access:  public


[ Top ]
Methods
Constructor __construct  [line 38]

  Device_macosx __construct( )

this array holds the list of EAP methods supported by this device


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 61]

  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.        $dom textdomain(NULL);
  16.       textdomain("devices");
  17.     $this->supportedEapMethods Device_macosx::$my_eap_methods;
  18.  
  19.     debug(4,"macosx Module Installer start\n");
  20. //    $this->setup($profile);
  21.     $this->massaged_inst preg_replace('/ +/','_',$this->attributes['general:instname'][0]);
  22.     $this->massaged_profile preg_replace('/ +/','_',$this->attributes['profile:name'][0]);
  23.     $this->massaged_country strtolower($this->attributes['internal:country'][0]);
  24.     $this->lang preg_replace('/\..+/','',setlocale(LC_ALL,"0"));
  25.  
  26.     if (isset($this->attributes['internal:use_anon_outer']&& $this->attributes['internal:use_anon_outer'][0== "1" && isset($this->attributes['internal:realm']))
  27.             $use_realm $this->attributes['internal:realm'][0];
  28.     else
  29.             $use_realm 0;
  30.  
  31.     $filename $this->attributes['general:instname'][0]."-".$this->attributes['profile:name'][0].".networkConnect";
  32.     $filename preg_replace('/ +/','_',$filename);
  33.     debug(4,"filename is going to be".$filename."\n");
  34.     $xml_f fopen($filename,'w');
  35.     $raw_document "";
  36.  
  37.  
  38.     $ssid_list $this->attributes['general:SSID'];
  39.     $server_names $this->attributes['eap:server_name'];
  40.     $uuid_list $this->list_ca_uuids($this->attributes['internal:CAs'][0]);
  41.     $ca_list $this->attributes['internal:CAs'][0];
  42.     $eap_type $this->selected_eap;
  43.  
  44.     $raw_document .= "<?xml version=\"1.0\" encoding=\"utf-8\"?>
  45. <!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"
  46. \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
  47. <plist version=\"1.0\">
  48.    <dict>
  49.     <key>8021X</key>
  50.     <dict>
  51.       <key>UserProfiles</key>
  52.          <array>";
  53.  
  54.     $raw_document .= $this->all_wlan($ssid_list,$uuid_list,$eap_type$use_realm$ca_list$server_names);
  55.  
  56.     //$raw_document .= $this->all_ca($this->attributes['internal:CAs'][0]);
  57.  
  58.     //$raw_document .= $this->all_server_names($server_names);
  59.  
  60.     $raw_document .= "
  61.    </dict>
  62.  </dict>
  63. </plist>";
  64.   
  65.     $tidy_config array(
  66.            'input-xml'        => true,
  67.            'indent'         => true,
  68.            'output-xml'   => true,
  69.            'tabsize'    => 4,
  70.            'wrap'           => 83);
  71.  
  72.     // Tidy
  73.     $tidy new tidy;
  74.     $tidy->parseString($raw_document$tidy_config'utf8');
  75.     $tidy->cleanRepair();
  76.     
  77.     fwrite($xml_f,$tidy);
  78.  
  79.     fclose($xml_f);
  80.    if($this->sign{
  81.       $e 'signed-'.$filename;
  82.       $o system($this->sign." $filename $e > /dev/null");
  83.    }
  84.    else
  85.       $e $filename;
  86.  
  87.    textdomain($dom);
  88.     return $e;
  89.    }


API Tags:
Access:  public


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

[ Top ]

Documentation generated on Wed, 08 Apr 2015 07:12:46 +0000 by phpDocumentor 1.4.4