From d4fd47d43f01f14f392e55dd0469ee58ca200729 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Thu, 6 Sep 2012 23:14:43 +0200
Subject: [PATCH] clear user filecache after the user mount configuration has
 changed

---
 lib/util.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/util.php b/lib/util.php
index 42a0f5c7df..1dcf7c2cbf 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -58,6 +58,13 @@ class OC_Util {
 						OC_Filesystem::mount($options['class'], $options['options'], $mountPoint);
 					}
 				}
+
+				$mtime=filemtime($user_root.'/mount.php');
+				$previousMTime=OC_Preferences::getValue($user,'files','mountconfigmtime',0);
+				if($mtime>$previousMTime){//mount config has changed, filecache needs to be updated
+					OC_FileCache::clear($user);
+					OC_Preferences::setValue($user,'files','mountconfigmtime',$mtime);
+				}
 			}
 			OC_Hook::emit('OC_Filesystem', 'setup', array('user' => $user, 'user_dir' => $user_dir));
 		}
-- 
GitLab