Changeset 8237

Show
Ignore:
Timestamp:
08/29/09 11:39:09 (4 years ago)
Author:
p_lindheimer
Message:

fixes #3436 create reserved directory with blank music file, use of /dev/null no longer works

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.6/music/functions.inc.php

    r6555 r8237  
    99    if ($handle = opendir($path)){ 
    1010      while (false !== ($file = readdir($handle))){  
    11         if ( ($file != ".") && ($file != "..") && ($file != "CVS") && ($file != ".svn") )  
     11        if ( ($file != ".") && ($file != "..") && ($file != "CVS") && ($file != ".svn") && ($file != ".nomusic_reserved" ) ) 
    1212        { 
    1313          if (is_dir("$path/$file")) 
  • modules/branches/2.6/music/install.php

    r4538 r8237  
    77if (isset($tresults)) { 
    88  foreach ($tresults as $tresult)  { 
    9     if ($tresult != "default" ) { 
     9    if ($tresult == "default" ) { 
     10      $dir = $asterisk_conf['astvarlibdir']."/mohmp3/"; 
     11    } elseif ($tresult == "none") { 
     12      $dir = $amp_conf['ASTVARLIBDIR']."/mohmp3/.nomusic_reserved"; 
     13      if (!is_dir($dir)) { 
     14        mkdir("$dir", 0755);  
     15      } 
     16      touch($dir."/silence.wav"); 
     17    } else { 
    1018      $dir = $asterisk_conf['astvarlibdir']."/mohmp3/{$tresult}/"; 
    11     } else { 
    12       $dir = $asterisk_conf['astvarlibdir']."/mohmp3/"; 
    1319    } 
    1420    if (file_exists("{$dir}.random")) { 
  • modules/branches/2.6/music/module.xml

    r8068 r8237  
    22  <rawname>music</rawname> 
    33  <name>Music on Hold</name> 
    4   <version>2.6.0.0</version> 
     4  <version>2.6.0.1</version> 
    55  <publisher>FreePBX</publisher> 
    66  <license>GPLv2+</license> 
     
    1111  <description>Uploading and management of sound files (wav, mp3) to be used for on-hold music.</description> 
    1212  <changelog> 
     13    *2.6.0.1* 3436 
    1314    *2.6.0.0* added publisher/lic 
    1415    *2.5.1.4* #3711 and localizations 
  • modules/branches/2.6/music/page.music.php

    r7807 r8237  
    110110      // 
    111111      if ($tresult == "none") { 
    112         $dir = "/dev/null"; 
    113         $File_Write.="[{$tresult}]\nmode=files\ndirectory={$dir}\n"; 
    114         continue; 
    115       } 
    116       if ($tresult != "default" ) { 
     112        $dir = $amp_conf['ASTVARLIBDIR']."/mohmp3/.nomusic_reserved"; 
     113        if (!is_dir($dir)) { 
     114          makemusiccategory($dir); 
     115        } 
     116        touch($dir."/silence.wav"); 
     117      } elseif ($tresult != "default" ) { 
    117118        $dir = $amp_conf['ASTVARLIBDIR']."/mohmp3/{$tresult}/"; 
    118119      } else { 
     
    304305  if (!isAlphanumeric(theForm.category.value)) 
    305306    return warnInvalid(theForm.category, msgInvalidCategoryName); 
    306   if (theForm.category.value == "default" || theForm.category.value == "none"
     307  if (theForm.category.value == "default" || theForm.category.value == "none" || theForm.category.value == ".nomusic_reserved"
    307308    return warnInvalid(theForm.category, msgReservedCategoryName); 
    308309   
     
    355356  if (!isAlphanumeric(theForm.category.value)) 
    356357    return warnInvalid(theForm.category, msgInvalidCategoryName); 
    357   if (theForm.category.value == "default" || theForm.category.value == "none"
     358  if (theForm.category.value == "default" || theForm.category.value == "none" || theForm.category.value == ".nomusic_reserved"
    358359    return warnInvalid(theForm.category, msgReservedCategoryName); 
    359360  if (isEmpty(theForm.stream.value))