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

Class: DeviceConfig

Source Location: /core/Device.php

Class DeviceConfig

Class Overview

This class defines the API for CAT module writers.

A device is a fairly abstract notion. In most cases it represents a particular operating system or a set of operationg systems like MS Windows Vista and newer.

The purpose of this class is to preapare a setup for the device configurator, collect all necessary information from the database, taking into account limitations, that a given device may present (like a set of supported EAP methods).

All that is required from the device module is to produce a conigurator file and pass its name back to the API.

Located in /core/Device.php [line 41]



		
				Author(s):
		
		
		API Tags:
Abstract:  

Information Tags:
License:  http://ticker.eduroam.lu/cat/LICENSE

Properties

Methods

[ Top ]
Descendants
Child Class Description
Device_welcomeletter This is the main implementation class of the module
Device_TestModule This is the main implementation class of the module
Device_Vista7
Device_mobileconfig This is the main implementation class of the module
Device_WindowsXP
Device_macosx This is the main implementation class of the module

[ Top ]
Property Summary
array   $attributes   Array passing all options to the device module.
string   $FPATH   stores the path to the temporary working directory for a module instance
string   $lang_index   the string referencing the language (index ot the Config::$LANGUAGES array it is set to the current language and may be used by the device module to set its language
string   $module_path   stores the path to the module source location and is used by copyFile and translateFile the only reason for it to be a public variable ies that it is set by the DeviceFactory class module_path should not be used by module drivers.
EAP::constant   $selected_eap   optimal EAP method selected given profile and device
string   $sign   the path to the profile signing program

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

[ Top ]
Properties
array   $attributes [line 361]

Array passing all options to the device module.

$attrbutes array contains option values defined for the institution and a particular profile (possibly overriding one another) ready for the device module to consume.

For each of the options the value is another array of vales (even if only one value is present). Some attributes may be missing if they have not been configured for a viven institution or profile.

The following attributes are meant to be used by device modules:

  • general:geo_coordinates - geographical coordinates of the institution or a campus
  • general:info_file - consent file displayed to the users
  • general:logo_file - file data containing institution logo
  • support:eap_types - URL to a local support page for a specific eap methiod, not to be confused with general:url
  • support:email - email for users to contact for local instructions
  • support:phone - telephone number for users to contact for local instructions
  • support:url - URL where the user will find local eduroam instructions
  • internal:info_file - the pathname of the info_file saved in the working directory
  • internal:logo_file - array of pathnames of logo_files saved in the working directory
  • internal:CAs - the value is an array produced by X509::processCertificate() with the following filds
  • internal:SSID - an array indexed by SSID strings with values either TKIP or AES; if TKIP is set the both WPA/TKIP and WPA2/AES should be set if AES is set the this is a WPA2/AES only SSID; the eduroam SSID is always set as TKIP and is the first array element.
  • internal:profile_count - the number of profiles for the associated IdP

these attributes are available and can be used, but the "internal" attributes are better suited for modules

  • eap:ca_file - certificate of the CA signing the RADIUS server key
  • general:SSID - additional SSID to configure, WPA2/AES only (device modules should use internal:SSID)
  • general:SSID_with_legacy - additional SSID to configure, WPA2/AES and WPA/TKIP (device modules should use internal:SSID)

API Tags:
See:  X509::processCertificate()
Access:  public


[ Top ]
string   $FPATH [line 46]

stores the path to the temporary working directory for a module instance

API Tags:
Access:  public


[ Top ]
string   $lang_index [line 397]

the string referencing the language (index ot the Config::$LANGUAGES array it is set to the current language and may be used by the device module to set its language

API Tags:
Access:  public


[ Top ]
string   $module_path [line 369]

stores the path to the module source location and is used by copyFile and translateFile the only reason for it to be a public variable ies that it is set by the DeviceFactory class module_path should not be used by module drivers.

API Tags:
Access:  public


[ Top ]
EAP::constant   $selected_eap [line 379]

optimal EAP method selected given profile and device

API Tags:
Access:  public


[ Top ]
string   $sign [line 389]

the path to the profile signing program

device modules which require signing should use this property to exec the signer the signer program must accept two arguments - input and output file names the signer program mus operate in the local directory and filenames are relative to this directory

API Tags:
Access:  public


[ Top ]
Methods
Constructor __construct  [line 52]

  DeviceConfig __construct( )

device module constructor should be defined by each module, but if it is not, then here is a default one


API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
copyFile  [line 137]

  bool copyFile( string $source_name, [string $output_name = 0]  )

Copy a file from the module location to the temporary directory.

If the second argument is provided then the file will be saved under the name taken form this argument. If only one parameter is given, source and destination filenames are the same

Parameters:
string   $source_name:  The source file name
string   $output_name:  The destination file name

API Tags:
Return:  result of the copy operation
Access:  protected

Information Tags:
Final:  not to be redefined

[ Top ]
dumpAttibutes  [line 300]

  void dumpAttibutes( string $file  )

dumps attributes for debugging purposes

dumpAttibutes method is supplied for debuging purposes, it simply dumps the attribute array to a file with name passed in the attribute.

Parameters:
string   $file:  the output file name

API Tags:
Access:  protected


[ Top ]
getPreferredEapType  [line 113]

  void getPreferredEapType( $eap_array  )

select the preferred eap method

Parameters:
   $eap_array: 

API Tags:
Access:  public


[ Top ]
saveCertificateFiles  [line 198]

  array saveCertificateFiles( string $format  )

Save certificate files in either DER or PEM format

Certificate files will be saved in the module working directory.

Parameters:
string   $format:  only "der" and "pem" are currently allowed

API Tags:
Return:  an array of saved certificate file names or FALSE on error
Access:  protected


[ Top ]
setup  [line 77]

  void setup( $profile  )

Set up working environment for a device module

Sets up the device module environment taking into account the actual profile selected by the user in the GUI. The selected profile is passed as the Profile $profile argumant.

This method needs to be called after the device instance has been created (the GUI class does that)

setup performs the following tasks:

  • collect profile attributes and pass them as the attributes property;
  • create the temporary working directory
  • process CA certificates and store them as 'internal:CAs' attribute
  • process and save optional info files and store references to them in 'internal:info_file' attribute

Parameters:
Profile   $profile:  the profile object which will be passed by the caller

API Tags:
Access:  public

Information Tags:
Final:  not to be redefined

[ Top ]
translateFile  [line 166]

  void translateFile( string $source_name, [string $output_name = 0], [int $use_win_cp = 0]  )

Copy a file from the module location to the temporary directory aplying translation.

If the second argument is provided and is not equal to 0, then the file will be saved under the name taken form this argument. If only one parameter is given or the second is equal to 0, source and destination filenames are the same. The third optional parameter, if nonzero, will add changing the charset to one of old Windows charsets. This is required by the Windows installer and is expected to go away in the future.

Parameters:
string   $source_name:  The source file name
string   $output_name:  The destination file name
int   $use_win_cp:  Set Windows charset if non-zero

API Tags:
Access:  protected

Information Tags:
Final:  not to be redefined

[ Top ]
writeInstaller  [line 313]

  void writeInstaller( )

placeholder for the main device method


API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]

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