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



		
				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

[ 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
mixed   $lang_index  
mixed   $module_path  
EAP::constant   $selected_eap   optimal EAP method selected given profile and device
mixed   $sign  

[ Top ]
Method Summary
bool   copyFile()   Copy a file from the module location to the temporary directory.
void   dumpAttibutes()   dumps attributes for debugging purposes
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 359]

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
  • general:SSID - additional SSID to configure, WPA2/AES only
  • general:SSID_with_legacy - additional SSID to configure, WPA2/AES and WPA/TKIP
  • 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

these attributes are available and can be used, but ...

  • eap:ca_file - certificate of the CA signing the RADIUS server key

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


[ Top ]
string   $FPATH [line 45]

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

API Tags:
Access:  public


[ Top ]
mixed   $lang_index [line 371]
API Tags:
Access:  public


[ Top ]
mixed   $module_path [line 360]
API Tags:
Access:  public


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

optimal EAP method selected given profile and device

API Tags:
Access:  public


[ Top ]
mixed   $sign [line 372]
API Tags:
Access:  public


[ Top ]
Methods
copyFile  [line 110]

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

  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 ]
saveCertificateFiles  [line 176]

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

  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 inside of the Device::writeInstaller method.

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 writeInstaller.

API Tags:
Access:  public

Information Tags:
Final:  not to be redefined

[ Top ]
translateFile  [line 139]

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

  void writeInstaller( $profile  )

placeholder for the main device method

writeInstaller method needs to be redefined in every device module class the one below is just an example writeInstaller must call the setup method passing to it the $profile argument.

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

API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]

Documentation generated on Fri, 05 Aug 2011 15:56:30 +0200 by phpDocumentor 1.4.3