Changeset 4898

Show
Ignore:
Timestamp:
08/18/07 21:53:32 (1 year ago)
Author:
p_lindheimer
Message:

#2016 allow amportal.conf AMPLAYKEY override hardcoded crypt key

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.3/recordings/audio.php

    r4767 r4898  
    66 */ 
    77 
    8  
    9  
    108if (isset($_GET['recording'])) { 
    119 
    12   chdir(".."); 
    1310  include_once("crypt.php"); 
    1411 
    15   //$REC_CRYPT_PASSWORD="moufdsuu3nma0"; 
    16   $REC_CRYPT_PASSWORD = (isset($amp_conf['AMPPLAYKEY']) && trim($amp_conf['AMPPLAYKEY']) != "")?trim($amp_conf['AMPPLAYKEY]']):'moufdsuu3nma0'; 
    17  
    18  
     12  $REC_CRYPT_PASSWORD = (isset($_REQUEST['cryptpass']) && trim($_REQUEST['cryptpass']) != "")?trim($_REQUEST['cryptpass']):'moufdsuu3nma0'; 
    1913 
    2014  $crypt = new Crypt(); 
    2115 
    2216  $opath = $_GET['recording']; 
    23   $path = $crypt->decrypt($opath,$REC_CRYPT_PASSWORD); 
     17  $path = $crypt->decrypt($opath,urldecode($REC_CRYPT_PASSWORD)); 
    2418  $path=$opath; 
    2519 
     
    3327  elseif (is_file("$path.mp3")) { $path=$path.mp3; } 
    3428  elseif (is_file("$path.gsm")) { $path="$path.gsm"; } 
    35   elseif (!is_file($path)) { die_freepbx("<b>404 File not found!: $opath </b>"); } 
     29  elseif (!is_file($path)) { die("<b>404 File not found!: $opath </b>"); } 
    3630 
    3731  // Gather relevent info about file 
  • modules/branches/2.3/recordings/module.xml

    r4833 r4898  
    22        <rawname>recordings</rawname> 
    33        <name>Recordings</name> 
    4         <version>3.3.5.1</version> 
     4        <version>3.3.5.2</version> 
    55        <candisable>no</candisable> 
    66        <canuninstall>no</canuninstall> 
     
    99        <description>Creates and manages system recordings, used by many other modules (eg, IVR).</description> 
    1010        <changelog> 
     11                *3.3.5.2* #2016 allow amportal.conf AMPLAYKEY override hardcoded crypt key 
    1112                *3.3.5.1* bump for rc1 
    1213                *3.3.5* #2092 can't cannot save/read file fix some errors, better messages 
  • modules/branches/2.3/recordings/page.recordings.php

    r4574 r4898  
    382382 
    383383function recordings_display_sndfile($item, $count, $max, $astpath) { 
     384        global $amp_conf; 
    384385        // Note that when using this, it needs a <table> definition around it. 
    385386        $astsnd = isset($asterisk_conf['astvarlibdir'])?$asterisk_conf['astvarlibdir']:'/var/lib/asterisk'; 
     
    394395 
    395396        echo "<td>"; 
    396         $audio=$astpath.$item; 
    397397        $audio=$astpath; 
    398         $recurl="modules/recordings/popup.php?recording=".$audio; 
     398 
     399        $REC_CRYPT_PASSWORD = urlencode((isset($amp_conf['AMPPLAYKEY']) && trim($amp_conf['AMPPLAYKEY']) != "")?trim($amp_conf['AMPPLAYKEY']):'moufdsuu3nma0'); 
     400        $recurl="modules/recordings/popup.php?cryptpass=$REC_CRYPT_PASSWORD&recording=$audio"; 
     401 
    399402        echo "<a href='#' type='submit' onClick=\"javascript:popUp('$recurl',document.prompt.sysrec$count); return false;\" input='foo'  >"; 
    400403        echo "<img border='0' width='20'  height='20' src='images/play.png' title='Click here to play this recording' />"; 
  • modules/branches/2.3/recordings/popup.php

    r4213 r4898  
    66 */ 
    77 
    8 chdir(".."); 
    98include_once("crypt.php"); 
    109 
     
    2221<?php 
    2322 
    24  
    25   global $amp_conf; 
    26  
    27  
    28   //$REC_CRYPT_PASSWORD="moufdsuu3nma0"; 
    29   $REC_CRYPT_PASSWORD= (isset($amp_conf['AMPPLAYKEY']) && trim($amp_conf['AMPPLAYKEY']) != "")?trim($amp_conf['AMPPLAYKEY]']):'moufdsuu3nma0'; 
    30  
     23  $REC_CRYPT_PASSWORD = urlencode((isset($_REQUEST['cryptpass']) && trim($_REQUEST['cryptpass']) != "")?trim($_REQUEST['cryptpass']):'moufdsuu3nma0'); 
    3124 
    3225  $crypt = new Crypt(); 
    3326 
    34   $file = $crypt->encrypt($_GET['recording'],$REC_CRYPT_PASSWORD); 
    35   $ufile = $_GET['recording']; 
    36   $file = $_GET['recording']; 
     27  $file = $crypt->encrypt($_REQUEST['recording'],$REC_CRYPT_PASSWORD); 
     28  $ufile = $_REQUEST['recording']; 
     29  $file = $_REQUEST['recording']; 
    3730 
    38   //echo("<text>$file</text>"); 
    3931  if (isset($file)) { 
    4032    echo("<br>"); 
    41     echo("<embed src='audio.php?recording=" . $file . "' width=300, height=20 autoplay=true loop=false></embed><br>"); 
    42     echo("<br><a class='popup_download' href=/admin/modules/recordings/audio.php?recording="  . $ufile . ">" . _("download: $ufile") . "</a><br>"); 
     33    echo("<embed src='audio.php?cryptpass=$REC_CRYPT_PASSWORD&recording=$file' width=300, height=20 autoplay=true loop=false></embed><br>"); 
     34    echo("<br><a class='popup_download' href=".dirname(__FILE__)."/audio.php?cryptpass=$REC_CRYPT_PASSWORD&recording=$ufile>" . _("download: $ufile") . "</a><br>"); 
    4335  } 
    44  
    4536?> 
    46  
    4737  </body> 
    4838</html>