Changeset 11010
- Timestamp:
- 01/18/11 15:53:25 (2 years ago)
- Files:
-
- freepbx/trunk/amp_conf/htdocs/admin/libraries/freepbx_conf.class.php (modified) (13 diffs)
- freepbx/trunk/amp_conf/htdocs/admin/views/freepbx.php (modified) (1 diff)
- freepbx/trunk/libfreepbx.install.php (modified) (75 diffs)
- modules/branches/2.9/core/advancedsettings.js (modified) (1 diff)
- modules/branches/2.9/core/page.advancedsettings.php (modified) (2 diffs)
- modules/branches/2.9/dashboard/install.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/trunk/amp_conf/htdocs/admin/libraries/freepbx_conf.class.php
r11008 r11010 4 4 define("CONF_TYPE_DIR", 'dir'); 5 5 define("CONF_TYPE_INT", 'int'); 6 define("CONF_TYPE_UINT", 'uint');7 6 define("CONF_TYPE_SELECT", 'select'); 8 7 … … 25 24 'AMPDBNAME' => array(CONF_TYPE_TEXT, 'asterisk'), 26 25 'AMPENGINE' => array(CONF_TYPE_SELECT, 'asterisk'), 27 'ASTMANAGERPORT' => array(CONF_TYPE_ UINT, '5038'),26 'ASTMANAGERPORT' => array(CONF_TYPE_INT, '5038'), 28 27 'ASTMANAGERHOST' => array(CONF_TYPE_TEXT, 'localhost'), 29 28 'AMPDBHOST' => array(CONF_TYPE_TEXT, 'localhost'), … … 34 33 'FOPPASSWORD' => array(CONF_TYPE_TEXT, 'passw0rd'), 35 34 'FOPSORT' => array(CONF_TYPE_SELECT, 'extension'), 36 'AMPSYSLOGLEVEL '=> array(CONF_TYPE_ UINT, 'LOG_ERR'),37 'NOOPTRACE' => array(CONF_TYPE_ UINT, '1'),35 'AMPSYSLOGLEVEL '=> array(CONF_TYPE_INT, 'LOG_ERR'), 36 'NOOPTRACE' => array(CONF_TYPE_INT, '1'), 38 37 'ARI_ADMIN_PASSWORD' => array(CONF_TYPE_TEXT, 'ari_password'), 39 38 'CFRINGTIMERDEFAULT' => array(CONF_TYPE_SELECT, '0'), … … 77 76 78 77 // Time Conditions (2.9 New) 79 'TCINTERVAL' => array(CONF_TYPE_ UINT, '60'),78 'TCINTERVAL' => array(CONF_TYPE_INT, '60'), 80 79 'TCMAINT' => array(CONF_TYPE_BOOL, true), 81 80 … … 98 97 var $parsed_from_db = false; 99 98 var $amportal_canwrite; 99 100 // This will be set with any update/define to provide feedback that can be optionally used inside or outside of 101 // the class. The structure should be: 102 // $last_update_status[$keyword]['validated'] true/false 103 // $last_update_status[$keyword]['saved'] true/false 104 // $last_update_status[$keyword]['orig_value'] value submitted 105 // $last_update_status[$keyword]['saved_value'] value submitted 106 // $last_update_status[$keyword]['msg'] error message 107 var $last_update_status; 108 109 // Internal reference pointer to the internal $last_update_status[$keyword] 110 // e.g. $this->_last_update_status =& $last_update_status[$keyword]; 111 // 112 var $_last_update_status; 113 100 114 101 115 // access should always be through create so only one copy is ever running … … 123 137 die_freepbx(_('fatal error reading freepbx_settings')); 124 138 } 139 unset($this->last_update_status); 125 140 foreach($db_raw as $setting) { 141 $this->last_update_status[$setting['keyword']]['validated'] = false; 142 $this->last_update_status[$setting['keyword']]['saved'] = false; 143 $this->last_update_status[$setting['keyword']]['orig_value'] = $setting['value']; 144 $this->last_update_status[$setting['keyword']]['saved_value'] = $setting['value']; 145 $this->last_update_status[$setting['keyword']]['msg'] = ''; 146 $this->_last_update_status =& $this->last_update_status[$setting['keyword']]; 147 126 148 $this->db_conf_store[$setting['keyword']] = $setting; 127 149 $this->db_conf_store[$setting['keyword']]['modified'] = false; … … 129 151 // note the reference assignment, if it's actually the authoritative source 130 152 $this->conf[$setting['keyword']] =& $this->db_conf_store[$setting['keyword']]['value']; 153 154 // The assumption is that the database settings were validated on input. We are not going to throw errors when 155 // reading them back but the last_update_status array is available for debugging purposes to review. 156 // 131 157 if (!$setting['emptyok'] && $setting['value'] == '') { 132 $this->db_conf_store[$setting['keyword']]['value'] = $this->_prepare_conf_value($setting[' value'], $setting['type'], $setting['defaultval']);158 $this->db_conf_store[$setting['keyword']]['value'] = $this->_prepare_conf_value($setting['defaultval'], $setting['type'], $setting['emptyok'], $setting['options']); 133 159 } else { 134 $this->db_conf_store[$setting['keyword']]['value'] = $this->_prepare_conf_value($setting['value'], $setting['type'], $setting['emptyok'] );160 $this->db_conf_store[$setting['keyword']]['value'] = $this->_prepare_conf_value($setting['value'], $setting['type'], $setting['emptyok'], $setting['options']); 135 161 } 136 162 } … … 301 327 } 302 328 329 function get_last_update_status() { 330 return $this->last_update_status; 331 } 332 303 333 // used to insert or update an existing setting such as in an install 304 334 // script. $vars will include some required fields and we are strict … … 311 341 // different then the initial value??? 312 342 // 343 313 344 function define_conf_setting($keyword,$vars,$commit=false) { 314 345 global $amp_conf; 346 347 unset($this->last_update_status); 348 $this->last_update_status[$keyword]['validated'] = false; 349 $this->last_update_status[$keyword]['saved'] = false; 350 $this->last_update_status[$keyword]['orig_value'] = $vars['value']; 351 $this->last_update_status[$keyword]['saved_value'] = $vars['value']; 352 $this->last_update_status[$keyword]['msg'] = ''; 353 354 $this->_last_update_status =& $this->last_update_status[$keyword]; 355 315 356 $attributes = array( 316 357 'keyword' => '', … … 336 377 die_freepbx(sprintf(_("missing value and/or defaultval required for [%s]"),$keyword)); 337 378 } else { 338 // validate even if already set, catches coding errors early even though we don't use it339 $value = $this->_prepare_conf_value($vars['value'], $vars['type'] ,$vars['emptyok']);340 $attributes['value'] = $new_setting ? $value : $this->db_conf_store[$keyword];341 $attributes['defaultval'] = $this->_prepare_conf_value($vars['defaultval'], $vars['type'] ,$vars['emptyok']);342 379 $attributes['keyword'] = $keyword; 343 380 $attributes['type'] = $vars['type']; 344 381 } 345 if ($vars['type'] == CONF_TYPE_SELECT) { 382 switch ($vars['type']) { 383 case CONF_TYPE_SELECT: 346 384 if (!isset($vars['options']) || $vars['options'] == '') { 347 385 die_freepbx(sprintf(_("missing options for keyword [%] required if type is select"),$keyword)); 348 386 } else { 349 $attributes['options'] = is_array($vars['options']) ? implode(',',$vars['options']) : $vars['options']; 350 } 351 } 387 $opt_array = is_array($vars['options']) ? $vars['options'] : explode(',',$vars['options']); 388 foreach($opt_array as $av) { 389 $trim_options[] = trim($av); 390 } 391 $attributes['options'] = implode(',',$trim_options); 392 unset($opt_array); 393 unset($trim_options); 394 } 395 break; 396 case CONF_TYPE_INT: 397 if (isset($vars['options']) && $vars['options'] != '') { 398 $validate_options = !is_array($vars['options']) ? explode(',',$vars['options']) : $vars['options']; 399 if (count($validate_options) != 2 || !is_numeric($validate_options[0]) || !is_numeric($validate_options[1])) { 400 die_freepbx(sprintf(_("invalid validation options provided for keyword %s: %s"),$keyword,implode(',',$validate_options))); 401 } else { 402 $attributes['options'] = (int) $validate_options[0] . ',' . (int) $validate_options[1]; 403 } 404 } 405 break; 406 case CONF_TYPE_TEXT: 407 case CONF_TYPE_DIR: 408 if (isset($vars['options'])) { 409 $attributes['options'] = $vars['options']; 410 } 411 break; 412 } 413 352 414 if (isset($vars['level'])) { 353 415 $attributes['level'] = (int) $vars['level'] > 0 ? ((int) $vars['level'] < 10 ? (int) $vars['level'] : 10) : 0; … … 368 430 } 369 431 } 432 433 // validate even if already set, catches coding errors early even though we don't use it 434 $value = $this->_prepare_conf_value($vars['value'], $vars['type'] ,$attributes['emptyok'], $attributes['options']); 435 $attributes['value'] = $new_setting ? $value : $this->db_conf_store[$keyword]; 436 $attributes['defaultval'] = $this->_prepare_conf_value($vars['defaultval'], $vars['type'] ,$attributes['emptyok'], $attributes['options']); 437 438 // Let's be really stict here, if anything violated validation, we fail! 439 // This method is only called to define new settings, this catches programming errors early on. 440 // 441 if (!$this->_last_update_status['validated']) { 442 die_freepbx( 443 sprintf(_("method define_conf_setting() failed to pass validation for keyword [%s] setting value [%s], error msg if supplied [%s]"), 444 $keyword, $vars['value'], $this->_last_update_status['msg']) 445 ); 446 } 447 370 448 if ($new_setting || $attributes != $this->db_conf_store[$keyword]) { 371 449 if (!$new_setting) { … … 395 473 die_freepbx(_("called set_conf_values with a non-array")); 396 474 } 475 unset($this->last_update_status); 397 476 foreach($update_arr as $keyword => $value) { 398 477 if (!isset($this->db_conf_store[$keyword])) { 399 478 die_freepbx(sprintf(_("trying to set keyword [%s] to [%s] on unitialized setting"),$keyword, $value)); 400 479 } 401 $prep_value = $this->_prepare_conf_value($value, $this->db_conf_store[$keyword]['type'] ,$this->db_conf_store[$keyword]['emptyok']); 402 if ($prep_value != $this->db_conf_store[$keyword]['value'] && ($prep_value !== '' || $this->db_conf_store[$keyword]['emptyok']) && ($override_readonly || !$this->db_conf_store[$keyword]['readonly'])) { 480 $this->last_update_status[$keyword]['validated'] = false; 481 $this->last_update_status[$keyword]['saved'] = false; 482 $this->last_update_status[$keyword]['orig_value'] = $value; 483 $this->last_update_status[$keyword]['saved_value'] = $value; 484 $this->last_update_status[$keyword]['msg'] = ''; 485 $this->_last_update_status =& $this->last_update_status[$keyword]; 486 487 $prep_value = $this->_prepare_conf_value($value, $this->db_conf_store[$keyword]['type'], $this->db_conf_store[$keyword]['emptyok'], $this->db_conf_store[$keyword]['options']); 488 489 // If we reported saved then even if we didn't validate, we still were able to rectify 490 // it into something and therefore will use it. For example, if we set an integer out of 491 // range then we will still save the value. If the calling function wants to be strict 492 // they can not supply the commit flag and check the validation status and not save/commit 493 // the value based on their own decision criteria. 494 // 495 if ($this->_last_update_status['saved'] 496 && $prep_value != $this->db_conf_store[$keyword]['value'] 497 && ($prep_value !== '' || $this->db_conf_store[$keyword]['emptyok']) 498 && ($override_readonly || !$this->db_conf_store[$keyword]['readonly'])) { 499 403 500 $this->db_conf_store[$keyword]['value'] = $prep_value; 404 501 $this->db_conf_store[$keyword]['modified'] = true; … … 412 509 } 413 510 414 function _prepare_conf_value($value, $type, $emptyok ) {511 function _prepare_conf_value($value, $type, $emptyok, $options = false) { 415 512 switch ($type) { 513 416 514 case CONF_TYPE_BOOL: 417 515 $ret = $value ? 1 : 0; 516 $this->_last_update_status['validated'] = true; 418 517 break; 518 519 case CONF_TYPE_SELECT: 520 $val_arr = explode(',',$options); 521 if (in_array($value,$val_arr)) { 522 $ret = $value; 523 $this->_last_update_status['validated'] = true; 524 } else { 525 $ret = null; 526 $this->_last_update_status['validated'] = false; 527 $this->_last_update_status['msg'] = _("Invalid value supplied to select"); 528 $this->_last_update_status['saved_value'] = $ret; 529 $this->_last_update_status['saved'] = false; 530 file_put_contents("/tmp/freepbx_debug.log","SELECT failed: [$value] ".print_r($val_arr,true),FILE_APPEND); 531 dbug($value); 532 dbug($val_arr); 533 // 534 // NOTE: returning from function early! 535 return $ret; 536 } 537 break; 538 539 case CONF_TYPE_DIR: 540 // we don't consider trailing '/' in a directory an error for validation purposes 541 $value = rtrim($value,'/'); 542 // NOTE: fallthrough to CONF_TYPE_TEXT, NO break on purpose! 543 // | 544 // | 545 // V 419 546 case CONF_TYPE_TEXT: 420 case CONF_TYPE_SELECT: 421 $ret = $value; 547 if ($value == '' && !$emptyok) { 548 $this->_last_update_status['validated'] = false; 549 $this->_last_update_status['msg'] = _("Empty value not allowed for this field"); 550 } else if ($options != '' && $value != '') { 551 if (preg_match($options,$value)) { 552 $ret = $value; 553 $this->_last_update_status['validated'] = true; 554 } else { 555 $ret = null; 556 $this->_last_update_status['validated'] = false; 557 $this->_last_update_status['msg'] = sprintf(_("Invalid value supplied violates the validation regex: %s"),$options); 558 $this->_last_update_status['saved_value'] = $ret; 559 $this->_last_update_status['saved'] = false; 560 // 561 // NOTE: returning from function early! 562 return $ret; 563 } 564 } else { 565 $ret = $value; 566 $this->_last_update_status['validated'] = true; 567 } 422 568 break; 423 case CONF_TYPE_DIR: 424 $ret = rtrim($value,'/'); 425 break; 569 426 570 case CONF_TYPE_INT: 427 571 $ret = $emptyok && $value == '' ? '' : (int) $value; 572 573 if ($options != '' && $ret != '') { 574 $range = is_array($options) ? $options : explode(',',$options); 575 switch ($ret) { 576 case $ret < $range[0]: 577 $ret = $range[0]; 578 $this->_last_update_status['validated'] = false; 579 $this->_last_update_status['msg'] = sprintf(_("Value [%s] out of range, changed to [%s]"),$value,$ret); 580 break; 581 case $ret > $range[1]: 582 $ret = $range[1]; 583 $this->_last_update_status['validated'] = false; 584 $this->_last_update_status['msg'] = sprintf(_("Value [%s] out of range, changed to [%s]"),$value,$ret); 585 break; 586 default: 587 $this->_last_update_status['validated'] = (string) $ret === (string) $value; 588 break; 589 } 590 } else { 591 $this->_last_update_status['validated'] = (string) $ret === (string) $value; 592 } 428 593 break; 429 case CONF_TYPE_UINT: 430 $ret = $emptyok && $value == '' ? '' : ((int) $value < 0 ? 0 : (int) $value); 431 break; 594 432 595 default: 433 596 die_freepbx(sprintf(_("unknown type: [%s]"),$type)); 434 597 break; 435 598 } 599 $this->_last_update_status['saved_value'] = $ret; 600 $this->_last_update_status['saved'] = true; 436 601 return $ret; 437 602 } freepbx/trunk/amp_conf/htdocs/admin/views/freepbx.php
r10998 r11010 73 73 $version = $version ? $version : getversion(); 74 74 $version_tag = '?load_version='.urlencode($version); 75 76 // TODO: append ?load_version=$version (and for module specific $load_version=$view_module_version) to end of images, js, etc.77 // to get these to load, per moshe's suggestion78 75 79 76 if ($amp_conf['BRAND_IMAGE_HIDE_NAV_BACKGROUND']) { freepbx/trunk/libfreepbx.install.php
r11005 r11010 413 413 $set['options'] = '0,1,2,3,4,5,6,7,8,9,10'; 414 414 $set['description'] = 'This will filter which settings that are displayed on this Advanced Settings page. The higher the level, the more obscure settings will be shown. Settings at higher levels are unlikely to be of interest to most users and could be more volatile to breaking your system if set wrong.'; 415 $set['emptyok'] = 0; 415 416 $set['level'] = 0; 416 417 $set['readonly'] = 0; … … 423 424 $set['value'] = false; 424 425 $set['description'] = 'This will display settings that are normally hidden by the system. These settings are often internally used settings that are not of interest to most users.'; 426 $set['emptyok'] = 0; 425 427 $set['level'] = 0; 426 428 $set['readonly'] = 0; … … 433 435 $set['value'] = false; 434 436 $set['description'] = 'This will display settings that are readonly. These settings are often internally used settings that are not of interest to most users. Since they are readonly they can only be viewed.'; 437 $set['emptyok'] = 0; 435 438 $set['level'] = 0; 436 439 $set['readonly'] = 0; … … 449 452 $set['options'] = 'asterisk'; 450 453 $set['description'] = 'The telephony backend engine being used, asterisk is the only option currently.'; 454 $set['emptyok'] = 0; 451 455 $set['level'] = 3; 452 456 $set['readonly'] = 1; … … 460 464 $set['options'] = 'database,none,webserver'; 461 465 $set['description'] = 'Authentication type to use for web admin. If type set to <b>database</b>, the primary AMP admin credentials will be the AMPDBUSER/AMPDBPASS above. When using database you can create users that are restricted to only certain module pages. When set to none, you should make sure you have provided security at the apache level. When set to webserver, FreePBX will expect authentication to happen at the apache level, but will take the user credentials and apply any restrictions as if it were in database mode.'; 466 $set['emptyok'] = 0; 462 467 $set['level'] = 3; 463 468 $set['type'] = CONF_TYPE_SELECT; … … 469 474 $set['options'] = 'extensions,deviceanduser'; 470 475 $set['description'] = 'Sets the extension behavior in FreePBX. If set to <b>extensions</b>, Devices and Users are administered together as a unified Extension, and appear on a single page. If set to <b>deviceanduser</b>, Devices and Users will be administered seperately. Devices (e.g. each individual line on a SIP phone) and Users (e.g. <b>101</b>) will be configured independent of each other, allowing association of one User to many Devices, or allowing Users to login and logout of Devices.'; 476 $set['emptyok'] = 0; 471 477 $set['type'] = CONF_TYPE_SELECT; 472 478 $freepbx_conf->define_conf_setting('AMPEXTENSIONS',$set); … … 475 481 $set['value'] = '007'; 476 482 $set['description'] = 'Defaults to 077 allowing only the asterisk user to have any permission on VM files. If set to something like 007, it would allow the group to have permissions. This can be used if setting apache to a different user then asterisk, so that the apache user (and thus ARI) can have access to read/write/delete the voicemail files. If changed, some of the voicemail directory structures may have to be manually changed.'; 483 $set['emptyok'] = 0; 477 484 $set['type'] = CONF_TYPE_TEXT; 478 485 $set['level'] = 4; … … 488 495 $freepbx_conf->define_conf_setting('AMPWEBADDRESS',$set); 489 496 $set['level'] = 0; 490 $set['emptyok'] = 0;491 497 492 498 // ARI_ADMIN_USERNAME … … 496 502 $set['type'] = CONF_TYPE_TEXT; 497 503 $freepbx_conf->define_conf_setting('ARI_ADMIN_USERNAME',$set); 498 $set['emptyok'] = 0;499 504 500 505 // ARI_ADMIN_PASSWORD 501 506 $set['value'] = 'ari_password'; 502 507 $set['description'] = 'This is the default admin password to allow an administrator to login to ARI bypassing all security. Change this to a secure password.Default = not set'; 508 $set['emptyok'] = 0; 503 509 $set['type'] = CONF_TYPE_TEXT; 504 510 $freepbx_conf->define_conf_setting('ARI_ADMIN_PASSWORD',$set); … … 507 513 $set['value'] = 'asterisk'; 508 514 $set['description'] = 'The user Asterisk should be running as, used by freepbx_engine. Most systems should not change this.'; 515 $set['emptyok'] = 0; 509 516 $set['type'] = CONF_TYPE_TEXT; 510 517 $set['level'] = 4; … … 515 522 $set['value'] = 'asterisk'; 516 523 $set['description'] = 'The user group Asterisk should be running as, used by freepbx_engine. Most systems should not change this.'; 524 $set['emptyok'] = 0; 517 525 $set['type'] = CONF_TYPE_TEXT; 518 526 $set['level'] = 4; … … 523 531 $set['value'] = 'asterisk'; 524 532 $set['description'] = 'The user your httpd should be running as, used by freepbx_engine. Most systems should not change this.'; 533 $set['emptyok'] = 0; 525 534 $set['type'] = CONF_TYPE_TEXT; 526 535 $set['level'] = 4; … … 531 540 $set['value'] = 'asterisk'; 532 541 $set['description'] = 'The user group your httpd should be running as, used by freepbx_engine. Most systems should not change this.'; 542 $set['emptyok'] = 0; 533 543 $set['type'] = CONF_TYPE_TEXT; 534 544 $set['level'] = 4; … … 539 549 $set['value'] = 'asterisk'; 540 550 $set['description'] = 'The user that various device directories should be set to, used by freepbx_engine. Examples include /dev/zap, /dev/dahdi, /dev/misdn, /dev/mISDN and /dev/dsp. Most systems should not change this.'; 551 $set['emptyok'] = 0; 541 552 $set['type'] = CONF_TYPE_TEXT; 542 553 $set['level'] = 4; … … 547 558 $set['value'] = 'asterisk'; 548 559 $set['description'] = 'The user group that various device directories should be set to, used by freepbx_engine. Examples include /dev/zap, /dev/dahdi, /dev/misdn, /dev/mISDN and /dev/dsp. Most systems should not change this.'; 560 $set['emptyok'] = 0; 549 561 $set['type'] = CONF_TYPE_TEXT; 550 562 $set['level'] = 4; … … 561 573 $set['value'] = true; 562 574 $set['description'] = 'Generate the bad-number context which traps any bogus number or feature code and plays a message to the effect. If you use the Early Dial feature on some Grandstream phones, you will want to set this to false.'; 575 $set['emptyok'] = 0; 563 576 $set['type'] = CONF_TYPE_BOOL; 564 577 $set['level'] = 2; … … 569 582 $set['value'] = true; 570 583 $set['description'] = 'For extensions that have CW enabled, report unanswered CW calls as <b>busy</b> (resulting in busy voicemail greeting). If set to no, unanswered CW calls simply report as <b>no-answer</b>.'; 584 $set['emptyok'] = 0; 571 585 $set['type'] = CONF_TYPE_BOOL; 572 586 $freepbx_conf->define_conf_setting('CWINUSEBUSY',$set); … … 575 589 $set['value'] = false; 576 590 $set['description'] = 'If set to true, FreePBX will check if you have chan_dadhi installed. If so, it will automatically use all your ZAP configuration settings (devices and trunks) and silently convert them, under the covers, to DAHDI so no changes are needed. The GUI will continue to refer to these as ZAP but it will use the proper DAHDI channels. This will also keep Zap Channel DIDs working.'; 591 $set['emptyok'] = 0; 577 592 $set['type'] = CONF_TYPE_BOOL; 578 593 $freepbx_conf->define_conf_setting('ZAP2DAHDICOMPAT',$set); … … 581 596 $set['value'] = false; 582 597 $set['description'] = 'If true, Core will not statically generate hints, but instead make a call to the AMPBIN php script, and generate_hints.php through an Asterisk #exec call. This requires Asterisk.conf to be configured with <b>execincludes=yes<b> set in the [options] section.'; 598 $set['emptyok'] = 0; 583 599 $set['type'] = CONF_TYPE_BOOL; 584 600 $freepbx_conf->define_conf_setting('DYNAMICHINTS',$set); … … 587 603 $set['value'] = true; 588 604 $set['description'] = 'Enable call waiting by default when an extension is created (Default is yes). Set to <b>no</b> to if you dont want phones to be commissioned with call waiting already enabled. The user would then be required to dial the CW feature code (*70 default) to enable their phone. Most installations should leave this alone. It allows multi-line phones to receive multiple calls on their line appearances.'; 605 $set['emptyok'] = 0; 589 606 $set['type'] = CONF_TYPE_BOOL; 590 607 $freepbx_conf->define_conf_setting('ENABLECW',$set); … … 593 610 $set['value'] = false; 594 611 $set['description'] = 'When set to true, a beep is played instead of confirmation message when activating/de-activating: CallForward, CallWaiting, DayNight, DoNotDisturb and FindMeFollow.'; 612 $set['emptyok'] = 0; 595 613 $set['type'] = CONF_TYPE_BOOL; 596 614 $freepbx_conf->define_conf_setting('FCBEEPONLY',$set); … … 599 617 $set['value'] = false; 600 618 $set['description'] = 'If this is set, it assumes that you are running Asterisk 1.4 or higher and want to take advantage of the func_devstate.c backport available from Asterisk 1.6. This allows custom hints to be created to support BLF for server side feature codes such as daynight, followme, etc'; 619 $set['emptyok'] = 0; 601 620 $set['type'] = CONF_TYPE_BOOL; 602 621 $freepbx_conf->define_conf_setting('USEDEVSTATE',$set); … … 605 624 $set['value'] = false; 606 625 $set['description'] = 'Setting this flag will generate the required global variable so that enumlookup.agi will use Google DNS 8.8.8.8 when performing an ENUM lookup. Not all DNS deals with NAPTR record, but Google does. There is a drawback to this as Google tracks every lookup. If you are not comfortable with this, do not enable this setting. Please read Google FAQ about this: <b>http://code.google.com/speed/public-dns/faq.html#privacy</b>.'; 626 $set['emptyok'] = 0; 607 627 $set['type'] = CONF_TYPE_BOOL; 608 628 $set['level'] = 2; … … 613 633 $set['value'] = false; 614 634 $set['description'] = 'Normally FreePBX auto-generates a custom context that may be usable for adding custom dialplan to modify the normal behavior of FreePBX. It takes a good understanding of how Asterisk processes these includes to use this and in many of the cases, there is no useful application. All includes will result in a WARNING in the Asterisk log if there is no context found to include though it results in no errors. If you know that you want the includes, you can set this to true. If you comment it out FreePBX will revert to legacy behavior and include the contexts.'; 635 $set['emptyok'] = 0; 615 636 $set['type'] = CONF_TYPE_BOOL; 616 637 $set['level'] = 2; … … 623 644 $set['options'] = '0,1,2,3,4,5,6,7,8,9,10'; 624 645 $set['description'] = 'Some modules will generate lots of Noop() commands proceeded by a [TRACE](trace_level) that can be used during development or while trying to trace call flows. These Noop() commands serve no other purpose so if you do not want to see excessive Noop()s in your dialplan you can set this to 0. The higher the number the more detailed level of trace Noop()s will be generated'; 646 $set['emptyok'] = 0; 625 647 $set['type'] = CONF_TYPE_SELECT; 626 648 $freepbx_conf->define_conf_setting('NOOPTRACE',$set); … … 629 651 $set['value'] = false; 630 652 $set['description'] = 'If this value is set to true, then calls going out your outbound routes that originate from outside your PBX and were subsequently forwarded through a call forward, ring group, follow-me or other means, will have a SIP diversion header added to the call with the original incoming DID assuming there is a DID available. This is useful with some carriers that may require this under certain circumstances.'; 653 $set['emptyok'] = 0; 631 654 $set['type'] = CONF_TYPE_BOOL; 632 655 $freepbx_conf->define_conf_setting('DIVERSIONHEADER',$set); … … 640 663 $set['options'] = $opts; 641 664 $set['description'] = 'This is the default time in seconds to try and connect a call that has been call forwaded by the server side CF, CFU and CFB options. (If your phones use client side CF such as SIP redirects, this will not have any affect) If set to the default of 0, it will use the standard ring timer. If set to -1 it will ring the forwarded number with no limit which is consistent with the behavior of some existing PBX systems. If set to any other value, it will ring for that duration before diverting the call to the users voicemail if they have one. This can be overriden for each extension.'; 665 $set['emptyok'] = 0; 642 666 $set['type'] = CONF_TYPE_SELECT; 643 667 $freepbx_conf->define_conf_setting('CFRINGTIMERDEFAULT',$set); … … 652 676 $set['value'] = '/var/lib/asterisk/bin'; 653 677 $set['description'] = 'Location of the FreePBX command line scripts.'; 678 $set['emptyok'] = 0; 654 679 $set['type'] = CONF_TYPE_DIR; 655 680 $set['level'] = 4; … … 659 684 $set['value'] = '/usr/sbin'; 660 685 $set['description'] = 'Where (root) command line scripts are located.'; 686 $set['emptyok'] = 0; 661 687 $set['type'] = CONF_TYPE_DIR; 662 688 $set['level'] = 4; … … 666 692 $set['value'] = '/var/www/html'; 667 693 $set['description'] = 'The path to Apache webroot (leave off trailing slash).'; 694 $set['emptyok'] = 0; 668 695 $set['type'] = CONF_TYPE_DIR; 669 696 $set['level'] = 4; … … 673 700 $set['value'] = '/var/lib/asterisk/agi-bin'; 674 701 $set['description'] = 'This is the default directory for Asterisks agi files.'; 702 $set['emptyok'] = 0; 675 703 $set['type'] = CONF_TYPE_DIR; 676 704 $set['level'] = 4; … … 680 708 $set['value'] = '/etc/asterisk'; 681 709 $set['description'] = 'This is the default directory for Asterisks configuration files.'; 710 $set['emptyok'] = 0; 682 711 $set['type'] = CONF_TYPE_DIR; 683 712 $set['level'] = 4; … … 687 716 $set['value'] = '/var/log/asterisk'; 688 717 $set['description'] = 'This is the default directory for Asterisks log files.'; 718 $set['emptyok'] = 0; 689 719 $set['type'] = CONF_TYPE_DIR; 690 720 $set['level'] = 4; … … 694 724 $set['value'] = '/usr/lib/asterisk/modules'; 695 725 $set['description'] = 'This is the default directory for Asterisks modules.'; 726 $set['emptyok'] = 0; 696 727 $set['type'] = CONF_TYPE_DIR; 697 728 $set['level'] = 4; … … 701 732 $set['value'] = '/var/spool/asterisk'; 702 733 $set['description'] = 'This is the default directory for Asterisks spool directory.'; 734 $set['emptyok'] = 0; 703 735 $set['type'] = CONF_TYPE_DIR; 704 736 $set['level'] = 4; … … 708 740 $set['value'] = '/var/run/asterisk'; 709 741 $set['description'] = 'This is the default directory for Asterisks run files.'; 742 $set['emptyok'] = 0; 710 743 $set['type'] = CONF_TYPE_DIR; 711 744 $set['level'] = 4; … … 715 748 $set['value'] = '/var/lib/asterisk'; 716 749 $set['description'] = 'This is the default directory for Asterisks lib files.'; 750 $set['emptyok'] = 0; 717 751 $set['type'] = CONF_TYPE_DIR; 718 752 $set['level'] = 4; … … 722 756 $set['value'] = '/var/www/cgi-bin '; 723 757 $set['description'] = 'The path to Apache cgi-bin dir (leave off trailing slash).'; 758 $set['emptyok'] = 0; 724 759 $set['type'] = CONF_TYPE_DIR; 725 760 $set['level'] = 4; … … 729 764 $set['value'] = 'moh'; 730 765 $set['description'] = 'This is the subdirectory for the MoH files/directories which is located in ASTVARLIBDIR if not specified it will default to mohmp3 for backward compatibility.'; 766 $set['emptyok'] = 0; 731 767 $set['type'] = CONF_TYPE_DIR; 732 768 $set['level'] = 4; … … 743 779 $set['value'] = true; 744 780 $set['description'] = 'When set to the default value of true, all requests into FreePBX that might possibly add/edit/delete settings will be validated to assure the request is coming from the server. This will protect the system from CSRF (cross site request forgery) attacks. It will have the effect of preventing legitimately entering URLs that could modify settings which can be allowed by changing this field to false.'; 781 $set['emptyok'] = 0; 745 782 $set['type'] = CONF_TYPE_BOOL; 746 783 $freepbx_conf->define_conf_setting('CHECKREFERER',$set); … … 749 786 $set['value'] = false; 750 787 $set['description'] = 'Module Admin normally tries to get its online information through direct file open type calls to URLs that go back to the freepbx.org server. If it fails, typically because of content filters in firewalls that dont like the way PHP formats the requests, the code will fall back and try a wget to pull the information. This will often solve the problem. However, in such environment there can be a significant timeout before the failed file open calls to the URLs return and there are often 2-3 of these that occur. Setting this value will force FreePBX to avoid the attempt to open the URL and go straight to the wget calls.'; 788 $set['emptyok'] = 0; 751 789 $set['type'] = CONF_TYPE_BOOL; 752 790 $freepbx_conf->define_conf_setting('MODULEADMINWGET',$set); … … 755 793 $set['value'] = true; 756 794 $set['description'] = 'Controls if the menu items in the admin interface are sorted by category (true) or sorted alphebetically with no categories shown (false). Defaults = true'; 795 $set['emptyok'] = 0; 757 796 $set['type'] = CONF_TYPE_BOOL; 758 797 $freepbx_conf->define_conf_setting('USECATEGORIES',$set); … … 761 800 $set['value'] = false; 762 801 $set['description'] = 'Precede browser title with the server name.'; 802 $set['emptyok'] = 0; 763 803 $set['type'] = CONF_TYPE_BOOL; 764 804 $freepbx_conf->define_conf_setting('SERVERINTITLE',$set); … … 767 807 $set['value'] = true; 768 808 $set['description'] = 'When set to false, will bypass the confirm on Reload Box.'; 809 $set['emptyok'] = 0; 769 810 $set['type'] = CONF_TYPE_BOOL; 770 811 $freepbx_conf->define_conf_setting('RELOADCONFIRM',$set); … … 773 814 $set['value'] = false; 774 815 $set['description'] = 'Setting either of these to true will result in retrieve_conf aborting during a reload if an extension conflict is detected or a destination is detected. It is usually better to allow the reload to go through and then correct the problem but these can be set if a more strict behavior is desired.'; 816 $set['emptyok'] = 0; 775 817 $set['level'] = 3; 776 818 $set['type'] = CONF_TYPE_BOOL; … … 781 823 $set['value'] = false; 782 824 $set['description'] = 'Setting either of these to true will result in retrieve_conf aborting during a reload if an extension conflict is detected or a destination is detected. It is usually better to allow the reload to go through and then correct the problem but these can be set if a more strict behavior is desired.'; 825 $set['emptyok'] = 0; 783 826 $set['level'] = 3; 784 827 $set['type'] = CONF_TYPE_BOOL; … … 789 832 $set['value'] = true; 790 833 $set['description'] = 'If false, then the Destination Registry will not report unknown destinations as errors. This should be left to the default true and custom destinations should be moved into the new custom apps registry.'; 834 $set['emptyok'] = 0; 791 835 $set['level'] = 2; 792 836 $set['type'] = CONF_TYPE_BOOL; … … 803 847 $set['value'] = 'amp111'; 804 848 $set['description'] = 'Password for accessing the Asterisk Manager Interface (AMI), you must change this in manager.conf if changed here.'; 849 $set['emptyok'] = 0; 805 850 $set['type'] = CONF_TYPE_TEXT; 806 851 $set['level'] = 2; … … 811 856 $set['value'] = 'admin'; 812 857 $set['description'] = 'Username for accessing the Asterisk Manager Interface (AMI), you must change this in manager.conf if changed here.'; 858 $set['emptyok'] = 0; 813 859 $set['type'] = CONF_TYPE_TEXT; 814 860 $set['level'] = 2; … … 819 865 $set['value'] = 'localhost'; 820 866 $set['description'] = 'Hostname for the Asterisk Manager'; 867 $set['emptyok'] = 0; 821 868 $set['type'] = CONF_TYPE_TEXT; 822 869 $set['level'] = 2; 823 870 $freepbx_conf->define_conf_setting('ASTMANAGERHOST',$set); 824 871 $set['level'] = 0; 825 826 $set['type'] = CONF_TYPE_UINT;827 872 828 873 // ASTMANAGERPORT 829 874 $set['value'] = '5038'; 830 875 $set['description'] = 'Port for the Asterisk Manager'; 831 $set['type'] = CONF_TYPE_UINT; 876 $set['emptyok'] = 0; 877 $set['type'] = CONF_TYPE_INT; 878 $set['options'] = array(1024,65535); 832 879 $set['level'] = 2; 833 880 $freepbx_conf->define_conf_setting('ASTMANAGERPORT',$set); … … 837 884 $set['value'] = ''; 838 885 $set['description'] = 'Optional port for an Asterisk Manager Proxy'; 839 $set['type'] = CONF_TYPE_UINT; 840 $set['emptyok'] = 1; 886 $set['type'] = CONF_TYPE_INT; 887 $set['emptyok'] = 1; 888 $set['options'] = array(1024,65535); 841 889 $set['level'] = 2; 842 890 $freepbx_conf->define_conf_setting('ASTMANAGERPROXYPORT',$set); 843 891 $set['level'] = 0; 844 $set['emptyok'] = 0;845 892 846 893 … … 854 901 $set['value'] = '/tmp/freepbx_debug.log'; 855 902 $set['description'] = 'Full path and name of FreePBX debug file. Used by the dbug() funciton by developers.'; 903 $set['emptyok'] = 0; 856 904 $set['type'] = CONF_TYPE_TEXT; 857 905 $freepbx_conf->define_conf_setting('FPBXDBUGFILE',$set); … … 860 908 $set['value'] = false; 861 909 $set['description'] = 'This enables several debug features geared towards developers, including some page load timing information, some debug information in Module Admin, use of original CSS files and other future capabilities will be enabled.'; 910 $set['emptyok'] = 0; 862 911 $set['type'] = CONF_TYPE_BOOL; 863 912 $freepbx_conf->define_conf_setting('DEVEL',$set); … … 866 915 $set['value'] = false; 867 916 $set['description'] = 'Forces the "Apply Configuration Changes" reload bar to always be present even when not necessary.'; 917 $set['emptyok'] = 0; 868 918 $set['type'] = CONF_TYPE_BOOL; 869 919 $freepbx_conf->define_conf_setting('DEVELRELOAD',$set); … … 875 925 $set['type'] = CONF_TYPE_TEXT; 876 926 $freepbx_conf->define_conf_setting('PRE_RELOAD',$set); 877 $set['emptyok'] = 0;878 927 879 928 // POST_RELOAD … … 883 932 $set['type'] = CONF_TYPE_TEXT; 884 933 $freepbx_conf->define_conf_setting('POST_RELOAD',$set); 885 $set['emptyok'] = 0;886 934 887 935 // POST_RELOAD_DEBUG 888 936 $set['value'] = false; 889 937 $set['description'] = 'Display debug output for script used if POST_RELOAD is used.'; 938 $set['emptyok'] = 0; 890 939 $set['type'] = CONF_TYPE_BOOL; 891 940 $freepbx_conf->define_conf_setting('POST_RELOAD_DEBUG',$set); … … 894 943 $set['value'] = ''; 895 944 $set['description'] = 'If this directory is defined, retrieve_conf will check for a file called <i>retrieve_conf_post_custom</i> and if that file exists, it will be included after other processing thus having full access to the current environment for addtional customization.'; 945 $set['emptyok'] = 1; 896 946 $set['type'] = CONF_TYPE_DIR; 897 947 $freepbx_conf->define_conf_setting('AMPLOCALBIN',$set); … … 900 950 $set['value'] = true; 901 951 $set['description'] = 'Whether or not to invoke the FreePBX log facility.'; 952 $set['emptyok'] = 0; 902 953 $set['type'] = CONF_TYPE_BOOL; 903 954 $freepbx_conf->define_conf_setting('AMPDISABLELOG',$set); … … 906 957 $set['value'] = false; 907 958 $set['description'] = 'Whether or not to include log messages marked as <b>devel-debug</b> in the log system.'; 959 $set['emptyok'] = 0; 908 960 $set['type'] = CONF_TYPE_BOOL; 909 961 $freepbx_conf->define_conf_setting('AMPENABLEDEVELDEBUG',$set); … … 913 965 $set['options'] = 'LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG, LOG_SQL,SQL'; 914 966 $set['description'] = 'Where to log if enabled, SQL, LOG_SQL logs to old MySQL table, others are passed to syslog system to determine where to log.'; 967 $set['emptyok'] = 0; 915 968 $set['type'] = CONF_TYPE_SELECT; 916 969 $freepbx_conf->define_conf_setting('AMPSYSLOGLEVEL',$set); … … 919 972 $set['value'] = false; 920 973 $set['description'] = 'Stops the automatic generation of a stripped CSS file that replaces the primary sheet, usually mainstyle.css.'; 974 $set['emptyok'] = 0; 921 975 $set['type'] = CONF_TYPE_BOOL; 922 976 $freepbx_conf->define_conf_setting('DISABLE_CSS_AUTOGEN',$set); … … 933 987 $set['options'] = 'extension,lastname'; 934 988 $set['description'] = 'How FOP sort extensions. By Last Name [lastname] or by Extension [extension].'; 989 $set['emptyok'] = 0; 935 990 $set['type'] = CONF_TYPE_SELECT; 936 991 $freepbx_conf->define_conf_setting('FOPSORT',$set); … … 939 994 $set['value'] = '/var/www/html/panel'; 940 995 $set['description'] = 'Path to the Flash Operator Panel webroot (leave off trailing slash).'; 996 $set['emptyok'] = 0; 941 997 $set['type'] = CONF_TYPE_DIR; 942 998 $set['level'] = 4; … … 947 1003 $set['value'] = 'passw0rd'; 948 1004 $set['description'] = 'Password for performing transfers and hangups in the Flash Operator Panel (FOP).'; 1005 $set['emptyok'] = 0; 949 1006 $set['type'] = CONF_TYPE_TEXT; 950 1007 $freepbx_conf->define_conf_setting('FOPPASSWORD',$set); … … 953 1010 $set['value'] = false; 954 1011 $set['description'] = 'Set to true to disable FOP in interface and retrieve_conf. Useful for sqlite3 or if you do not want FOP.'; 1012 $set['emptyok'] = 0; 955 1013 $set['type'] = CONF_TYPE_BOOL; 956 1014 $freepbx_conf->define_conf_setting('FOPDISABLE',$set); … … 959 1017 $set['value'] = true; 960 1018 $set['description'] = 'Set to true if you want FOP started by freepbx_engine (amportal_start), false otherwise.'; 1019 $set['emptyok'] = 0; 961 1020 $set['type'] = CONF_TYPE_BOOL; 962 1021 $freepbx_conf->define_conf_setting('FOPRUN',$set); … … 968 1027 $set['category'] = 'Remote CDR Database'; 969 1028 $set['level'] = 3; 970 $set['emptyok'] = 1;971 1029 972 1030 // CDRDBHOST 973 1031 $set['value'] = ''; 974 1032 $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you dont use the default values provided by FreePBX.<br>Hostname of db server if not the same as AMPDBHOST.'; 1033 $set['emptyok'] = 1; 975 1034 $set['type'] = CONF_TYPE_TEXT; 976 1035 $freepbx_conf->define_conf_setting('CDRDBHOST',$set); … … 979 1038 $set['value'] = ''; 980 1039 $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you dont use the default values provided by FreePBX.<br>Name of database used for cdr records.'; 1040 $set['emptyok'] = 1; 981 1041 $set['type'] = CONF_TYPE_TEXT; 982 1042 $freepbx_conf->define_conf_setting('CDRDBNAME',$set); … … 985 1045 $set['value'] = ''; 986 1046 $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you dont use the default values provided by FreePBX.<br>Password for connecting to db if its not the same as AMPDBPASS.'; 1047 $set['emptyok'] = 1; 987 1048 $set['type'] = CONF_TYPE_TEXT; 988 1049 $freepbx_conf->define_conf_setting('CDRDBPASS',$set); … … 991 1052 $set['value'] = ''; 992 1053 $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you dont use the default values provided by FreePBX.<br>Port number for db host.'; 1054 $set['emptyok'] = 1; 993 1055 $set['type'] = CONF_TYPE_TEXT; 994 1056 $freepbx_conf->define_conf_setting('CDRDBPORT',$set); … … 997 1059 $set['value'] = ''; 998 1060 $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you dont use the default values provided by FreePBX. Name of the table in the db where the cdr is stored. cdr is default.'; 1061 $set['emptyok'] = 1; 999 1062 $set['type'] = CONF_TYPE_TEXT; 1000 1063 $freepbx_conf->define_conf_setting('CDRDBTABLENAME',$set); … … 1003 1066 $set['value'] = ''; 1004 1067 $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you dont use the default values provided by FreePBX. Defaults to your configured AMDBENGINE.'; 1068 $set['emptyok'] = 1; 1005 1069 $set['options'] = ',mysql,postgres'; 1006 1070 $set['type'] = CONF_TYPE_SELECT; … … 1010 1074 $set['value'] = ''; 1011 1075 $set['description'] = 'DO NOT set this unless you know what you are doing. Only used if you dont use the default values provided by FreePBX. Username to connect to db with if it is not the same as AMPDBUSER.'; 1076 $set['emptyok'] = 1; 1012 1077 $set['type'] = CONF_TYPE_TEXT; 1013 1078 $freepbx_conf->define_conf_setting('CDRDBUSER',$set); … … 1019 1084 $set['category'] = 'Styling and Logos'; 1020 1085 $set['level'] = 1; 1021 $set['emptyok'] = 0;1022 1086 1023 1087 // AMPADMINLOGO … … 1158 1222 $module_migrate['AMPBACKUPSUDO'] = CONF_TYPE_BOOL; 1159 1223 $module_migrate['USEQUEUESTATE'] = CONF_TYPE_BOOL; 1160 $module_migrate['DASHBOARD_INFO_UPDATE_TIME'] = CONF_TYPE_ UINT;1161 $module_migrate['DASHBOARD_STATS_UPDATE_TIME'] = CONF_TYPE_ UINT;1162 $module_migrate['SSHPORT'] = CONF_TYPE_ UINT;1163 $module_migrate['MAXCALLS'] = CONF_TYPE_ UINT;1224 $module_migrate['DASHBOARD_INFO_UPDATE_TIME'] = CONF_TYPE_INT; 1225 $module_migrate['DASHBOARD_STATS_UPDATE_TIME'] = CONF_TYPE_INT; 1226 $module_migrate['SSHPORT'] = CONF_TYPE_INT; 1227 $module_migrate['MAXCALLS'] = CONF_TYPE_INT; 1164 1228 $module_migrate['AMPMPG123'] = CONF_TYPE_BOOL; 1165 1229 $module_migrate['PARKINGPATCH'] = CONF_TYPE_BOOL; modules/branches/2.9/core/advancedsettings.js
r11009 r11010 35 35 mythis.attr({src: 'images/accept.png'}); 36 36 if (data != 'ok') { 37 alert('ERROR: When saving key ' + mykey );37 alert('ERROR: When saving key ' + mykey + 'Error Info:' + data); 38 38 } else { 39 39 mythis.parent().delay(500).fadeOut(); modules/branches/2.9/core/page.advancedsettings.php
r11009 r11010 1 1 <?php /* $Id */ 2 // TODO: Get rid of undefined in http log. Sigh3 2 4 $getvars = array('level','action', 'keyword', 'value');5 foreach ($getvars as $v){6 $var[$v] = isset($_REQUEST[$v]) ? $_REQUEST[$v] : 0;7 }3 $getvars = array('action', 'keyword', 'value'); 4 foreach ($getvars as $v){ 5 $var[$v] = isset($_POST[$v]) ? $_POST[$v] : 0; 6 } 8 7 9 if($var['action'] === 'setkey') { 10 if ($freepbx_conf->conf_setting_exists($var['keyword'])) { 11 $freepbx_conf->set_conf_values(array($var['keyword'] => $var['value']),true); 12 if ($freepbx_conf->get_conf_setting($var['keyword']) == $var['value']) { 13 echo 'ok'; 14 } 15 dbug($freepbx_conf->db_conf_store[$var['keyword']]); 8 // TODO: provide error info if errors were detected 9 // change to json so we can send back info like what it was updated to 10 // and other useful stuff 11 // 12 if($var['action'] === 'setkey') { 13 if ($freepbx_conf->conf_setting_exists($var['keyword'])) { 14 $freepbx_conf->set_conf_values(array($var['keyword'] => $var['value']),true); 15 if ($freepbx_conf->get_conf_setting($var['keyword']) == $var['value']) { 16 echo 'ok'; 17 } 18 dbug($freepbx_conf->get_last_update_status()); 19 } 20 exit; 16 21 } 17 exit;18 }19 22 echo '<script type="text/javascript">'; 20 23 echo 'can_write_amportalconf = "'.$amp_conf['amportal_canwrite'] .'"; '; … … 77 80 case CONF_TYPE_DIR: 78 81 case CONF_TYPE_INT: 79 case CONF_TYPE_UINT:80 82 $readonly = $c['readonly'] ? 'readonly="readonly"' : ''; 81 83 echo '<input class="valueinput" id="'.$c['keyword'].'" type="text" size="60" value="'.$amp_conf[$c['keyword']].'" data-valueinput-orig="'.$amp_conf[$c['keyword']].'" '.$readonly.'/>'; modules/branches/2.9/dashboard/install.php
r11003 r11010 24 24 $set['value'] = 6; 25 25 $set['defaultval'] =& $set['value']; 26 $set['options'] = array(6,10,20,30,45,60,120,300,600); 26 27 $set['readonly'] = 0; 27 28 $set['hidden'] = 0; … … 29 30 $set['module'] = 'dashboard'; 30 31 $set['category'] = 'GUI Behavior'; 31 $set['emptyok'] = 1;32 $set['emptyok'] = 0; 32 33 $set['description'] = 'Update rate in seconds of all sections of the System Status panel except the Info box.'; 33 $set['type'] = CONF_TYPE_ UINT;34 $set['type'] = CONF_TYPE_SELECT; 34 35 $freepbx_conf->define_conf_setting('DASHBOARD_STATS_UPDATE_TIME',$set); 35 36 … … 38 39 $set['value'] = 30; 39 40 $set['defaultval'] =& $set['value']; 41 $set['options'] = array(15,30,60,120,300,600); 40 42 $set['readonly'] = 0; 41 43 $set['hidden'] = 0; … … 43 45 $set['module'] = 'dashboard'; 44 46 $set['category'] = 'GUI Behavior'; 45 $set['emptyok'] = 1;47 $set['emptyok'] = 0; 46 48 $set['description'] = 'Update rate in seconds of the Info section of the System Status panel.'; 47 $set['type'] = CONF_TYPE_ UINT;49 $set['type'] = CONF_TYPE_SELECT; 48 50 $freepbx_conf->define_conf_setting('DASHBOARD_INFO_UPDATE_TIME',$set); 49 51 … … 52 54 $set['value'] = ''; 53 55 $set['defaultval'] =& $set['value']; 56 $set['options'] = array(1,65535); 54 57 $set['readonly'] = 0; 55 58 $set['hidden'] = 0; … … 59 62 $set['emptyok'] = 1; 60 63 $set['description'] = 'SSH port number configured on your system if not using the default port 22, this allows the dashboard monitoring to watch the poper port.'; 61 $set['type'] = CONF_TYPE_ UINT;64 $set['type'] = CONF_TYPE_INT; 62 65 $freepbx_conf->define_conf_setting('SSHPORT',$set); 63 66 … … 66 69 $set['value'] = ''; 67 70 $set['defaultval'] =& $set['value']; 71 $set['options'] = array(0,3000); 68 72 $set['readonly'] = 0; 69 73 $set['hidden'] = 0; … … 73 77 $set['emptyok'] = 1; 74 78 $set['description'] = 'Use this to pre-set the scale for maximum calls on the Dashboard display. If not set, the the scale is dynamically sized based on the active calls on the system.'; 75 $set['type'] = CONF_TYPE_ UINT;79 $set['type'] = CONF_TYPE_INT; 76 80 $freepbx_conf->define_conf_setting('MAXCALLS',$set); 77 81
