| @@ 52-70 (lines=19) @@ | ||
| 49 | return $clientConfig; |
|
| 50 | } |
|
| 51 | ||
| 52 | public function disableCommonName($commonName) |
|
| 53 | { |
|
| 54 | Utils::validateCommonName($commonName); |
|
| 55 | ||
| 56 | $clientConfig = $this->parseCcd($commonName); |
|
| 57 | foreach ($clientConfig as $k => $v) { |
|
| 58 | if ('disable' === $v) { |
|
| 59 | // already disabled |
|
| 60 | return false; |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||
| 64 | // not yet disabled |
|
| 65 | $clientConfig[] = 'disable'; |
|
| 66 | ||
| 67 | $this->writeFile($commonName, $clientConfig); |
|
| 68 | ||
| 69 | return true; |
|
| 70 | } |
|
| 71 | ||
| 72 | public function enableCommonName($commonName) |
|
| 73 | { |
|
| @@ 72-89 (lines=18) @@ | ||
| 69 | return true; |
|
| 70 | } |
|
| 71 | ||
| 72 | public function enableCommonName($commonName) |
|
| 73 | { |
|
| 74 | Utils::validateCommonName($commonName); |
|
| 75 | ||
| 76 | $clientConfig = $this->parseCcd($commonName); |
|
| 77 | foreach ($clientConfig as $k => $v) { |
|
| 78 | if ('disable' === $v) { |
|
| 79 | // it is disabled |
|
| 80 | unset($clientConfig[$k]); |
|
| 81 | $this->writeFile($commonName, $clientConfig); |
|
| 82 | ||
| 83 | return true; |
|
| 84 | } |
|
| 85 | } |
|
| 86 | ||
| 87 | // not disabled |
|
| 88 | return false; |
|
| 89 | } |
|
| 90 | ||
| 91 | public function isDisabled($commonName) |
|
| 92 | { |
|