| @@ 68-82 (lines=15) @@ | ||
| 65 | } |
|
| 66 | } |
|
| 67 | ||
| 68 | public function disableCommonName($commonName) |
|
| 69 | { |
|
| 70 | Utils::validateCommonName($commonName); |
|
| 71 | ||
| 72 | $clientConfig = $this->parseConfig($commonName); |
|
| 73 | if (array_key_exists('disable', $clientConfig) && $clientConfig['disable']) { |
|
| 74 | // already disabled |
|
| 75 | return false; |
|
| 76 | } |
|
| 77 | ||
| 78 | $clientConfig['disable'] = true; |
|
| 79 | $this->writeFile($commonName, $clientConfig); |
|
| 80 | ||
| 81 | return true; |
|
| 82 | } |
|
| 83 | ||
| 84 | public function enableCommonName($commonName) |
|
| 85 | { |
|
| @@ 84-99 (lines=16) @@ | ||
| 81 | return true; |
|
| 82 | } |
|
| 83 | ||
| 84 | public function enableCommonName($commonName) |
|
| 85 | { |
|
| 86 | Utils::validateCommonName($commonName); |
|
| 87 | ||
| 88 | $clientConfig = $this->parseConfig($commonName); |
|
| 89 | if (array_key_exists('disable', $clientConfig) && $clientConfig['disable']) { |
|
| 90 | // it is disabled, enable it |
|
| 91 | $clientConfig['disable'] = false; |
|
| 92 | $this->writeFile($commonName, $clientConfig); |
|
| 93 | ||
| 94 | return true; |
|
| 95 | } |
|
| 96 | ||
| 97 | // it is not disabled |
|
| 98 | return false; |
|
| 99 | } |
|
| 100 | ||
| 101 | public function isDisabled($commonName) |
|
| 102 | { |
|