--- /dev/null
+<?php
+
+// touch shared directories to trigger one-time re-scan for all users
+$datadir = \OCP\Config::getSystemValue('datadirectory');
+$currentVersion=OC_Appconfig::getValue('files_sharing', 'installed_version');
+if (version_compare($currentVersion, '0.2.2', '<')) {
+ if ($handle = opendir($datadir)) {\r
+ while (false !== ($entry = readdir($handle))) {\r
+ $sharedFolder = $datadir.'/'.$entry.'/files/Shared';\r
+ if ($entry != "." && $entry != ".." && is_dir($sharedFolder)) {\r
+ touch($sharedFolder);\r
+ }\r
+ }\r
+ closedir($handle);\r
+ }
+}
\ No newline at end of file