From 158dfc329466162a124c8410b68671cb0cd100ba Mon Sep 17 00:00:00 2001 From: Lucas Bartholemy Date: Fri, 10 Jan 2020 15:12:59 +0100 Subject: [PATCH] Better PE cloud demo handling --- .../marketplace/components/LicenceManager.php | 5 ++++- .../marketplace/widgets/AboutVersion.php | 6 ++++- .../widgets/views/about_version_pro_cloud.php | 20 +++++++++++++++++ .../widgets/views/about_version_prodemo.php | 22 ------------------- 4 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 protected/humhub/modules/marketplace/widgets/views/about_version_pro_cloud.php delete mode 100644 protected/humhub/modules/marketplace/widgets/views/about_version_prodemo.php diff --git a/protected/humhub/modules/marketplace/components/LicenceManager.php b/protected/humhub/modules/marketplace/components/LicenceManager.php index cd8c751312..edca8cf5d9 100644 --- a/protected/humhub/modules/marketplace/components/LicenceManager.php +++ b/protected/humhub/modules/marketplace/components/LicenceManager.php @@ -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) { diff --git a/protected/humhub/modules/marketplace/widgets/AboutVersion.php b/protected/humhub/modules/marketplace/widgets/AboutVersion.php index 04e49d0c99..1c3456e524 100644 --- a/protected/humhub/modules/marketplace/widgets/AboutVersion.php +++ b/protected/humhub/modules/marketplace/widgets/AboutVersion.php @@ -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 { diff --git a/protected/humhub/modules/marketplace/widgets/views/about_version_pro_cloud.php b/protected/humhub/modules/marketplace/widgets/views/about_version_pro_cloud.php new file mode 100644 index 0000000000..f81c937c2a --- /dev/null +++ b/protected/humhub/modules/marketplace/widgets/views/about_version_pro_cloud.php @@ -0,0 +1,20 @@ + +
+
+ +
+ HumHub  Professional Edition - Demo
+ version ?>
+
+ +   + + +
diff --git a/protected/humhub/modules/marketplace/widgets/views/about_version_prodemo.php b/protected/humhub/modules/marketplace/widgets/views/about_version_prodemo.php deleted file mode 100644 index 57ecf9793c..0000000000 --- a/protected/humhub/modules/marketplace/widgets/views/about_version_prodemo.php +++ /dev/null @@ -1,22 +0,0 @@ - -
-
- -
-
-   - -
- HumHub  Professional Edition
- version ?>
- licencedTo; ?>
- maxUsers; ?>
-