Rev 1261 | Rev 1294 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1261 | Rev 1293 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | public static function getObjectTypeClassName(): string { |
33 | public static function getObjectTypeClassName(): string { |
34 | return OIDplusMac::class; |
34 | return OIDplusMac::class; |
35 | } |
35 | } |
36 | 36 | ||
37 | /** |
37 | /** |
38 | * @param string $actionID |
- | |
39 | * @param array $params |
38 | * @param array $params |
40 | * @return array |
39 | * @return array |
41 | * @throws OIDplusException |
40 | * @throws OIDplusException |
42 | */ |
41 | */ |
43 | public function action(string $actionID, array $params): array { |
42 | private function action_GenerateAAI(array $params): array { |
44 | if ($actionID == 'generate_aai') { |
- | |
45 | _CheckParamExists($params, 'aai_bits'); |
43 | _CheckParamExists($params, 'aai_bits'); |
46 | _CheckParamExists($params, 'aai_multicast'); |
44 | _CheckParamExists($params, 'aai_multicast'); |
47 | 45 | ||
48 | if (($params['aai_bits'] != '48') && ($params['aai_bits'] != '64')) { |
46 | if (($params['aai_bits'] != '48') && ($params['aai_bits'] != '64')) { |
49 | throw new OIDplusException(_L("Invalid bit amount")); |
47 | throw new OIDplusException(_L("Invalid bit amount")); |
Line 66... | Line 64... | ||
66 | 64 | ||
67 | $aai = strtoupper($aai); |
65 | $aai = strtoupper($aai); |
68 | $aai = rtrim(chunk_split($aai, 2, '-'), '-'); |
66 | $aai = rtrim(chunk_split($aai, 2, '-'), '-'); |
69 | 67 | ||
70 | return array("status" => 0, "aai" => $aai); |
68 | return array("status" => 0, "aai" => $aai); |
- | 69 | } |
|
- | 70 | ||
- | 71 | /** |
|
- | 72 | * @param string $actionID |
|
- | 73 | * @param array $params |
|
- | 74 | * @return array |
|
- | 75 | * @throws OIDplusException |
|
- | 76 | */ |
|
- | 77 | public function action(string $actionID, array $params): array { |
|
- | 78 | if ($actionID == 'generate_aai') { |
|
- | 79 | return $this->action_GenerateAAI($params); |
|
71 | } else { |
80 | } else { |
72 | return parent::action($actionID, $params); |
81 | return parent::action($actionID, $params); |
73 | } |
82 | } |
74 | } |
83 | } |
75 | 84 |