Changeset 13570
- Timestamp:
- 02/23/12 15:16:57 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.10/amp_conf/htdocs/admin/functions.inc.php
r13200 r13570 317 317 } 318 318 319 function do_reload( ) {319 function do_reload($passthru=false) { 320 320 global $amp_conf, $asterisk_conf, $db, $astman, $version; 321 $freepbx_conf =& freepbx_conf::create(); 322 323 $setting_pre_reload = $freepbx_conf->get_conf_setting('AMPMGRUSER', $passthru); 324 $setting_ampbin = $freepbx_conf->get_conf_setting('AMPBIN', $passthru); 325 $setting_post_reload = $freepbx_conf->get_conf_setting('POST_RELOAD', $passthru); 321 326 322 327 if (empty($version)) { … … 330 335 $exit_val = null; 331 336 332 if ( isset($amp_conf["PRE_RELOAD"]) && !empty($amp_conf['PRE_RELOAD'])) {333 exec( $ amp_conf["PRE_RELOAD"], $output, $exit_val );337 if ($setting_pre_reload) { 338 exec( $setting_pre_reload, $output, $exit_val ); 334 339 335 340 if ($exit_val != 0) { 336 341 $desc = sprintf(_("Exit code was %s and output was: %s"), $exit_val, "\n\n".implode("\n",$output)); 337 $notify->add_error('freepbx','reload_pre_script', sprintf(_('Could not run %s script.'), $ amp_conf['PRE_RELOAD']), $desc);342 $notify->add_error('freepbx','reload_pre_script', sprintf(_('Could not run %s script.'), $setting_pre_reload), $desc); 338 343 339 344 $return['num_errors']++; … … 343 348 } 344 349 345 $retrieve = $ amp_conf['AMPBIN'].'/retrieve_conf 2>&1';350 $retrieve = $setting_ampbin . '/retrieve_conf 2>&1'; 346 351 //exec($retrieve.'&>'.$asterisk_conf['astlogdir'].'/freepbx-retrieve.log', $output, $exit_val); 347 352 exec($retrieve, $output, $exit_val); … … 388 393 } 389 394 390 if ( isset($amp_conf["POST_RELOAD"]) && !empty($amp_conf['POST_RELOAD'])) {391 exec( $ amp_conf["POST_RELOAD"], $output, $exit_val );395 if ($setting_pre_reload) { 396 exec( $setting_pre_reload, $output, $exit_val ); 392 397 393 398 if ($exit_val != 0) { 394 399 $desc = sprintf(_("Exit code was %s and output was: %s"), $exit_val, "\n\n".implode("\n",$output)); 395 $notify->add_error('freepbx','reload_post_script', sprintf(_('Could not run %s script.'), 'POST_RELOAD'), $desc);400 $notify->add_error('freepbx','reload_post_script', sprintf(_('Could not run %s script.'), $setting_pre_reload), $desc); 396 401 397 402 $return['num_errors']++; freepbx/branches/2.10/amp_conf/htdocs/admin/libraries/freepbx_conf.class.php
r12810 r13570 522 522 * 523 523 * @param string The setting to fetch. 524 * @param boolean Optional forces the actual database variable to be fetched 524 525 * @return mixed returns the value of the setting, or boolean false if the 525 526 * setting does not exist. Since configuration booleans are … … 528 529 * not exist. 529 530 */ 530 function get_conf_setting($keyword) { 531 if (isset($this->db_conf_store[$keyword])) { 531 function get_conf_setting($keyword, $passthru=false) { 532 if ($passthru) { 533 // This is a special case situation, do I need to confirm if the setting 534 // actually exists so I can return a boolean false if not? 535 // 536 global $db; 537 $sql = "SELECT `value` FROM freepbx_settings WHERE `keyword` = '$keyword'"; 538 $value = $db->getOne($sql); 539 if (isset($this->db_conf_store[$keyword])) { 540 $this->db_conf_store[$keyword]['value'] = $value; 541 } 542 return $value; 543 } elseif (isset($this->db_conf_store[$keyword])) { 532 544 return $this->db_conf_store[$keyword]['value']; 533 545 } else {
