From: Bart Visscher Date: Tue, 27 Sep 2011 20:36:14 +0000 (+0200) Subject: Add flag in info.xml to control the apps that are installed by default X-Git-Tag: v3.0~134 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c6f78fbe43dbe3f6875b72b34592bde25fc78d0b;p=nextcloud-server.git Add flag in info.xml to control the apps that are installed by default --- diff --git a/apps/calendar/appinfo/info.xml b/apps/calendar/appinfo/info.xml index c846fc1eebc..6b1ecd2337f 100644 --- a/apps/calendar/appinfo/info.xml +++ b/apps/calendar/appinfo/info.xml @@ -7,4 +7,5 @@ Georg Ehrke (Userinterface), Jakob Sack 2 Calendar with CalDAV support + diff --git a/apps/contacts/appinfo/info.xml b/apps/contacts/appinfo/info.xml index 77c9dc91bfc..d18a19c3aea 100644 --- a/apps/contacts/appinfo/info.xml +++ b/apps/contacts/appinfo/info.xml @@ -7,4 +7,5 @@ Jakob Sack 2 Address book with CardDAV support. + diff --git a/apps/files_imageviewer/appinfo/info.xml b/apps/files_imageviewer/appinfo/info.xml index f3b5a67960e..00b55c254dd 100644 --- a/apps/files_imageviewer/appinfo/info.xml +++ b/apps/files_imageviewer/appinfo/info.xml @@ -7,4 +7,5 @@ AGPL Robin Appelman 2 - \ No newline at end of file + + diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml index 2fbb3300f69..abf847b4483 100644 --- a/apps/files_sharing/appinfo/info.xml +++ b/apps/files_sharing/appinfo/info.xml @@ -7,4 +7,5 @@ AGPL Michael Gapczynski 2 - \ No newline at end of file + + diff --git a/apps/files_textviewer/appinfo/info.xml b/apps/files_textviewer/appinfo/info.xml index 209b4140346..becfd5e35c8 100644 --- a/apps/files_textviewer/appinfo/info.xml +++ b/apps/files_textviewer/appinfo/info.xml @@ -6,4 +6,5 @@ AGPL Robin Appelman 2 + diff --git a/apps/media/appinfo/info.xml b/apps/media/appinfo/info.xml index 044abade53f..795c9a4dd71 100644 --- a/apps/media/appinfo/info.xml +++ b/apps/media/appinfo/info.xml @@ -7,4 +7,5 @@ AGPL Robin Appelman 2 - \ No newline at end of file + + diff --git a/apps/user_openid/appinfo/info.xml b/apps/user_openid/appinfo/info.xml index 32525009d61..332d2199dd3 100644 --- a/apps/user_openid/appinfo/info.xml +++ b/apps/user_openid/appinfo/info.xml @@ -7,4 +7,5 @@ AGPL Robin Appelman 2 - \ No newline at end of file + + diff --git a/lib/installer.php b/lib/installer.php index 9416a42c972..0febb2cab46 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -243,13 +243,14 @@ class OC_Installer{ * If $enabled is true, apps are installed as enabled. * If $enabled is false, apps are installed as disabled. */ - public static function installShippedApps( $enabled ){ + public static function installShippedApps(){ $dir = opendir( OC::$SERVERROOT."/apps" ); while( false !== ( $filename = readdir( $dir ))){ if( substr( $filename, 0, 1 ) != '.' and is_dir(OC::$SERVERROOT."/apps/$filename") ){ if( file_exists( OC::$SERVERROOT."/apps/$filename/appinfo/app.php" )){ if(!OC_Installer::isInstalled($filename)){ - OC_Installer::installShippedApp($filename); + $info = OC_Installer::installShippedApp($filename); + $enabled = isset($info['default_enable']); if( $enabled ){ OC_Appconfig::setValue($filename,'enabled','yes'); }else{ @@ -265,7 +266,7 @@ class OC_Installer{ /** * install an app already placed in the app folder * @param string $app id of the app to install - * @return bool + * @returns array see OC_App::getAppInfo */ public static function installShippedApp($app){ //install the database @@ -279,5 +280,6 @@ class OC_Installer{ } $info=OC_App::getAppInfo(OC::$SERVERROOT."/apps/$app/appinfo/info.xml"); OC_Appconfig::setValue($app,'installed_version',$info['version']); + return $info; } } diff --git a/lib/setup.php b/lib/setup.php index 7b205acd705..8d3079720cc 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -206,7 +206,7 @@ class OC_Setup { OC_User::login($username, $password); //guess what this does - OC_Installer::installShippedApps(true); + OC_Installer::installShippedApps(); //create htaccess files for apache hosts if (strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {