Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-10-16 17:30:29 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2015-10-26 11:53:04 +0300
commit6fc59f85b69af3ab6a8b979b7b6240cc4920efc7 (patch)
tree55c1de1372d91fec11d9f1abb35e72415a757b7d /lib/private/app.php
parent1f32a3e485e33c56c559fc8f354ab82b0e5f7736 (diff)
Store list of apps which cannot be disabled in shipped.json
Diffstat (limited to 'lib/private/app.php')
-rw-r--r--lib/private/app.php20
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index 718adcd25c1..a95019ac022 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -61,7 +61,6 @@ class OC_App {
static private $appTypes = array();
static private $loadedApps = array();
static private $altLogin = array();
- private static $shippedApps = null;
const officialApp = 200;
/**
@@ -223,18 +222,7 @@ class OC_App {
* Check if an app that is installed is a shipped app or installed from the appstore.
*/
public static function isShipped($appId) {
- if (is_null(self::$shippedApps)) {
- $shippedJson = \OC::$SERVERROOT . '/core/shipped.json';
- if (file_exists($shippedJson)) {
- self::$shippedApps = json_decode(file_get_contents($shippedJson), true);
- self::$shippedApps = self::$shippedApps['shippedApps'];
- } else {
- self::$shippedApps = ['files', 'encryption', 'files_external',
- 'files_sharing', 'files_trashbin', 'files_versions', 'provisioning_api',
- 'user_ldap', 'user_webdavauth'];
- }
- }
- return in_array($appId, self::$shippedApps);
+ return \OC::$server->getAppManager()->isShipped($appId);
}
/**
@@ -285,9 +273,6 @@ class OC_App {
* This function checks whether or not an app is enabled.
*/
public static function isEnabled($app) {
- if ('files' == $app) {
- return true;
- }
return \OC::$server->getAppManager()->isEnabledForUser($app);
}
@@ -368,9 +353,6 @@ class OC_App {
$app = self::getInternalAppIdByOcs($app);
}
- if($app === 'files') {
- throw new \Exception("files can't be disabled.");
- }
self::$enabledAppsCache = array(); // flush
// check if app is a shipped app or not. if not delete
\OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app));