Changeset 10314

Show
Ignore:
Timestamp:
09/23/10 15:32:39 (3 years ago)
Author:
mickecarlsson
Message:

Updated amportalsettings with missing keynames, fixed some settings, extended some fields, bumped version number, not ready for pubslishing. Those who had pulled this module from svn needs to uninstall the old module then install this one for the database to be updated, no migration exists (yet)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • contributed_modules/modules/amportalsettings/functions.inc.php

    r10203 r10314  
    1010function amportalsettings_set_keys($key, $value){ 
    1111  global $db; 
    12   $sql = 'UPDATE freepbx_settings set value = ? where `key` = ?'; 
     12  $sql = 'UPDATE freepbx_settings set value = ? where `keyname` = ?'; 
    1313  $res = $db->query($sql, array($value, $key)); 
    1414  if(DB::IsError($res)){ 
  • contributed_modules/modules/amportalsettings/install.php

    r10211 r10314  
    77if(DB::IsError($result)){ 
    88  $sql[] = "CREATE TABLE `freepbx_settings` ( 
    9     `key` varchar(25) default NULL, 
     9    `keyname` varchar(30) default NULL, 
    1010    `value` varchar(100) default NULL, 
    1111    `level` int(11) default '0', 
     
    1616    `readonly` varchar(15) default NULL, 
    1717    `hidden` varchar(15) default NULL, 
    18     UNIQUE KEY `key` (`key`) 
     18    UNIQUE KEY `keyname` (`keyname`) 
    1919  ) ENGINE=MyISAM DEFAULT CHARSET=latin1"; 
    2020 
     
    2222  $sql[] = "INSERT INTO `freepbx_settings` VALUES  
    2323    ('AMPADMINLOGO','logo.png',0,'Defines the logo that is to be displayed at the TOP RIGHT of the admin screen. This enables you to customize the look of the administration screen. NOTE: images need to be saved in the ..../admin/images directory of your AMP install. This image should be 55px in height<br>Default = logo.png','text',NULL,NULL,NULL,NULL), 
     24    ('AMPBACKUPSUDO','',0,'This option allows you to use sudo when backing up files. Useful ONLY when using AMPPROVROOT. Allows backup and restore of files specified in AMPPROVROOT, based on permissions in /etc/sudoers for example, adding the following to sudoers would allow the user asterisk to run tar on ANY file on the system:<br>asterisk localhost=(root)NOPASSWD: /bin/tar<br>Defaults:asterisk !requiretty<br>PLEASE KEEP IN MIND THE SECURITY RISKS INVOLVED IN ALLOWING THE ASTERISK USER TO TAR/UNTAR ANY FILE<br>Default = false','select','TRUE,FALSE',NULL,NULL,NULL), 
    2425    ('AMPBADNUMBER','TRUE',0,'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<br>Default = true','select','TRUE,FALSE','TRUE',NULL,NULL), 
    2526    ('AMPBIN','/var/lib/asterisk/bin',0,'Location of the FreePBX command line scripts<br>Default = /var/lib/asterisk/bin','text',NULL,'/var/lib/asterisk/bin',NULL,NULL), 
     
    2829    ('AMPDBHOST','localhost',0,'Hostname where the database asterisk is located<br>Default = localhost','text',NULL,'localhost',NULL,NULL), 
    2930    ('AMPDBNAME','asterisk',0,'Name of the FreePBX database<br>Default = asterisk','text',NULL,'asterisk',NULL,NULL), 
    30     ('AMPDBPASS','fpbx',0,'Password for accessing the database asterisk. Used in combination with AMPDBUSER<br>Default = amp109','text',NULL,NULL,NULL,NULL), 
    31     ('AMPDBUSER','freepbx',0,'Username for accessing the database asterisk<br>Default = asteriskuser','text',NULL,NULL,NULL,NULL), 
     31    ('AMPDBPASS','amp109',0,'Password for accessing the database asterisk. Used in combination with AMPDBUSER<br>Default = amp109','text',NULL,NULL,NULL,NULL), 
     32    ('AMPDBUSER','asteriskuser',0,'Username for accessing the database asterisk<br>Default = asteriskuser','text',NULL,NULL,NULL,NULL), 
    3233    ('AMPDISABLELOG','TRUE',0,'Whether or not to invoke the FreePBX log facility<br>Default = true','select','TRUE,FALSE','TRUE',NULL,NULL), 
    3334    ('AMPENABLEDEVELDEBUG','FALSE',0,'Whether or not to include log messages marked as <b>devel-debug</b> in the log system<br>Default = false','select','TRUE,FALSE','FALSE',NULL,NULL), 
    3435    ('AMPENGINE','asterisk',0,'The telephony backend engine to use<br>Default = asterisk','text',NULL,'asterisk',NULL,NULL), 
    35     ('AMPEXTENSIONS','extensions',0,'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<br>Default = extensions','text',NULL,'extensions',NULL,NULL), 
     36    ('AMPEXTENSIONS','extensions',0,'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<br>Default = extensions','select','extensions,deviceanduser',NULL,NULL,NULL), 
    3637    ('AMPMGRPASS','amp111',0,'Password for accessing the Asterisk Manager Interface (AMI)<br>Default = amp111','text',NULL,'amp111',NULL,NULL), 
    3738    ('AMPMGRUSER','admin',0,'Username for accessing the Asterisk Manager Interface (AMI)<br>Default = admin','text',NULL,'admin',NULL,NULL), 
     
    4445    ('ARI_ADMIN_PASSWORD','ari_password',0,'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','text',NULL,'ari_password',NULL,NULL), 
    4546    ('ARI_ADMIN_USERNAME','',0,'This is the default admin name used to allow an administrator to login to ARI bypassing all security. Change this to whatever you want, dont forget to change the ARI_ADMIN_PASSWORD as well.Default = not set','text',NULL,'admin',NULL,NULL), 
    46     ('ASTMANAGER','',0,'Port for the Asterisk Manager<br>Default = 5028','text',NULL,'5038',NULL,NULL), 
    47     ('ASTMANAGERHOST','localhost',0,'Hostname for the Asterisk Manager<br>Default = localhost','text',NULL,'localhost',NULL,NULL), 
     47    ('ASTAGIDIR','/var/lib/asterisk/agi-bin',0,'This is the default directory for Asterisks agi files<br>Default = /var/lib/asterisk/agi-bin','text',NULL,'/var/lib/asterisk/agi-bin',NULL,NULL), 
     48    ('ASTETCDIR','/etc/asterisk',0,'This is the default directory for Asterisks configuration files<br>Default = /etc/asterisk','text',NULL,'/etc/asterisk',NULL,NULL), 
     49    ('ASTLOGDIR','/var/log/asterisk',0,'This is the default directory for Asterisks log files<br>Default = /var/log/asterisk','text',NULL,'/var/log/asterisk',NULL,NULL), 
     50    ('ASTMODDIR','/usr/lib/asterisk/modules',0,'This is the default directory for Asterisks modules<br>Default = /usr/lib/asterisk/modules','text',NULL,'/usr/lib/asterisk/modules',NULL,NULL), 
     51    ('ASTSPOOLDIR','/var/spool/asterisk',0,'This is the default directory for Asterisks spool directory<br>Default = /var/spool/asterisk','text',NULL,'/var/spool/asterisk',NULL,NULL), 
     52    ('ASTRUNDIR','/var/run/asterisk',0,'This is the default directory for Asterisks run files<br>Default = /var/run/asterisk','text',NULL,'/var/run/asterisk',NULL,NULL), 
     53    ('ASTVARLIBDIR','/var/lib/asterisk',0,'This is the default directory for Asterisks lib files<br>Default = /var/lib/asterisk','text',NULL,'/var/lib/asterisk',NULL,NULL), 
     54    ('ASTMANAGERPORT','5038',0,'Port for the Asterisk Manager<br>Default = 5038','text',NULL,'5038',NULL,NULL), 
     55    ('ASTMANAGERHOST','localhost',0,'Hostname for the Asterisk Manager<br>Default = 5038','text',NULL,'5038',NULL,NULL), 
    4856    ('AUTHTYPE','database',0,'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. Valid settings are: none, database<br>Default = none','select','none,database','none',NULL,NULL), 
    4957    ('BADDESTABORT','FALSE',0,'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<br>Default = false','select','TRUE,FALSE','FALSE',NULL,NULL), 
     
    5866    ('CUSTOMASERROR','TRUE',0,'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<br>Default = true','select','TRUE,FALSE','TRUE',NULL,NULL), 
    5967    ('CWINUSEBUSY','TRUE',0,'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><br>Default = true','select','TRUE,FALSE','TRUE',NULL,NULL), 
    60     ('DASHBOARD_INFO_UPDATE_TIM','',0,'These can be used to change the refresh rate of the System Status Panel. Most of the stats are updated based on the STATS interval but a few items are','text',NULL,NULL,NULL,NULL), 
    61     ('DASHBOARD_STATS_UPDATE_TI','',0,'These can be used to change the refresh rate of the System Status Panel. Most of the stats are updated based on the STATS interval but a few items are','text',NULL,NULL,NULL,NULL), 
     68    ('DASHBOARD_INFO_UPDATE_TIME','',0,'These can be used to change the refresh rate of the System Status Panel. Most of the stats are updated based on the STATS interval but a few items are','text',NULL,NULL,NULL,NULL), 
     69    ('DASHBOARD_STATS_UPDATE_TIME','',0,'These can be used to change the refresh rate of the System Status Panel. Most of the stats are updated based on the STATS interval but a few items are','text',NULL,NULL,NULL,NULL), 
    6270    ('DEVEL','FALSE',0,'Needs to be documented<br>Default = false','select','TRUE,FALSE','FALSE',NULL,NULL), 
    6371    ('DEVELRELOAD','FALSE',0,'Needs to be documented<br>Default = false','select','TRUE,FALSE','FALSE',NULL,NULL), 
     
    7886    ('RELOADCONFIRM','TRUE',0,'When set to false, will bypass the confirm on Reload Box<br>Default = true','select','TRUE,FALSE','TRUE',NULL,NULL), 
    7987    ('SERVERINTITLE','FALSE',0,'Precede browser title with the server name<br>Default = false','select','TRUE,FALSE','TRUE',NULL,NULL), 
     88    ('USEDIALONE','FALSE',0,'Un-published option, to use the experimental macro-dial-one in place of macro-dial + dialparties.agi when dialing single extensions. The macro has been very little tested and is otherwise not used at all if this is not set. However, this will enable for those who want to start to test the macro and help flush out its operation for a 2.8 target re #4068<br>Default = false','select','TRUE,FALSE','FALSE',NULL,NULL), 
    8089    ('USECATEGORIES','TRUE',0,'Controls if the menu items in the admin interface are sorted by category (true) or sorted alphebetically with no categories shown (false). Defaults = true','select','TRUE,FALSE','TRUE',NULL,NULL), 
    8190    ('USEDEVSTATE','TRUE',0,'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<br>Default = false','select','TRUE,FALSE','TRUE',NULL,NULL), 
     
    8392    ('USEQUEUESTATE','FALSE',0,'Setting this flag will generate the required dialplan to integrate with the following Asterisk patch: <b>https://issues.asterisk.org/view.php?id=15168</b>. This feature is planned for a future 1.6 release but given the existence of the patch can be used prior. Once the release version is known, code will be added to automatically enable this format in versions of Asterisk that support it<br>Default = false','select','TRUE,FALSE','FALSE',NULL,NULL), 
    8493    ('XTNCONFLICTABORT','FALSE',0,'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<br>Default = false','select','TRUE,FALSE','FALSE',NULL,NULL), 
    85     ('ZAP2DAHDICOMPAT','TRUE',0,'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<br>Default = false','select','TRUE,FALSE','TRUE',NULL,NULL), 
    86     ('AMPBACKUPSUDO','',0,'This option allows you to use sudo when backing up files. Useful ONLY when using AMPPROVROOT. Allows backup and restore of files specified in AMPPROVROOT, based on permissions in /etc/sudoers for example, adding the following to sudoers would allow the user asterisk to run tar on ANY file on the system:<br>asterisk localhost=(root)NOPASSWD: /bin/tar<br>Defaults:asterisk !requiretty<br>PLEASE KEEP IN MIND THE SECURITY RISKS INVOLVED IN ALLOWING THE ASTERISK USER TO TAR/UNTAR ANY FILE<br>Default = false','select','TRUE,FALSE',NULL,NULL,NULL)"; 
     94    ('ZAP2DAHDICOMPAT','TRUE',0,'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<br>Default = false','select','TRUE,FALSE','TRUE',NULL,NULL)"; 
    8795   
    8896  foreach ($sql as $q) { 
     
    107115          break; 
    108116      } 
    109       $settings[] = array('key' => $key, 'value' => $val); 
     117      $settings[] = array('keyname' => $key, 'value' => $val); 
    110118  } 
    111119 
    112   $query = $db->prepare("UPDATE freepbx_settings set value = ? WHERE `key` = ?"); 
     120  $query = $db->prepare("UPDATE freepbx_settings set value = ? WHERE `keyname` = ?"); 
    113121  $result = $db->executeMultiple($query,$settings); 
    114122  if(DB::IsError($result)){ 
  • contributed_modules/modules/amportalsettings/module.xml

    r10203 r10314  
    22  <rawname>amportalsettings</rawname> 
    33  <name>Amportal Settings</name> 
    4   <version>2.8.0.0</version> 
     4  <version>2.8.0.2</version> 
    55  <publisher>Mikael Carlsson</publisher> 
    66  <license>GPLv2</license> 
     
    1212  </menuitems> 
    1313  <changelog> 
     14    *2.8.0.2* Added more ampkeys, extended table sizes 
    1415    *2.8.0.1* Localization, minor fixes 
    1516    *2.8.0.0* Initial release 
  • contributed_modules/modules/amportalsettings/page.amportalsettings.php

    r10203 r10314  
    44// TODO: Get rid of undefined in http log. Sigh 
    55 
    6 $getvars = array('level', 'action', 'key', 'value'); 
     6$getvars = array('level', 'action', 'keyname', 'value'); 
    77 
    88foreach ($getvars as $v){ 
     
    1212 
    1313if($var['action'] === 'setkey') { 
    14   if (amportalsettings_set_keys($var['key'], $var['value'])) { 
     14  if (amportalsettings_set_keys($var['keyname'], $var['value'])) { 
    1515    echo 'ok'; 
    1616  } else { 
     
    2929  echo '<table id="set_table">'; 
    3030  foreach ($conf as $c){ 
    31     echo '<tr><td><a href="javascript:void(null)" class="info">'.$c['key'].'<span>'.$c['description'].'</span></a></td>'; 
     31    echo '<tr><td><a href="javascript:void(null)" class="info">'.$c['keyname'].'<span>'.$c['description'].'</span></a></td>'; 
    3232    echo '<td>'; 
    3333    switch ($c['type']) { 
    3434      case 'text': 
    35         echo '<input class="valueinput" id="'.$c['key'].'" type="text" value="'.$c['value'].'" data-valueinput-orig="'.$c['value'].'"/>'; 
     35        echo '<input class="valueinput" id="'.$c['keyname'].'" type="text" value="'.$c['value'].'" data-valueinput-orig="'.$c['value'].'"/>'; 
    3636        break; 
    3737      case 'select': 
    38         echo '<select class="valueinput" id="'.$c['key'].'" data-valueinput-orig="'.$c['value'].'">'; 
     38        echo '<select class="valueinput" id="'.$c['keyname'].'" data-valueinput-orig="'.$c['value'].'">'; 
    3939          $opt = explode(',',$c['options']); 
    4040          foreach($opt as $o) { 
     
    4747    echo '</td>'; 
    4848    if($c['readonly'] != 'true'){ 
    49       echo '<td><input type="image" class="default" src="images/default-option.png" data-key="'.$c['key'].'" data-default="'.$c['defaultval'].'" name="default" title="'._('Revert to Default').'"></td>'; 
    50       echo '<td class="savetd"><input type="image" class="save" src="images/accept.png" name="save" data-key="'.$c['key'].'" title="'._('Save').'"></td>'; 
    51       //echo '<td><input type="image" class="delete"  src="images/trash.png" name="delete" data-key="'.$c['key'].'" title="'._('Delete').'"></td>';  
     49      echo '<td><input type="image" class="default" src="images/default-option.png" data-key="'.$c['keyname'].'" data-default="'.$c['defaultval'].'" name="default" title="'._('Revert to Default').'"></td>'; 
     50      echo '<td class="savetd"><input type="image" class="save" src="images/accept.png" name="save" data-key="'.$c['keyname'].'" title="'._('Save').'"></td>'; 
     51      //echo '<td><input type="image" class="delete"  src="images/trash.png" name="delete" data-key="'.$c['keyname'].'" title="'._('Delete').'"></td>';  
    5252    } 
    5353    echo '</tr>';