|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* To change this license header, choose License Headers in Project Properties. |
|
5
|
|
|
* To change this template file, choose Tools | Templates |
|
6
|
|
|
* and open the template in the editor. |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
namespace devices\ms; |
|
10
|
|
|
|
|
11
|
|
|
class MsOneX |
|
12
|
|
|
{ |
|
13
|
|
|
const MS_EAPHOST_NS = 'http://www.microsoft.com/provisioning/EapHostConfig'; |
|
14
|
|
|
const MS_EAPCOMMON_NS = 'http://www.microsoft.com/provisioning/EapCommon'; |
|
15
|
|
|
private $eapConfig; |
|
16
|
|
|
|
|
17
|
|
|
public function getOneX($eapConfig) |
|
18
|
|
|
{ |
|
19
|
|
|
$this->eapConfig = $eapConfig; |
|
20
|
|
|
$element = new \core\DeviceXMLmain(); |
|
21
|
|
|
$element->setChild('cacheUserData', 'true'); |
|
22
|
|
|
$element->setChild('authMode', 'user'); |
|
23
|
|
|
$element->setChild('EAPConfig', $this->getEAPConfig()); |
|
24
|
|
|
return($element); |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
private function getEAPConfig() |
|
28
|
|
|
{ |
|
29
|
|
|
$element = new \core\DeviceXMLmain(); |
|
30
|
|
|
$element->setChild('EapHostConfig', $this->getEapHostConfig(), self::MS_EAPHOST_NS); |
|
31
|
|
|
return($element); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
private function getEapHostConfig() |
|
35
|
|
|
{ |
|
36
|
|
|
$element = new \core\DeviceXMLmain(); |
|
37
|
|
|
$element->setChild('EapMethod', $this->getEapMethod()); |
|
38
|
|
|
$element->setChild('Config', $this->eapConfig->config, self::MS_EAPHOST_NS); |
|
39
|
|
|
return($element); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
private function getEapMethod() |
|
43
|
|
|
{ |
|
44
|
|
|
$element = new \core\DeviceXMLmain(); |
|
45
|
|
|
$element->setChild('Type', $this->eapConfig->type, self::MS_EAPCOMMON_NS); |
|
46
|
|
|
$element->setChild('VendorId',0, self::MS_EAPCOMMON_NS); |
|
47
|
|
|
$element->setChild('VendorType',0, self::MS_EAPCOMMON_NS); |
|
48
|
|
|
$element->setChild('AuthorId', $this->eapConfig->authorId, self::MS_EAPCOMMON_NS); |
|
49
|
|
|
return($element); |
|
50
|
|
|
} |
|
51
|
|
|
} |