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