/** {@inheritDoc} */
 public function run(IOutput $out)
 {
     $rootView = new View();
     $dataDirectory = $this->config->getSystemValue('datadirectory', null);
     if (is_null($dataDirectory)) {
         throw new \Exception('No data directory specified');
     }
     $pathToRootCerts = '/files_external/rootcerts.crt';
     foreach ($rootView->getDirectoryContent('', 'httpd/unix-directory') as $fileInfo) {
         $uid = trim($fileInfo->getPath(), '/');
         if ($rootView->file_exists($uid . $pathToRootCerts)) {
             // Delete the existing root certificate
             $rootView->unlink($uid . $pathToRootCerts);
             /**
              * FIXME: The certificate manager does only allow specifying the user
              *        within the constructor. This makes DI impossible.
              */
             // Regenerate the certificates
             $certificateManager = $this->server->getCertificateManager($uid);
             $certificateManager->createCertificateBundle();
         }
     }
 }
Пример #2
0
 public function testGetCertificateManager()
 {
     $this->assertInstanceOf('\\OC\\Security\\CertificateManager', $this->server->getCertificateManager('test'), 'service returned by "getCertificateManager" did not return the right class');
     $this->assertInstanceOf('\\OCP\\ICertificateManager', $this->server->getCertificateManager('test'), 'service returned by "getCertificateManager" did not return the right class');
 }