|
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 MsLanProfile |
|
12
|
|
|
{ |
|
13
|
|
|
private $eapConfig; |
|
14
|
|
|
|
|
15
|
|
|
const MS_ONEX_NS = 'http://www.microsoft.com/networking/OneX/v1'; |
|
16
|
|
|
|
|
17
|
|
|
/* |
|
18
|
|
|
* prepare data for the <EapConfig> element. The contents of this element |
|
19
|
|
|
* depends on the implementation of a particular EAP method and thus is |
|
20
|
|
|
* delivered by an EAP-specific class. |
|
21
|
|
|
*/ |
|
22
|
|
|
public function setEapConfig($eapConfig) |
|
23
|
|
|
{ |
|
24
|
|
|
$this->eapConfig = $eapConfig; |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
public function writeLANprofile() |
|
28
|
|
|
{ |
|
29
|
|
|
$rootname = 'LANProfile'; |
|
30
|
|
|
$dom = new \DOMDocument('1.0', 'utf-8'); |
|
31
|
|
|
$root = $dom->createElement($rootname); |
|
32
|
|
|
$dom->appendChild($root); |
|
33
|
|
|
$ns = $dom->createAttributeNS( null, 'xmlns' ); |
|
34
|
|
|
$ns->value = "hhttp://www.microsoft.com/networking/LAN/profile/v1"; |
|
35
|
|
|
$root->appendChild($ns); |
|
36
|
|
|
\core\DeviceXMLmain::marshalObject($dom, $root, 'WLANprofile', $this->getLANprofile(), '', true); |
|
|
|
|
|
|
37
|
|
|
$dom->formatOutput = true; |
|
38
|
|
|
$xml = $dom->saveXML(); |
|
39
|
|
|
return($xml); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
private function getLANprofile() |
|
43
|
|
|
{ |
|
44
|
|
|
$element = new \core\DeviceXMLmain(); |
|
45
|
|
|
$element->setChild('MSM', $this->getMSM()); |
|
46
|
|
|
return($element); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
private function getMSM() |
|
50
|
|
|
{ |
|
51
|
|
|
$element = new \core\DeviceXMLmain(); |
|
52
|
|
|
$element->setChild('security', $this->getSecurity()); |
|
53
|
|
|
return($element); |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
private function getSecurity() |
|
57
|
|
|
{ |
|
58
|
|
|
$element = new \core\DeviceXMLmain(); |
|
59
|
|
|
$oneX = new \devices\ms\MsOneX(); |
|
60
|
|
|
$element->setChild('OneXEnforced', 'false'); |
|
61
|
|
|
$element->setChild('OneXEnabled', 'true'); |
|
62
|
|
|
$element->setChild('OneX', $oneX->getOneX($this->eapConfig), self::MS_ONEX_NS); |
|
63
|
|
|
return($element); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
|
|
67
|
|
|
} |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.