Changeset 7894

Show
Ignore:
Timestamp:
07/06/09 04:17:44 (4 years ago)
Author:
p_lindheimer
Message:

add sip.conf/iax.conf to chekced files, rename and sort module tab

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.6/iaxsettings/module.xml

    r7885 r7894  
    11<module> 
    22  <rawname>iaxsettings</rawname> 
    3   <name>IAX Settings</name> 
     3  <name>Asterisk IAX Settings</name> 
    44  <version>2.6.0beta1.1</version> 
    55  <type>tool</type> 
    66  <category>System Administration</category> 
    77  <menuitems> 
    8     <iaxsettings>IAX Settings</iaxsettings> 
     8    <iaxsettings sort="-6">Asterisk IAX Settings</iaxsettings> 
    99  </menuitems> 
    1010  <description> 
     
    1414  <license>AGPLv3</license> 
    1515  <changelog> 
    16     *2.6.0beta1.1* install script 'if not exists' missing, add check for custom file content 
     16    *2.6.0beta1.1* install script 'if not exists' missing 
    1717    *2.6.0beta1.0* lots of tweaks, fixed install.php error 
    1818  </changelog> 
  • modules/branches/2.6/iaxsettings/page.iaxsettings.php

    r7883 r7894  
    553553  $errors = array(); 
    554554 
     555  $custom_files[] = $amp_conf['ASTETCDIR']."/iax.conf"; 
    555556  $custom_files[] = $amp_conf['ASTETCDIR']."/iax_general_custom.conf"; 
    556557  $custom_files[] = $amp_conf['ASTETCDIR']."/iax_custom.conf"; 
     
    558559  foreach ($custom_files as $file) { 
    559560    if (file_exists($file)) { 
    560       $sip_conf = parse_ini_file($file,true); 
    561       foreach ($sip_conf as $item) { 
     561      $iax_conf = parse_ini_file($file,true); 
     562      $main = true; // 1 is iax.conf, after that don't care 
     563      foreach ($iax_conf as $section => $item) { 
    562564        // If setting is an array, then it is a subsection 
    563565        // 
    564566        if (!is_array($item)) { 
    565           $msg =  sprintf(_("Settings in %s may override these, they should be removed"),"<b>$file</b>"); 
     567          $msg =  sprintf(_("Settings in %s may override these, the settings should be removed"),"<b>$file</b>"); 
     568          $errors[] = array( 'js' => '', 'div' => $msg); 
     569          break; 
     570        } elseif ($main && is_array($item) && strtolower($section) == 'general' && !empty($item)) { 
     571          $msg =  sprintf(_("File %s should not have any settings in it, the settings should be removed"),"<b>$file</b>"); 
    566572          $errors[] = array( 'js' => '', 'div' => $msg); 
    567573          break; 
    568574        } 
     575        $main = false; 
    569576      } 
    570577    } 
  • modules/branches/2.6/sipsettings/module.xml

    r7884 r7894  
    11<module> 
    22  <rawname>sipsettings</rawname> 
    3   <name>SIP Settings</name> 
     3  <name>Asterisk SIP Settings</name> 
    44  <version>2.6.0beta1.2</version> 
    55  <type>tool</type> 
    66  <category>System Administration</category> 
    77  <menuitems> 
    8     <sipsettings>SIP Settings</sipsettings> 
     8    <sipsettings sort="-6">Asterisk SIP Settings</sipsettings> 
    99  </menuitems> 
    1010  <description> 
     
    1414  <license>AGPLv3</license> 
    1515  <changelog> 
    16     *2.6.0beta1.2* install script 'if not exists' missing, check for custom file content 
     16    *2.6.0beta1.2* install script 'if not exists' missing 
    1717    *2.6.0beta1.1* misc bugs, typos 
    1818    *2.6.0beta1.0* lots of tweaks, fixed install.php error 
  • modules/branches/2.6/sipsettings/page.sipsettings.php

    r7883 r7894  
    945945  $errors = array(); 
    946946 
     947  $custom_files[] = $amp_conf['ASTETCDIR']."/sip.conf"; 
    947948  $custom_files[] = $amp_conf['ASTETCDIR']."/sip_nat.conf"; 
    948949  $custom_files[] = $amp_conf['ASTETCDIR']."/sip_general_custom.conf"; 
     
    952953    if (file_exists($file)) { 
    953954      $sip_conf = parse_ini_file($file,true); 
    954       foreach ($sip_conf as $item) { 
     955      $main = true; // 1 is sip.conf, after that don't care 
     956      foreach ($sip_conf as $section => $item) { 
    955957        // If setting is an array, then it is a subsection 
    956958        // 
    957959        if (!is_array($item)) { 
    958           $msg =  sprintf(_("Settings in %s may override these, they should be removed"),"<b>$file</b>"); 
     960          $msg =  sprintf(_("Settings in %s may override these, the settings should be removed"),"<b>$file</b>"); 
     961          $errors[] = array( 'js' => '', 'div' => $msg); 
     962          break; 
     963        } elseif ($main && is_array($item) && strtolower($section) == 'general' && !empty($item)) { 
     964          $msg =  sprintf(_("File %s should not have any settings in it, the settings should be removed"),"<b>$file</b>"); 
    959965          $errors[] = array( 'js' => '', 'div' => $msg); 
    960966          break; 
    961967        } 
     968        $main = false; 
    962969      } 
    963970    }