Commit 7b02f8da authored by Thomas Citharel's avatar Thomas Citharel 🌲

Merge branch 'fix-certtask-for-wiki' into 'framasites'

Add sufffix for subdomains & put all the domains in the cert task

Closes #48

See merge request framasoft/framasite!21
parents 7dc46104 326c7150
Pipeline #26112 passed with stage
in 1 minute and 14 seconds
......@@ -15,6 +15,11 @@ class CertData {
*/
private $subdomain;
/**
* @var string
*/
private $suffix;
/**
* @var int
*/
......@@ -64,6 +69,24 @@ class CertData {
return $this;
}
/**
* @return string
*/
public function getSuffix(): string
{
return $this->suffix;
}
/**
* @param string $suffix
* @return CertData
*/
public function setSuffix(string $suffix): CertData
{
$this->suffix = $suffix;
return $this;
}
/**
* @return int
*/
......
......@@ -45,15 +45,21 @@ class CertTaskFactory {
$certData = new CertData();
$certData->setSubdomain($site->getSubdomain())
->addName($domain->getDomainName())
->setAction($action)
->setUserLocale($user->getLocale())
->setUserEmail($user->getEmail())
;
foreach ($site->getDomains() as $domain) {
$certData->addName($domain);
}
if ($site instanceof Blog) {
$certData->setType(CertData::TYPE_SITE);
$certData->setSuffix('.frama.site');
} elseif ($site instanceof Wiki) {
$certData->setType(CertData::TYPE_WIKI);
$certData->setSuffix('.frama.wiki');
} else {
throw new \Exception('Ooops');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment