Changeset 5133 for trunk/expressoAdmin1_2/setup
- Timestamp:
- 11/03/11 13:24:14 (13 years ago)
- Location:
- trunk/expressoAdmin1_2/setup
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoAdmin1_2/setup/setup.inc.php
r4306 r5133 13 13 $setup_info['expressoAdmin1_2']['title'] = 'Expresso Admin'; 14 14 /* Ao incrementar versão, não esquecer de declarar função do tables_update.inc.php*/ 15 $setup_info['expressoAdmin1_2']['version'] = '2. 2.2';15 $setup_info['expressoAdmin1_2']['version'] = '2.0.006'; 16 16 $setup_info['expressoAdmin1_2']['app_order'] = 1; 17 17 $setup_info['expressoAdmin1_2']['tables'][] = 'phpgw_expressoadmin'; … … 20 20 $setup_info['expressoAdmin1_2']['tables'][] = 'phpgw_expressoadmin_log'; 21 21 $setup_info['expressoAdmin1_2']['tables'][] = 'phpgw_expressoadmin_samba'; 22 $setup_info['expressoAdmin1_2']['tables'][] = 'phpgw_expressoadmin_configuration'; 23 $setup_info['expressoAdmin1_2']['tables'][] = 'phpgw_expressoadmin_acls'; 22 24 $setup_info['expressoAdmin1_2']['enable'] = 1; 23 25 … … 35 37 $setup_info['expressoAdmin1_2']['depends'][] = array( 36 38 'appname' => 'phpgwapi', 37 'versions' => Array('2. 2')39 'versions' => Array('2.4.0') 38 40 ); 39 41 ?> -
trunk/expressoAdmin1_2/setup/tables_current.inc.php
r414 r5133 15 15 'manager_lid' => array('type' => 'varchar','precision' => 50,'nullable' => false), 16 16 'context' => array('type' => 'varchar','precision' => 255,'nullable' => false), 17 'acl' => array('type' => 'int','precision' => 8,'nullable' => false)17 'acl' => array('type' => 'int','precision' => 14,'nullable' => false) 18 18 ), 19 19 'pk' => array(), … … 68 68 'ix' => array(), 69 69 'uc' => array() 70 ), 71 72 'phpgw_expressoadmin_configuration' => array( 73 'fd' => array( 74 'id' => array( 'type' => 'int', 'precision' => 8), 75 'email_user' => array( 'type' => 'varchar', 'precision' => 100), 76 'configuration_type' => array( 'type' => 'varchar', 'precision' => 30), 77 'email_max_recipient' => array( 'type' => 'int', 'precision' => 8), 78 'email_user_type' => array( 'type' => 'varchar', 'precision' => 1), 79 'email_quota' => array( 'type' => 'int', 'precision' => 8), 80 'email_recipient' => array( 'type' => 'varchar', 'precision' => 50), 81 82 ), 83 'pk' => array('id'), 84 'fk' => array(), 85 'ix' => array(), 86 'uc' => array() 87 ), 88 89 'phpgw_expressoadmin_acls' => array( 90 'fd' => array( 91 'manager_lid' => array( 'type' => 'varchar', 'precision' => 50), 92 'context' => array( 'type' => 'varchar', 'precision' => 255), 93 'acl_name' => array( 'type' => 'varchar', 'precision' => 255) 94 ), 95 'pk' => array(), 96 'fk' => array(), 97 'ix' => array(), 98 'uc' => array() 99 ), 100 101 'phpgw_expressoadmin_configuration' => array( 102 'fd' => array( 103 'id' => array( 'type' => 'int', 'precision' => 8), 104 'email_user' => array( 'type' => 'varchar', 'precision' => 100), 105 'configuration_type' => array( 'type' => 'varchar', 'precision' => 30), 106 'email_max_recipient' => array( 'type' => 'int', 'precision' => 8), 107 'email_user_type' => array( 'type' => 'varchar', 'precision' => 1), 108 'email_quota' => array( 'type' => 'int', 'precision' => 8), 109 'email_recipient' => array( 'type' => 'varchar', 'precision' => 50), 110 111 ), 112 'pk' => array('id'), 113 'fk' => array(), 114 'ix' => array(), 115 'uc' => array() 116 ), 117 118 'phpgw_expressoadmin_acls' => array( 119 'fd' => array( 120 'manager_lid' => array( 'type' => 'varchar', 'precision' => 50), 121 'context' => array( 'type' => 'varchar', 'precision' => 255), 122 'acl_name' => array( 'type' => 'varchar', 'precision' => 255) 123 ), 124 'pk' => array(), 125 'fk' => array(), 126 'ix' => array(), 127 'uc' => array() 70 128 ) 71 129 ); -
trunk/expressoAdmin1_2/setup/tables_update.inc.php
r4306 r5133 9 9 * option) any later version. * 10 10 \**************************************************************************/ 11 // Since Expresso 1.2 using ExpressoAdmin 1.261 11 $test[] = '1.2'; 12 function expressoAdmin1_2_upgrade1_2() 13 { 14 $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '1.21'; 15 return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver']; 16 } 17 18 $test[] = '1.21'; 19 function expressoAdmin1_2_upgrade1_21() 20 { 21 $oProc = $GLOBALS['phpgw_setup']->oProc; 22 23 $oProc->CreateTable( 24 'phpgw_expressoadmin_samba', array( 25 'fd' => array( 26 'samba_domain_name' => array( 'type' => 'varchar', 'precision' => 50), 27 'samba_domain_sid' => array( 'type' => 'varchar', 'precision' => 100) 28 ), 29 'pk' => array('samba_domain_name'), 30 'fk' => array(), 31 'ix' => array(), 32 'uc' => array() 33 ) 34 ); 35 36 $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '1.240'; 37 return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver']; 38 } 39 40 $test[] = '1.240'; 41 function expressoAdmin1_2_upgrade1_240() 42 { 43 $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '1.250'; 44 return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver']; 45 } 46 47 $test[] = '1.250'; 48 function expressoAdmin1_2_upgrade1_250() 49 { 50 $GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_expressoadmin_log','','appinfo'); 51 $GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_expressoadmin_log','','groupinfo'); 52 $GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_expressoadmin_log','','msg'); 53 $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '1.261'; 54 return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver']; 55 } 56 12 57 $test[] = '1.261'; 13 58 function expressoAdmin1_2_upgrade1_261() … … 44 89 { 45 90 $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '2.0.005'; 91 //$GLOBALS['phpgw_setup']->db->query("alter table phpgw_expressoadmin_log drop groupinfo"); 92 //$GLOBALS['phpgw_setup']->db->query("alter table phpgw_expressoadmin_log drop appinfo"); 93 //$GLOBALS['phpgw_setup']->db->query("alter table phpgw_expressoadmin_log drop msg");/ 94 46 95 return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver']; 47 96 } 48 97 $test[] = '2.0.005'; 49 function expressoAdmin1_2_upgrade2_0_005() 50 { 51 $GLOBALS['phpgw_setup']->db->query("alter table phpgw_expressoadmin_log drop groupinfo"); 52 $GLOBALS['phpgw_setup']->db->query("alter table phpgw_expressoadmin_log drop appinfo"); 53 $GLOBALS['phpgw_setup']->db->query("alter table phpgw_expressoadmin_log drop msg"); 54 $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '2.1.000'; 55 return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver']; 56 } 57 $test[] = '2.1.000'; 58 function expressoAdmin1_2_upgrade2_1_000() 59 { 60 $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '2.2.000'; 61 return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver']; 62 } 63 $test[] = '2.2.000'; 64 function expressoAdmin1_2_upgrade2_2_000() 65 { 66 $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '2.2.1'; 67 return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver']; 68 } 69 $test[] = '2.2.1'; 70 function expressoAdmin1_2_upgrade2_2_1() 98 function expressoAdmin1_2_upgrade2_0_005() { 99 $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '2.0.006'; 100 $GLOBALS['phpgw_setup']->db->query(" 101 102 DROP SEQUENCE IF EXISTS seq_phpgw_expressoadmin_configuration; 103 CREATE SEQUENCE seq_phpgw_expressoadmin_configuration 104 INCREMENT 1 105 MINVALUE 1 106 MAXVALUE 9223372036854775807 107 START 93 108 CACHE 1; 109 ALTER TABLE seq_phpgw_expressoadmin_configuration OWNER TO ".$GLOBALS['phpgw_domain']['default']['db_user']."; 110 111 112 DROP TABLE IF EXISTS phpgw_expressoadmin_configuration; 113 CREATE TABLE phpgw_expressoadmin_configuration 114 ( 115 id integer NOT NULL DEFAULT nextval(('seq_phpgw_expressoadmin_configuration'::text)::regclass), 116 email_user character varying(100), 117 configuration_type character varying(30) NOT NULL, 118 email_max_recipient integer DEFAULT 0, 119 email_user_type character varying(1), 120 email_quota integer, 121 email_recipient character varying(50), 122 CONSTRAINT phpgw_expressoadmin_configuration_pkey PRIMARY KEY (id) 123 ) 124 WITH ( 125 OIDS=TRUE 126 ); 127 128 DROP INDEX IF EXISTS configuration_type_indice; 129 CREATE INDEX configuration_type_indice 130 ON phpgw_expressoadmin_configuration 131 USING btree 132 (configuration_type); 133 ALTER TABLE phpgw_expressoadmin_configuration CLUSTER ON configuration_type_indice; 134 135 DROP INDEX IF EXISTS email_user_indice; 136 CREATE INDEX email_user_indice 137 ON phpgw_expressoadmin_configuration 138 USING btree 139 (email_user); 140 ALTER TABLE phpgw_expressoadmin_configuration CLUSTER ON email_user_indice; 141 142 DROP TABLE IF EXISTS phpgw_expressoadmin_acls; 143 CREATE TABLE phpgw_expressoadmin_acls 144 ( 145 manager_lid character varying(50) NOT NULL, 146 context character varying(255) NOT NULL, 147 acl_name character varying(255) NOT NULL 148 ) 149 WITH ( 150 OIDS=TRUE 151 ); 152 ALTER TABLE phpgw_expressoadmin_acls OWNER TO ".$GLOBALS['phpgw_domain']['default']['db_user']."; 153 154 155 DROP INDEX IF EXISTS manager_lid_indice; 156 CREATE INDEX manager_lid_indice 157 ON phpgw_expressoadmin_acls 158 USING btree 159 (manager_lid); 160 ALTER TABLE phpgw_expressoadmin_acls CLUSTER ON manager_lid_indice; 161 162 163 "); 164 165 $GLOBALS['phpgw_setup']->db->query("SELECT * FROM phpgw_expressoadmin"); 166 $results = array(); 167 168 function safeBitCheck($number,$comparison) 169 { 170 $binNumber = base_convert($number,10,2); 171 $binComparison = strrev(base_convert($comparison,10,2)); 172 $str = strlen($binNumber); 173 174 if ( ($str <= strlen($binComparison)) && ($binComparison{$str-1}==="1") ) 175 return '1'; 176 else 177 return '0'; 178 } 179 180 function make_array_acl($acl) 181 { 182 183 $array_acl_tmp = array(); 184 $tmp = array( "acl_add_users", 185 "acl_edit_users", 186 "acl_delete_users", 187 "acl_EMPTY1", 188 "acl_add_groups", 189 "acl_edit_groups", 190 "acl_delete_groups", 191 "acl_change_users_password", 192 "acl_add_maillists", 193 "acl_edit_maillists", 194 "acl_delete_maillists", 195 "acl_EMPTY2", 196 "acl_create_sectors", 197 "acl_edit_sectors", 198 "acl_delete_sectors", 199 "acl_edit_sambausers_attributes", 200 "acl_view_global_sessions", 201 "acl_view_logs", 202 "acl_change_users_quote", 203 "acl_set_user_default_password", 204 "acl_create_computers", 205 "acl_edit_computers", 206 "acl_delete_computers", 207 "acl_rename_users", 208 "acl_edit_sambadomains", 209 "acl_view_users", 210 "acl_edit_email_groups", 211 "acl_empty_user_inbox", 212 "acl_manipulate_corporative_information", 213 "acl_edit_users_picture", 214 "acl_edit_scl_email_lists", 215 "acl_edit_users_phonenumber", 216 "acl_add_institutional_accounts", 217 "acl_edit_institutional_accounts", 218 "acl_remove_institutional_accounts", 219 "acl_add_shared_accounts", 220 "acl_edit_shared_accounts", 221 "acl_delete_shared_accounts", 222 "acl_edit_shared_accounts_acl", 223 "acl_edit_shared_accounts_quote", 224 "acl_empty_shared_accounts_inbox" 225 ); 226 227 foreach ($tmp as $index => $right) 228 { 229 $bin = ''; 230 for ($i=0; $i<$index; $i++) 231 { 232 $bin .= '0'; 233 } 234 $bin = '1' . $bin; 235 236 $array_acl[$right] = safeBitCheck(bindec($bin), $acl); 237 } 238 return $array_acl; 239 } 240 241 while($GLOBALS['phpgw_setup']->db->next_record()) 242 array_push($results, $GLOBALS['phpgw_setup']->db->row()); 243 244 foreach ($results as $result) 245 { 246 $manager_info = make_array_acl($result['acl']); 247 248 249 foreach ($manager_info as $info => $value) 250 { 251 $acl = strstr($info, 'acl_'); 252 253 if ($acl !== false) 71 254 { 72 $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '2.2.2'; 255 256 $fields = array( 257 'manager_lid' => $result['manager_lid'], 258 'context' => $result['context'], 259 'acl_name' => $info, 260 ); 261 262 263 $GLOBALS['phpgw_setup']->db->insert('phpgw_expressoadmin_acls', $fields); 264 265 } 266 267 } 268 269 } 270 73 271 return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver']; 74 272 }
Note: See TracChangeset
for help on using the changeset viewer.