| @@ 57-71 (lines=15) @@ | ||
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| 57 | public function disableCommonName($commonName) |
|
| 58 | { |
|
| 59 | Utils::validateCommonName($commonName); |
|
| 60 | ||
| 61 | $clientConfig = $this->parseConfig($commonName); |
|
| 62 | if (array_key_exists('disable', $clientConfig) && $clientConfig['disable']) { |
|
| 63 | // already disabled |
|
| 64 | return false; |
|
| 65 | } |
|
| 66 | ||
| 67 | $clientConfig['disable'] = true; |
|
| 68 | $this->writeFile($commonName, $clientConfig); |
|
| 69 | ||
| 70 | return true; |
|
| 71 | } |
|
| 72 | ||
| 73 | public function enableCommonName($commonName) |
|
| 74 | { |
|
| @@ 73-88 (lines=16) @@ | ||
| 70 | return true; |
|
| 71 | } |
|
| 72 | ||
| 73 | public function enableCommonName($commonName) |
|
| 74 | { |
|
| 75 | Utils::validateCommonName($commonName); |
|
| 76 | ||
| 77 | $clientConfig = $this->parseConfig($commonName); |
|
| 78 | if (array_key_exists('disable', $clientConfig) && $clientConfig['disable']) { |
|
| 79 | // it is disabled, enable it |
|
| 80 | $clientConfig['disable'] = false; |
|
| 81 | $this->writeFile($commonName, $clientConfig); |
|
| 82 | ||
| 83 | return true; |
|
| 84 | } |
|
| 85 | ||
| 86 | // it is not disabled |
|
| 87 | return false; |
|
| 88 | } |
|
| 89 | ||
| 90 | public function isDisabled($commonName) |
|
| 91 | { |
|