3 # Usage: generate-folderinfo-sql-for-users user1 [user2] [user3] [...]
11 TIMEZONE="Canada/Eastern"
14 while [ "$1" != "" ]; do
16 USER_TABLE=`echo $USER_ID | tr -s [:punct:] _`
19 -- (C) 2004 SKYRIX Software AG
22 -- add a unique constraints on path
24 UPDATE SOGo_folder_info
25 SET c_acl_location = 'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_acl'
26 WHERE c_folder_type = 'Container'
27 AND c_path2 = '${USER_ID}';
28 UPDATE SOGo_folder_info
29 SET c_acl_location = 'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_contacts_acl'
30 WHERE c_folder_type = 'Contact'
31 AND c_path2 = '${USER_ID}';
32 UPDATE SOGo_folder_info
33 SET c_acl_location = 'http://${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}/SOGo_${USER_TABLE}_privcal_acl'
34 WHERE c_folder_type = 'Appointment'
35 AND c_path2 = '${USER_ID}';
37 DROP TABLE SOGo_${USER_TABLE}_acls;
38 DROP TABLE SOGo_${USER_TABLE}_privcal_acls;
39 DROP TABLE SOGo_${USER_TABLE}_contacts_acls;
41 DROP TABLE SOGo_${USER_TABLE}_acl;
42 DROP TABLE SOGo_${USER_TABLE}_privcal_acl;
43 DROP TABLE SOGo_${USER_TABLE}_contacts_acl;
45 CREATE TABLE SOGo_${USER_TABLE}_acl (
46 c_uid VARCHAR(256) NOT NULL,
47 c_object VARCHAR(256) NOT NULL,
48 c_role VARCHAR(80) NOT NULL
51 CREATE TABLE SOGo_${USER_TABLE}_privcal_acl (
52 c_uid VARCHAR(256) NOT NULL,
53 c_object VARCHAR(256) NOT NULL,
54 c_role VARCHAR(80) NOT NULL
57 CREATE TABLE SOGo_${USER_TABLE}_contacts_acl (
58 c_uid VARCHAR(256) NOT NULL,
59 c_object VARCHAR(256) NOT NULL,
60 c_role VARCHAR(80) NOT NULL