Changeset 14152
- Timestamp:
- 06/19/12 11:23:43 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.10/upgrades/2.10.1/migration.php
r12873 r14152 5 5 $freepbx_conf =& freepbx_conf::create(); 6 6 7 // TODO: remember to put these into beta 2 migration also, most of these may not have originally been in the alpha/beta1 migration stage 8 // 9 7 outn(_("removing deprecated Advanced settings if needed..")); 10 8 //depricated views 11 9 // 12 $freepbx_conf->remove_conf_settings('VIEW_FREEPBX');13 $freepbx_conf->remove_conf_settings('VIEW_FREEPBX_ADMIN');14 $freepbx_conf->remove_conf_settings('VIEW_FREEPBX_RELOAD');15 $freepbx_conf->remove_conf_settings('VIEW_FREEPBX_RELOADBAR');16 $freepbx_conf->remove_conf_settings('VIEW_UNAUTHORIZED');17 $freepbx_conf->remove_conf_settings('VIEW_LOGGEDOUT');18 $freepbx_conf->remove_conf_settings('VIEW_LOGGEDOUT');19 10 $freepbx_conf->remove_conf_settings('BRAND_FREEPBX_ALT_RIGHT'); 20 11 $freepbx_conf->remove_conf_settings('BRAND_IMAGE_FREEPBX_LINK_RIGHT'); 12 $freepbx_conf->remove_conf_settings('BRAND_HIDE_LOGO_RIGHT'); 13 $freepbx_conf->remove_conf_settings('BRAND_HIDE_HEADER_VERSION'); 14 $freepbx_conf->remove_conf_settings('BRAND_HIDE_HEADER_MENUS'); 15 $freepbx_conf->remove_conf_settings('AMPADMINLOGO'); 21 16 $freepbx_conf->remove_conf_settings('BRAND_IMAGE_HIDE_NAV_BACKGROUND'); 22 $freepbx_conf->remove_conf_settings('BRAND_HIDE_LOGO_RIGHT'); 23 $freepbx_conf->remove_conf_settings('BRAND_HIDE_HEADER_MENUS'); 24 $freepbx_conf->remove_conf_settings('BRAND_HIDE_HEADER_VERSION'); 25 $freepbx_conf->remove_conf_settings('VIEW_REPORTS'); 26 $freepbx_conf->remove_conf_settings('VIEW_PANEL'); 27 $freepbx_conf->remove_conf_settings('BRAND_IMAGE_FREEPBX_LEFT'); 17 $freepbx_conf->remove_conf_settings('BRAND_IMAGE_SHADOW_SIDE_BACKGROUND'); 18 $freepbx_conf->remove_conf_settings('BRAND_IMAGE_FREEPBX_RIGHT'); 19 $freepbx_conf->remove_conf_settings('BRAND_IMAGE_RELOAD_LOADING'); 28 20 29 21 //commit all settings 30 22 $freepbx_conf->commit_conf_settings(); 23 out(_("ok")); 31 24 32 / /settings33 global $amp_conf; 25 /* Check and add if necessary the writetimeout setting to the manager configuration 26 */ 34 27 35 $outdated = array( 36 $amp_conf['AMPWEBROOT'] . '_asterisk', 37 $amp_conf['AMPWEBROOT'] . '/admin/views/freepbx.php', 38 $amp_conf['AMPWEBROOT'] . '/admin/views/freepbx_admin.php', 39 $amp_conf['AMPWEBROOT'] . '/admin/views/freepbx_reload.php', 40 $amp_conf['AMPWEBROOT'] . '/admin/views/freepbx_reloadbar.php', 41 $amp_conf['AMPWEBROOT'] . '/admin/views/freepbx_footer.php', 42 $amp_conf['AMPWEBROOT'] . '/admin/views/unauthorized.php', 43 $amp_conf['AMPWEBROOT'] . '/admin/views/loggedout.php', 44 ); 28 // Read in manager.conf and strip out any #includes to avoid warnings 29 // 30 $orig_manager = file($amp_conf['ASTETCDIR'] . '/manager.conf'); 31 if (is_array($orig_manager) && !empty($orig_manager)) { 32 $manager = array(); 33 foreach ($orig_manager as $l) { 34 $tl = trim($l); 35 if ($tl[0] != '#') { 36 $manager[] = $l; 37 } 38 } 45 39 46 out("Cleaning up deprecated or moved files:"); 40 // check if we already have writetimeout by parsing as an ini file 41 // 42 $manager_ini = parse_ini_string(implode("", $manager), true); 43 unset($manager); 44 if (!isset($manager_ini[$amp_conf['AMPMGRUSER']]['writetimeout'])) { 45 out(_("writetimeout not present, adding")); 47 46 48 foreach ($outdated as $file) { 49 outn("Checking $file.."); 50 if (file_exists($file) && !is_link($file)) { 51 unlink($file) ? out("removed") : out("failed to remove"); 47 // add the setting right after the section heading 48 // 49 foreach ($orig_manager as $l) { 50 $new_manager[] = $l; 51 if (trim($l) == '[' . $amp_conf['AMPMGRUSER'] . ']') { 52 $new_manager[] = 'writetimeout = ' . $amp_conf['ASTMGRWRITETIMEOUT'] . "\n"; 53 } 54 } 55 if (file_put_contents($amp_conf['ASTETCDIR'] . '/manager.conf', $new_manager)) { 56 out(_("writetimeout added to manager.conf")); 57 } else { 58 out(_("an error occurred trying to write out manager.conf changes")); 59 } 60 unset($new_manager); 52 61 } else { 53 out( "Not Required");62 out(_("writetimeout already exists")); 54 63 } 64 unset($manager_ini); 65 } else { 66 out(_("Failed to read manager file to add writetimeout")); 55 67 } 56 ?> 68 unset($orig_manager); 69
