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
5 changes: 0 additions & 5 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,6 @@
* Options for the Apps folder, Apps store, and App code checker.
*/

/**
* When enabled, admins may install apps from the ownCloud app store.
*/
'appstoreenabled' => true,

/**
* The URL of the appstore to use.
*/
Expand Down
4 changes: 0 additions & 4 deletions lib/private/legacy/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,6 @@ private static function proceedNavigation($list) {
* @return string|false
*/
public static function getInstallPath() {
if (\OC::$server->getSystemConfig()->getValue('appstoreenabled', true) == false) {
return false;
}

foreach (OC::$APPSROOTS as $dir) {
if (isset($dir['writable']) && $dir['writable'] === true) {
return $dir['path'];
Expand Down
15 changes: 2 additions & 13 deletions settings/Controller/CheckSetupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,35 +147,24 @@ protected function getCurlVersion() {
* @return string
*/
private function isUsedTlsLibOutdated() {
// Appstore is disabled by default in EE
$appStoreDefault = false;
if (\OC_Util::getEditionString() === \OC_Util::EDITION_COMMUNITY) {
$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)
&& $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no'
if($this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'no'
&& $this->config->getAppValue('files_sharing', 'incoming_server2server_share_enabled', 'yes') === 'no') {
return '';
}

$versionString = $this->getCurlVersion();
if(isset($versionString['ssl_version'])) {
$versionString = $versionString['ssl_version'];
} else {
return '';
}

$features = (string)$this->l10n->t('installing and updating apps via the app store or Federated Cloud Sharing');
if(!$this->config->getSystemValue('appstoreenabled', $appStoreDefault)) {
$features = (string)$this->l10n->t('Federated Cloud Sharing');
}
$features = (string)$this->l10n->t('installing and updating apps via the market or Federated Cloud Sharing');

// Check if at least OpenSSL after 1.01d or 1.0.2b
if(strpos($versionString, 'OpenSSL/') === 0) {
Expand Down
3 changes: 1 addition & 2 deletions settings/Panels/Admin/Apps.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ public function getPriority() {

public function getPanel() {
$tmpl = new Template('settings', 'panels/admin/apps');
$tmpl->assign('appstoreEnabled', $this->config->getSystemValue('appstoreenabled', true));
return $tmpl;
}

public function getSectionID() {
return 'apps';
}

}
}
8 changes: 3 additions & 5 deletions settings/templates/panels/admin/apps.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
</li>
{{/each}}

<?php if($_['appstoreEnabled']): ?>
<li>
<a class="app-external" target="_blank" rel="noreferrer" href="https://owncloud.org/dev"><?php p($l->t('Developer documentation'));?> ↗</a>
</li>
<?php endif; ?>
<li>
<a class="app-external" target="_blank" rel="noreferrer" href="https://owncloud.org/dev"><?php p($l->t('Developer documentation'));?> ↗</a>
</li>
</script>

<script id="app-template" type="text/x-handlebars">
Expand Down
43 changes: 5 additions & 38 deletions tests/Settings/Controller/CheckSetupControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,20 +406,7 @@ public function testIsUsedTlsLibOutdatedWithOlderOpenSsl() {
->expects($this->once())
->method('getCurlVersion')
->will($this->returnValue(['ssl_version' => 'OpenSSL/1.0.1c']));
$this->assertSame('cURL is using an outdated OpenSSL version (OpenSSL/1.0.1c). Please update your operating system or features such as installing and updating apps via the app store or Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
}

public function testIsUsedTlsLibOutdatedWithOlderOpenSslAndWithoutAppstore() {
$this->config
->expects($this->at(0))
->method('getSystemValue')
->with('has_internet_connection', true)
->will($this->returnValue(true));
$this->checkSetupController
->expects($this->once())
->method('getCurlVersion')
->will($this->returnValue(['ssl_version' => 'OpenSSL/1.0.1c']));
$this->assertSame('cURL is using an outdated OpenSSL version (OpenSSL/1.0.1c). Please update your operating system or features such as Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
$this->assertSame('cURL is using an outdated OpenSSL version (OpenSSL/1.0.1c). Please update your operating system or features such as installing and updating apps via the market or Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
}

public function testIsUsedTlsLibOutdatedWithOlderOpenSsl1() {
Expand All @@ -430,7 +417,7 @@ public function testIsUsedTlsLibOutdatedWithOlderOpenSsl1() {
->expects($this->once())
->method('getCurlVersion')
->will($this->returnValue(['ssl_version' => 'OpenSSL/1.0.2a']));
$this->assertSame('cURL is using an outdated OpenSSL version (OpenSSL/1.0.2a). Please update your operating system or features such as installing and updating apps via the app store or Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
$this->assertSame('cURL is using an outdated OpenSSL version (OpenSSL/1.0.2a). Please update your operating system or features such as installing and updating apps via the market or Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
}

public function testIsUsedTlsLibOutdatedWithMatchingOpenSslVersion() {
Expand Down Expand Up @@ -485,7 +472,7 @@ public function testIsBuggyNss400() {
->method('newClient')
->will($this->returnValue($client));

$this->assertSame('cURL is using an outdated NSS version (NSS/1.0.2b). Please update your operating system or features such as installing and updating apps via the app store or Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
$this->assertSame('cURL is using an outdated NSS version (NSS/1.0.2b). Please update your operating system or features such as installing and updating apps via the market or Federated Cloud Sharing will not work reliably.', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
}


Expand Down Expand Up @@ -532,11 +519,6 @@ public function testIsUsedTlsLibOutdatedWithInternetDisabled() {
}

public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingEnabled() {
// Appstore is disabled by default in EE
$appStoreDefault = false;
if (\OC_Util::getEditionString() === \OC_Util::EDITION_COMMUNITY) {
$appStoreDefault = true;
}

$this->config
->expects($this->at(0))
Expand All @@ -545,16 +527,11 @@ public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSha
->will($this->returnValue(true));
$this->config
->expects($this->at(1))
->method('getSystemValue')
->with('appstoreenabled', $appStoreDefault)
->will($this->returnValue(false));
$this->config
->expects($this->at(2))
->method('getAppValue')
->with('files_sharing', 'outgoing_server2server_share_enabled', 'yes')
->will($this->returnValue('no'));
$this->config
->expects($this->at(3))
->expects($this->at(2))
->method('getAppValue')
->with('files_sharing', 'incoming_server2server_share_enabled', 'yes')
->will($this->returnValue('yes'));
Expand All @@ -567,11 +544,6 @@ public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSha
}

public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSharingDisabled() {
// Appstore is disabled by default in EE
$appStoreDefault = false;
if (\OC_Util::getEditionString() === \OC_Util::EDITION_COMMUNITY) {
$appStoreDefault = true;
}

$this->config
->expects($this->at(0))
Expand All @@ -580,16 +552,11 @@ public function testIsUsedTlsLibOutdatedWithAppstoreDisabledAndServerToServerSha
->will($this->returnValue(true));
$this->config
->expects($this->at(1))
->method('getSystemValue')
->with('appstoreenabled', $appStoreDefault)
->will($this->returnValue(false));
$this->config
->expects($this->at(2))
->method('getAppValue')
->with('files_sharing', 'outgoing_server2server_share_enabled', 'yes')
->will($this->returnValue('no'));
$this->config
->expects($this->at(3))
->expects($this->at(2))
->method('getAppValue')
->with('files_sharing', 'incoming_server2server_share_enabled', 'yes')
->will($this->returnValue('no'));
Expand Down
1 change: 0 additions & 1 deletion tests/Settings/Panels/Admin/AppsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function testGetPriority() {
}

public function testGetPanel() {
$this->config->expects($this->once())->method('getSystemValue')->with('appstoreenabled', true)->willReturn(true);
$templateHtml = $this->panel->getPanel()->fetchPage();
$this->assertContains('<div id="apps-list" class="icon-loading"></div>', $templateHtml);
}
Expand Down
5 changes: 0 additions & 5 deletions tests/lib/InstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,15 @@
class InstallerTest extends TestCase {

private static $appid = 'testapp';
private $appstore;

protected function setUp() {
parent::setUp();

$config = \OC::$server->getConfig();
$this->appstore = $config->setSystemValue('appstoreenabled', true);
$config->setSystemValue('appstoreenabled', true);
Installer::removeApp(self::$appid);
}

protected function tearDown() {
Installer::removeApp(self::$appid);
\OC::$server->getConfig()->setSystemValue('appstoreenabled', $this->appstore);

parent::tearDown();
}
Expand Down
1 change: 0 additions & 1 deletion tests/lib/UtilCheckServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class UtilCheckServerTest extends \Test\TestCase {
*/
protected function getConfig($systemOptions) {
$systemOptions['datadirectory'] = $this->datadir;
$systemOptions['appstoreenabled'] = false; //it's likely that there is no app folder we can write in
$config = $this->getMockBuilder('\OCP\IConfig')
->disableOriginalConstructor()
->getMock();
Expand Down
4 changes: 3 additions & 1 deletion tests/preseed-config.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
$CONFIG = [
'appstoreenabled' => false,
'apps_paths' => [
[
'path' => OC::$SERVERROOT . '/apps',
Expand All @@ -18,3 +17,6 @@
'writable' => false,
];
}
if (getenv("TC") === "selenium") {
$CONFIG['skeletondirectory'] = OC::$SERVERROOT . '/tests/ui/skeleton';
}