Changeset 13170

Show
Ignore:
Timestamp:
01/07/12 12:40:18 (1 year ago)
Author:
p_lindheimer
Message:

[Auto Check-in of any outstanding changes in fw_fop]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.10/fw_fop/functions.inc.php

    r13091 r13170  
    1818  switch($engine) { 
    1919    case "asterisk": 
    20       fw_fop_retrieve_op_conf_from_mysql(); 
     20      $result = fw_fop_retrieve_op_conf_from_mysql(); 
    2121 
    2222      // TODO: This used to be done in the POST_RELOAD space after reload was successful and there was likely 
     
    2727      unset($output); 
    2828      exec('killall -HUP op_server.pl 2>&1', $output, $exit_val); 
    29       if ($exit_val != 0) { 
    30         $desc = _('Could not reload the FOP operator panel server using killall -HUP op_server.pl. Configuration changes may not be reflected in the panel display. If the FOP module was just installed you may have to retart Asterisk with the "amportal restart" command for the FOP server to run.'); 
    31         $nt->add_error('freepbx','reload_fop', _('Could not reload FOP server'), $desc); 
    32         // send the error output to dbug log if enabled. 
     29      if ($result) { 
     30        if ($exit_val != 0) { 
     31          $desc = _('Could not reload the FOP operator panel server using killall -HUP op_server.pl. Configuration changes may not be reflected in the panel display. If the FOP module was just installed you may have to retart Asterisk with the "amportal restart" command for the FOP server to run.'); 
     32          $nt->add_error('freepbx','reload_fop', _('Could not reload FOP server'), $desc); 
     33          // send the error output to dbug log if enabled. 
     34        } else { 
     35          $nt->delete('fw_fop','reload_fop'); 
     36        } 
    3337      } else { 
    34         $nt->delete('freepbx','reload_fop'); 
     38        $nt->delete('fw_fop','reload_fop'); // clean this up either way 
     39        $desc = _('An error occured trying to configure FOP. There may be a conflict with another module or there may be permission problems. Check the FreePBX log for more details.'); 
     40        $nt->add_error('fw_fop','configuration', _('FOP Could Not Be Configured'), $desc, "", false, true); 
    3541      } 
    3642    break; 
     
    5763global $db; 
    5864global $chan_dahdi; 
     65 
     66// If another module such as isymphony has been loaded and "taken control" then this will fail 
     67// so detect here, log the error and don't bother! 
     68// 
     69$fopwebroot = $amp_conf['AMPWEBROOT'] . '/admin/modules/fw_fop'; 
     70if ($amp_conf['FOPWEBROOT'] != $fopwebroot) { 
     71  freepbx_log(FPBX_LOG_CRITICAL, _("fw_fop is NOT confgured as your Operator Panel, attempting to disable, FOPWEBROOT: $fopwebroot.")); 
     72  out(_("fw_fop is NOT confgured as your Operator Panel, FOPWEBROOT: $fopwebroot.")); 
     73  outn(_("disabling fw_fop..")); 
     74  if (is_array($errors = module_disable('fw_fop'))) { 
     75    out(_("The following error(s) occured:")); 
     76    foreach ($errors as $error) { 
     77      out(" - $error"); 
     78    } 
     79  } else { 
     80    out(_("disabled")); 
     81  } 
     82  return false; 
     83} 
    5984 
    6085$zapataconfdir = $amp_conf['ASTETCDIR']."/"; 
     
    190215 
    191216$fhandle = fopen($op_conf,"w" ); 
    192 if ($fhandle === false) {die("Cannot create/overwrite config file: $op_conf \n");} 
     217if ($fhandle === false) { 
     218  out(sprintf(_("fw_fop cannot create/overwrite config file: %s"), $op_conf)); 
     219  freepbx_log(FPBX_LOG_CRITICAL, _("fw_fop failed to create/overwrite config file $op_conf.")); 
     220  return false; 
     221
    193222fwrite($fhandle, $warning_banner); 
    194223 
     
    595624 
    596625} 
     626return true; 
    597627 
    598628} // function fw_fop_retrieve_op_conf_from_mysql() 
  • modules/branches/2.10/fw_fop/install.php

    r13091 r13170  
    2121global $amp_conf; 
    2222global $asterisk_conf; 
     23global $db; 
    2324 
    2425$freepbx_conf =& freepbx_conf::create(); 
     
    8081 
    8182$freepbx_conf->set_conf_values(array('FOPWEBROOT' => $fopwebroot), true, true); 
     83 
     84// Clean up old notification categorized under freepbx since it is now fw_fop 
     85// 
     86$nt = notifications::create($db); 
     87$nt->delete('freepbx','reload_fop'); 
    8288?> 
  • modules/branches/2.10/fw_fop/module.xml

    r12878 r13170  
    33  <repo>unsupported</repo> 
    44  <name>FreePBX FOP Framework</name> 
    5   <version>2.10.0.1</version> 
     5  <version>2.10.0.2</version> 
    66  <publisher>FreePBX</publisher> 
    77  <license>GPLv2+</license> 
     
    1010  </menuitems> 
    1111  <changelog> 
     12    *2.10.0.2* #5496 
    1213    *2.10.0.1* fix for fw_fop_parse_zapata 
    1314    *2.10.0.0* upgrade xml info, category, support info