]> source.dussan.org Git - nextcloud-server.git/commitdiff
Deprecate getEditionString() 1285/head
authorJoas Schilling <coding@schilljs.com>
Tue, 6 Sep 2016 12:11:30 +0000 (14:11 +0200)
committerJoas Schilling <coding@schilljs.com>
Tue, 6 Sep 2016 14:05:28 +0000 (16:05 +0200)
15 files changed:
apps/files_sharing/templates/public.php
core/Command/Status.php
core/Controller/OCSController.php
core/templates/layout.user.php
lib/private/OCSClient.php
lib/private/Updater/VersionCheck.php
lib/private/legacy/app.php
lib/private/legacy/util.php
settings/Controller/CheckSetupController.php
settings/templates/personal.php
settings/templates/settings.development.notice.php
status.php
tests/Settings/Controller/CheckSetupControllerTest.php
tests/lib/Updater/VersionCheckTest.php
tests/lib/UpdaterTest.php

index fe363ed82f5212c0895383578168a6e0d5626b03..1b282f04a7a68018a604c7be3f0db579ffd205a6 100644 (file)
@@ -43,13 +43,7 @@ $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
 
                <div class="header-appname-container">
                        <h1 class="header-appname">
-                               <?php
-                                       if(OC_Util::getEditionString() === '') {
-                                               p($theme->getName());
-                                       } else {
-                                               print_unescaped($theme->getHTMLName());
-                                       }
-                               ?>
+                               <?php p($theme->getName()); ?>
                        </h1>
                </div>
 
index 91c79d276700c8020e250ce79a27e65c717edfba..177c63f0405b613c702077e3f85ceae91815d65b 100644 (file)
@@ -38,13 +38,11 @@ class Status extends Base {
        }
 
        protected function execute(InputInterface $input, OutputInterface $output) {
-               $installed = (bool) \OC::$server->getConfig()->getSystemValue('installed', false);
-
                $values = array(
-                       'installed' => $installed,
+                       'installed' => (bool) \OC::$server->getConfig()->getSystemValue('installed', false),
                        'version' => implode('.', \OCP\Util::getVersion()),
                        'versionstring' => \OC_Util::getVersionString(),
-                       'edition' => $installed ? \OC_Util::getEditionString() : '',
+                       'edition' => '',
                );
 
                $this->writeArrayInOutputFormat($input, $output, $values);
index c785f1ff94a80b99fafe8caa26f46488997f7d19..13cc4d8ce2c14b5c84baec75248a818be694a2ca 100644 (file)
@@ -81,7 +81,7 @@ class OCSController extends \OCP\AppFramework\OCSController {
                        'minor' => $minor,
                        'micro' => $micro,
                        'string' => \OC_Util::getVersionString(),
-                       'edition' => \OC_Util::getEditionString(),
+                       'edition' => '',
                );
 
                $result['capabilities'] = $this->capabilitiesManager->getCapabilities();
index b5466b6fc05783ad293e046c628e9b156fed7d1c..6b9cd4061ed23bf9d28ed13bba32c880638cbfd6 100644 (file)
 
                        <a href="#" class="header-appname-container menutoggle" tabindex="2">
                                <h1 class="header-appname">
-                                       <?php
-                                               if(OC_Util::getEditionString() === '') {
-                                                       p(!empty($_['application'])?$_['application']: $l->t('Apps'));
-                                               } else {
-                                                       print_unescaped($theme->getHTMLName());
-                                               }
-                                       ?>
+                                       <?php p(!empty($_['application'])?$_['application']: $l->t('Apps')); ?>
                                </h1>
                                <div class="icon-caret"></div>
                        </a>
index d864e6d4dcb32049f54630e5a5e25a867d92290a..76c0b136c067a062283f6cfa1cec0b567bed84e9 100644 (file)
@@ -70,13 +70,7 @@ class OCSClient {
         * @return bool
         */
        public function isAppStoreEnabled() {
-               // For a regular edition default to true, all others default to false
-               $default = false;
-               if (\OC_Util::getEditionString() === '') {
-                       $default = true;
-               }
-
-               return $this->config->getSystemValue('appstoreenabled', $default) === true;
+               return $this->config->getSystemValue('appstoreenabled', true) === true;
        }
 
        /**
index d240687f9bd28f3fe572183c5f3fb3266d29e895..6f6508d314c2629a632338b56e8492aad161acab 100644 (file)
@@ -71,7 +71,7 @@ class VersionCheck {
                $version['installed'] = $this->config->getAppValue('core', 'installedat');
                $version['updated'] = $this->config->getAppValue('core', 'lastupdatedat');
                $version['updatechannel'] = \OC_Util::getChannel();
-               $version['edition'] = \OC_Util::getEditionString();
+               $version['edition'] = '';
                $version['build'] = \OC_Util::getBuild();
                $versionString = implode('x', $version);
 
index 1efd3bceb2384da72d326f169531634d2a502749..d964212f3bb5462c16bfc4c1210a9d09bd54a17d 100644 (file)
@@ -437,9 +437,7 @@ class OC_App {
 
                $settings = array();
                // by default, settings only contain the help menu
-               if (OC_Util::getEditionString() === '' &&
-                       \OC::$server->getSystemConfig()->getValue('knowledgebaseenabled', true) == true
-               ) {
+               if (\OC::$server->getSystemConfig()->getValue('knowledgebaseenabled', true)) {
                        $settings = array(
                                array(
                                        "id" => "help",
index 648be70cf0d0a580db9b046c480c015327050544..04dcb8fc896de6147f2c0cf6a492a09323b08088 100644 (file)
@@ -382,18 +382,11 @@ class OC_Util {
        }
 
        /**
-        * @description get the current installed edition of ownCloud. There is the community
-        * edition that just returns an empty string and the enterprise edition
-        * that returns "Enterprise".
+        * @deprecated the value is of no use anymore
         * @return string
         */
        public static function getEditionString() {
-               if (OC_App::isEnabled('enterprise_key')) {
-                       return "Enterprise";
-               } else {
-                       return "";
-               }
-
+               return '';
        }
 
        /**
index 3881952872fc76c8a097d2e001de36d1b92e15d7..d9e4846672c542b01e21fc5f8f0fecda2d4509a3 100644 (file)
@@ -174,19 +174,13 @@ class CheckSetupController extends Controller {
         * @return string
         */
        private function isUsedTlsLibOutdated() {
-               // Appstore is disabled by default in EE
-               $appStoreDefault = false;
-               if (\OC_Util::getEditionString() === '') {
-                       $appStoreDefault = true;
-               }
-
                // Don't run check when:
                // 1. Server has `has_internet_connection` set to false
                // 2. AppStore AND S2S is disabled
                if(!$this->config->getSystemValue('has_internet_connection', true)) {
                        return '';
                }
-               if(!$this->config->getSystemValue('appstoreenabled', $appStoreDefault)
+               if(!$this->config->getSystemValue('appstoreenabled', true)
                        && $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no'
                        && $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') {
                        return '';
@@ -200,7 +194,7 @@ class CheckSetupController extends Controller {
                }
 
                $features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing');
-               if(!$this->config->getSystemValue('appstoreenabled', $appStoreDefault)) {
+               if(!$this->config->getSystemValue('appstoreenabled', true)) {
                        $features = (string)$this->l10n->t('Federated Cloud Sharing');
                }
 
index a3ea87a89c66af43039720cbf287bede87654ecc..bbb47f48bab73fbb43f0a2eb18f1e80d8010780b 100644 (file)
@@ -157,12 +157,10 @@ if($_['passwordChangeSupported']) {
                        </option>
                <?php endforeach;?>
        </select>
-       <?php if (OC_Util::getEditionString() === ''): ?>
        <a href="https://www.transifex.com/nextcloud/nextcloud/"
                target="_blank" rel="noreferrer">
                <em><?php p($l->t('Help translate'));?></em>
        </a>
-       <?php endif; ?>
 </form>
 
 
@@ -181,7 +179,6 @@ if($_['passwordChangeSupported']) {
                         alt="<?php p($l->t('iOS app'));?>" />
        </a>
 
-       <?php if (OC_Util::getEditionString() === ''): ?>
                <p>
                        <?php print_unescaped($l->t('If you want to support the project
                <a href="https://nextcloud.com/contribute"
@@ -190,7 +187,6 @@ if($_['passwordChangeSupported']) {
                <a href="https://nextcloud.com/contribute"
                        target="_blank" rel="noreferrer">spread the word</a>!'));?>
                </p>
-       <?php endif; ?>
 
        <?php if(OC_APP::isEnabled('firstrunwizard')) {?>
                <p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>
index ccbd0b7df80005b838ea967fdacb6a45fc9c82e7..72d81d08cf5ad41b00cb62e4ba5d4cb243db191d 100644 (file)
@@ -1,4 +1,3 @@
-<?php if (OC_Util::getEditionString() === ''): ?>
        <p>
                <?php print_unescaped(str_replace(
                        [
@@ -63,5 +62,3 @@
 {newsletteropen}<img width="50" src="{mailimage}" title="{mailtext}" alt="{mailtext}">{linkclose}'
                )); ?>
        </p>
-
-<?php endif; ?>
index ed7287cb3173ffb680d786110088eb5d45ee4df4..e0db479d3e4bb05d755bce8fd3eed7b1bf962a03 100644 (file)
@@ -43,7 +43,7 @@ try {
                'maintenance' => $maintenance,
                'version'=>implode('.', \OCP\Util::getVersion()),
                'versionstring'=>OC_Util::getVersionString(),
-               'edition'=> $installed ? OC_Util::getEditionString() : '',
+               'edition'=> '',
                'productname'=>$defaults->getName());
        if (OC::$CLI) {
                print_r($values);
index e4f66b5d87957790789a406e18dcf85f9108e328..c465ee79ed16c8b663b2147edb921d3584ffaae5 100644 (file)
@@ -508,12 +508,6 @@ class CheckSetupControllerTest extends TestCase {
        }
 
        public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingEnabled() {
-               // Appstore is disabled by default in EE
-               $appStoreDefault = false;
-               if (\OC_Util::getEditionString() === '') {
-                       $appStoreDefault = true;
-               }
-
                $this->config
                        ->expects($this->at(0))
                        ->method('getSystemValue')
@@ -522,7 +516,7 @@ class CheckSetupControllerTest extends TestCase {
                $this->config
                        ->expects($this->at(1))
                        ->method('getSystemValue')
-                       ->with('appstoreenabled', $appStoreDefault)
+                       ->with('appstoreenabled', true)
                        ->will($this->returnValue(false));
                $this->config
                        ->expects($this->at(2))
@@ -543,12 +537,6 @@ class CheckSetupControllerTest extends TestCase {
        }
 
        public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingDisabled() {
-               // Appstore is disabled by default in EE
-               $appStoreDefault = false;
-               if (\OC_Util::getEditionString() === '') {
-                       $appStoreDefault = true;
-               }
-
                $this->config
                        ->expects($this->at(0))
                        ->method('getSystemValue')
@@ -557,7 +545,7 @@ class CheckSetupControllerTest extends TestCase {
                $this->config
                        ->expects($this->at(1))
                        ->method('getSystemValue')
-                       ->with('appstoreenabled', $appStoreDefault)
+                       ->with('appstoreenabled', true)
                        ->will($this->returnValue(false));
                $this->config
                        ->expects($this->at(2))
index fb43571ceceb3a722180519985cba871c9f3c4f2..5283ca9c555cd02abfc36c8ce7058d2d9c87bfee 100644 (file)
@@ -50,7 +50,7 @@ class VersionCheckTest extends \Test\TestCase {
         * @return string
         */
        private function buildUpdateUrl($baseUrl) {
-               return $baseUrl . '?version='.implode('x', Util::getVersion()).'xinstalledatxlastupdatedatx'.\OC_Util::getChannel().'x'.\OC_Util::getEditionString().'x';
+               return $baseUrl . '?version='.implode('x', Util::getVersion()).'xinstalledatxlastupdatedatx'.\OC_Util::getChannel().'xx';
        }
 
        public function testCheckInCache() {
index e45a9f082430ce318a6e8f8a3548f096821744d9..0c67a3f7433e1eab3a06e4a7762bc1f01a4f1b45 100644 (file)
@@ -61,7 +61,7 @@ class UpdaterTest extends \Test\TestCase {
         * @return string
         */
        private function buildUpdateUrl($baseUrl) {
-               return $baseUrl . '?version='.implode('x', \OCP\Util::getVersion()).'xinstalledatxlastupdatedatx'.\OC_Util::getChannel().'x'.\OC_Util::getEditionString().'x';
+               return $baseUrl . '?version='.implode('x', \OCP\Util::getVersion()).'xinstalledatxlastupdatedatx'.\OC_Util::getChannel().'xx';
        }
 
        /**