From 98bc9160166e931ae1eec840277edbabaf9e40b7 Mon Sep 17 00:00:00 2001
From: Bart Visscher <bartv@thisnet.nl>
Date: Tue, 5 Jun 2012 17:51:41 +0200
Subject: [PATCH] Make check for writable apps dir configurable

Conflicts:

	config/config.sample.php
---
 config/config.sample.php | 5 +++++
 lib/util.php             | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/config/config.sample.php b/config/config.sample.php
index 2205ee1b47..21c728db44 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -31,6 +31,11 @@ $CONFIG = array(
 "loglevel" => "",
 "passwordsalt" => "",
 "updatechecker" => true,
+/* Set this to false to disable the check for writable apps dir.
+ * If the apps dir is not writable, you can't download&install extra apps
+ * in the admin apps menu.
+ */
+"writable_appsdir" => true,
 // "datadirectory" => ""
 );
 ?>
diff --git a/lib/util.php b/lib/util.php
index c47a7e5d84..1dd11e7b5c 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -29,7 +29,7 @@ class OC_Util {
 		}
 
 		// Check if apps folder is writable.
-		if(!is_writable(OC::$SERVERROOT."/apps/")) {
+		if(OC_Config::getValue('writable_appsdir', true) && !is_writable(OC::$SERVERROOT."/apps/")) {
 			$tmpl = new OC_Template( '', 'error', 'guest' );
 			$tmpl->assign('errors',array(1=>array('error'=>"Can't write into apps directory 'apps'",'hint'=>"You can usually fix this by giving the webserver user write access to the config directory in owncloud")));
 			$tmpl->printPage();
-- 
GitLab