aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-07-15 20:31:06 +0200
committerGitHub <noreply@github.com>2019-07-15 20:31:06 +0200
commita3deb21bf4eac8fffebbed1d70ca7a1ba9e2496c (patch)
tree98265abd387922d6293f2c41b13ef758ba106f70
parent89e8b29aad5cec451e72c395ace92a0f8e9871f3 (diff)
parentb732f51c103d66509ac7d2c467e1201880ee5601 (diff)
downloadnextcloud-server-a3deb21bf4eac8fffebbed1d70ca7a1ba9e2496c.tar.gz
nextcloud-server-a3deb21bf4eac8fffebbed1d70ca7a1ba9e2496c.zip
Merge pull request #16334 from nextcloud/feature/noid/enterprise-logo
Add enterprise logo
-rw-r--r--core/img/logo/logo-enterprise.pngbin0 -> 10318 bytes
-rw-r--r--core/img/logo/logo-enterprise.svg1
-rw-r--r--lib/composer/composer/autoload_classmap.php1
-rw-r--r--lib/composer/composer/autoload_static.php1
-rw-r--r--lib/private/Repair.php2
-rw-r--r--lib/private/Repair/NC17/SetEnterpriseLogo.php117
6 files changed, 122 insertions, 0 deletions
diff --git a/core/img/logo/logo-enterprise.png b/core/img/logo/logo-enterprise.png
new file mode 100644
index 00000000000..4dca9f7f3a3
--- /dev/null
+++ b/core/img/logo/logo-enterprise.png
Binary files differ
diff --git a/core/img/logo/logo-enterprise.svg b/core/img/logo/logo-enterprise.svg
new file mode 100644
index 00000000000..b5da1784ad7
--- /dev/null
+++ b/core/img/logo/logo-enterprise.svg
@@ -0,0 +1 @@
+<svg width="3.2143cm" height="2.7502cm" enable-background="new 0 0 196.6 72" version="1.1" viewBox="0 0 113.89 97.45" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g fill="#fff"><path d="m57.033 0c-11.805 0-21.811 8.0032-24.912 18.847-2.6952-5.7515-8.5359-9.7809-15.263-9.7809-9.2518 0-16.857 7.6053-16.857 16.857 0 9.2518 7.6052 16.861 16.857 16.861 6.7274 0 12.568-4.0319 15.263-9.7844 3.1012 10.844 13.107 18.85 24.912 18.85 11.718 0 21.673-7.8851 24.853-18.607 2.745 5.6219 8.5134 9.5414 15.145 9.5414 9.2518 0 16.861-7.6087 16.861-16.861 0-9.2518-7.6087-16.857-16.861-16.857-6.6319 0-12.4 3.917-15.145 9.5379-3.1805-10.721-13.135-18.604-24.853-18.604zm0 9.8955c8.9116 0 16.031 7.1156 16.031 16.027 0 8.9116-7.1191 16.031-16.031 16.031-8.9116 0-16.027-7.1191-16.027-16.031 0-8.9116 7.1156-16.027 16.027-16.027zm-40.176 9.0657c3.9044 0 6.965 3.0572 6.965 6.9616s-3.0607 6.965-6.965 6.965c-3.9044 0-6.9616-3.0607-6.9616-6.965s3.0572-6.9616 6.9616-6.9616zm80.174 0c3.9044 0 6.965 3.0572 6.965 6.9616s-3.0607 6.965-6.965 6.965c-3.9044 0-6.9616-3.0607-6.9616-6.965s3.0572-6.9616 6.9616-6.9616z" color-rendering="auto" enable-background="accumulate" image-rendering="auto" shape-rendering="auto" solid-color="#000000"/><g transform="matrix(.47039 0 0 .47039 11.389 40.76)"><path d="m37.67 48.9c5.9 0 9.2 4.2 9.2 10.5 0 0.6-0.5 1.1-1.1 1.1h-15.9c0.1 5.6 4 8.8 8.5 8.8 2.8 0 4.8-1.2 5.8-2 0.6-0.4 1.1-0.3 1.4 0.3l0.3 0.5c0.3 0.5 0.2 1-0.3 1.4-1.2 0.9-3.8 2.4-7.3 2.4-6.5 0-11.5-4.7-11.5-11.5 0.1-7.2 4.9-11.5 10.9-11.5zm6.1 9.4c-0.2-4.6-3-6.9-6.2-6.9-3.7 0-6.9 2.4-7.6 6.9z"/><path d="m76.9 52.1v-7.7c0-0.7 0.4-1.1 1.1-1.1h0.8c0.7 0 1 0.4 1 1.1v5.2h4.5c0.7 0 1.1 0.4 1.1 1.1v0.3c0 0.7-0.4 1-1.1 1h-4.5v11c0 5.1 3.1 5.7 4.8 5.8 0.9 0.1 1.2 0.3 1.2 1.1v0.6c0 0.7-0.3 1-1.2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0.8c0.7 0 1.1-0.4 1.1-1.1v-21.472c0-3.4 3.7-5.8277 7.9-5.8277s7.9 2.4277 7.9 5.8277v21.472c0 0.7 0.4 1.1 1.1 1.1h0.8c0.7 0 1-0.4 1-1.1v-21.6c0-5.7-5.7-8.5-10.9-8.5-5 0-10.7 2.8-10.7 8.5v21.6c0 0.7 0.3 1.1 1 1.1z"/><path d="m167.9 49.4h-0.8c-0.7 0-1.1 0.4-1.1 1.1v12.1c0 3.4-2.2 6.5-6.5 6.5-4.2 0-6.5-3.1-6.5-6.5v-12.1c0-0.7-0.4-1.1-1.1-1.1h-0.8c-0.7 0-1 0.4-1 1.1v12.9c0 5.7 4.2 8.5 9.4 8.5s9.4-2.8 9.4-8.5v-12.9c0.1-0.7-0.3-1.1-1-1.1z"/><path d="m68.908 49.236c-0.24494 0.0391-0.4801 0.20259-0.70508 0.4707l-4.0469 4.8242-3.0293 3.6094-4.5859-5.4668-2.4883-2.9668c-0.22498-0.26812-0.47975-0.41472-0.74414-0.4375s-0.53852 0.07775-0.80664 0.30273l-0.61328 0.51367c-0.53623 0.44995-0.50854 0.94814-0.05859 1.4844l4.0488 4.8242 3.3574 4-4.916 5.8574c-0.0037 0.0044-0.0061 0.0093-0.0098 0.01367l-2.4805 2.9551c-0.44995 0.53623-0.39953 1.1008 0.13672 1.5508l0.61328 0.51172c0.53623 0.44995 1.0227 0.33701 1.4727-0.19922l4.0469-4.8242 3.0293-3.6094 4.5859 5.4668c3e-3 0.0036 0.0067 0.0062 0.0098 0.0098l2.4805 2.957c0.44995 0.53623 1.0126 0.58474 1.5488 0.13476l0.61328-0.51367c0.53623-0.44995 0.50854-0.94814 0.05859-1.4844l-4.0488-4.8242-3.3574-4 4.916-5.8574c0.0037-0.0044 0.0061-0.0093 0.0098-0.01367l2.4805-2.9551c0.44995-0.53623 0.39953-1.1008-0.13672-1.5508l-0.61328-0.51367c-0.26812-0.22498-0.52264-0.30864-0.76758-0.26953z"/></g><g stroke-width=".9025" aria-label="Enterprise"><path d="m18.81 93.113h-7.4209v-12.885h7.4209v2.2386h-4.6888v2.8291h4.3627v2.2386h-4.3627v3.3227h4.6888z"/><path d="m30.391 93.113h-2.6881v-5.7552q0-1.0664-0.37898-1.5952-0.37898-0.53762-1.2074-0.53762-1.1281 0-1.6305 0.75796-0.50237 0.74914-0.50237 2.4942v4.6359h-2.6881v-9.8535h2.0535l0.36135 1.2603h0.14983q0.44949-0.71389 1.2339-1.0752 0.79321-0.37017 1.798-0.37017 1.7186 0 2.6088 0.93423 0.89016 0.92542 0.89016 2.6793z"/><path d="m37.327 91.148q0.70508 0 1.6922-0.30847v2.0007q-1.0047 0.44949-2.4678 0.44949-1.6129 0-2.3532-0.81084-0.73152-0.81965-0.73152-2.4501v-4.7505h-1.2868v-1.1369l1.4807-0.89897 0.77559-2.08h1.7186v2.0976h2.7586v2.0183h-2.7586v4.7505q0 0.57288 0.31728 0.84609 0.3261 0.27322 0.85491 0.27322z"/><path d="m45.083 84.987q-0.85491 0-1.3396 0.54644-0.48474 0.53762-0.55525 1.5335h3.7722q-0.01763-0.99592-0.52-1.5335-0.50237-0.54644-1.3573-0.54644zm0.37898 8.3023q-2.3796 0-3.7193-1.3132-1.3396-1.3132-1.3396-3.7193 0-2.4766 1.2339-3.825 1.2427-1.3573 3.4284-1.3573 2.0888 0 3.2522 1.1898 1.1634 1.1898 1.1634 3.2874v1.3044h-6.3545q0.04407 1.1458 0.67864 1.7891 0.63457 0.64338 1.7803 0.64338 0.89016 0 1.6834-0.18508t1.6569-0.5905v2.08q-0.70508 0.35254-1.5071 0.52-0.80203 0.17627-1.9566 0.17627z"/><path d="m57.184 83.075q0.54644 0 0.90779 0.07932l-0.20271 2.5207q-0.3261-0.08813-0.79321-0.08813-1.2868 0-2.0095 0.66101-0.71389 0.66101-0.71389 1.8508v5.0149h-2.6881v-9.8535h2.0359l0.39661 1.6569h0.1322q0.4583-0.82847 1.2339-1.3308 0.7844-0.51118 1.701-0.51118z"/><path d="m65.31 93.29q-1.7363 0-2.7234-1.2603h-0.14102q0.14102 1.2339 0.14102 1.4278v3.9925h-2.6881v-14.19h2.1857l0.37898 1.278h0.12339q0.94304-1.463 2.7939-1.463 1.7451 0 2.7322 1.3485 0.98711 1.3485 0.98711 3.7457 0 1.5776-0.46712 2.741-0.4583 1.1634-1.3132 1.7715-0.85491 0.60813-2.0095 0.60813zm-0.79321-8.0643q-0.99592 0-1.4542 0.61694-0.4583 0.60813-0.47593 2.0183v0.29084q0 1.5864 0.46711 2.2739 0.47593 0.68745 1.4983 0.68745 1.8068 0 1.8068-2.979 0-1.4542-0.44949-2.1769-0.44067-0.73152-1.3925-0.73152z"/><path d="m76.82 83.075q0.54644 0 0.90779 0.07932l-0.20271 2.5207q-0.3261-0.08813-0.79321-0.08813-1.2868 0-2.0095 0.66101-0.71389 0.66101-0.71389 1.8508v5.0149h-2.6881v-9.8535h2.0359l0.39661 1.6569h0.1322q0.4583-0.82847 1.2339-1.3308 0.7844-0.51118 1.701-0.51118z"/><path d="m79.42 80.713q0-1.3132 1.463-1.3132t1.463 1.3132q0 0.62576-0.37017 0.9783-0.36135 0.34373-1.0929 0.34373-1.463 0-1.463-1.322zm2.8027 12.401h-2.6881v-9.8535h2.6881z"/><path d="m91.909 90.187q0 1.5159-1.0576 2.3091-1.0488 0.79321-3.1464 0.79321-1.0752 0-1.8332-0.14983-0.75796-0.14102-1.419-0.42305v-2.221q0.74914 0.35254 1.6834 0.5905 0.94304 0.23796 1.6569 0.23796 1.463 0 1.463-0.84609 0-0.31728-0.1939-0.51118-0.1939-0.20271-0.66982-0.44949-0.47593-0.25559-1.2691-0.5905-1.1369-0.47593-1.6746-0.88135-0.52881-0.40542-0.77559-0.92542-0.23796-0.52881-0.23796-1.2956 0-1.3132 1.0136-2.0271 1.0224-0.7227 2.8908-0.7227 1.7803 0 3.4637 0.77559l-0.81084 1.939q-0.74033-0.31728-1.3837-0.52-0.64338-0.20271-1.3132-0.20271-1.1898 0-1.1898 0.64338 0 0.36135 0.37898 0.62576 0.38779 0.2644 1.6834 0.7844 1.1546 0.46712 1.6922 0.87253 0.53762 0.40542 0.79321 0.93423t0.25559 1.2603z"/><path d="m98.105 84.987q-0.85491 0-1.3396 0.54644-0.48474 0.53762-0.55525 1.5335h3.7722q-0.01763-0.99592-0.52-1.5335-0.50237-0.54644-1.3573-0.54644zm0.37898 8.3023q-2.3796 0-3.7193-1.3132-1.3396-1.3132-1.3396-3.7193 0-2.4766 1.2339-3.825 1.2427-1.3573 3.4284-1.3573 2.0888 0 3.2522 1.1898t1.1634 3.2874v1.3044h-6.3545q0.04407 1.1458 0.67864 1.7891 0.63457 0.64338 1.7803 0.64338 0.89016 0 1.6834-0.18508 0.79322-0.18508 1.6569-0.5905v2.08q-0.70508 0.35254-1.5071 0.52-0.80202 0.17627-1.9566 0.17627z"/></g></g></svg>
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index d04a186036e..8eb33b932e9 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -1067,6 +1067,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 8cd007f5135..104ae692b02 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -1101,6 +1101,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 bd2fc081131..35e6856e429 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 00000000000..2ba8d3c206b
--- /dev/null
+++ b/lib/private/Repair/NC17/SetEnterpriseLogo.php
@@ -0,0 +1,117 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright Copyright (c) 2019, Morris Jobke <hey@morrisjobke.de>
+ *
+ * @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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+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');
+ }
+}