From 1cfa911ce38a22788fae73e0770156263fdc03e5 Mon Sep 17 00:00:00 2001
From: Michael Gapczynski <GapczynskiM@gmail.com>
Date: Wed, 20 Jul 2011 14:42:48 -0400
Subject: [PATCH] Update database.xml to current database fields, remove hard
 coded MTGap when mounting shared storage provider

---
 .../appinfo/.database.xml.kate-swp            | Bin 0 -> 34 bytes
 apps/files_sharing/appinfo/database.xml       |  24 +++++++-----------
 lib/base.php                                  |   4 +--
 3 files changed, 11 insertions(+), 17 deletions(-)
 create mode 100644 apps/files_sharing/appinfo/.database.xml.kate-swp

diff --git a/apps/files_sharing/appinfo/.database.xml.kate-swp b/apps/files_sharing/appinfo/.database.xml.kate-swp
new file mode 100644
index 0000000000000000000000000000000000000000..f2127b00c76b8bd8d4d04cf340cdc6aa023a544f
GIT binary patch
literal 34
pcmZQzV36@nEJ;-eE>A2_aLdd|RnS!kOD!tS%+FIW)H4Wn1pu6)36}r>

literal 0
HcmV?d00001

diff --git a/apps/files_sharing/appinfo/database.xml b/apps/files_sharing/appinfo/database.xml
index bb80484bd6..3378b6b09e 100644
--- a/apps/files_sharing/appinfo/database.xml
+++ b/apps/files_sharing/appinfo/database.xml
@@ -8,40 +8,34 @@
 		<name>*dbprefix*sharing</name>
 		<declaration>
 			<field>
-				<name>item</name>
+				<name>uid_owner</name>
 				<type>text</type>
 				<notnull>true</notnull>
-				<length>128</length>
+				<length>64</length>
 			</field>
 			<field>
-				<name>source</name>
+				<name>uid_shared_with</name>
 				<type>text</type>
 				<notnull>true</notnull>
-				<length>128</length>
+				<length>64</length>
 			</field>
 			<field>
-				<name>target</name>
+				<name>source</name>
 				<type>text</type>
 				<notnull>true</notnull>
 				<length>128</length>
 			</field>
 			<field>
-				<name>uid_owner</name>
+				<name>target</name>
 				<type>text</type>
 				<notnull>true</notnull>
-				<length>64</length>
+				<length>128</length>
 			</field>
 			<field>
-				<name>uid_shared_with</name>
-				<type>text</type>
-				<notnull>true</notnull>
-				<length>64</length>
-			 </field>
-			 <field>
 				<name>permissions</name>
-				<type>text</type>
+				<type>integer</type>
 				<notnull>true</notnull>
-				<length>3</length>
+				<length>1</length>
 			 </field>
 		</declaration>
 	</table>
diff --git a/lib/base.php b/lib/base.php
index d369b392a4..9218861ed5 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -166,8 +166,8 @@ class OC_UTIL {
 			OC_FILESYSTEM::mount($rootStorage,'/');
 
 			// TODO add this storage provider in a proper way
-			$sharedStorage = OC_FILESYSTEM::createStorage('shared',array('datadir'=>'/MTGap/files/Share/'));
-			OC_FILESYSTEM::mount($sharedStorage,'MTGap/files/Share/');
+			$sharedStorage = OC_FILESYSTEM::createStorage('shared',array('datadir'=>'/'.$_SESSION['user_id'].'/files/Share/'));
+			OC_FILESYSTEM::mount($sharedStorage,'/'.$_SESSION['user_id'].'/files/Share/');
 			
 			$CONFIG_DATADIRECTORY = "$CONFIG_DATADIRECTORY_ROOT/$user/$root";
 			if( !is_dir( $CONFIG_DATADIRECTORY )){
-- 
GitLab