From b732f51c103d66509ac7d2c467e1201880ee5601 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 10 Jul 2019 17:34:43 +0200 Subject: [PATCH] Add enterprise logo Also set it as theming logo if the subscription is valid. Signed-off-by: Morris Jobke --- core/img/logo/logo-enterprise.png | Bin 0 -> 10318 bytes core/img/logo/logo-enterprise.svg | 1 + lib/composer/composer/autoload_classmap.php | 1 + lib/composer/composer/autoload_static.php | 1 + lib/private/Repair.php | 2 + lib/private/Repair/NC17/SetEnterpriseLogo.php | 117 ++++++++++++++++++ 6 files changed, 122 insertions(+) create mode 100644 core/img/logo/logo-enterprise.png create mode 100644 core/img/logo/logo-enterprise.svg create mode 100644 lib/private/Repair/NC17/SetEnterpriseLogo.php diff --git a/core/img/logo/logo-enterprise.png b/core/img/logo/logo-enterprise.png new file mode 100644 index 0000000000000000000000000000000000000000..4dca9f7f3a39d6b8f92de34c1b2e01de68583141 GIT binary patch literal 10318 zcmb8VWl&tr7e07r7~I`8Sa5e4G!O{Eg3I7;0fNH-2_D=Xf)gZo(7_?NyGw9Fa7bXY z|F`z{acj5h)H%<2&U3oD?uV}KdvBz=+AC}f3Jd@Mu$7hMH30zp4}x0Ikp2b8Ld~0h z;hVauw!**o`22s5fBrx4@PEKR|8M+xe*OpkWA6SR&40>&{$KS!|G)PC(*OAX&GV1E z|38!bPxfEwKiPlefB2vBf9e02f8u}mpZ(Xx&}2sbZ_#2Nnrd3WDDuNOo^@Lx);qpU zj~6%1&_Q{Fh&6Pdz$x0?n38&z`Ip>8yYc3iDLoW5>Y?If6|Xan4;+?Fgo*@_HUNNy zKv`Z!+k5$Bb)_kj2M=X40gkwVZ-elgBZwt*noC>%ZajCl>eMVp8-HTNTk+?P$E;(P zv*x?naQoRYG386~sBE9f4wTrH?7TU#ta>VNiocmKxH7O2?>GHs$WlpbH2uUmZ%13| zy?(kVb^!YoSG!)vD;KzKJ&CF0=X5)1!#aLEx?j}6x)Wc#DLjf()REhJ57r3tqeeAR zA;O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-XR9M7Q{3t4)6G4eidblnK>)0mUr3OJd$j&*K}}?XeAlF>vf^e zad}Mc2>6qMwpOdaGOv6!G{S%%?MWz^#1)?ySQJ xVvtI}ORk-laZ_9dkRpX_y8r(UQdpbPsoyCjNq*)j{rkrbP*zZrua<>{{9lewVUz#> literal 0 HcmV?d00001 diff --git a/core/img/logo/logo-enterprise.svg b/core/img/logo/logo-enterprise.svg new file mode 100644 index 0000000000..b5da1784ad --- /dev/null +++ b/core/img/logo/logo-enterprise.svg @@ -0,0 +1 @@ + diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index b7af5b3819..581c7b54cc 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -1065,6 +1065,7 @@ return array( 'OC\\Repair\\NC16\\AddClenupLoginFlowV2BackgroundJob' => $baseDir . '/lib/private/Repair/NC16/AddClenupLoginFlowV2BackgroundJob.php', 'OC\\Repair\\NC16\\CleanupCardDAVPhotoCache' => $baseDir . '/lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php', 'OC\\Repair\\NC16\\RemoveCypressFiles' => $baseDir . '/lib/private/Repair/NC16/RemoveCypressFiles.php', + 'OC\\Repair\\NC17\\SetEnterpriseLogo' => $baseDir . '/lib/private/Repair/NC17/SetEnterpriseLogo.php', 'OC\\Repair\\NC17\\SwitchUpdateChannel' => $baseDir . '/lib/private/Repair/NC17/SwitchUpdateChannel.php', 'OC\\Repair\\OldGroupMembershipShares' => $baseDir . '/lib/private/Repair/OldGroupMembershipShares.php', 'OC\\Repair\\Owncloud\\DropAccountTermsTable' => $baseDir . '/lib/private/Repair/Owncloud/DropAccountTermsTable.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 5aa6af0697..ff8c960df5 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -1099,6 +1099,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Repair\\NC16\\AddClenupLoginFlowV2BackgroundJob' => __DIR__ . '/../../..' . '/lib/private/Repair/NC16/AddClenupLoginFlowV2BackgroundJob.php', 'OC\\Repair\\NC16\\CleanupCardDAVPhotoCache' => __DIR__ . '/../../..' . '/lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php', 'OC\\Repair\\NC16\\RemoveCypressFiles' => __DIR__ . '/../../..' . '/lib/private/Repair/NC16/RemoveCypressFiles.php', + 'OC\\Repair\\NC17\\SetEnterpriseLogo' => __DIR__ . '/../../..' . '/lib/private/Repair/NC17/SetEnterpriseLogo.php', 'OC\\Repair\\NC17\\SwitchUpdateChannel' => __DIR__ . '/../../..' . '/lib/private/Repair/NC17/SwitchUpdateChannel.php', 'OC\\Repair\\OldGroupMembershipShares' => __DIR__ . '/../../..' . '/lib/private/Repair/OldGroupMembershipShares.php', 'OC\\Repair\\Owncloud\\DropAccountTermsTable' => __DIR__ . '/../../..' . '/lib/private/Repair/Owncloud/DropAccountTermsTable.php', diff --git a/lib/private/Repair.php b/lib/private/Repair.php index bd2fc08113..35e6856e42 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -43,6 +43,7 @@ use OC\Repair\NC14\AddPreviewBackgroundCleanupJob; use OC\Repair\NC16\AddClenupLoginFlowV2BackgroundJob; use OC\Repair\NC16\CleanupCardDAVPhotoCache; use OC\Repair\NC16\RemoveCypressFiles; +use OC\Repair\NC17\SetEnterpriseLogo; use OC\Repair\NC17\SwitchUpdateChannel; use OC\Repair\OldGroupMembershipShares; use OC\Repair\Owncloud\DropAccountTermsTable; @@ -151,6 +152,7 @@ class Repair implements IOutput { new RemoveLinkShares(\OC::$server->getDatabaseConnection(), \OC::$server->getConfig(), \OC::$server->getGroupManager(), \OC::$server->getNotificationManager(), \OC::$server->query(ITimeFactory::class)), \OC::$server->query(RemoveCypressFiles::class), \OC::$server->query(SwitchUpdateChannel::class), + \OC::$server->query(SetEnterpriseLogo::class), ]; } diff --git a/lib/private/Repair/NC17/SetEnterpriseLogo.php b/lib/private/Repair/NC17/SetEnterpriseLogo.php new file mode 100644 index 0000000000..2ba8d3c206 --- /dev/null +++ b/lib/private/Repair/NC17/SetEnterpriseLogo.php @@ -0,0 +1,117 @@ + + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OC\Repair\NC17; + +use OC\Files\AppData\Factory; +use OC\Template\SCSSCacher; +use OCA\Theming\ThemingDefaults; +use OCP\Files\IAppData; +use OCP\Files\NotFoundException; +use OCP\IConfig; +use OCP\Migration\IOutput; +use OCP\Migration\IRepairStep; +use OCP\Support\Subscription\IRegistry; + +/** + * @deprecated - can be removed in 18 + */ +class SetEnterpriseLogo implements IRepairStep { + + /** @var IConfig $config */ + private $config; + + /** @var IRegistry $subscriptionRegistry */ + private $subscriptionRegistry; + + /** @var IAppData $appData */ + private $appData; + + /** @var SCSSCacher $scssCacher */ + private $scssCacher; + + /** @var \OC_Defaults|ThemingDefaults */ + private $themingDefaults; + + public function getName(): string { + return 'Sets the enterprise logo'; + } + + public function __construct( + IConfig $config, + IRegistry $subscriptionRegistry, + Factory $appDataFactory, + SCSSCacher $SCSSCacher, + $ThemingDefaults + ) { + $this->config = $config; + $this->subscriptionRegistry = $subscriptionRegistry; + $this->appData = $appDataFactory->get('theming'); + $this->scssCacher = $SCSSCacher; + $this->themingDefaults = $ThemingDefaults; + } + + public function run(IOutput $output): void { + // only run once + if ($this->config->getAppValue('core', 'enterpriseLogoChecked') === 'yes') { + $output->info('Repair step already executed'); + return; + } + + if (!$this->subscriptionRegistry->delegateHasValidSubscription()) { + // no need to set the enterprise logo + $this->config->setAppValue('core', 'enterpriseLogoChecked', 'yes'); + return; + } + + if ($this->themingDefaults instanceof ThemingDefaults) { + $output->info('Theming is enabled - trying to set logo.'); + try { + $folder = $this->appData->getFolder('images'); + } catch (NotFoundException $e) { + $folder = $this->appData->newFolder('images'); + } + + if (!$folder->fileExists('logo') || $folder->getFile('logo')->getSize() === 0) { + $output->info('Logo does not exist yet - setting it.'); + + if ($folder->fileExists('logo')) { + $folder->getFile('logo')->delete(); + } + $target = $folder->newFile('logo'); + + $target->putContent(file_get_contents(__DIR__ . '/../../../../core/img/logo/logo-enterprise.png')); + + $this->themingDefaults->set('logoMime', 'image/png'); + + $this->scssCacher->process(\OC::$SERVERROOT, 'core/css/css-variables.scss', 'core'); + } else { + $output->info('Logo already set - skipping.'); + } + } else { + $output->info('Theming is not enabled - skipping.'); + } + + // if all were done, no need to redo the repair during next upgrade + $this->config->setAppValue('core', 'enterpriseLogoChecked', 'yes'); + } +}