Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions apps/files_sharing/templates/public.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,7 @@

<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>

Expand Down
6 changes: 2 additions & 4 deletions core/Command/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ protected function configure() {
}

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);
Expand Down
2 changes: 1 addition & 1 deletion core/Controller/OCSController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getCapabilities() {
'minor' => $minor,
'micro' => $micro,
'string' => \OC_Util::getVersionString(),
'edition' => \OC_Util::getEditionString(),
'edition' => '',
);

$result['capabilities'] = $this->capabilitiesManager->getCapabilities();
Expand Down
8 changes: 1 addition & 7 deletions core/templates/layout.user.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,7 @@

<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>
Expand Down
8 changes: 1 addition & 7 deletions lib/private/OCSClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,7 @@ public function __construct(IClientService $httpClientService,
* @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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Updater/VersionCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function check() {
$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);

Expand Down
4 changes: 1 addition & 3 deletions lib/private/legacy/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,7 @@ public static function getSettingsNavigation() {

$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",
Expand Down
11 changes: 2 additions & 9 deletions lib/private/legacy/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,18 +382,11 @@ public static function getVersionString() {
}

/**
* @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 '';
}

/**
Expand Down
10 changes: 2 additions & 8 deletions settings/Controller/CheckSetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,13 @@ protected function getCurlVersion() {
* @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 '';
Expand All @@ -200,7 +194,7 @@ private function isUsedTlsLibOutdated() {
}

$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');
}

Expand Down
4 changes: 0 additions & 4 deletions settings/templates/personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,10 @@
</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>


Expand All @@ -181,7 +179,6 @@
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"
Expand All @@ -190,7 +187,6 @@
<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>
Expand Down
3 changes: 0 additions & 3 deletions settings/templates/settings.development.notice.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?php if (OC_Util::getEditionString() === ''): ?>
<p>
<?php print_unescaped(str_replace(
[
Expand Down Expand Up @@ -63,5 +62,3 @@
{newsletteropen}<img width="50" src="{mailimage}" title="{mailtext}" alt="{mailtext}">{linkclose}'
)); ?>
</p>

<?php endif; ?>
2 changes: 1 addition & 1 deletion status.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'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);
Expand Down
16 changes: 2 additions & 14 deletions tests/Settings/Controller/CheckSetupControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,6 @@ public function testIsUsedTlsLibOutdatedWithInternetDisabled() {
}

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')
Expand All @@ -522,7 +516,7 @@ public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSha
$this->config
->expects($this->at(1))
->method('getSystemValue')
->with('appstoreenabled', $appStoreDefault)
->with('appstoreenabled', true)
->will($this->returnValue(false));
$this->config
->expects($this->at(2))
Expand All @@ -543,12 +537,6 @@ public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSha
}

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')
Expand All @@ -557,7 +545,7 @@ public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSha
$this->config
->expects($this->at(1))
->method('getSystemValue')
->with('appstoreenabled', $appStoreDefault)
->with('appstoreenabled', true)
->will($this->returnValue(false));
$this->config
->expects($this->at(2))
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Updater/VersionCheckTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function setUp() {
* @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() {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/UpdaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function setUp() {
* @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';
}

/**
Expand Down