Browse code

Install rls-presence tables too if the user chooses to install presence related tables

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2992 689a6050-402a-0410-94f2-e92a70836424

Dan Pascu authored on 26/10/2007 09:59:51
Showing 4 changed files
... ...
@@ -37,7 +37,7 @@ STANDARD_TABLES="version acc dbaliases lcr domain grp uri speed_dial gw pdt
37 37
 
38 38
 EXTRA_TABLES="imc_members imc_rooms cpl sip_trace domainpolicy"
39 39
 
40
-PRESENCE_TABLES="presentity active_watchers watchers xcap pua"
40
+PRESENCE_TABLES="presentity active_watchers watchers xcap pua rls_presentity rls_watchers"
41 41
 
42 42
 SERWEB_TABLES="active_sessions pending phonebook usr_preferences_types
43 43
 		server_monitoring server_monitoring_agg admin_privileges"
... ...
@@ -17,7 +17,7 @@ STANDARD_TABLES="version acc dbaliases lcr domain grp uri speed_dial gw pdt
17 17
 
18 18
 EXTRA_TABLES="imc_members imc_rooms cpl sip_trace domainpolicy"
19 19
 
20
-PRESENCE_TABLES="presentity active_watchers watchers xcap pua"
20
+PRESENCE_TABLES="presentity active_watchers watchers xcap pua rls_presentity rls_watchers"
21 21
 
22 22
 SERWEB_TABLES="active_sessions pending phonebook usr_preferences_types
23 23
 		server_monitoring server_monitoring_agg admin_privileges"
... ...
@@ -205,6 +205,13 @@ if [ $? -ne 0 ] ; then
205 205
 	exit 1
206 206
 fi
207 207
 
208
+sql_query $1 < $DB_SCHEMA/rls-create.sql
209
+
210
+if [ $? -ne 0 ] ; then
211
+	merr "Failed to create rls-presence tables!"
212
+	exit 1
213
+fi
214
+
208 215
 minfo "Presence tables succesfully created."
209 216
 }  # end presence_create
210 217
 
... ...
@@ -212,11 +212,19 @@ if [ $? -ne 0 ] ; then
212 212
 	exit 1
213 213
 fi
214 214
 
215
+sql_query "$1" < $DB_SCHEMA/rls-create.sql
216
+
217
+if [ $? -ne 0 ] ; then
218
+	merr "Failed to create rls-presence tables!"
219
+	exit 1
220
+fi
221
+
215 222
 sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE 	active_watchers, active_watchers_id_seq,
216 223
 		presentity, presentity_id_seq, watchers, watchers_id_seq, xcap,
217
-		xcap_id_seq, pua, pua_id_seq TO $DBRWUSER;
224
+		xcap_id_seq, pua, pua_id_seq, rls_presentity, rls_presentity_id_seq,
225
+		rls_watchers, rls_watchers_id_seq TO $DBRWUSER;
218 226
 		GRANT SELECT ON TABLE active_watchers, presentity, watchers, xcap,
219
-		pua TO $DBROUSER;"
227
+		pua, rls_presentity, rls_watchers TO $DBROUSER;"
220 228
 
221 229
 if [ $? -ne 0 ] ; then
222 230
 	merr "Grant privileges to presences tables failed!"