Changeset 13565

Show
Ignore:
Timestamp:
02/23/12 11:59:57 (1 year ago)
Author:
mbrevda
Message:

add support to apply configs after a Warm Spare restore; GUI to disbale registered trunks (not actually implemented yet)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.10/backup/bin/backup.php

    r13184 r13565  
    3131    backup_log(_('Intializing Backup') . ' ' .$vars['id']); 
    3232    $b->init(); 
    33          
    3433    if ($b->b['bu_server'] == "0") { 
    3534      //get lock to prevent backups from being run cuncurently 
     
    123122      $b->run_hooks('post-backup'); 
    124123       
     124      //disable registered trunks if requested 
     125      if ($b->b['diabletrunks'] == 'true') { 
     126        //TODO: do soemthing 
     127      } 
     128       
     129      //apply configs if requested 
     130      if ($b->b['applyconfigs'] == 'true') { 
     131        do_reload(); 
     132      }  
    125133      backup_log(_('Backup successfully completed!')); 
    126134    }  
  • modules/branches/2.10/backup/functions.inc/backup.php

    r13184 r13565  
    3737    case '': 
    3838      $ret = array( 
     39        'applyconfigs'    => '', 
    3940        'bu_server'     => '', 
    4041        'cron_dom'      => array(), 
     
    4950        'delete_time_type'  => '', 
    5051        'delete_time'   => 0, 
     52        'diabletrunks'    => '', 
    5153        'exclude'     => '', 
    5254        'host'        => '', 
     
    131133       
    132134      //ensure bool's are initialized 
    133       $ret['restore'] = isset($ret['restore']) ? $ret['restore'] : false; 
     135      $ret['restore']     = isset($ret['restore'])    ? $ret['restore'] : false; 
     136      $ret['applyconfigs']  = isset($ret['applyconfigs']) ? $ret['applyconfigs'] : false; 
     137      $ret['diabletrunks']  = isset($ret['diabletrunks']) ? $ret['diabletrunks'] : false; 
    134138       
    135139      //get items 
     
    220224      case 'prebu_hook': 
    221225      case 'prere_hook': 
     226        if ($value !== '') { 
     227          $data[] = array($var['id'],  $key, '', $value); 
     228        } 
     229        break; 
    222230      case 'restore': 
    223         //only save if we have a value 
    224         if ($value !== '') { 
     231        //only save if we have a value and we didnt select the local server 
     232        if ($value !== '' && $var['bu_server'] > 0) { 
     233          $data[] = array($var['id'],  $key, '', $value); 
     234        } 
     235        break; 
     236      case 'diabletrunks': 
     237      case 'applyconfigs': 
     238        //only save if we have a value, we didnt select the local server, and were doing a restore 
     239        if ($value !== '' && $var['bu_server'] > 0 && $var['restore'] == 'true') { 
    225240          $data[] = array($var['id'],  $key, '', $value); 
    226241        } 
  • modules/branches/2.10/backup/functions.inc/restore.php

    r13562 r13565  
    584584   
    585585} 
     586 
    586587?> 
  • modules/branches/2.10/backup/page.backup.php

    r12988 r13565  
    11<?php  
     2 
    23if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); } 
    34$get_vars = array( 
    45        'action'      => '', 
     6        'applyconfigs'    => '', 
    57        'bu_server'     => '', 
    68        'cron_dom'      => array(), 
     
    1517        'delete_time_type'  => '', 
    1618        'delete_time'   => '', 
     19        'diabletrunks'    => '', 
    1720        'display'     => '', 
    1821        'exclude'     => '', 
  • modules/branches/2.10/backup/views/backup/backup.php

    r13560 r13565  
    132132 
    133133//disbale trunks 
    134 $label = fpbx_label(_('Disable Registered trunks'),  
     134$label = fpbx_label(_('Disable Trunks'),  
    135135    'After a restore, disable any trunks that use registration. This is helpfull to ' 
    136136    . 'prevent the Primary sytem and the Standby systems from "fighting"  for the ' 
     
    147147 
    148148//apply configs 
    149 $label = fpbx_label(_('Apply Config after Restore'),  
     149$label = fpbx_label(_('Apply Configs'),  
    150150    'Equivalence of clicking the red button, will happen automatically after a restore on a Standby system'); 
    151151$data = array(