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

file listing

  1. <?php
  2. /* *********************************************************************************
  3.  * (c) 2011-13 DANTE Ltd. on behalf of the GN3 and GN3plus consortia
  4.  * License: see the LICENSE file in the root directory
  5.  ***********************************************************************************/
  6. ?>
  7. <?php
  8. /**
  9.  * This file contains the Devices class.
  10.  *
  11.  * @package ModuleWriting
  12.  */
  13. /**
  14.  * The Devices class holds a list of all devices the CAT knows about
  15.  * 
  16.  * @author Tomasz Wolniewicz <twoln@umk.pl>
  17.  * 
  18.  * @license see LICENSE file in root directory
  19.  * 
  20.  * @package ModuleWriting
  21.  */
  22. class Devices{
  23.  
  24. /**
  25.  * This array lists available configuration options for local device management.
  26.  * Values from this array will be taken as defaults.
  27.  * Do not modify this array unless you really konw what you are doing.
  28.  * Default values will be overriden by the settings of options inside
  29.  * each device definition
  30.  *
  31.  * - 'sign' - if set to nonzero will cause installer signing if the module
  32.  *         supports this. The default settings for Microsoft and Apple systems
  33.  *         is 1, since without signing, installation makes liitle sense. Be aware
  34.  *         that you need to set up signers and have proper certificates, if
  35.  *         you do not want to do that and you are just testing CAT, then you can
  36.  *         switch sign to 0, of course.
  37.  * - 'no_cache' if defined and equal to 1 will block installer caching - useful
  38.  *         for device development, should not be used in production
  39.  * - 'hidden' if defined and equal to 1 will hide the device form listing -
  40.  *         useful for device development
  41.  * - 'redirect if defined and equal to 1 will only show the device on the listing
  42.  *         if device redirect has been defined by the admin
  43.  * - 'message' if defined will cause a display of the contents of this option as
  44.  *         an additional warning
  45.  *
  46.  * - 'device_id' - used in building the installer filename; when this option
  47.  *         is not defined, the filename will use the index from
  48.  *         the listDevices array; when defined and not empty, it will be
  49.  *         used in place of this index; when defined as empty will cause
  50.  *         the omission of the device part the filename.
  51.  *         The default is unset, so it is not listed in the Options array.
  52.  * - 'mime' - used to set the MIME type of the installer file;
  53.  *         if not set will default to the value provided by PHP finfo.
  54.  *         The default is unset, so it is not listed in the Options array.
  55.  */
  56.  
  57. public static $Options=array(
  58.   'sign'=>0,
  59.   'no_cache'=>0,
  60.   'hidden'=>0,
  61.   'redirect'=>0,
  62. );
  63.  
  64. /**
  65.  * Each device is defined as a sub-array within this array
  66.  *
  67.  * Except for changing/adding things inside the options arrays, do not modify
  68.  * this array unless you really know what you are doing.
  69.  *
  70.  * Beware that the entrance page of CAT contains a rolling ad which
  71.  * lists some devices, and also states that certain device modules are signed,
  72.  * you should keep this information in sync with your settings in this file
  73.  * See web/user/roll.php for settings and more information.
  74.  *
  75.  * Settings
  76.  * - 'group' - caused device grouping used by the entrance screen
  77.  * - 'display' is the name shown on the GUI button
  78.  * - 'match' - a regular expression which will be matched against HTTP_USER_AGENT
  79.  *             to discover the operating system of the user
  80.  * - 'directory' is the subdirectory of devices directory, where
  81.  *       the device module resides
  82.  * - 'module' is the name of the module class, the same name with .php
  83.  *       added will be used as the name of the main include file for the module
  84.  * - 'signer' if defined points to a script which will sign a file.
  85.  *       The script must be located in the signer subdirectory of CAT.
  86.  *       The first argument of this script must be the input file name,
  87.  *       the second - the signed file filename. Signer will not be used
  88.  *       unless the sign option is set to nonzero.
  89.  * - 'options' - the array of options overriding the default settings.
  90.  *       See the descripption of options above.
  91.  *
  92.  * @example devices/devices-template.php file listing
  93.  * @return array the device modules
  94.  */
  95.  
  96.  
  97. public static function listDevices({
  98.     return array(
  99.  'w10'=>array(
  100.    'group' => "microsoft",
  101.    'display'=>_("MS Windows 10"),
  102.    'match'=>'Windows NT 6[._][4]',
  103.    'directory'=>'ms',
  104.    'module'=>'W8',
  105.    'signer'=>'ms_windows_sign',
  106.     'options'=>array(
  107.        'sign'=>1,
  108.        'device_id'=>'W10',
  109.        'mime'=>'application/x-dosexec',
  110.       ),
  111.    ),
  112.     
  113.  'w8'=>array(
  114.    'group' => "microsoft",
  115.    'display'=>_("MS Windows 8, 8.1"),
  116.    'match'=>'Windows NT 6[._][23]',
  117.    'directory'=>'ms',
  118.    'module'=>'W8',
  119.    'signer'=>'ms_windows_sign',
  120.     'options'=>array(
  121.        'sign'=>1,
  122.        'device_id'=>'W8',
  123.        'mime'=>'application/x-dosexec',
  124.       ),
  125.    ),
  126.     
  127.  'w7'=>array(
  128.    'group' => "microsoft",
  129.    'display'=>_("MS Windows 7"),
  130.    'match'=>'Windows NT 6[._]1',
  131.    'directory'=>'ms',
  132.    'module'=>'Vista7',
  133.    'signer'=>'ms_windows_sign',
  134.     'options'=>array(
  135.        'sign'=>1,
  136.        'device_id'=>'W7',
  137.        'mime'=>'application/x-dosexec',
  138.       ),
  139.    ),
  140.     
  141.  'vista'=>array(
  142.    'group' => "microsoft",
  143.    'display'=>_("MS Windows Vista"),
  144.    'match'=>'Windows NT 6[._]0',
  145.    'directory'=>'ms',
  146.    'module'=>'Vista7',
  147.    'signer'=>'ms_windows_sign',
  148.     'options'=>array(
  149.        'sign'=>1,
  150.        'device_id'=>'Vista',
  151.        'mime'=>'application/x-dosexec',
  152.       ),
  153.    ),
  154.     
  155.  'win-rt'=>array(
  156.     'group' => "microsoft",
  157.     'display'=>_("Windows RT"),
  158.     'directory'=>'redirect_dev',
  159.     'module'=>'RedirectDev',
  160.     'options'=>array(
  161.       'hidden'=>0,
  162.       'redirect'=>1,
  163.       ),
  164.    ),
  165.     
  166.  
  167.  'apple_yos'=>array(
  168.     'group' => "apple",
  169.     'display'=>_("Apple OS X Yosemite"),
  170.     'match'=>'Mac OS X 10[._]10',
  171.     'directory'=>'apple_mobileconfig',
  172.     'module'=>'mobileconfig_os_x',
  173.     'signer'=>'mobileconfig_sign',
  174.     'options'=>array(
  175.        'sign'=>1,
  176.        'device_id'=>'OS_X',
  177.        'mime'=>'application/x-apple-aspen-config',
  178.       ),
  179.     ),
  180.  
  181.     
  182.  'apple_mav'=>array(
  183.     'group' => "apple",
  184.     'display'=>_("Apple OS X Mavericks"),
  185.     'match'=>'Mac OS X 10[._]9',
  186.     'directory'=>'apple_mobileconfig',
  187.     'module'=>'mobileconfig_os_x',
  188.     'signer'=>'mobileconfig_sign',
  189.     'options'=>array(
  190.        'sign'=>1,
  191.        'device_id'=>'OS_X',
  192.        'mime'=>'application/x-apple-aspen-config',
  193.       ),
  194.     ),
  195.     
  196.     
  197.  'apple_m_lion'=>array(
  198.     'group' => "apple",
  199.     'display'=>_("Apple OS X Mountain Lion"),
  200.     'match'=>'Mac OS X 10[._]8',
  201.     'directory'=>'apple_mobileconfig',
  202.     'module'=>'mobileconfig_os_x',
  203.     'signer'=>'mobileconfig_sign',
  204.     'options'=>array(
  205.        'sign'=>1,
  206.        'device_id'=>'OS_X',
  207.        'mime'=>'application/x-apple-aspen-config',
  208.       ),
  209.     ),
  210.     
  211.  'apple_lion'=>array(
  212.     'group' => "apple",
  213.     'display'=>_("Apple OS X Lion"),
  214.     'match'=>'Mac OS X 10[._]7',
  215.     'directory'=>'apple_mobileconfig',
  216.     'module'=>'mobileconfig_os_x',
  217.     'signer'=>'mobileconfig_sign',
  218.     'options'=>array(
  219.        'sign'=>1,
  220.        'device_id'=>'OS_X',
  221.        'mime'=>'application/x-apple-aspen-config',
  222.       ),
  223.     ),
  224.  'mobileconfig'=>array(
  225.     'group' => "apple",     
  226.     'display'=>_("Apple iOS mobile devices"),
  227.     'match'=>'iOS|iPad|iPhone|iPod',
  228.     'directory'=>'apple_mobileconfig',
  229.     'module'=>'mobileconfig_ios',
  230.     'signer'=>'mobileconfig_sign',
  231.     'options'=>array(
  232.        'sign'=>1,
  233.        'device_id'=>'iOS',
  234.        'mime'=>'application/x-apple-aspen-config',
  235.       ),
  236.     ),
  237.  'linux'=>array(
  238.      'group' => "linux",
  239.      'display'=>_("Linux"),
  240.      'match'=>'Linux(?!.*Android)',
  241.      'directory'=>'linux',
  242.      'module' => 'Linux',
  243.      'options'=>array(
  244.        'mime'=>'application/x-sh',
  245.       ),
  246.    ),
  247.  
  248.  
  249.  'android_lollipop'=>array(
  250.     'group' => "android",
  251.     'display'=>_("Android 5.0 Lollipop"),
  252.      'match'=>'Android 5\.[0]',
  253.     'directory'=>'xml',
  254.     'module'=>'Lollipop',
  255.     'options'=>array(
  256.        'mime'=>'application/eap-config',
  257.        'message'=>sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from %s and will use the configuration file downloaded from CAT to create all necessary settings."),"eduroamCAT","<a target='_blank' href='https://play.google.com/store/'>Google Play</a>"),
  258.       ),
  259.    ),
  260.  
  261.  'android_kitkat'=>array(
  262.     'group' => "android",
  263.     'display'=>_("Android 4.4 KitKat"),
  264.      'match'=>'Android 4\.[4-9]',
  265.     'directory'=>'xml',
  266.     'module'=>'KitKat',
  267.     'options'=>array(
  268.        'mime'=>'application/eap-config',
  269.        'message'=>sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from %s and will use the configuration file downloaded from CAT to create all necessary settings."),"eduroamCAT","<a target='_blank' href='https://play.google.com/store/'>Google Play</a>"),
  270.       ),
  271.    ),
  272.  
  273.  'android_legacy'=>array(
  274.      'group' => "android",
  275.      'display'=>_("Android"),
  276.      'match'=>'Android',
  277.      'directory'=>'redirect_dev',
  278.      'module'=>'RedirectDev',
  279.      'options'=>array(
  280.        'redirect'=>1,
  281.       ),
  282.    ),
  283.  
  284.  'eap-config'=>array(
  285.     'group' => "eap-config",
  286.     'display'=>_("EAP config"),
  287.     'directory'=>'xml',
  288.     'module'=>'XML_ALL',
  289.     'options'=>array(
  290.        'mime'=>'application/eap-config',
  291.        'message'=>sprintf(_("This option provides a generic EAP config XML file, which can be consumed by dedicated applications like eduroamCAT for Android and Linux platforms. This is still an experimental feature.")),
  292.       ),
  293.     ),
  294.  
  295.  'test'=>array(
  296.     'group' => "other",
  297.     'display'=>_("Test"),
  298.     'directory'=>'test_module',
  299.     'module'=>'TestModule',
  300.     'options'=>array(
  301.        'hidden'=>1,
  302.       ),
  303.    ),
  304.  
  305.  
  306. /*    
  307.     
  308.  'xml-ttls-pap'=>array(
  309.     'group' => "generic",
  310.     'display'=>_("Generic profile TTLS-PAP"),
  311.     'directory'=>'xml',
  312.     'module'=>'XML_TTLS_PAP',
  313.     'options'=>array(
  314.        'mime'=>'application/eap-config',
  315.       ),
  316.    ),
  317.     
  318.  'xml-ttls-mschap2'=>array(
  319.     'group' => "generic",
  320.     'display'=>_("Generic profile TTLS-MSCHAPv2"),
  321.     'directory'=>'xml',
  322.     'module'=>'XML_TTLS_MSCHAP2',
  323.     'options'=>array(
  324.        'mime'=>'application/eap-config',
  325.       ),
  326.    ),
  327.     
  328.  'xml-peap'=>array(
  329.     'group' => "generic",
  330.     'display'=>_("Generic profile PEAP"),
  331.     'directory'=>'xml',
  332.     'module'=>'XML_PEAP',
  333.     'options'=>array(
  334.        'mime'=>'application/eap-config',
  335.       ),
  336.    ),
  337.     
  338.  'xml-tls'=>array(
  339.     'group' => "generic",
  340.     'display'=>_("Generic profile TLS"),
  341.     'directory'=>'xml',
  342.     'module'=>'XML_TLS',
  343.     'options'=>array(
  344.        'mime'=>'application/eap-config',
  345.       ),
  346.    ),
  347.     
  348.  'xml-pwd'=>array(
  349.     'group' => "generic",
  350.     'display'=>_("Generic profile PWD"),
  351.     'directory'=>'xml',
  352.     'module'=>'XML_PWD',
  353.     'options'=>array(
  354.        'mime'=>'application/eap-config',
  355.       ),
  356.    ),
  357.  'xml-all'=>array(
  358.     'group' => "generic",
  359.     'display'=>_("Generic profile ALL EAPs"),
  360.     'directory'=>'xml',
  361.     'module'=>'XML_ALL',
  362.     'options'=>array(
  363.        'mime'=>'application/eap-config',
  364.       ),
  365.    ),
  366. */
  367. );
  368. }
  369. }
  370. ?>

Documentation generated on Thu, 16 Apr 2015 10:26:07 +0000 by phpDocumentor 1.4.4