Better PE cloud demo handling

This commit is contained in:
Lucas Bartholemy 2020-01-10 15:12:59 +01:00
parent 8b47e75ae9
commit 158dfc3294
4 changed files with 29 additions and 24 deletions

View File

@ -72,7 +72,10 @@ class LicenceManager
}
}
if (Yii::$app->hasModule('enterprise')) {
if (isset(Yii::$app->params['hosting'])) {
// In our demo hosting, we allow pro licences without registration
$licence->type = Licence::LICENCE_TYPE_PRO;
} elseif (Yii::$app->hasModule('enterprise')) {
/** @var \humhub\modules\enterprise\Module $enterprise */
$enterprise = Yii::$app->getModule('enterprise');
if ($enterprise->settings->get('licence') !== null && $enterprise->settings->get('licence_valid') == 1) {

View File

@ -26,7 +26,11 @@ class AboutVersion extends Widget
$licence = $module->getLicence();
if ($licence->type === Licence::LICENCE_TYPE_PRO) {
return $this->render('about_version_pro', ['licence' => $licence]);
if (isset(Yii::$app->params['hosting'])) {
return $this->render('about_version_pro_cloud', []);
} else {
return $this->render('about_version_pro', ['licence' => $licence]);
}
} elseif ($licence->type === Licence::LICENCE_TYPE_EE) {
return $this->render('about_version_ee');
} else {

View File

@ -0,0 +1,20 @@
<?php
use yii\helpers\Url;
/* @var $this \humhub\components\View */
?>
<div style="padding:20px;min-height:164px" class="jumbotron">
<div class="pull-left" style="padding-right:24px;">
<img src="<?= Yii::getAlias('@web-static/img/humhub_pro.jpg'); ?>" style="height:124px;">
</div>
<span style="font-size:36px">HumHub&nbsp;&nbsp;</span><span
style="font-size:24px">Professional Edition - Demo</span><br/>
<span style="font-size:18px"><?= Yii::t('MarketplaceModule.base', 'Version:'); ?> <?= Yii::$app->version ?></span><br/>
<br/>
<a href="<?= Url::to('https://www.humhub.com/professional-edition'); ?>" class="btn btn-success pull-right">
<i class="fa fa-external-link" target="_blank">&nbsp;</i>
<?= Yii::t('MarketplaceModule.base', 'More information'); ?>
</a>
</div>

View File

@ -1,22 +0,0 @@
<?php
use humhub\modules\marketplace\models\Licence;
use yii\helpers\Url;
/* @var $this \humhub\components\View */
/* @var $licence Licence */
?>
<div style="padding:20px" class="jumbotron">
<div class="pull-left" style="padding-right:24px">
<img src="<?= Yii::getAlias('@web-static/img/humhub_pro.jpg'); ?>" style="height:124px;">
</div>
<div class="pull-right">
<a href="<?= Url::to(['/marketplace/licence']); ?>" class="btn btn-primary btn-sm"><i class="fa fa-cogs">&nbsp;</i>
<?= Yii::t('MarketplaceModule.base', 'Edit licence'); ?></a>
</div>
<span style="font-size:36px">HumHub&nbsp;&nbsp;</span><span style="font-size:24px">Professional Edition</span><br/>
<span style="font-size:18px"><?= Yii::t('MarketplaceModule.base', 'Version:'); ?> <?= Yii::$app->version ?></span><br/>
<span style="font-size:18px"><?= Yii::t('MarketplaceModule.base', 'Licenced to:'); ?> <?= $licence->licencedTo; ?></span><br/>
<span style="font-size:18px"><?= Yii::t('MarketplaceModule.base', 'Max. users:'); ?> <?= $licence->maxUsers; ?></span><br/>
</div>